Hi, I have this problem that with some of these transparent parts I have in models they have this “shine” reflection in them when viewed from below this is most apparent, is this just an issue with my shader? (Applied in blender script) or is this also preventable by some viewer setting?
If you are using PBRMaterial you could set useSpecularOverAlpha and useRadianceOverAlpha to false to prevent this behavior, in StandardMaterial it would only be useSpecularOverAlpha .
Ehm, I am not sure how to access the material? I used load async previously but now wish meshtask I can only look at loadedMeshes which as _material and _effectiveMaterial but I cannot access this?
var viewerMeshTask = VIEWER_assetsManager.addMeshTask("loadViewerModel", "", BABYLON_path, BABYLON_file);
viewerMeshTask.onSuccess = function (task) {
console.log(task.loadedMeshes);
for(i = 0; i < task.loadedMeshes.length; i++) {
task.loadedMeshes[i]._material.useRadianceOverAlpha = false;
task.loadedMeshes[i]._material.useSpecularOverAlpha = false;
}
Alright so, for some reason .material was not set on some meshes, not sure how that works but I added a loop in my lighting functions that loops all meshes disables the properties sebavan mentioned and it appears to work.
for(i = 0; i < scene.meshes.length; i++) {
if(scene.meshes[i]) {
let material = scene.meshes[i].material;
if(material != null) {
material.useSpecularOverAlpha = false;
material.useRadianceOverAlpha = false;
}
}
}