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

Custom shaders don't work on instanced models #10113

Closed
j9liu opened this issue Feb 17, 2022 · 1 comment
Closed

Custom shaders don't work on instanced models #10113

j9liu opened this issue Feb 17, 2022 · 1 comment
Assignees

Comments

@j9liu
Copy link
Contributor

j9liu commented Feb 17, 2022

While reviewing #10110, I discovered that custom shaders won't apply to instanced models, even if they're simple. I tested this with the sandcastle here.

What the custom shader is doing is applying a solid yellow color to the model:
image

However, this doesn't work for BoxInstanced.gltf:
image

@ptrgags
Copy link
Contributor

ptrgags commented Jul 6, 2022

I did some digging today and found that the model is rendering correctly based on PBR works.

If the specular value is high, then the reflections tend to overwhelm the diffuse color. By default, the glTF spec requires baseColor, metallic, and roughness to all be 1.0 (which corresponds to diffuse = 0.0, specular = vec3(1.0), roughness = 1.0. Since the Sandcastle in the description only changes the diffuse value, it is overwhelmed by the specular reflections.

However, if you reduce the specular value like in this sandcastle it does render yellow!

image

There's nothing actionable here so I'm closing this issue.

@ptrgags ptrgags closed this as completed Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants