I set several material properties for my shader, and some of them are based on Vec4 and Color settings that I expose in the editor.
So in my code I have:
this.material.setParameter('radius', this.corners.data);
but this raises several warnings like:
- pc.Vec4#data is not public API and should not be used. Access vector components via their individual properties.
- pc.Color#data is not public API and should not be used. Access color components via their individual properties.
Is there a better way to set the shader params without doing a new array every time like this:
this.material.setParameter('radius', new Float32Array([this.corners.x, this.corners.y, this.corners.z, this.corners.w]));