Closed WOLFxxxxxx closed 6 months ago
Transparent objects needs to be drawn back-to-front. The objects in front are getting drawn first and writing to the depth buffer, and the objects behind them are getting drawn later and depth testing against the transparent pixels.
You can put objects into a table with their distance to the camera and sort based on that.
In the future LÖVR may be able to do this automatically.
You can achieve a lot with this line at the start of lovr.draw
function:
pass:setAlphaToCoverage(true)
It won't solve all issues with complex overlaps but it should fix the situation in your screenshot. There's a great article that covers a more advanced technique for foliage: Anti-aliased Alpha Test: The Esoteric Alpha To Coverage