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

Specular color texture is never passed to the PBR shader #113

Open
dar-dev opened this issue Aug 1, 2023 · 2 comments
Open

Specular color texture is never passed to the PBR shader #113

dar-dev opened this issue Aug 1, 2023 · 2 comments

Comments

@dar-dev
Copy link
Contributor

dar-dev commented Aug 1, 2023

At this line: https://github.com/mgsx-dev/gdx-gltf/blob/7d70839067ead66ec6107bc1be8c060c7c0fc7aa/gltf/src/net/mgsx/gltf/loaders/shared/material/PBRMaterialLoader.java#L167C7-L167C7

A specular color texture attribute is created but the texture is never passed to the shader.

@dar-dev dar-dev changed the title PBR SpecularColorTexture attribute does not match with the TextureAttribute.specular in PBR shader Specular color texture is never passed to the PBR shader Aug 3, 2023
dar-dev added a commit to MikOfClassX/gdx-gltf that referenced this issue Aug 8, 2023
@mgsx-dev
Copy link
Owner

@dar-dev i think to issue is here :

.get(PBRTextureAttribute.Specular))).textureDescription);

it should use PBRTextureAttribute.SpecularColorTexture instead of PBRTextureAttribute.Specular.

Could you please test it with your models to confirm it works and send a PR?

@dar-dev
Copy link
Contributor Author

dar-dev commented Nov 14, 2023

Tested using "PBRTextureAttribute.SpecularColorTexture":

com.badlogic.gdx.utils.GdxRuntimeException: Shader compilation failed:
Fragment shader:
0(1254) : error C1503: undefined variable "u_specularColorSampler"

	at net.mgsx.gltf.scene3d.shaders.PBRShaderProvider.checkShaderCompilation(PBRShaderProvider.java:633)

The issue here's the "specularColorTextureFlag" is never defined in the PBRShader.

Please, check our fix here: MikOfClassX@fdb7570

I can send a PR if it looks good to you..

--

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

No branches or pull requests

2 participants