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: 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.

77
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);
}




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

79
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.

80
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

81
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.

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

83
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.

84
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.

85
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

86
Support / Re: Multiple entities using the same models/textures.
« on: February 12, 2014, 12:39:13 am »
oh, are there any examples anywhere? not sure i'll get this without seeing how it is used.

87
Support / Multiple entities using the same models/textures.
« on: February 11, 2014, 11:23:40 pm »
Is there a correct way to have multiple copies of objects in jPCT game?

I want to spawn multiple identical entities that would have the same 3d models and textures. If i was handling the graphics myself i would just spawn the one object and repeat the draw command for the object in each location where there is an instance of the entity.

But since jPCT handles that aspect of it im not sure how to proceed.

88
Support / Re: Texture doesn't seem to apply to a sphere
« on: January 09, 2014, 01:03:56 am »
I understand now, there was some annoying distortions that was particularly noticeable when looking at Africa which was very elongated. When i switched to the the ellipsoid that fixed it! ;D Thanks :)

89
Support / Re: Texture doesn't seem to apply to a sphere
« on: January 08, 2014, 01:08:56 am »
Does it get wrapped twice? i'll try the ellipsoid then.

In the meantime i've added a cloudsphere  8)


90
Support / Re: Texture doesn't seem to apply to a sphere
« on: January 06, 2014, 10:45:11 pm »
Amazing , it works perfectly!


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