Code from this week is up at this google drive folder!
A question came up about physical collisions in VFX graph. Because everything is GPU based it's quite constrained -- you can specify geometry like planes or spheres and if you need to collide with objects in the scene the best you can do is collide with a camera's depth buffer.
We looked at post processing and full screen shader effects this week. Unity has a few different approaches, the simplest the "volume framework". You can have multiple volumes in your scenes and each volume can have its own post-processing stack associated with it. Whenever a camera is inside a volume it will take on the post-processing of its volume.
The simplest thing you can do is use the "global" volume that is always available and always active. To get to it, navigate to Settings > PC_RPAsset in your Project tab.
You will see many of the standard post-processing effects there -- like Bloom, Vignette, Depth of Field. They are easy to enable and use right away with no code or shaders if all you need is a simple global always-on effect.
Scrolling down and pressing "Add Override" exposes the remaining built in post-processing effects. There are some subtle but important options here, particularly Color Curves, Lift Gama Gain. You can tweak them as if your game was in Photoshop to adjust the final colors in the render of each frame.
The adjustments you can make here will depend on your game and the look you're going for. Color grading and color theory can fill an entire classes on their own, and you should look up general color grading tutorials -- they will apply in Unity! Here's a Unity specific one I like.
Unity has many overrides and you should experiment with them, depending in your game's needs. A good breakdown from 4 years ago can be found in this video
` # Look Up Tables Related to color grading are look up tables or "LUTs". They are mappings from one color space to another, packaged as 3D textures. They're a great way to apply polish to your renders, similar to color grading but more powerful inYou can make your own by
There are also many LUT packs available on the Asset Store for quite cheap
Volume based post processing is great but limited in that you cannot really make your own effects. For that you need to write a Full Screen Shader effect and load it into Unity's rendering Pipeline
Now anything you put in the Fullscreen Shader Graph shader will process the pixels of your game! All the normal Shader Graph techniques apply here. Keep in mind that the "URP Sample Buffer" is how you access the pixels of the screen. This was the shader I made to implement an FPS damage effect.
A few things about cameras:
You can render any camera to a texture rather than the screen
This texture can then be used anywhere you'd use a texture. This can be useful in some post-processing tricks, or for something as simple as an in-game security camera by applying the texture to a mesh.
You can stack cameras
This allows you to layer the images that the cameras render on top of each other. Combined with layers and the cameras' culling masks you can achieve certain effects like minimaps and user interfaces with ease.