Jump to content
  • Advertisement
Sign in to follow this  

Passing from vertex to fragment shader WITHOUT interpolation.

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

Hello, I am writing a terrain engines that uses shaders (GLSL). I am drawing the terrain as triangles. I now need the following: I am storing a byte value with every vertex. Let's now say the actual triangle my fragment shader runs consists of vertices V1,V2,V3. Then I stored and passed my byte values B1,B2,B3 into the vertex shader. Is there a way to get them to the fragment shader WITHOUT being interpolated? I am using a 3d texture to store my different terrain 2d textures - so the byte value identifies the layer in which the correct texture for a vertex is hiding. So I need to know inside my shader what the the 3 byte values (and so the 3 textures) are my actual triangles has to be made of. how can i do this?

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!