Connect arbitrary points with tube in vertex shader

Connect arbitrary points with tube in vertex shader

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!!!!
Attachments
Tube.7.toe
sm87

Posts: 7
Joined: Mon Jul 24, 2017 4:21 am

Re: Connect arbitrary points with tube in vertex shader

partial solution.
seem like the full one will have to involve geometry shader.
Hope it helps.
Attachments
two_points_example.toe

barakooda

Posts: 669
Joined: Fri Nov 27, 2009 5:08 pm

Re: Connect arbitrary points with tube in vertex shader

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.
Attachments
lignesPoints.toe
Jacques Hoepffner
visual artist, programmer
jacqueshoepffner

Posts: 144
Joined: Fri Dec 23, 2016 4:59 pm
Location: Paris (France)

Re: Connect arbitrary points with tube in vertex shader

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
Attachments
lignesPointsGeometry.toe
Jacques Hoepffner
visual artist, programmer
jacqueshoepffner

Posts: 144
Joined: Fri Dec 23, 2016 4:59 pm
Location: Paris (France)

Re: Connect arbitrary points with tube in vertex shader

Thank you very much to all for the answers!!!! Very helpful, i learned a lot!!! Thanks!!!
sm87

Posts: 7
Joined: Mon Jul 24, 2017 4:21 am