@@ -9,7 +9,10 @@ import {
99 ShaderMaterial ,
1010 Uniform ,
1111} from 'three' ;
12- import { CommonComponentProps , CustomMaterialProps } from '../../../common/types' ;
12+ import {
13+ CommonComponentProps ,
14+ CustomMaterialProps ,
15+ } from '../../../common/types' ;
1316import { useGenerator } from '../../../hooks/useGenerator' ;
1417import { useWellboreContext } from '../../../hooks/useWellboreContext' ;
1518import { createLayers , LAYERS } from '../../../layers/layers' ;
@@ -109,31 +112,31 @@ export const Perimeter = ({
109112 return onMaterialPropertiesChange
110113 ? onMaterialPropertiesChange
111114 : ( props : Record < string , any > , material : Material | Material [ ] ) => {
112- const m = material as ShaderMaterial ;
113- m . uniforms . uColor . value = new Color ( props . color ) ;
114- m . uniforms . uFrom . value = props . from ;
115- m . uniforms . uTo . value = props . to ;
116- m . uniforms . uOpacity . value = props . opacity ;
117- m . uniforms . uTime . value = props . time ;
118- } ;
115+ const m = material as ShaderMaterial ;
116+ m . uniforms . uColor . value = new Color ( props . color ) ;
117+ m . uniforms . uFrom . value = props . from ;
118+ m . uniforms . uTo . value = props . to ;
119+ m . uniforms . uOpacity . value = props . opacity ;
120+ m . uniforms . uTime . value = props . time ;
121+ } ;
119122 } , [ onMaterialPropertiesChange ] ) ;
120123
121124 const material = useMemo < Material | Material [ ] > ( ( ) => {
122125 const m = customMaterial
123126 ? customMaterial
124127 : new ShaderMaterial ( {
125- transparent : true ,
126- side : DoubleSide ,
127- vertexShader,
128- fragmentShader,
129- uniforms : {
130- uTime : new Uniform ( 0 ) ,
131- uFrom : new Uniform ( 0 ) ,
132- uTo : new Uniform ( 0 ) ,
133- uOpacity : new Uniform ( 0 ) ,
134- uColor : new Uniform ( new Color ( '#56af3b' ) ) ,
135- } ,
136- } ) ;
128+ transparent : true ,
129+ side : DoubleSide ,
130+ vertexShader,
131+ fragmentShader,
132+ uniforms : {
133+ uTime : new Uniform ( 0 ) ,
134+ uFrom : new Uniform ( 0 ) ,
135+ uTo : new Uniform ( 0 ) ,
136+ uOpacity : new Uniform ( 0 ) ,
137+ uColor : new Uniform ( new Color ( '#56af3b' ) ) ,
138+ } ,
139+ } ) ;
137140 return m ;
138141 } , [ customMaterial ] ) ;
139142
0 commit comments