Login  Register

Re: Negating some JNI call overhead by doing transformations in Java

Posted by Michael Bien on Jul 21, 2011; 1:05pm
URL: https://forum.jogamp.org/Negating-some-JNI-call-overhead-by-doing-transformations-in-Java-tp3188212p3188475.html


On 07/21/2011 02:28 PM, GiGurra [via jogamp] wrote:

>
> I'm not sure I agree with you here. JNI is a factor.
> Calling glRoatef for example in jogl would probably take a factor 10 longer
> than from a C program (probably more).
> Let's say I I have 10 of those. Why not just make a single transformation
> matrix of that in java and THEN make one glLoadMatrixf to opengl though
> jogl? surely that must be an advantage if the application has a significant
> amount of transformations.
>
> (let's for the moment skip shaders cause i dont even know what they are :),
> opengl beginner here but I very much need to optimize performance)
>
>
what you want are shaders :)
glRoatef for example does no longer exist in OpenGL 4. All those
transformations are either done in a shader, and/or as you said on the
host using matrices. The whole intention behind most GL features
introduced in the last 15 years was the reduction of API calls.
VertexArrays, DisplayLists, VBOs, shaders, removal of the fixed function
pipeline etc.

if you can, do as much as possible on the GPU.

regards,
michael

--
http://michael-bien.com/