Rewrote bloom preview shaders, making them almost 1:1 with BeatSabers bloom#22
Open
OwenTheProgrammer wants to merge 2 commits into
Open
Rewrote bloom preview shaders, making them almost 1:1 with BeatSabers bloom#22OwenTheProgrammer wants to merge 2 commits into
OwenTheProgrammer wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I spent a week reverse engineering the BeatSaber bloom shaders in hopes to have an accurate bloom preview for Unity. This is finally at the point where I have to verify if im looking at beat saber or my own screenshots (for scenes that actually look good lol) The bloom shader was built from the ground up to be 1:1 with the shader assembly, outside of cb# offsets and such.
Nerd shit:
This effect seems to work in editor, game, and even VR view!
I have automatically excluded reflection probes since I doubt people want bloom in their reflection probe bakes. If you want that, just bitwise OR
CameraType.ReflectionintoEDITOR_CAMERA_TYPESorRUNTIME_CAMERA_TYPESwithin theBloomPreviewscript.I have verified the script almost certainly doesnt break or leave a command buffer active, but if you find a way to break it within reason, im all ears.
The camera attached script has changed a bit, but its mostly the same as before.

Full Composite: Shows you the final composition of the bloom on your scene. This is the default option.Alpha Only: Displays the alpha channel thats going into the bloom effect, so you can figure out why your screen is entirely white (see note below)Bloom Only: Displays just the bloom stack without overlaying the original framebuffer; quite literally only the bloom.Note
In some cases, such as using the default Unity skybox without replacing it, you may find your entire screen has bloom. There's a very good chance this is because Unity is writing 100% alpha to the framebuffer. I sadly can't mitigate this directly, however you'd have the same problem within BeatSaber using the Unity skybox. Check the
Alpha Onlypass to verify your screen is entirely white. If thats not the case, I'll help, but I almost guarantee the solution is one or two changes max.Showcase
Made a simple scene to show the effect:
Baseline:
Alpha Only:
Bloom Only:
Full Composition: