New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to color mesh vertices with (r,g,b,a)? #2118
Comments
It's not supported at the moment, but I've heard of other people needing RGBA vertex colors. I guess we'll have to tackle this eventually. |
You can do this using custom attributes and custom |
@alteredq , can you please provide us a jsfiddle, how to modify the following example to use |
Just check this example: http://mrdoob.github.com/three.js/examples/webgl_custom_attributes_particles.html and change attributes = {
// ...
customColor: { type: 'v4', value: [] }
// ...
}; var values_color = attributes.customColor.value;
for( var v = 0; v < vertices.length; v++ ) {
// ...
values_color[ v ] = new THREE.Vector4();
// ...
} It's up you how you want to fill-in these And on shader side just replace // vertex shader
attribute vec4 customColor;
varying vec4 vColor; // fragment shader
varying vec4 vColor;
void main() {
gl_FragColor = vColor;
// ...
} |
Why did you close this? Still good feature.. |
+1 This should be supported through THREE.Color |
There is a long history here. See #6014 and follow the links. |
+1 (BTW, my use case is minor: mainly to see if it can be done - I have a 3D chart demo, done years ago in Flash, that uses an opacity gradient. So if supporting this feature increased CPU or memory requirements for everyone else, then I think it is not worth it.) |
THREE.Geometry.colors are accepting only (r,g,b). I really need to render vertices with color in the format (r,g,b,a), where a = alpha/transparancy component.
Is there any workaround ?
What i need is, in the following example is it possible to make few of the balls fully transparent ?
http://mrdoob.github.com/three.js/examples/webgl_particles_billboards_colors.html
The text was updated successfully, but these errors were encountered: