Skip to content

perf(pbr): improve glints#962

Merged
doodlum merged 10 commits into
devfrom
glints-opt
Feb 16, 2025
Merged

perf(pbr): improve glints#962
doodlum merged 10 commits into
devfrom
glints-opt

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented Feb 12, 2025

No description provided.

@Pentalimbed
Copy link
Copy Markdown
Collaborator

actually, just put the noise in GlintCachedVars

@doodlum doodlum changed the title perf: improve glints performance perf: improve glints Feb 12, 2025
@doodlum
Copy link
Copy Markdown
Collaborator Author

doodlum commented Feb 12, 2025

actually, just put the noise in GlintCachedVars

It's not specifically made for glints so i dont think it should be in there because it might be reused in the future.

@Pentalimbed
Copy link
Copy Markdown
Collaborator

Pentalimbed commented Feb 12, 2025

actually, just put the noise in GlintCachedVars

It's not specifically made for glints so i dont think it should be in there because it might be reused in the future.

Do that when you actually need it in the future.

Edit: nvm

Comment thread package/Shaders/Common/Glints/Glints2023.hlsli Outdated
@Pentalimbed
Copy link
Copy Markdown
Collaborator

Pentalimbed commented Feb 13, 2025

@doodlum
Copy link
Copy Markdown
Collaborator Author

doodlum commented Feb 13, 2025

@Pentalimbed
Copy link
Copy Markdown
Collaborator

no measurable performance impact but also no visual difference.

Okay then I think it's better if you make it 512

@Pentalimbed
Copy link
Copy Markdown
Collaborator

Additionally, here https://github.com/doodlum/skyrim-community-shaders/blob/7be08c17b5c2eb76a2fc28344291513b50f11692/package/Shaders/Common/Glints/Glints2023.hlsli#L536
you may incerase the clamp value (20) until you see weird glitter lines (the sand beach in front of broken oar grotto is a good location to test)

@doodlum
Copy link
Copy Markdown
Collaborator Author

doodlum commented Feb 13, 2025

no measurable performance impact but also no visual difference.

Okay then I think it's better if you make it 512

I'm not sure because it will matter when you have a lot of lights.

@doodlum
Copy link
Copy Markdown
Collaborator Author

doodlum commented Feb 13, 2025

Additionally, here

https://github.com/doodlum/skyrim-community-shaders/blob/7be08c17b5c2eb76a2fc28344291513b50f11692/package/Shaders/Common/Glints/Glints2023.hlsli#L536

you may incerase the clamp value (20) until you see weird glitter lines (the sand beach in front of broken oar grotto is a good location to test)

That is outside the scope of this PR

@doodlum doodlum changed the title perf: improve glints perf(pbr): improve glints Feb 13, 2025
@Pentalimbed
Copy link
Copy Markdown
Collaborator

Additionally, here
https://github.com/doodlum/skyrim-community-shaders/blob/7be08c17b5c2eb76a2fc28344291513b50f11692/package/Shaders/Common/Glints/Glints2023.hlsli#L536

you may incerase the clamp value (20) until you see weird glitter lines (the sand beach in front of broken oar grotto is a good location to test)

That is outside the scope of this PR

No? because you stochastized the sampling, you are now temporally averaging the clamped value instead of clamping the average value, which means there's more bias towards the tamer side.

@doodlum
Copy link
Copy Markdown
Collaborator Author

doodlum commented Feb 15, 2025

Additionally, here
https://github.com/doodlum/skyrim-community-shaders/blob/7be08c17b5c2eb76a2fc28344291513b50f11692/package/Shaders/Common/Glints/Glints2023.hlsli#L536

you may incerase the clamp value (20) until you see weird glitter lines (the sand beach in front of broken oar grotto is a good location to test)

That is outside the scope of this PR

No? because you stochastized the sampling, you are now temporally averaging the clamped value instead of clamping the average value, which means there's more bias towards the tamer side.

done

@Pentalimbed
Copy link
Copy Markdown
Collaborator

done

great, also check out the change request

@doodlum doodlum merged commit 326f3de into dev Feb 16, 2025
alandtse pushed a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
* perf: improve glints performance

* style: 🎨 apply clang-format changes

* chore: more cleanup

* style: 🎨 apply clang-format changes

* chore: increase glint texture size

* chore: improved sampling

* style: 🎨 apply clang-format changes

* chore: increase glint max brightness

* chore: clean up tetra

---------

Co-authored-by: doodlum <doodlum@users.noreply.github.com>
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