Multitexturing using Fragment Shaders
Hey all.
I finally decided to step forward into the new era of graphics technology, and am attempting to wrap my head around fragment shaders. Now, I know how to push a texture straight through, and I understand it for the most part, I''m just a bit confused on how I would implement support for multiple texture stages. ...perhaps I''m just out of it today, but it''s really confusing me.
Any help would be appreciated.
Best Regards,
Julian Spillane
Ok, i''m guessing you have a vertex shader which passes through the texcoords into the fragment shader.
At this point you do your tex2d() lookups and get a color for each texcoord from the samplers (or sampler if its the same texture) and so now you have two colors and you can simply combine them!
There are lots of ways to do this, for example lerp().
good luck.
At this point you do your tex2d() lookups and get a color for each texcoord from the samplers (or sampler if its the same texture) and so now you have two colors and you can simply combine them!
There are lots of ways to do this, for example lerp().
good luck.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement