Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color Gradient for Three.js line

Tags:

three.js

webgl

I only can find THREE.LineBasicMaterial(). Is there a way to have a simple color gradient from point a to point b?

like image 552
Bryce Evans Avatar asked Jun 20 '26 09:06

Bryce Evans


1 Answers

You can use Vertex & fragment shaders for change color for vertices[0] and vertices[1]. (Line points) See http://mrdoob.github.com/three.js/examples/webgl_custom_attributes_lines.html

like image 142
soil Avatar answered Jun 25 '26 08:06

soil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!