Notifications
Article
How to cull water
Updated 11 days ago
9
0
How to cull water
Water rendering is difficult to cull water surface. Especially, a reflection rendering pass is requied and a fixed performance loss occurs.
I write my algorithm how avoid rendering unless the area is visible on the screen.
[RIVER]
Prepare 1. Set the area on the water surface to 2d closed path
Runtime 2. Create a convex surface of the water plane by view frustum. (This is the area of ​​water that will be drawn on the screen.)
3. Test that the area of ​​1 overlaps the area of ​​2. Clips region 1 in region 2. If it is not visible on the screen, there is no polygon left.
4. Do not render water if there is no overlapping area. (with reflection pass)
[OCEAN + ISLAND] Infinite plane
Prepare 1. Set the area on the island surface to 2d closed path
Runtime 2. Same as above 3. Test if area 2 is completely inside area 1. Start at any point in the area 2. Failure if point is outside area 1. Test that the outline of area 1 intersects the line in the direction of the next point. Failure if any line is intesected. 4. Do not render water if there is no intersected line.

Tags:
VisualWorks
VisualWorks - Programmer
3
Comments