Hi.I am developing an OpenGLES2.0 application.Time to render the application is crucial thing for me.My application has both static and dynamic objects(moving pointers in dial).To improve the performance I want to reduce the computation burden on CPU. I want to compute the transformation matrices(translate,rotate,scaling) in the shader itself instead of computing them on CPU (only for dynamic objects).Is it advisable to do like this to improve the performance?
My vertex shader will look this
vertex .c
---------------------------------------------------------------------------------
int main()
{
if(static==0) //for static rendering. Value sent from the app
{
gl_Position = mvp* vec4(vert,1.0); // MVP is calculated in the app and sent to shader
}
if(static==1) // for dynamic objects. Value sent from the app
{
/* compute translated matrix
/* Compute rotated matrix
/* compute scaled matrix
gl_Postion = mvp*vec4(vert,1.0); /* mvp is calculated in the shader
}
}
calculation burden will be on GPU instead of CPU only in the case of dynamic objects.Will this improve time to render an application? I need a better FPS.