Jump to content
  • Advertisement
Sign in to follow this  
PhillipHamlyn

Prevent interpolation of value from VS to PS

This topic is 651 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

Hi,

 

I pass in an array of textures into my shader, with a vertex value ("textureIndex") indicating which texture from the array should be used to paint that particular vertex. If my triangle has vertexes which have different selection values the textureIndex is interpolated across the face of the triangle and my PS gets a whole "rainbow" of indexes across the triangle, instead of just the two possible values I want to paint.

 

Is there any way of instructing the PS how to interpolate values ?

 

If my verexes have textureIndex of 1,5,5 on my triangle I'd wish my PS to get either 1 or 5 but not 1,2,3,4,5 (and all floats inbetween).

 

If I'm simply doing things a weird way, that would also be a great answer :-)

 

Phillip

Share this post


Link to post
Share on other sites
Advertisement

Note that "nointerpolation" uses the value from the first vertex of a primitive.  If that doesn't work for you, then the "normal" approach is to duplicate vertices.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!