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

How to achieve constant brightness with varying theta for distantlight? #298

Closed
Theverat opened this issue Feb 1, 2020 · 2 comments
Closed
Assignees
Labels

Comments

@Theverat
Copy link
Member

Theverat commented Feb 1, 2020

Is it possible with the current distantlight to use different thetas, but counteract the brightness changes to keep the end result at the same brightness level? (I'm speaking of the brightness on a surface hit by the light)

Is it possible to do this "from outside" by changing the gain property according to some formula, or would it require changes in LuxCore source code?

@Dade916
Copy link
Member

Dade916 commented Feb 2, 2020

Yes, if you multiply the gain for:

cosThetaMax = min(cos(radians(theta)), 1.f - epsilon);
gain *= 1.f / (2.f * M_PI * (1.f - cosThetaMax))

where theta is the angle in degree, you will get constant light brightness for any theta.

You could add a normalize flags to enable this behavior.

@Theverat
Copy link
Member Author

Theverat commented Feb 2, 2020

Awesome, it works, thanks!

@Theverat Theverat closed this as completed Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants