Opacity Based Back Scattering Mini Tutorial [UE5.5)
realtimevfx.com
Hello everyone,This is something I have been wanting to achieve for MANY years and I finally was able to accomplish it so I figured I would share! This is for UE5.5 but it may work with earlier versions too. It works thanks to some new upgrades to the scene capture 2d entity. Im not sure exactly when the changes were made but it was fairly recent. (pass info settings in details panel)This mini tutorial will go over how to set up an emissive back scattering map that is based on the particles opacity map. This solves the issue of having halos around each individual sprite when you try and bake a scattering map into the texture.Create your particle system. For this tutorial I will be making some clouds. Make your material for your particles and set it aside for now, we will need it later.Create a new render target, Set the format to RGBA8 and the resolution to 1 pixel. If you wanted you could automate this creation via a blueprint but for now we will just manually create the render target.Add a scene capture 2d entity into the level. This is where the magic happens. Assign your render target to the capture2d entity and enable the capture every frame flag.Disable the atmosphere flag or else the opacity from the particles wont show up in the RT.Enable the main view camera for the capture source and the ignore screen percentage. This is required for the RT to map correctly onto the particles. The render divisor can also dramatically improve performance. A value one 1 is rendering the full screen resolution, which is total overkill. Setting it to 4-6 still looks pretty good.Open up the material you used for your particle system. Create a new texture sampler and assign the render target. Create a screen position node and plug it into the UV of the texture sampler with the RT.Thats it! You can combine this backscatter mask into your shader however you need. Im doing a bit of extra stuff to adjust color and fade based on camera angles etc, but its not required for this technique to work. The great thing about this is since its using the opacity buffer from your particles, it will correctly react to changing opacity from your niagara systems.Troubleshooting: If your particle isnt showing up in the render target, make sure you dont have the hidden in scene capture flag set in the particle details panel.Enjoy!
0 Σχόλια ·0 Μοιράστηκε ·54 Views