Hello, I'm trying to write a 3D engine, but I'm having some problems with the management of my shaders and materials.
Mostly, the problem is keeping the two seperate. Some things in my engine require texture splatting, others need to be reflective, others need to glow, yet others should look liquid, and then some more...
I was quite impressed by Ogre3D's material scripts, but I can't make heads or tails out of the enormous amount of source code.
My current approach is to try to automatically generate a shader program for every material, but this seems kinda wasteful. I might for example have two things in the game world that look exactly identical except for a different color.
Also, since the program generation is now locked away in the material, how to I implement things like tesselation and vertex manipulation?
This has been causing me headaches over the past couple days up to the point where I felt like just abandoning, but I'd at least like to understand this before I do.