0

I'm feeling like I'm grasping at straws right now researching this!

My goal is to write a simple water shader. The plan is to use tessellation to implement dynamic LODs, and apply a height map based on fractal noise (ref this paper). Where I am stumbling is where we are supposed to apply the height map. It seems like it should be applied to the vertex shader, but the vertex shader precedes the tessellation shaders. So I am looking to apply the displace vertices at the tessellation evaluation shader (OpenGL) using noise, is that the best way to go?

For the noise, I am planning on inputting the vertices positions to the noise function.

It is confusing to me because so far I have not found any examples on the web on the matter. I am seeing people people sampling in the tessellation shader, but I don't have a texture, only noise. I've also seen someone mention something about using a geometry shader to displace vertices. What's the widely accepted procedure here?

I'm wondering about the impacts of the performances and advice on whether I should think of generating noise texture and interpolating those instead.

  • 1
    "*I don't have a texture, only noise*" Then sample the noise. A texture is just a (discrete) function that maps values to other values. Just like a noise function, right? – Nicol Bolas Nov 09 '20 at 05:14
  • @NicolBolas My interpretation of a texture is literally an image file or some sort, that is passed as a sampler2d. I think that matches your definition, right? So I could pass an image of a noise, but I want the water to be animating with time. So my idea was to use the noise() function in the gpu directly. Is this considered "sampling the noise"? – Trang Dinh Nov 09 '20 at 05:58

0 Answers0