Your Universal Remote Control Center
RemoteCentral.com
Graphics & User Interfaces Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Multiple objects with their own shaders in GLES
This thread has no replies.
Post 1 made on Thursday June 4, 2020 at 01:57
kirankamath
Junior Member
Joined:
Posts:
June 2020
1
I'm very new to OpenGL and want to start with the smallest and most portable standard, OpenGL ES 2.0. I believe I have basic understanding now about the rendering pipeline and most of the data structures.

Using C++ I would now write different classes for different objects (e.g. wheel, tree, sphere) but each class should supply its own vertex and fragment shader because they have custom implementations of creating transformation matrices, coloring and effects. From my understanding I should use vertex buffers to push the object meshes to the GPU and uniforms to apply parameters (e.g. that influence color, rotation etc.).

My problem is I can only use one program of vert+frag shaders in one context at a time but I want to draw multiple elements using their own shaders. What would be the general way to do this? Should I compile one huge shader from all the parts consisting of a list of switch cases?

Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse