filmov
tv
OpenGL Water Tutorial 8: Soft Edges (FINAL)

Показать описание
Final episode of the tutorial series about programming 3D water using OpenGL!
Smoothing up those hard water edges this week!
DuDv Map and Normal Map:
Conversion Code:
Conversion Explanations:
gl_FragCoord:
One thing I didn't mention: if you want to make deeper water look murky then you can add something like this into the fragment shader:
refractColour = mix(refractColour, murkyWaterColour, clamp(waterDepth/60.0, 0.0, 1.0));
Common Problems:
-If the edges of the water quad look a bit glitchy and jagged (especially when you zoom out with the camera) then you may have a problem with the precision of the depth buffer. This can be fixed by increasing the NEAR_PLANE value of your projection matrix in the MasterRenderer, or by changing "new PixelFormat()" to "new PixelFormat().withDepthBits(24)" when creating the display.
Series Overview:
1. Introduction
2. Rendering to textures
3. Clipping planes
4. Projective texturing
5. Du Dv Maps
6. Fresnel Effect
7. Lighting
8. Depth Effects
End of video music- Kai Engel, "Waking Stars":
Smoothing up those hard water edges this week!
DuDv Map and Normal Map:
Conversion Code:
Conversion Explanations:
gl_FragCoord:
One thing I didn't mention: if you want to make deeper water look murky then you can add something like this into the fragment shader:
refractColour = mix(refractColour, murkyWaterColour, clamp(waterDepth/60.0, 0.0, 1.0));
Common Problems:
-If the edges of the water quad look a bit glitchy and jagged (especially when you zoom out with the camera) then you may have a problem with the precision of the depth buffer. This can be fixed by increasing the NEAR_PLANE value of your projection matrix in the MasterRenderer, or by changing "new PixelFormat()" to "new PixelFormat().withDepthBits(24)" when creating the display.
Series Overview:
1. Introduction
2. Rendering to textures
3. Clipping planes
4. Projective texturing
5. Du Dv Maps
6. Fresnel Effect
7. Lighting
8. Depth Effects
End of video music- Kai Engel, "Waking Stars":
Комментарии