Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lawless_c

Pages: 1 ... 4 5 [6] 7
76
Support / Re: Multiple shared shaders
« on: June 03, 2014, 01:06:46 am »
oh yes  ;D ;D ;D ;D

For some silly reason i thought IrenderHook could only be implemented with via a shader object.

It works perfectly now with the IrenderHook implemented by entities themselves. (hopefully this wont bite in the ass later but it seems to work  ;D)

77
Support / Re: Multiple shared shaders
« on: June 01, 2014, 04:22:51 pm »
How exactly is this used?

hmm http://www.jpct.net/wiki/index.php/Shaders looking at the example here it may not work for me.
Would their be a way to call the uniforms i need to set before each rendering?
The only way i can think of doing this for now is to add some sort of list/vector to the class that holds the set uniforms for each object as they are updated.
and gets called and iterated through during the rendering.

78
Support / Multiple shared shaders
« on: May 15, 2014, 10:56:02 pm »
Is there a way to quickly copy or share GLSLShader objects. I incorrectly assumed that using one shader among many objects would be ok but ive only just copped it that you need a shader for every instance, otherwise the uniforms will be set to those of the very last item updated before rendering.

79
Support / Re: Scale many objects together
« on: April 25, 2014, 04:04:08 pm »
okay i think i have it.

Consider scaling as a percentage.
get the offset of each object from the centre object and divide by 100.
multiply that answer by the percentage change in scale.
Add that answer to the position of the object.

80
I think you want the invert function for Object3d?

http://www.jpct.net/doc/com/threed/jpct/Object3D.html#invert()

81
Support / Re: Allowed shader types?
« on: March 13, 2014, 01:38:20 am »
Is their a page with a list of the acceptable keywords? I think i found it before but im having difficulty finding it again.

82
Support / Allowed shader types?
« on: March 11, 2014, 01:27:04 am »
Is it feasible to use shaders such as this for creating glassy effects? Or can JPCT only contain certain uniforms names?

// from the Orange Book 2nd edition

const float Eta = 0.66;
const float FresnelPower = 0.5;
const float F = ((1.0-Eta)*(1.0-Eta))/((1.0+Eta)*(1.0+Eta));

varying vec3 Reflect;
varying vec3 Refract;
uniform float Ratio;

void main()
{
    vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
    vec3 ecPosition3 = ecPosition.xyz / ecPosition.w;

    vec3 i = normalize(ecPosition3);
    vec3 n = normalize(gl_NormalMatrix * gl_Normal);

    Ratio = F + (1.0 - F) * pow((1.0 - dot(-i, n)), FresnelPower);

    Refract = refract(i, n, Eta);
    Refract = vec3(gl_TextureMatrix[0] * vec4 (Refract, 1.0));

    Reflect = reflect(i, n);
    Reflect = vec3(gl_TextureMatrix[0] * vec4 (Reflect, 1.0));

    gl_Position = ftransform();
}








Fragment shader


// from the Orange Book 2nd edition

varying vec3 Reflect;
varying vec3 Refract;
uniform float Ratio;

uniform sampler2D MyTex;

void main (void)
{
vec3 refractColor = vec3(texture2D( MyTex, Refract));
vec3 reflectColor = vec3(texture2D( MyTex, Reflect));

vec3 color = mix(refractColor, reflectColor, Ratio);

gl_FragColor = vec4(color, 1.0);
}




83
Support / Re: odd texture error causing wrap around?
« on: March 02, 2014, 06:26:24 pm »
Yup, that was it, functions perfectly now.

84
Support / Re: odd texture error causing wrap around?
« on: February 28, 2014, 10:30:32 am »
final text is intended to be planet ring, however i swapped it out with the red and white one to make it easier to perceive the problem.

85
Support / Re: odd texture error causing wrap around?
« on: February 28, 2014, 09:55:30 am »
It's the shader from this demo.

http://www.youtube.com/watch?v=5Zgn1OCDIus

86
Support / odd texture error causing wrap around?
« on: February 28, 2014, 01:13:08 am »
I've run into this odd quirk with a texture i loaded, to demonstrate it i have replaced the texture with one a bit more simple. when i view the textures in an editor they look fine, however loading them into jpct causes the a chunk of the left side to be cut of and moved to the right side.

Here is the texture

Here it is being rendered.



If you are wondering about the fuzziness it's because i haven't got shaders set up entirely correctly yet.

87
Support / Re: A touchscreen UI with blitter
« on: February 27, 2014, 10:36:02 am »
okay i'll try that  :)

88
Support / Re: Texture Limit
« on: February 26, 2014, 03:02:17 pm »
if you're on an emulator trying  increasing the size of your VM heap. helped me out, at least in the short term. There might be long term consequences.

89
Support / A touchscreen UI with blitter
« on: February 26, 2014, 02:54:09 pm »
Is there what would be considered a good or standard way of doing a UI with the blitter?

For example if i want to place a button and make it touchable with it interfering with what is happening behind it how would i do that?

At the moment im thinking of simply doing a ray trace and checking if a line coming from the touch would intersect it but that might be wrong.

90
Support / Re: Multiple entities using the same models/textures.
« on: February 26, 2014, 12:05:09 pm »
Sorry should have updated, your code work worked perfectly, not even something like so much as an exactly like. :D

Pages: 1 ... 4 5 [6] 7