Archived

This topic is now archived and is closed to further replies.

JulianSpillane

Multitexturing using Fragment Shaders

Recommended Posts

JulianSpillane    122
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

Share this post


Link to post
Share on other sites
jonnii    122
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.

Share this post


Link to post
Share on other sites