GLSL, all in one or many shader programs?
Posted
by
stjepano
on Game Development
See other posts from Game Development
or by stjepano
Published on 2012-08-23T14:15:53Z
Indexed on
2012/09/21
15:54 UTC
Read the original article
Hit count: 266
I am doing some 3D demos using OpenGL and I noticed that GLSL is somewhat "limited" (or is it just me?). Anyway I have many different types of materials. Some materials have ambient and diffuse color, some materials have ambient occlusion map, some have specular map and bump map etc.
Is it better to support everything in one vertex/fragment shader pair or is it better to create many vertex/fragment shaders and select them based on currently selected material? What is the usual shader strategy in OpenGL or D3D?
© Game Development or respective owner