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

Fix exception when using Instancing with Fog in PBR #2391

Merged
merged 3 commits into from
Mar 12, 2025

Conversation

yaRnMcDonuts
Copy link
Member

The fog code in PBRLighting.j3md is encountering the same issue that was reported before with Lighting.j3md : #1458

This PR should fix the issue.

The fog code in PBRLighting.j3md is encountering the same issue that was reported before with Lighting.j3md : #1458

This PR should fix the issue.
@yaRnMcDonuts yaRnMcDonuts added this to the v3.8.0 milestone Mar 7, 2025
@yaRnMcDonuts yaRnMcDonuts added the bug Something that is supposed to work, but doesn't. More severe than a "defect". label Mar 7, 2025
@yaRnMcDonuts
Copy link
Member Author

yaRnMcDonuts commented Mar 8, 2025

I just realized that the variable name for the varying distance variable is different in PBRLighting.vert compared to Lighting.vert. And this means fog was broken in lighting.j3md.

One is fog_distance and the other is fogDistance. So I'm fixing both varyings to be named fogDistance.

I typically don't like using the _ character in regular variable names in shaders unless im working with a define (since defines are in all caps so _ character becomes useful since you can't use upper and lowercase to differentiate words in the variable name when its already all uppercase. For example I'd be okay with naming the corresponding define FOG_DISTANCE but the uniform should just be named fogDistance or FogDistance)

@yaRnMcDonuts yaRnMcDonuts merged commit 832814b into master Mar 12, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to work, but doesn't. More severe than a "defect".
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant