Skip to content
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

shaderMaterial for Line object #681

Closed
milcktoast opened this issue Oct 23, 2011 · 8 comments
Closed

shaderMaterial for Line object #681

milcktoast opened this issue Oct 23, 2011 · 8 comments
Labels

Comments

@milcktoast
Copy link
Contributor

My goal is to be able to control a lines vertices and possibly segment colors with custom attributes and shaders. I've seen examples ( http://www.ro.me/tech/demos/8/index.html ) of this done with ParticleSystems, but haven't been able to render lines with similar techniques. This is the basic look I'd like to get, but via shader rather than explicit vertex positions : http://dl.dropbox.com/u/18230908/three_exp/vis_exp_001.html

@alteredq
Copy link
Contributor

Custom attributes are implemented just for meshes and particles so far. I can give a try for lines once we get dev branch to working state.

ShaderMaterial should work I think. Just for line width you would need to manually add linewidth property.

@nosy-b
Copy link
Contributor

nosy-b commented Oct 25, 2011

I can't manage to make a linewidth larger than 1.
I tried:
var lineBasicMaterial = new THREE.LineBasicMaterial( { color: 0xaaff0f, opacity:1, linewidth:5 } ) // a
var meshBasicMaterial = new THREE.MeshBasicMaterial({wireframe: true, wireframeLinewidth : 5}) // b
var shader_material = new THREE.ShaderMaterial({wireframe: true, wireframeLinewidth : 5}) // c

var lineMesure = new THREE.Line(geometryLinesMesure,/a or b or c/,THREE.LinePieces);

Any clue?
thanks!

@alteredq
Copy link
Contributor

@nosy-b #309

@nosy-b
Copy link
Contributor

nosy-b commented Oct 25, 2011

Thanks!
ok so it's an Angle aspect as I get ALIASED_LINE_WIDTH_RANGE that says "1-1" (http://alteredqualia.com/tmp/webgl-maxparams-test/)
Too bad, maybe I can tell my firefox to use my OpenGL last drivers and don't use Angle rendering backend...

@nosy-b
Copy link
Contributor

nosy-b commented Oct 25, 2011

In fact yes it's possible :)
in the about:config of firefox I set true to
webgl.prefer-nativ-gl

and now I got wide lines on my windows comp!

@alteredq
Copy link
Contributor

Ok, lines can use custom attributes now:

http://alteredqualia.com/three/examples/webgl_custom_attributes_lines.html

alteredq@046f4bf

@nosy-b
Copy link
Contributor

nosy-b commented Oct 25, 2011

Huge!
nice example

@milcktoast
Copy link
Contributor Author

cool, just what I was trying for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants