godotengine / godot

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

Overdraw viewport mode is not affected by vertex shader displacement #24232

Open Zylann opened 5 years ago

Zylann commented 5 years ago

Godot 3.0.6

Out of curiosity, I wanted to check what the overdraw viewport mode would look like with my terrain plugin. image But with overdraw mode: image

Wireframe and unshaded modes work. I think it is caused by the fact my terrain rendering is using vertex displacement in the vertex shader, overdraw mode ignores it...

Edit: in 3.2 I'm using it to debug Transvoxel geometry and it's unusable as well.

bojidar-bg commented 5 years ago

Can confirm in 3.1 as well.

KoBeWi commented 3 years ago

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

If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.

Zylann commented 3 years ago

Still happens in 3.2.4 beta2: DisplacementAndOverdraw.zip

Calinou commented 3 years ago

Is there a way we could keep the original vertex shader only and still use an override for the fragment shader? This is probably the only way the overdraw mode could work in this case.

clayjohn commented 3 years ago

@Calinou In theory, yes. It would take some modifications to rasterizer_storage_rd.cpp though. It will not be a trivial change.