You can use the uv coordinates in this way:
I’m afraid there’s no list of variables you can use when injecting custom code with a PBRCustomMaterial
/ CustomMaterial
(or a material plugin), you’ll have to refer to the shader source code itself.
You can use the uv coordinates in this way:
I’m afraid there’s no list of variables you can use when injecting custom code with a PBRCustomMaterial
/ CustomMaterial
(or a material plugin), you’ll have to refer to the shader source code itself.
Thanks there it is working with my model: https://playground.babylonjs.com/debug.html#6T8SBT#18
But I had to remove the uv definition as I had the shader error 'uv' : redefinition
.
Though in your example this is needed or it won’t work so I wonder if it is safe to simply remove the uv definition? Does any material imported from GLTF always have uv already defined?
Otherwise, I looked for a way to check if an attribute is already defined in GLSL but no clue.
You need to delete the definition as it has already been added, since your material uses other textures (bump, ambient, …). As long as at least one texture is used by your material, the definition of the uv attribute will be added to the shader.