Shader's Hell !

Started by MoonHelp, February 11, 2012, 09:08:54 PM

Previous topic - Next topic

MoonHelp

Shader's Hell...

Hi, Everybody !! (Hello Egon) [I read your forum everyday]

My test : The HelloShader Eclipse data

I'am playing with JPCT-AE and I tried some test.

I keep the GLSLShader Method on my cube.

I removed all shaders files into the jar
and I expected an Eclipse bug : but nothing wrong...
My scene is the same. (nothing change).

Could you tell me why ?

Friendly

Olivier (France)
Graphic Designer (print publishing) ==>15 years skill BUT JAVA noob
Bad english inside ? sorry !! : -) I'am French  and I don't speak every days your language !
Rights ?

EgonOlsen

I don't get the problem...you've removed the shader files and expected the result to be wrong but it wasn't? Or was is wrong before and nothing changed after removing the files?

MoonHelp

#2
Hi,Egon !

I mean :
My scene was ok at the begining !
A spinning cube with a grey jpeg bitmap texture

My test :
I deleted all the code in these 2 files (now I have 2 empty files)  :

res/raw/fragmentshader_offset.glsl
res/raw/vertexshader_offset.glsl


and I unpacked the jar > deleted  all the 16 shaders file .src
I repacked the jar

I updated the eclipse project with this new jar without .src files
and lauched again...

My scene is identical : my 3D object seems a bit more opaque...

My question : now what is the process who's support the non existing GLSLshaders informations
and return a default value ?

Merci
Olivier




EgonOlsen

The shader files are only needed for OpenGL ES2.0. Are you sure that you are using this?

MoonHelp

#4
OK

I loaded a new instance of the HelloShader eclipse project
and deleted all code in the 2 shaders files (res/raw) and copy/paste
code from the Shaders Generator Devel apk (Android Market)

And now I have a beautiful  ERROR: Missing attribute 'position' in vertex shader
OK OPENGL ES2.0 is now enable !

BTW : why shaders devel generate wrong code ? (I imported the same 3D object (a simply cube) in shader devel)

Thank you



EgonOlsen

It doesn't generate wrong code  (i assume...)...it's just that you have to follow some naming conventions in your shaders for uniforms and attributes to allow jPCT-AE to inject its data into your shader. Those are documented in the GLSLShader class: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/GLSLShader.html

MoonHelp

#6
Ok
I will try.

Merci