i would like to understand more in deep how works jogl so that i can use the correct chose during my implementation.during one of my exercise i find out a strange behavior that can change the performance of the program that i wrote.

this is the question look at this code, that i use to draw a surface flat divided in square

I just read that if the glNormal is called one time instead that repeat for each vertex performance are better.Becouse there are less call to GL system.i did the test and in my program the fps are increased

Using the float version of glNormal (glNormal3f()) should be a bit faster, but you want really good performance you should look into display lists or VBOs. Your data seems to be static, so you should be able to generate your geometry and store it in a display list or VBO, and use glTranslatef() to position your objects when rendering.

hi theagentd , thanks for the answer but for mistake i post only half of my question so i modified it and in meanwhile you was answering to my half post!!! i hope that now you can read and answer reading the complete questionthanks

Using the float version of glNormal (glNormal3f()) should be a bit faster, but you want really good performance you should look into display lists or VBOs. Your data seems to be static, so you should be able to generate your geometry and store it in a display list or VBO, and use glTranslatef() to position your objects when rendering.

I believe that's because OpenGL expects a normal per vertex. If you don't specify it, your graphics driver might have to use a slower method for rendering, which might impact performance. If you were to render this with VBOs and shaders, you'd either specify this as a per-vertex attribute or a uniform variable. OpenGL does not support per-primitive attributes, or more specifically attributes that aren't per vertex.

I know, I know... The thing is that that's a OGL 3 feature intended for instancing and can't be used to specify per-face normals for example. Plus, the point that it's an OGL 3 feature means that display lists probably don't take advantage of the same capabilities.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org