Skip to content

Conversation

@blueskythlikesclouds
Copy link
Contributor

Point size emulation relies on the viewport size and screen pixel size parameters in the scene UBO. In many effects, these values are set to (1, 1), causing point primitives to cover the entire framebuffer. This PR updates all uses of _setup_environment to correctly pass these values in every effect.

For the viewport size, this change also passes the actual viewport dimensions instead of the screen size so that point size emulation matches Vulkan. This should make no difference in the main rendering pass, since the viewports there cover the entire framebuffer anyway, and the values were already incorrect for other effects.

Normally, this issue would not be so urgent, but it caused a severe problem in my system. When point primitives are rendered into shadow maps via ubershaders, each point primitive covers the entire shadow map due to the incorrect viewport size values. With thousands of points, the manual culling via discard in the ubershader creates such a large performance hit that either the FPS drops dramatically, or the driver crashes system-wide due to TDR timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant