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

Add emission profile to flashlight #214

Merged
merged 11 commits into from
May 12, 2022

Conversation

res2k
Copy link
Contributor

@res2k res2k commented Apr 24, 2022

Follow-up to #203. Now uses an emission profile generated from an IES file.

Screenshot from master:
quake000

Screenshot with emission profile:
quake001

  • I tried to extend the light sampling in a way that allows future enhancements, e.g. perhaps profiles that are not axially symmetric, or projection lights.
  • I opted to store the emission profile as a 16bpc grayscale PNG, so as a collateral I needed to add support for that.
  • The emission profile texture is indexed by the cosine of the angle from the spotlight direction. It was quite convenient to simply use that.
  • The specific used profile is BEGA 50964K4 from ieslibrary.com

Possibly future enhancements:
Currently, the emission profile is assumed to cover 90 degrees from the spotlight direction.
Might be interesting to make that customizable, e.g. for profiles that just zero out before 90 degrees, or for profiles that cover a larger range (the IES profile mentioned above actually has values for a tad over 90 degrees).

@res2k res2k force-pushed the flashlight-emission-profile branch from 5ef4734 to a69a694 Compare April 24, 2022 21:03
@apanteleev
Copy link
Collaborator

Thanks @res2k - this looks good overall, but I'd like to request one change. Can you make the profile texture have angle on the X axis and not cos(angle)? With the cosine, you get really poor angular resolution next to the center of the beam.

res2k added 2 commits May 12, 2022 12:38
…exing to just 'angle'.

For better angular resolution next to the center of the beam.
@res2k
Copy link
Contributor Author

res2k commented May 12, 2022

Can you make the profile texture have angle on the X axis and not cos(angle)? With the cosine, you get really poor angular resolution next to the center of the beam.

Sure, updated the branch.

@apanteleev apanteleev merged commit c3573f5 into NVIDIA:master May 12, 2022
@res2k res2k deleted the flashlight-emission-profile branch February 11, 2023 12:03
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

Successfully merging this pull request may close these issues.

2 participants