How would you prefer a bloom effect?
- luluco250
- Topic Author
Now I have some doubts about how I should proceed with this, so before I go into technical details I'll simply ask this: Do you prefer quality over performance/less memory consumption?
Now for the technical jargon:
I've updated MagicBloom (which is ironically now version 3, "skipping" 2) to use an inverse tonemapper which provides better results than the usual pow() thresholding. It's not perfect, but looks convincing enough in HDR games while still being quite customizable to fit LDR ones.
Meanwhile I've also implemented and discovered different ways to process the effect.
One way, the way MagicBloom (1) does it is to simply make sequentially blurred copies of the source image into various textures, then combine them all into one, while also taking the adaptation value from the a mipmap texture (which could be one of the blurred ones, or the final maybe), which works best with PoT resolutions (deprecated OpenGL like the one Minecraft uses refuses to make mipmaps out of non PoT textures, I've learned this the hard way hence why version 2 was redone into 3, which is all PoT).
Now, having a lot of textures is a memory waster and uses more passes, and can only reasonably be done using single-pass blurring (otherwise you'd need double the textures), so from version 2 and on I implemented an alternative way, based on how Minecraft SEUS' bloom does it: you create a texture with many "virtual"/mini textures inside it (hard to explain I know) then you simply blur the entire thing, which can be done in two-pass using only two textures, and combined with PoT resolutions already solves the problem of getting and adaptation value.
This of course has a drawback: the quality is somewhat degraded and it's extremely painful to maintain (trying to avoid one image from bleeding into another is hell) and from what I've seen most bloom implementations just go with multiple textures anyway. Also this uses less passes obviously.
So what do you prefer? One method ensures quality, no weird texture bleeding problems and is also much simpler to maintain, but potentially costs more. The other is more complex in a way but also simplifies the blurring process, although at the potential cost of quality.
I want your opinion before proceeding.
Please Log in or Create an account to join the conversation.
- Martigen
Secondly, I guess it depends on the costs -- what performance cost over the other method are we talking? What cost to quality between them are we talking? (any comparison screenshots?)
In an ideal world I'd say implement both and provide a toggle for people to switch between them, but I imagine that's even _more_ work
Please Log in or Create an account to join the conversation.
- Marty McFly
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
Marty McFly wrote: Actually, there's a compromise that doesn't take too much resources. My private bloom (private because I was yet too lazy to finish it) only requires a 5-13 tap filter for downscaling, 9 for up scaling and for N textures requires 2N passes, result is silky smooth. Performance wise above the SEUS way.
I usually don't even bother blurring when upsampling because it tends to be pretty heavy. And yeah maybe the SEUS way should be used only in cases of necessity.
Also because of how ReShade can't parse expressions in technique passes that means every iteration of a pass, with slightly alterations like scale has to have a shader explicitly written for it. Though macros kinda help.
Please Log in or Create an account to join the conversation.
- Androll
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
Androll wrote: Sorry for offtopic, but if you still working on MagicBloom shader, can you add a depth mask of some kind to it, so we can get bloom only on the sky/close objects?
Feel free to make requests here, but I have to ask why would you want an effect like that? The sky is actually the most distant object, so that would require an arbitrary check to see if the distance is infinite while also reducing brightness of distant objects that aren't at sky distance, which might not work well with some games.
Something like this could work:
float z = ReShade::GetLinearizedDepth(uv);
bloom *= (z < sky_z) ? z : 1.0;
// Could be optimized to this (not sure, would need to test it):
// bloom *= 1.0 - (1.0 - z) * step(sky_z, z);
Something I've tinkered with before was make distant objects arbitrarily brighter, which gave a neat HDRish effect, though inverse tonemapping usually takes care of that well enough.
Please Log in or Create an account to join the conversation.
- Androll
Feel free to make requests here, but I have to ask why would you want an effect like that?
Because many games are over brightened / over saturated (like gta iv) and standard threshold-only controlled bloom is not enough to make them look good. For now i use shader and custom code from here:
reshade.me/forum/shader-presentation/254...3-yar?start=40#19273
But over time i've encountered many problems with it, and i'm looking for something new and "proper". English is not my primary language, so i have some hard time to explain what's on my mind. Just look at example screenshots below.
ON:
OFF:
Notice that no other bright spots besides sky produce bloom. Without depth check this kind of stuff is impossible to achieve.
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
Maybe an option to have depth affect the bloom brightness, either positively or negatively with the option to exclude the sky.
Also, maybe you haven't seen what inverse tonemapping looks like, so try this: github.com/luluco250/FXShaders/blob/mast...aders/MagicBloom2.fx
Yeah it's v2 but the v3 file in the repository has a bug which I can't update right now, though @matsilagi has the fixed version so you could ask him for it.
Inverse tonemapping fixes precisely the problem where things that don't look too bright still get way too much influence on the amount of bloom on-screen.
Please Log in or Create an account to join the conversation.
- Androll
Depth approach solves it all for me, because all i need is nice hazy bloom from the sky in day time only. If inverse tone-mapping can do this, then please tell me more about and how to use it.
Please Log in or Create an account to join the conversation.
- Chavolatra
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
Chavolatra wrote: Bloom equals GaussianBloom ?
I use gauss in blur but on various levels of detail, so you get both very fine, detail bloom as well as big halos around lights, a bit like what AmbientLight did.
Please Log in or Create an account to join the conversation.
- Chavolatra
luluco250 wrote:
Chavolatra wrote: Bloom equals GaussianBloom ?
I use gauss in blur but on various levels of detail, so you get both very fine, detail bloom as well as big halos around lights, a bit like what AmbientLight did.
but gaussianbloom have can saturation and choose color of bloom
In this preset i used blue gaussian bloom with you magic bloom 2 and i have good combination
Please Log in or Create an account to join the conversation.