Page 1 of 1

Connect arbitrary points with tube in vertex shader

PostPosted: Fri Jul 12, 2019 6:38 am
by sm87
Hi All!
I'm trying to use a vertex shader to connect 2 arbitrary points.. i know it's very simple but i can't get it working! :(
Any suggestion?
Thank you very much!!!!

Re: Connect arbitrary points with tube in vertex shader

PostPosted: Fri Jul 12, 2019 1:33 pm
by barakooda
partial solution.
seem like the full one will have to involve geometry shader.
Hope it helps.

Re: Connect arbitrary points with tube in vertex shader

PostPosted: Sat Jul 13, 2019 4:32 am
by jacqueshoepffner
Hello,
I propose another solution, using Add SOP, and forming polygone, you obtain lines.
Concerning Geometry shader I think its not the easiest solution, because you need points on the same polygon as to be able to make a line in geometry shader, but you have yet the line, or you can enter the coordinates separately though uniform and use static instanced points. Thats work well but I dont know if its what you want. I can prepare a little example showing hom to do. But you will be limited to very simple lines, no reflections, no shadows.

Re: Connect arbitrary points with tube in vertex shader

PostPosted: Sat Jul 13, 2019 6:09 am
by jacqueshoepffner
A quick test with geometry shader.
A made two propositions, one using transform as to do a 3D drawing, another with direst position obtaining a 2D drawing. You can see the difference moving the camera.
No tube with this technic, I use glsl mat Wire Frame to obtain a thick line but no lightning.
I hope the description is clear, there is comments in the glsl.
Jacques

Re: Connect arbitrary points with tube in vertex shader

PostPosted: Sat Jul 13, 2019 12:28 pm
by sm87
Thank you very much to all for the answers!!!! Very helpful, i learned a lot!!! Thanks!!!