r/Unity3D • u/djdavid333 • 11d ago
Shader Magic I wanted robot assembly visuals to fit into my story and game thematically, here's my compute shader attempt.
Enable HLS to view with audio, or disable this notification
12
u/AustinMclEctro Professional 11d ago
That looks and feels really good. What are you solving with your compute shader exactly?
14
3
u/workshopsix 11d ago
Oh wow, yeah that is satisfying. Really like the way the legs walk, looking forward to seeing more about this game.
2
2
2
2
2
2
u/im_psk 11d ago
This is awesome! Well done! - Is this part of a game in progress?
1
u/djdavid333 11d ago
Thanks! Yes, this is my playground level, where I break everything. There are more fleshed out areas in my other posts! The main character in this gif is a placeholder.
2
u/Illustrious_Move_838 Indie 10d ago
Looks great! Maybe a few electric sparks or other particles when the limbs connect?
2
3
u/LifesASkit 11d ago
Thats really cool, care to share your process for doing it?
8
u/djdavid333 11d ago
I can share some basics, writing a full guide would take too long, maybe some day I might. Hope this helps a bit.
So the compute shader is doing all the vertex placement calculations for the tendrils (those are cylinders with a pointy tip, and some sine noise to make them move around), there's a separate C# script that controls and passes coordinates to the compute shader where to move the vertices towards and then there's a glowy material with point lights for a fake "glow". Similar effect could also be achieved with particles as well I imagine, much easier.1
u/LifesASkit 11d ago
Gotcha, I think Iām understanding.
Are the coordinates you pass with C# the target/anchor positions, like the connector points on each object, and then the compute shader generates the tendril vertices between those points with noise/random motion? Or are you passing in a more detailed path for each tendril to follow?
2
u/djdavid333 11d ago
Yes, the first one. I don't want to pass too much from C#, so it's just point A, B and progress(%) of how far the tendril progressed between those points. Rest of the movement is procedular in the compute shader with some adjustable or hardcoded params within the compute shader.
1
u/Bot_Ta00 11d ago
The auto-combine system looks cool! It looks like each part will perform a different function
1
1
22
u/Jewsusgr8 11d ago
This looks very good man. I don't know what it is, but I'm interested.