in module 1 I have:
`setMaterial()
{
this.material = new THREE.ShaderMaterial({
transparent: true,
uniforms:
{
uAlpha: { value: 0}
},
//wireframe: true,
vertexShader:
void main()
{
gl_Position = vec4(position, 1.0);
}
,
fragmentShader:
uniform float uAlpha;
void main()
{
gl_FragColor = vec4(0.0, 0.0, 0.0, uAlpha);
}
})
}
in a second module I have:
my instance
this.material = new Loading()
and the gsap I want to recive the property:
setLoaders()
{
const loadingManager = new THREE.LoadingManager(
// Loaded
() =>
{
gsap.to(this.material.uniforms.uAlpha, { duration: 3, value: 0})
},
if I add anymore child properties on the instance it e.g.
this.material.uniforms = new Loading()
I am given a ERROR:
`Cannot set properties of undefined (setting 'uniforms')
`
how do I get the Uniforms then the uAlpha?