Loading...
Logo
Processing Forum
I have to get some of the dumb questions out of the way sorry.  Also my terminology is all over the place so please feel free to correct me.

PGraphics3D is a software implementation of a 3d software rendering library based on most of openGL standards?

and 

 I was reading through the Processing source code and was a but confused.

 // LIGHTING


  // We're not actually turning on GL lights right now

  // because our home-grown ones work better for now.



//  public void lights() {

//    super.lights();

//    gl.glEnable(GL.GL_LIGHTING);

//  }



//  public void noLights() {

//    super.noLights();

//    gl.glDisable(GL.GL_LIGHTING);

//  }

How is lighting being handled then when using openGL? I have some understanding of openGL i just finished reading the red book and have been using Processing for some time. I am trying to pick apart how Processing is implementing openGL.

When you switch to using OpenGL what in the rendering process is not being handled by openGL that could be?

Also this was a while ago but some one in the old forum made a post showing the differences in speed when using direct openGL calls. The program was using circle collisions and was just winging out circles all over the place. I searched for it but couldn't find it.

If any one can link me to this post or any other posts where people where demonstrating the speed differences from using native Processing and making calls directly to openGL.

; )

Replies(1)

Disclaimer: The following information is subjective and just to the best of my knowledge, just what I've picked up from using Processing and reading the boards/documentation.
How is lighting being handled then when using openGL?
I think processing calculates the lighting per-vertex and then just send the data to OpenGL as vertex colors. This is because per-vertex lighting is not so expensive to justify the GPU handling it vs the inconsistencies it would create with the P3D renderer's lighting calculations.
When you switch to using OpenGL what in the rendering process is not being handled by openGL that could be? 
All of the vertex transformations ( output vertex = perspective matrix * transform matrix stack * vertex ) are done by processing AFAIK along with the vertex color computation for the lighting so that it's roughly equivalent to the P3D renderer.

Possibly some of the AA code?

I think fry would be your guy for a definite answer.

Jack