Friday, December 1, 2023
HomeVisual EffectsScreenspace "Mild Shafts" shader for native particle flares

Screenspace “Mild Shafts” shader for native particle flares


Hiya everybody!

The objective i’m attempting to realize is to create a 2nd lightshafts shader that may be utilized to particle sprites for pseudo volumetric glows. This is similar impact many video games use to simulate solar gentle shafts and so on. (at the start went voxel primarily based) I needed it to be as easy and effiecient as attainable. I dont wish to need to setup render goal digital camera or any additional entities on this planet for it to work. Ideally it might be a easy shader you apply to the sprite.
Chapter 13. Volumetric Mild Scattering as a Publish-Course of | NVIDIA Developer

Most engines do that course of in screenspace. Nonetheless, since i would like this utilized to a particle sprite, it must pattern the depth of the scene and examine it to the depth of the particle. My thought was to create a fabric, pattern the scene depth and pixel depth and do an “if” statment to paint it black and white (black is all geo in entrance, white is behind. I’d then save that materials to a render goal which is then used for the radial blur and compositing into the scene.

Sadly this isnt working. For some purpose the render goal isnt accepting the information. It appears to be lacking the depth data. Nonetheless this isn’t the one downside, if the RT is created utilizing geometry thats on this planet, then it must exist someplace on this planet always. The ultimate materials on the particle sprite is just not this materials that creates the RT, however a brand new materials that’s studying and blurring the render goal. I experimented with having 2 sprite renderers in my niagara system (one for the RT materials and one for the ultimate impact) however no luck.

Does anybody know of a approach i can obtain this consequence? I primarily must make a black and white masks of the scene depth, with the seperation decided by the depth of the sprite, and have that added right into a render goal. I did get some outcomes utilizing the scene seize 2nd digital camera nevertheless it requires that additional entity on this planet and a few additional setups. (is there a technique to set the present/native cam to that scene capture2d digital camera?) One other factor to think about is what to do if multiple of those are on display screen…

Listed here are some pics…

That is the black and white masks. The fabric is at the moment utilized to niagara particle (for visualization). I need a consequence like this within the RT.

Thanks!


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments