godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.82k stars 20.94k forks source link

Spatial Shader with render_mode world_vertex_coords prevents skinning #33165

Open PolyVector opened 4 years ago

PolyVector commented 4 years ago

Characters with a Skeleton stop skinning altogether when their Material uses a Shader that sets render_mode to world_vertex_coords

I'm not sure if this is expected behavior, but I couldn't find any mention of it in the documentation.

Simplest shader to reproduce the issue: shader_type spatial; render_mode world_vertex_coords;

Tested Version: Godot 3.2.alpha3.official OS: Ubuntu 19.10

KoBeWi commented 3 years ago

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

PolyVector commented 3 years ago

I can confirm it still happens in Godot 3.2.3.stable.official and 3.2.4.beta1.official using my shader snippet above.

Tested Versions: Godot 3.2.3.stable.official, 3.2.4.beta1.official OS: Ubuntu 20.04.1 LTS

RockyMadio commented 2 years ago

When using world vertex coords to project the uv of a shader assigned on an Overlay Material, this material will glitch with black lines.

Calinou commented 2 years ago

@PolyVector @RockyMadio Please upload a minimal reproduction project to make this easier to troubleshoot.

Also, please check whether this occurs in 4.0.alpha16 :slightly_smiling_face:

RockyMadio commented 2 years ago

@PolyVector @RockyMadio Please upload a minimal reproduction project to make this easier to troubleshoot.

Also, please check whether this occurs in 4.0.alpha16 🙂

This is the result glitches

This is how the shader setup is made: The top one is a simple spatial material ( no changes) The bottom one is a custom shader which I provide here.

glitches_2

shader_type spatial;
render_mode blend_mul,specular_schlick_ggx,world_vertex_coords,shadows_disabled;
varying vec3 world_uv;
void vertex(){
    world_uv = VERTEX;
    }

I will try to godot 4.0 eventually :D

Calinou commented 2 years ago

Can you upload a minimal reproduction project as a ZIP attachment? We don't have time to recreate every scene setup individually, especially when it requires a skinned mesh to be reproducible.

PolyVector commented 2 years ago

Sure thing Calinou, here's a quick project to reproduce the issue for you.

Godot 3.5 Project Issue is still happening as of Godot 3.5

Godot 4.0 Project Issue appears to be fixed in Godot 4.0, however there is some nasty z-fighting

I'm guessing the z-fighting in 4.0 is simply FP error due to differences in the various render passes (since one is now calculating in a different space)

RicardRC commented 1 year ago

Godot 4.1 (v4.1.1.rc.custom_build [e709ad4d6]), the tearing is still an issue:

image

image

clayjohn commented 1 year ago

For people who can confirm the z-fighting issue, can you please post what graphics card models you are using?

I suspect NVidia, as I can't reproduce the issue on an intel chip

RicardRC commented 1 year ago

Nvidia rtx 4090 (windows on cpu amd 3960X if relevant...) I have access to a linux intel cpu with integrated + amd graphics card, will post results when I can, with makes and models. Thanks!

ardlak commented 1 year ago

For people who can confirm the z-fighting issue, can you please post what graphics card models you are using?

I suspect NVidia, as I can't reproduce the issue on an intel chip

I also experience this on an RTX 2080 SUPER.

Dabnabbit commented 1 year ago

I opened another ticket more specifically outlining exactly what triggers this issue with a super minimal MRP, @bitsawer has referenced the project. To inform your suspicion, I am also running an NVidia GPU (RTX 3070TI) https://github.com/godotengine/godot/issues/80917