Re: Problims with light
Posted by Tomasz on Nov 21, 2010; 3:26pm
URL: https://forum.jogamp.org/Problims-with-light-tp1824171p1940471.html
thing is simple all going on in the class GlRenderer.java and I'm using using glMaterial and my problem has somthing with settings of material propertis.
Some I've manage to resolve by my self
Here are updated setings:
float no_mat[] = { 0.1f, 0.1f, 0.3f, 0.0f };//materiał
float mat_ambient[] = { 0.7f, 0.7f, 0.7f, 0.8f };
float mat_ambient_color[] = { 0.8f, 0.8f, 0.2f, 1.0f };
float mat_diffuse[] = { 0.3f, 0.5f,0.0f, 1.0f };
float mat_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float no_shininess[] = { 0.0f };
float low_shininess[] = { 5.0f };
float high_shininess[] = { 75.0f }
float green[] = { 0.5f, 0.2f, 0.4f, 0.0f};//kolor osi
float red[] = { 0.7f, 0.0f, 0.0f, 0.5f};
gl.glMaterialfv(GL.GL_FRONT , GL.GL_AMBIENT, no_mat, 1);
gl.glMaterialfv(GL.GL_FRONT, GL.GL_DIFFUSE, mat_diffuse, 1);
gl.glMaterialfv(GL.GL_FRONT, GL.GL_SPECULAR, mat_specular, 1);
gl.glMaterialfv(GL.GL_FRONT, GL.GL_SHININESS, high_shininess, 0);
gl.glMaterialfv(GL.GL_FRONT, GL.GL_EMISSION, no_mat, 0);
and for one group of spheres:
gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, green, 1);
second
gl.glMaterialfv(GL.GL_FRONT, GL.GL_AMBIENT_AND_DIFFUSE, red, 1);
Now the colours show for all: terain + 2 grups of spheres, but I've lost all depth in tarrain coulors it's flat (no shadows no briter points) - but when I'm disconecting spheres is once again looking ok.
I bet that this are material settings or somthing with light
any idea would be helpfull
p.s. I've added whole project because without all classes and imports you wouldn't be able to run it and see what I'm talnking about.