Forum

SplineBuffered suqared technique


#1

Hey everyone! Thanks for great work!
As I am rather a beginner regarding shaders and particulary instancing (actually i am learning that on the fly from the InstanceNoodles pack), I am struggling a bit in one particular point:

I am basically trying to build instanced tentacle meshes using SplineBuffered module / gsfx, simillar to the Feedback (Transform Buffer) example / help patch, but build out of actual spline meshes instead of separate primitive instances.
I have already acheived this successfully, also implemented separate structured buffer for individual spline’s up-vectors etc., but what I am struggling with is the “gsTubeSQ” technique (or rather its respective method) of the geom shader - I am just not able to extend that to use the same radial tube resolution as the standard “gsTube” technique / method. In the original geom shader’s gsTubeSQ method the radial resolution (“TUBE_RES_SQ”) has a hardcoded value of 4 for a reason, so I linked the it to the standard “TUBE_RES” variable, which works except it just doesn’t draw all the splines in their whole - some are just unfinished. Obviously it has to do with themaxvertexcount parameter of the method. I have tested that if I set the whole spline resolution or controls point count to very low values, all splines get drawn completely even with higher tube resolution values.
It seems that the standard gsTube method deals with the vertices count in different way but I just can’t wrap my head around it.

Any suggestions pls?


#2

Hi you have to make a .zip file, with moded shaders and patch, attach it here…
This is only way to get help in such case…

Meanwhile:
tube
If you change tube res you have to change that value also, i suspect that’s a size of how many vertices you emit per spline segment… Anyways i don’t really see logic in what you are doing, but if it’s working you have to also provide correct value to Max Elements pin of that shader…


#3

Well thats exactly what I was missing, now it works exactly as I needed, thanks man!