Jump to content
  • Advertisement
Sign in to follow this  
Acid-Chris

GLSL terrain texture splatting shader

This topic is 4466 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 all! I'm currently trying to get some GLSL techniques up and running. Now i'd like to ask you guys if someone can point me to or provide a terrain texture splatting shader using GLSL. edit: basically just blending different types of textures using the RGB channels from a color-map. any help appreciated, best regards, - christoph -

Share this post


Link to post
Share on other sites
Advertisement
Another question:

Is it possible, for example, to combine different shaders for a terrain?
One would include geomorphing in the vertex shader, the other one the texture splatting (i guess fragment).

here's what i was thinking about:
1) geomorphing shader
- vertices calculated according to different LOD settings
- fragment program?
2) splatting
- vertex program?
- fragment program defines how the terrain is being textured.

am i totally wrong or is it better to combine this in one vertex and fragment program?


- christoph -

Share this post


Link to post
Share on other sites
You can combine a single fragment shader with a single vertex shader, but you can't use multiple of either (ie: You cant bind 2 fragment shaders with the same geometry).

That said, it looks like you have the right idea. Use a vertex shader for the geomorphing, and then a fragment shader to draw the splatting. You may also be able to calculate the texture coordinates within the vertex shader, possibly saving the CPU some time. (Depending on your implementation).

It also sounds like you may need to look up the definition of a fragment shader compared to a vertex shader? If you need clarification just ask.

~zix

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!