Where to store shaders

Posted by Mark Ingram on Game Development See other posts from Game Development or by Mark Ingram
Published on 2012-03-21T22:00:56Z Indexed on 2012/03/21 23:41 UTC
Read the original article Hit count: 305

Filed under:
|
|

I have an OpenGL renderer which has a Scene member variable. The Scene object can contain N SceneObjects. I use these SceneObjects for storing the vertex position and any transforms. My question is, where should shaders be stored in this arrangement? I guess they need to be in a central location because multiple objects can use the same shader. But then each object needs access to the shader because it needs to set attributes into the shader. Does anyone have any advice?

© Game Development or respective owner

Related posts about architecture

Related posts about shaders