Configuring GLSL Ocean Water Shader after Nvidia GPU Gems Chapter 1

I follow the Nvidia GPU Gems Chapter 1 regarding modeling water using shaders. I am trying to follow this chapter to create an ocean water shader using glsl in OpenGL es 2.0 (iOS).

I can create geometric waves as described in the chapter, but when it comes to creating a normal texture map, I have problems. The chapter is a bit unclear about what actually gets rendered for the texture rendering object. Should I display a normal map or elevation map? The text assumes that the normals are obtained for the target as the rgb color, but again, the images (b) and (d) in section 1.3 “Creation” seem to indicate that the gray height map should be mapped to the target textures, The chapter also talks about using the search texture for the u coordinate of the texture, but I don’t understand how it fits into the texture render. Are there two different textures? If someone can help clarify how these components fit together, I would really appreciate it!

+4
source share
1 answer

Why do you render texture at all? You can easily simply compute these values ​​on the fly in your geometric shader. Since they change every frame, you need to repeat these calculations every time anyway, so I don’t see what you get when creating the texture.

You need to calculate two values: the height offset (using equation 3) and the normal for each vertex (using equation 6b).

0
source

Source: https://habr.com/ru/post/1481072/


All Articles