hi, I am trying to making a OpenGL program which the object might be modified in during the execution of the program.
I have 2 approaches in my mind but I don't know which is better(especially for the new opengl). In the hello texture example, the rotation was done on the camera but this is not what I want to do for my program.
1. provide a transformation matrix for each object. An pass it as a uniform variable(once for an object) to the opengl, let the gpu do the calculation on each vertex every frame
2. do pre-calculation on the coordinates of the vertex before inserting it into the buffer and bind it to the uniform variable.
Which is preferred? Personally, I think both is ok but 1 requires more processing but simpler in implementation. Am I correct?
Actually, I always have problems in doing some trade-offs between processing speed and updating speed(update vertex buffer). For cases similar the above one, how should I make decisions on building a faster program?
Never Stop ... Learn more ... Be humble ...