PRISM (WIP) - Realistic All-In-One Post-Processing

PRISM - Realistic Post-Processing (NEW THREAD CAN BE FOUND HERE: PRISM - Realistic All-In-One Post-Processing for Unity - Community Showcases - Unity Discussions )

What is PRISM?
PRISM is an all-in-one post-processing solution for Unity, designed to incorporate multiple highly-optimized post-processing effects into one “Uber-Shader” to reduce expensive Graphics.Blit passes and increase performance.

Why make it?
In Down To One (the competitive survival game I’m leading development of at the moment), we use a bunch of post-processing effects on the main camera, and because of our custom 3-camera setup, performance does start to become an issue. As we’ve added a few more PP effects, it’s become obvious that you simply can’t have a properly optimized game when you “stack” effects on your camera - VRAM, extra GPU time spent in Graphics.Blit passes, performance lost where effects could be combined - there’s a reason no other game engine does it like Unity.

TL;DR - PRISM has been developed for use in DTO, and as a general asset for developers that want a highly optimized, realistic looking ‘one-stop-shop’ for post-processing.

What does it do?
The current version of PRISM features:
(ALL effects are HDR & LDR compatible)

Natural Bloom

-Unique, highly customizable stochastic bloom algorithm
-Highly scalable performance (can perform better than the default Unity bloom effect individually)
-Supports no threshold (physically correct) or threshold bloom (artistic choice)
-Temporal stability (anti-flicker)
-Integrated into Main Pass

Tonemapping (if you are using linear colour space, this is the “make pretty” button)

-State of the art tonemapping operator as default, with standard Filmic Tonemapping alternative
-Fully tweakable values on both tonemapping operators
-Integrated into Main Pass

Chromatic Aberration

-Vignette shape and horizontal edge shape supported
-Integrated into Main Pass

Vignette

-Integrated into Main Pass

Filmic Grain

-Scalable intensity
-Integrated into Main Pass

Depth of Field with Bokeh

-Bokeh temporal stability (anti-flicker)
-Highly scalable performance
-Highly customizable focus lengths, bokeh intensities, and blur amounts
-Integrated into Main Pass

Sharpen

-Highly optimized
-Scalable sharpen amount

Night Vision

-Requires deferred rendering
-Unique, 0-light compatible physically simulated effect
-Integrated into Main Pass

PRISM at work:

Older videos:
Alpha flythrough 1

Sounds intriguing and looks pretty but surprised at lack of AO ?

Actually, whilst the current alpha version of PRISM doesn’t have AO integrated into it, it is something that I want to get in fairly soon - the next video that I’ll post shows custom AO as well, but it hasn’t been put into the main shader yet, it’s quite tricky.

What I’m actually trying to do (and it may actually work) is integrating the AO directly into the bloom pre-pass - because PRISM uses a completely unique stochastic bloom algorithm, what this means is that in theory, once integrated, the AO should be super light. But, since that feature is not confirmed & fully working yet, I have not listed it.

Looks interesting, would like to see a side by side comparison with Unity effects though

nice work, hope more progress

Updated the original post with a new flythrough video! This time featuring the custom tonemapping operator in PRISM, which I’m very happy with:

Currently working on making a nice user-friendly inspector GUI for PRISM, also downloaded the “Dungeon Level Kit” that’s free for level11 users this month and took a couple of comparison screenshots showing PRISM v Unity Standard effects (both using bloom, DoF, tonemapping, vignette, chromatic aberration):

Getting close to having the PRISM inspector GUI finished - pretty happy with it so far! Every variable has an in-depth tooltip associated with it as well, so there’s no real need to alt-tab between Unity + documentation.

(Still a WIP ofc, and the PRISM presets field isn’t in there yet)

hello, am interested in your asset!
how it performs in highend mobiles? how much ms it costs overall to do Bloom + DoF ??

thanks

Looking very hot :smile: You know what people need. Also, when I dont use for example DoF, then postprocess will take a little less time to process it? I mean, you pay only for what you use? If so, its a win-win for everyone regarding postprocess. Very excited to see this.
Ps. and as always: lack of AA! :smile:

1 Like

PRISM hasn’t been tested on mobiles at all, but soon (this week) I want to do a closed beta test for PRISM, and if you’ve got access to some higher end mobiles to test it on, I would be interested to see how it performs (since it doesn’t require HDR/Linear like many other PP assets).

Definitely, that’s the whole idea with PRISM - if you disable an effect, then you don’t pay for it. The great thing about PRISM though, is that you can get a lot of effects for ‘practically free’ (eg. Vignette or Tonemapping) because most effects are optimized to use the same shader pass. SSAA is something that would be nice to integrate into PRISM as well (already have a working SSAA effect in Down To One, but it’s too hacky to put into PRISM at the moment).

i mainly develop for mobiles, i own sony Z3 compact (Adreno 330), and zte nubia z9 (Adreno 430), i don’t mind testing your asset.

i have bokeh dof script (got it somewhere from dev blog) when i use boken with default unity bloom, both effects generate around 8 drawcalls. which causes something like 0.2 ms overall.

Do you mean one shader only that does all effects ?

What is the differences with Scion post process package ?

Yes, that’s the main idea behind PRISM, combining as many effects into as few passes as possible to increase performance. Scion is great if you want to take screenshots or maybe shoot a trailer, but because it uses a “simulated camera model” it sacrifices a lot of flexibility, and is only usable (IMO) in a much smaller subset of games.

For instance, if you want super-fast DoF that starts applying 300 units away from the camera, and blurs to full by 350 units, you can only do that with PRISM. Last night I integrated PRISM into Down To One (fixed a bunch of bugs while I was at it), and even though PRISM still isn’t 100% optimized, it’s given us a >50% boost in image effect performance, so I’m very happy with it so far.

Also, probably won’t be starting the closed beta until Monday next week, heading to PAX Aus this weekend.

1 Like

Hello! (okay am being greedy here :smile:)
is it possible to add something like motion blur or anti alias to your asset?

am thinking if i can get stable 50fps in mobile without any of these effects…
maybe i can add all these effects and try have smoother movement animations with motion blur…
a stable 30fps game with motion blur + nice image effects, would look amazing!

i stumbled upon AA solution (SMAA): GitHub - Chman/SMAA: A highly customizable implementation of Subpixel Morphological Antialiasing for Unity

which has incredible performance, almost like free effect!
i think it will even work better if integrated in your solution.

good luck!

If PRISM gets AA, it will be SSAA (Supersampling). Unfortunately, due to the way that just about every post-process AA technique works, there’s no way to combine the passes - AA shaders need to be fed the whole, composited image, so they can’t be integrated into the same uber-pass as the rest of the effects. In terms of motion blur, the velocity filter could potentially share a shader pass with a few other effects, but that wouldn’t give any sizable benefit to performance, if any.

Chman’s SMAA port is brilliant though, definitely recommended!

Back from PAX Australia tomorrow, so should be ready for PRISM’s beta this week.

At PAX I had a chat to some other Aussie Unity devs (there are quite a few here!) about what post-processing/colour spaces/rendering paths they use in their games, quite eye-opening! Seems like most use default Unity FX with a plugin here or there, but none that I spoke to had a combined FX stack/wrote their own FX, which was pretty surprising given the benefits that you can get out of it. Did find another dev who also dislikes default Unity DoF though (it sucks)!

Used PRISM’s night vision stuff for Down To One’s night mode patch earlier this week, and integration was super easy thanks to PRISM Presets.
In night mode, we use different values for PRISM’s bloom, depth of field, night vision, vignette, and color correction, changing everything is done in one line of code:

prism.SetPrismPreset(nightVisionPreset)

Also, tomorrow night the PRISM closed beta will be going live! If anyone else would like to help test out PRISM and contribute feedback, send me a PM here on the Unity forums with your email & some information about what you will be using PRISM for.

The PRISM closed beta invites have now been sent out! Thanks to those who offered to test, excited to finally get PRISM out in the wild. Now, PRISM is feature complete for its asset store release, and focus is on making sure that the PRISM workflow, inspector GUI, and documentation are perfect (and of course nailing out any unknown bugs!).

Thanks to everyone who participated in the PRISM beta, after a few tweaks, the first public version of PRISM will be submitted to the Asset Store this weekend!