Multitexturing using Fragment Shaders

Started by
1 comment, last by JulianSpillane 20 years, 3 months ago
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
Advertisement
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.
-jonnii=========jon@voodooextreme.comwww.voodooextreme.com
Thanks a lot! I''ll get to work on that as soon as I get home. Thanks for your help.

This topic is closed to new replies.

Advertisement