mattdesl / webgl-lines

some interactive content for a blog post
http://mattdesl.svbtle.com/drawing-lines-is-hard
MIT License
415 stars 37 forks source link

offset.w should be zero? #6

Open gwaldron opened 6 years ago

gwaldron commented 6 years ago

Great set of examples!

One observation: since this is an offset vector, shouldn't the w component be zero instead of one? Setting it to one will break when using an orthographic camera.

https://github.com/mattdesl/webgl-lines/blob/2fb2712a897443c46ee128c3115298e8d4569239/projected/vert.glsl#L57

natevm commented 6 years ago

@gwaldron I just ran into a bug when using this shader with an orthographic camera. Setting w to 0 on the offset fixed my bug. Thanks for the tip.

amadeusCaleb commented 9 months ago

I ran into the same bug thanks @gwaldron and @natevm