Compute_tube
Added 2023-10-31 10:33:54 +0000 UTC
Hi,
Today topic is about compute geometry. In this example i am generating a tube from a circle in a compute shader.
I notice that rebuilding the primivite directly instead to sample them is a way better approce.
This does not scale properly for complex geometry, since you can not code a 3D object but you can sample it :-)
Here the code that is actually drawing the tube :
//Sample a texture with 1 row and the width of the shader
vec4 circle = texelFetch(sTD2DInputs[0], ivec2(gl_GlobalInvocationID.x,0), 0);
// here we loop 40 times so write the 40 line we need to in order to build a 40x40 texture
//each iteration we sample a chop and we add that off set to the circle
//yes a tube is just some circle in line :-)
for (int i = 1; i < 40 ; i++) {imageStore(mTDComputeOutputs[0], ivec2(gl_GlobalInvocationID.x,i), TDOutputSwizzle(circle+vec4(texelFetch(uOffset,i).r,i*.04,0,0)));
My next step is to build a set compute primitive and from there try to implement a simple nodebase phisix system.
I saw a lot of people posting great shaders but than, the "normal" or beginner user get scared and never go deep in reading the code.
I want a tool where you manipulete geometry with nodes in the gpu, what is more fun than that?
Stay tuned,
Unveil_studio is working on a new infrastructure for your creativity.
PEACE,
Simo
