Re: Mouse selection
Posted by
elect on
Mar 01, 2012; 10:01am
URL: https://forum.jogamp.org/Mouse-selection-tp3787468p3789947.html
gouessej wrote
Elect, I gave you an example of picking using JOGL on javagaming.org. However, hardware accelerated picking should not be used anymore because it relies on deprecated features of OpenGL and anyway, I observed important slowdowns when mixing shaders with it on some machines. Software picking might be slower but it is often more reliable.
Wait, im a nub :D what do you mean by hardware/software picking? What do they refer to? And the why shader?
Ps: trying to understand which are the picking methods, I went backward some page of the link you gave me
http://www.lighthouse3d.com/opengl/picking/and I found the "name stack"
Trying to figure out the limitation of this one and the color one, I calculated that with the unique-color I could have at maximum 2^(8+8+8) = 16777216 possible different colors.
Now for the "name stack"
The stacks maximum dimension is implementation dependent, however according to the specs it must contain at least 64 names which should prove to be more than enough for the vast majority of applications. Nevertheless if you want to be sure you may query the state variable GL_NAME_STACK_DEPTH (use glGetIntegerv(GL_NAME_STACK_DEPTH)). Pushing values onto the stack beyond its capacity causes an overflow error GL_STACK_OVERFLOW. Then I coded:
int test[] = new int[1];
gl.glInitNames();
gl.glGetIntegerv(GL2.GL_NAME_STACK_DEPTH, test, 0);
System.out.println("GL_NAME_STACK_DEPTH: "+test[0]);But I am getting this:
GL_NAME_STACK_DEPTH: 0Why?