Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider splitting up shadow shaders to eliminate excess branching. #893

Open
bryanedds opened this issue Nov 10, 2024 · 2 comments
Open
Labels
performance issues or potential issues relating to performance rendering

Comments

@bryanedds
Copy link
Owner

Right now we just have a single shadow shader for each surface type with a switch statement to vary behavior depending on the light type whose shadow is being rendered. We should probably go ahead and split each case up into its own set of shadow shaders.

@bryanedds bryanedds added performance issues or potential issues relating to performance rendering labels Nov 10, 2024
@bryanedds
Copy link
Owner Author

bryanedds commented Nov 13, 2024

There might be pretty limited benefit to doing so since lightType comes in on a uniform, so the switch cases are probably eliminated at raster time.

@bryanedds
Copy link
Owner Author

Now that we're using PCF in point lights, we only need one channel there, so we could halve the size of the shadow map if we split the shaders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance issues or potential issues relating to performance rendering
Projects
None yet
Development

No branches or pull requests

1 participant