BarthPaleologue / CosmosJourneyer

A space exploration game with a fully simulated universe running in the browser
https://cosmosjourneyer.com/
GNU Affero General Public License v3.0
11 stars 4 forks source link

Fix grass depth write with WebGPU and infinite perspective #137

Open BarthPaleologue opened 2 months ago

BarthPaleologue commented 2 months ago

Currently, the grass (and butterflies) do not render correctly to the depth buffer when using the infinite perspective matrix in WebGPU.

This must be fixed for the 2.0 update.

BarthPaleologue commented 1 month ago

Solution is to change depth write to camera space z:

https://forum.babylonjs.com/t/how-do-i-write-shadermaterial-depth-to-depthrenderer-infinite-far-plane/53461/3?u=crashmaster