WTF!
Why did no-one tell me you can get wireframe shading for free, just by encoding barycentric coords into mesh vertex colors? I've been stumped on this for YEARS!
There are like entire Unity assets that offer this, but you can do it with a few lines of #shaders code?
Obviously screen space line thickness will vary by distance to camera, but maybe I can account for that somehow. It's not proper vector line drawing, but it'll do for a lot of cases
Good one Barry
OK! Here's an updated version where I can adjust wireframe thicknesses based on near/far camera distance values, much better! Thanks @XiexeVR for the suggestion
👇
Before/after pics
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Unity NavMeshes! We've recently switched to them from our old custom A* pathfinding solution, and we've found it super fast, robust and accurate. Here's a few #UnityTips to help you make the most out of the NavMesh API
(thread) #madewithunity
NavMeshAgents are great to get something working quickly, but they're a bit limited & prescriptive when dealing with finely tuned movement & steering. Instead, we use CalculatePath, passing the result to our own character controllers. No agents necessary! docs.unity3d.com/ScriptReferenc…
Consider using NavMesh.SamplePosition instead of just passing your source and destination positions directly! This way our AI can create a best effort path even if the player or enemy positions aren't directly sitting on the NavMesh itself
Finally ported my old particles to HDRP shadergraph!
And poor @Skepsisology has been working on converting our hundreds of VFX prefabs to the new renderer, but it's totally worth it!
Recompile VFX uses 4 different shaders.
Here's how we made them (thread) #madewithunity#gamedev
First up is the unlit opaque particle shader. This is the most important part of the VFX, and provides all of the core glowing shapes. The bloom ramp is controlled by particle value (intensity), and the alpha cutout is controlled by particle alpha.
Next up is fog/smoke/steam particles. This is an unlit transparent shader with an inverted fresnel fade and soft particle depth. We can layer these up to create a faux volumetric effect!
I ported Recompile's hologram shader over to HDRP Shader Graph!
Also added a couple of new features & improvements...
Here's how it works (see graphs in thread) #madewithunity#gamedev#unitytips
It's basically a transparent lit shader with two layered screen space scanlines, fresnel glow, flicker, and some glitchy, wibbly wobbly vertex extrusion thing
For the scanlines, we simply scale the screen UVs and use the fraction node to get a gradient for each line. No textures required! We also animate/pan this along the Y axis
Finally added alpha dithering to our particle shaders! @Skepsisology has been requesting this for ages.
We use it for 2 things: fading out smoke that's too close to the camera, and fading out smoke over lifetime.
Here's how we did it (THREAD): #gamedev#unitytips#madewithunity
Btw here's the YouTube version that doesn't suffer from Twitter's video compression so you can see the effect clearly (2/9)
Firstly, fading out particles close to the camera. In the vert function we get the distance between the world space vertex and the camera position, and normalize that with our desired dithering distance (3/9)