Jump to content
  • Advertisement

Archived

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

JulianSpillane

Multitexturing using Fragment Shaders

This topic is 5314 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!