Open Dayruke opened 2 years ago
Looks ok @Zylann :+1:
(Ignore the earlier PR 7)
Ported to Beta 8. Found the depth buffer behaves different. In 3.5 you could have MeshInstances behave normally in space with the rendered SDF's. In 4.0 this is less reliable, depending on how far your camera is zoomed and where in space the MeshInstances are, some being occluded correctly, others showing up on top of the SDFs
For some reason dividing distance in half works, so changing this line:
vec4 sdf_ndc = PROJECTION_MATRIX * VIEW_MATRIX * vec4(ray_origin + ray_dir * d/2.0, 1.0);
Any chance this gets revisited? Also there is a newer PR #9
I'm no longer maintaining this.
FYI, I'm working on getting this functional in Godot 4.0 (beta1).
https://github.com/Corpusim/godot_sdf_blender/tree/godot-4-convert
Will submit a PR if it looks ok.