Zylann / godot_sdf_blender

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

Godot 4 Compatibility #6

Open Dayruke opened 2 years ago

Dayruke commented 2 years ago

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.

Dayruke commented 2 years ago

Looks ok @Zylann :+1:

8 : Godot 4 (Beta 1) compatibility

(Ignore the earlier PR 7)

mishapsi commented 1 year ago

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

mishapsi commented 1 year ago

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);

Radivarig commented 1 month ago

Any chance this gets revisited? Also there is a newer PR #9

Zylann commented 1 month ago

I'm no longer maintaining this.