godotengine / godot

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

Viewport with Render Always and a Child Camera makes Point Mesh shadow ignore Point size #50919

Open ghost opened 3 years ago

ghost commented 3 years ago

Godot version

3.3.2 latest official release

System information

Windows 10, GLES3, GTX 1650 Super

Issue description

Point Mesh shadow ignores POINT_SIZE when a Viewport Node with a Camera child is present in the scene and the Viewport has Render Mode set to Always. Switching to render back to When Visible fixes this issue.

EDIT: I believe this may in fact be part of a larger issue where point mesh shadows are scale relative viewport_size and not just POINT_SIZE and on very small viewports the point shadow is much smaller than the point itself. You can in fact see this triggered by making window really tiny and you will see that the shadow becomes a bunch of points. You can also trigger this by setting a low viewport 320x200 and set your Stretch Mode to Viewport to start the game in really low rez.

Steps to reproduce

Is quite difficult to reproduce this issue as it requires very specific conditions.

Instead please have a look at the test case below.

However just for sake of completeness it seems to require: point mesh with shadows enabled, an Omni Light with shadow casting enabled, a surface to cast shadows on, a Viewport with a Camera attached to it as well as the Viewport has to be set to Render Mode Always.

Minimal reproduction project

TestPointMeshShadow.zip

At the top of the project there is a Viewport with a Camera attached to it. Camera must stay attached to Viewport to trigger this issue. When changing Viewport Render Mode to Always this issue will occur.

RenderMode: Always image

RenderMode: When Visible image

filipworksdev commented 3 months ago

This is still an issue in Godot 4.3. POINT_SIZE appears to be ingored when generating shadow. It acts as if POINT_SIZE is always default size no matter what yo uset it as.