Hi, I’m using your engine and really like it! I tested the custom material example, but I get a “-1″ when I initialize my own uniform handles with e.g. “GLES20.glGetUniformLocation(mProgram, ‘uLightMVPMatrix’);”. Do you know what to do? I inserted the variable in the vertex shader as well and “checkGlError” doesn’t moan any thing…
Hi Ammo,
I’m glad you like the engine
Could you possibly show me some code so I can figure out where things go wrong?
You could also log this issue here: https://github.com/MasDennis/Rajawali/issues
Cheers,
Dennis
hi~ It’s the best 3d engine i have used based on OpenGL ES. Right now I am focusing on the a Double Sided Leaf. I used 3D max to get a double sided leaf with two different materials. how can i import the materials into Rajawali?? i.e. import two materials for a object, and displays them in order.
Leave a comment
About
Name: Dennis Ippel Job: Senior Creative Developer Location: London, United Kingdom E-mail: info at rozengain dot com
[...] to Rajawali Tutorial 7: Creating a Custom Material / GLSL Shader. Tags: 3D, Android, OpenGL ES, [...]
[...] To demonstrate this, I’m gonna use the custom material that I blogged about earlier today. [...]
[...] Rajawali Tutorial 7: Creating a Custom Material / GLSL Shader [...]
Hi, I’m using your engine and really like it!
I tested the custom material example, but I get a “-1″ when I initialize my own uniform handles with e.g. “GLES20.glGetUniformLocation(mProgram, ‘uLightMVPMatrix’);”. Do you know what to do? I inserted the variable in the vertex shader as well and “checkGlError” doesn’t moan any thing…
Thanks
Hi Ammo,
I’m glad you like the engine
Could you possibly show me some code so I can figure out where things go wrong?
You could also log this issue here: https://github.com/MasDennis/Rajawali/issues
Cheers,
Dennis
Dennis, there is a problem with the following code:
mTime += .1f;
mCustomMaterial.setTime(mTime);
Sonner or later the variable will overflow (both the java variable and the shader variable).
hi!,
Dennis, there is a problem….,
i’m use below code in my wallpaper
public class CustomMaterial extends SimpleMaterial {
protected static final String mCustomFShader =
“precision mediump float;\n” +
“uniform float uTime;\n” +
“varying vec2 vTextureCoord;\n” +
“void main() {\n” +
” vec4 newColor = vec4(1.0,1.0,0,1.0);\n” +
” float x = max(vTextureCoord.s, 4.0 – vTextureCoord.s);” +
” float z = vTextureCoord.t;” +
” newColor.g = cos(z * sin(uTime*0.1) * 120.0) + ” +
” sin(x * cos(uTime*0.0666) * 120.0) + ” +
” sin(sqrt(z * z + x * x) * 40.0);\n” +
” gl_FragColor = newColor;\n” +
“}\n”;
But i want to changes in shader view…So please help me.
hi~ It’s the best 3d engine i have used based on OpenGL ES. Right now I am focusing on the a Double Sided Leaf. I used 3D max to get a double sided leaf with two different materials. how can i import the materials into Rajawali?? i.e. import two materials for a object, and displays them in order.