From f25e932723b50b9f53c055c3bfa6a5f63f4622cb Mon Sep 17 00:00:00 2001 From: Erich Loftis Date: Thu, 28 Mar 2024 10:32:21 -0500 Subject: [PATCH] Update The_6_Platonic_Solids.js --- js/The_6_Platonic_Solids.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/The_6_Platonic_Solids.js b/js/The_6_Platonic_Solids.js index 27bb030..376630e 100644 --- a/js/The_6_Platonic_Solids.js +++ b/js/The_6_Platonic_Solids.js @@ -433,7 +433,7 @@ function initSceneData() rayTracingUniforms.uTriangleTexture = { value: triangleDataTexture }; rayTracingUniforms.uAABBTexture = { value: aabbDataTexture }; rayTracingUniforms.uMarbleTexture = { value: marbleTexture }; - rayTracingUniforms.uMaterialType = { value: new THREE.Vector3() }; + rayTracingUniforms.uMaterialColor = { value: new THREE.Color() }; rayTracingUniforms.uTetrahedronInvMatrix = { value: new THREE.Matrix4() }; rayTracingUniforms.uCubeInvMatrix = { value: new THREE.Matrix4() }; rayTracingUniforms.uOctahedronInvMatrix = { value: new THREE.Matrix4() }; @@ -463,19 +463,19 @@ function updateVariablesAndUniforms() // Gold: (1.000, 0.766, 0.336) / Aluminum: (0.913, 0.921, 0.925) / Copper: (0.955, 0.637, 0.538) / Silver: (0.972, 0.960, 0.915) if (matType == 'Aluminum') { // more of a 'blue-steel' in an attempt to match the original raytraced source image of this demo - rayTracingUniforms.uMaterialType.value.set(0.9, 0.95, 1.0); + rayTracingUniforms.uMaterialColor.value.setRGB(0.9, 0.95, 1.0); } else if (matType == 'Gold') { - rayTracingUniforms.uMaterialType.value.set(1.000, 0.766, 0.336); + rayTracingUniforms.uMaterialColor.value.setRGB(1.000, 0.766, 0.336); } else if (matType == 'Copper') { - rayTracingUniforms.uMaterialType.value.set(0.955, 0.637, 0.538); + rayTracingUniforms.uMaterialColor.value.setRGB(0.955, 0.637, 0.538); } else if (matType == 'Silver') { - rayTracingUniforms.uMaterialType.value.set(0.972, 0.960, 0.915); + rayTracingUniforms.uMaterialColor.value.setRGB(0.972, 0.960, 0.915); } cameraIsMoving = true;