You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to change only the alpha component of final color but cannot figure out how to do so.
Is this something that is currently easily feasible ?
To illustrate what I'm trying to achieve, here's to different pseudo-code solutions that would both satisfy my use case.
// In this pseudo-code example, the (imaginary) csm_Alpha is used to set the final gl_FragColor alpha componentvoid main() {
csm_Alpha =0.5;
}
// In this other pseudo-code example, I am able to retrieve the "temporary color" and update its alpha component.// The cms_TemporaryColor is not a "real property", here it would hold the color value as set by the extended material, before any CSM modification.void main() {
csm_DiffuseColor =vec4(cms_TemporaryColor.r, cms_TemporaryColor.g, cms_TemporaryColor.b, 0.5);
}
Using the Material's opacity property is not a viable option in my case because I am working with an InstancedBufferGeometry and would like every instance to have a different alpha value.
Thanks!
The text was updated successfully, but these errors were encountered:
Yes, csm_DiffuseColor is preloaded with the materials color prop. However, for InstancedMesh, you need to pass the color as an attribute, then as a varying or use the pre-existing vColor varying like so:
Hello
I would like to change only the alpha component of final color but cannot figure out how to do so.
Is this something that is currently easily feasible ?
To illustrate what I'm trying to achieve, here's to different pseudo-code solutions that would both satisfy my use case.
Using the Material's
opacity
property is not a viable option in my case because I am working with an InstancedBufferGeometry and would like every instance to have a different alpha value.Thanks!
The text was updated successfully, but these errors were encountered: