You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A cube with a default material; shadows are displayed correctly
A cube with a custom material jitter-not-using-viewport.tres; shadows are displayed correctly
The custom material essentially just does VERTEX = round(VERTEX * i) / i;, where i is set by the user
A cube with a custom material jitter-using-viewport; shadows are not displayed correctly
The custom material scales i by VIEWPORT_SIZE.y
The text was updated successfully, but these errors were encountered:
The underlying problem here is that the VIEWPORT_SIZE builtin changes depending on whether we are at the shadow pass or in a regular drawing pass. In the shadow pass it is Vector2(1, 1).
I don't think VIEWPORT_SIZE is used internally for anything. Therefore, we should be able to just pass the screen size in there when rendering shadows
Lookes like if we want to pass the correct viewport to shadowpass, we have to add more argument to _render_shadow_pass and _render_shadow_append. I will create a pr for this.
Do we need to add the same to compatibility and mobile ? I guess yes.
Godot version
v4.1.1.stable.mono.official [bd6af8e]
System information
Godot v4.1.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 (NVIDIA; 31.0.15.3713) - Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 Threads)
Issue description
I'm trying to implement a vertex jitter shader to emulate psx style graphics.
See: https://github.com/AnalogFeelings/godot-psx for a public implementation I am using for reference.
The shader should support shadows but there appears to be a bug in Godot that is preventing shadows from appearing.
As far as I can tell, the issue relates to VIEWPORT_SIZE. The shader uses VIEWPORT_SIZE to scale the jitter based on screensize.
Steps to reproduce
render_mode skip_vertex_transform
vertex()
function,VIEWPORT_SIZE
in some part of the calculation of VERTEX.Minimal reproduction project
no_shadows.zip
See screenshot below:
jitter-not-using-viewport.tres
; shadows are displayed correctlyThe custom material essentially just does
VERTEX = round(VERTEX * i) / i;
, where i is set by the userjitter-using-viewport
; shadows are not displayed correctlyThe custom material scales
i
byVIEWPORT_SIZE.y
The text was updated successfully, but these errors were encountered: