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

Lights are imported with the default 1 meter near clip plane #90

Open
Clockwork-Muse opened this issue Jan 12, 2021 · 5 comments
Open

Comments

@Clockwork-Muse
Copy link

... which is expected, I suppose, but this should probably be called out in documentation or something, since things closer than one meter then often end up rendering strangely.

@Moguri
Copy link
Owner

Moguri commented Jan 9, 2023

Light clip near/far is not something that glTF specifies (as far as I know), but we could expose some settings to allow the user to control the near and far values used when creating a light. We could also default these to something other than their current defaults if there are more sensible values. For example, we could add a light_clip_near that defaults to 0.1.

@Clockwork-Muse
Copy link
Author

... A light on a wall can easily be as close as 1cm.
Although I'm unsure how likely a setup would be in practice, given that last I knew there wasn't an in-engine way to bake lights.

@rdb
Copy link
Collaborator

rdb commented Jan 9, 2023

The near distance doesn't affect how close to a wall a light can be. It just affects how close an object can be to a light source and still cast shadows.

Placing the near plane too close will dramatically impact depth buffer precision and therefore shadow mapping quality.

@Clockwork-Muse
Copy link
Author

.... Like the shadows any lamp shade might cast?

@rdb
Copy link
Collaborator

rdb commented Jan 10, 2023

Those aren't likely to be within 1cm of the light source. For lights with such close casters, it would be necessary to tweak the near clip so that it's just barely within anything that might need to cast shadows.

Generally, I would say that it's better to handle lamp shades via an IES profile (which also allows them to be partially translucent). But those are not currently supported / require a custom shader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants