Zylann / godot_sdf_blender

Compose volumetric models using Signed Distance Fields
81 stars 9 forks source link

Fixed depth calculation in shader #1

Closed SIsilicon closed 3 years ago

SIsilicon commented 3 years ago

By reconstructing the position of the raymarch's hit in world space, and projecting in normalized device coordinates, an accurate depth value can be achieved. Before: image After: image

Zylann commented 3 years ago

Amazing! Thank you so much for fixing this, I could not figure it out :)

SIsilicon commented 3 years ago

Most welcome! I've had my hands on Signed distance fields before, but I never turned into a plugin like you did. Hats off to you. 😄🎩