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

[Rendering] Lens flare phase1 #66

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

[Rendering] Lens flare phase1 #66

wants to merge 31 commits into from

Conversation

fall2019
Copy link
Member

@fall2019 fall2019 commented Jun 3, 2023

add lens flare

@fall2019
Copy link
Member Author

fall2019 commented Jun 3, 2023

lensflare2

@fall2019
Copy link
Member Author

fall2019 commented Jun 3, 2023

image

@fall2019 fall2019 requested a review from MomoDeve June 3, 2023 16:47
@fall2019 fall2019 added the proposal new feature label Jun 3, 2023
Copy link
Member

@MomoDeve MomoDeve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asked for some improvements

@fall2019 fall2019 closed this Jun 5, 2023
@fall2019 fall2019 reopened this Jun 5, 2023
@MomoDeve
Copy link
Member

Whats my general concern - in lots of shader I see dependencies on scene luminance. It never should be there. You should handle all cases when light on scene have max luminance of 1, and when light have luminance of max 1000, or 100'000, etc...). To handle that you should introduce the least amount of constants - I guess only threshould value, which is multiple, so for example when light is twice the average - compute the halo.
I can imagine the issue here - when you are close to light, you get really big average from average white texture. For that ok, you can use tonemapping values, we have 'white point', 'min/max luminance'. If there is no tonemapping component in camera object, you can assume the values are defaults (like in its initialization)

@MomoDeve
Copy link
Member

MomoDeve commented Jun 23, 2023

also please leave comments what you changed in your commits so I can review the code faster 🙏

@fall2019
Copy link
Member Author

Will check comments later tonight

@fall2019
Copy link
Member Author

fall2019 commented Jun 23, 2023

handle any luminance and improve formatting

@fall2019 fall2019 requested a review from MomoDeve June 23, 2023 16:35
@MomoDeve
Copy link
Member

MomoDeve commented Jul 1, 2023

Try using smoothstep (https://registry.khronos.org/OpenGL-Refpages/gl4/html/smoothstep.xhtml) for ghost and halo to make a smooth transition for lights of different intensitities (thus for different average luminance).
Right now halo circle is always too bright, the effect is strictly clamped then light intensity is beyong cirtain theshold whichs not good

You should have a luminance point value when halo start appearing and point when it becomes at its max and a smooth transition between. For example you can see that orange light on SandboxApplication scene does not have halo at all, because its luminance is a bit lower when whites. I expect it to have it, but not so bright as for whites. But do not tweak parameters so the effect become visible for this particular light, it should work for large range of light sources with smooth transition depending on their intensities

@fall2019
Copy link
Member Author

fall2019 commented Mar 25, 2024

Try using smoothstep (https://registry.khronos.org/OpenGL-Refpages/gl4/html/smoothstep.xhtml) for ghost and halo to make a smooth transition for lights of different intensitities (thus for different average luminance). Right now halo circle is always too bright, the effect is strictly clamped then light intensity is beyong cirtain theshold whichs not good

You should have a luminance point value when halo start appearing and point when it becomes at its max and a smooth transition between. For example you can see that orange light on SandboxApplication scene does not have halo at all, because its luminance is a bit lower when whites. I expect it to have it, but not so bright as for whites. But do not tweak parameters so the effect become visible for this particular light, it should work for large range of light sources with smooth transition depending on their intensities

Fix mipmap level
Remove brightness clamping so that it can support larger range of light sources.So the orange light on SandboxApplication scene issue is fixed.
It still not perfect. But seems better than before.

@fall2019 fall2019 requested a review from MomoDeve March 25, 2024 15:24
@MomoDeve MomoDeve self-requested a review March 28, 2024 20:24
@MomoDeve
Copy link
Member

MomoDeve commented Mar 28, 2024

Mostly fine. but I not really like that sky on sponza gives the halo, also the halo is too strong for fires

You can move forward with other PR. I will finish this PR myself

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

Successfully merging this pull request may close these issues.

2 participants