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

Expose specularPower to roughness conversion #16137

Conversation

SergioRZMasson
Copy link
Contributor

When using RectAreaLight with StandardMaterial, the value used to calculate specular will come from "roughness". However, all other lights calculate specular based on "specularPower". If a user has a scene with multiple lights sources (RectAreaLight + PointLight for example), and uses StandardMaterial for its meshes, it needs to set the roughness to the bast value possible so that the specular behaves similarly for all lights.

We already perform a specularPower to roughness conversion when exporting StandardMaterial to GLTF. This PR makes that logic available so users can also consume it using the new "MaterialConversionHelper" class.

…e same calculations when doing Area Lights in a Standard material scene
…e same calculations when doing Area Lights in a Standard material scene
@bjsplat
Copy link
Collaborator

bjsplat commented Feb 3, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 3, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Feb 3, 2025

@sebavan sebavan enabled auto-merge (squash) February 3, 2025 18:58
@bjsplat
Copy link
Collaborator

bjsplat commented Feb 3, 2025

@sebavan sebavan merged commit 68522ff into BabylonJS:master Feb 3, 2025
14 of 15 checks passed
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.

4 participants