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

[Unity 5.2] LightShafts disappear #11

Open
Drommedhar opened this issue Feb 23, 2016 · 2 comments
Open

[Unity 5.2] LightShafts disappear #11

Drommedhar opened this issue Feb 23, 2016 · 2 comments

Comments

@Drommedhar
Copy link

I started using the Light Shafts in our project and found out, that in certain viewing angles the LightShafts disappear.
I was able to reproduce this issue with the following setup:

I had a ventilation duct on the top part of a wall (higher than the player camera) and placed a spot light in it, shining out of it. So the light had a -90degree rotation shining directly to the side.
If I now walked directly infront of it, looking right in the center of the light shafts, they disappeared.

Would love to use this asset in the project, but this is a no go.
Is there anything I can do to prevent this fromo happening?

I will provide some screenshots/video if I get home from work (if needed)

@Agilethief
Copy link

One solution would be to edit the lightshafts to always render regardless of if they are in view of the camera or not.
IIRC there is a check in the main lightshaft script that checks if the lightshaft is within the frustum of the camera.

This is more expensive however (as I believe it still does the raycasts despite not being on screen)

@Drommedhar
Copy link
Author

I will check this out later.
As I already want to implement the Pull Request which also disabled the light shafts based of distance (and even if not, I can do this outside the shader), the performance might not be such a big problem.

Will tell if I got this working. Thanks for letting me know ;D

EDIT:
Commenting the code in "IsVisible" did the trick and did not cost to much frames with 9 testlights in a scene. Thanks again.

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

2 participants