# Bloom before tonemapping

This topic is 2037 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How is a bloom effect like this achieved (notice that the bloom in the right retains a lot more detail)?

My idea is to use a FP16 texture to store the result of the bright pass filter and the blurring and then add the bloom to the scene color before the final tonemap step.

 float4 BrightPass(PSInput pIn) : SV_TARGET0 { float3 color = gSceneTexture.Sample(...).rgb; float3 tonemapped = Tonemap(color); if(tonemapped - threshold < 0.0f) return float4(0.0f, 0.0f, 0.0f, 0.0f); return float4(color, 1.0f); } 

EDIT: Here is the description of the effect. Edited by TiagoCosta

##### Share on other sites
They tell you right in the image title, you use the 'screen' blend mode instead of a direct addition. Much, much simpler ;)

##### Share on other sites

They tell you right in the image title, you use the 'screen' blend mode instead of a direct addition. Much, much simpler ;)

I haven't noticed that So now I know how they add the bloom to the scene, but in description of the effect they said they add the bloom to the scene before tonemapping (instead of after like its done in the DXSDK examples), so how should the bright pass filter be done? Edited by TiagoCosta

##### Share on other sites
You shouldn't be using a threshold for the bright pass filter. Instead you should multiply the colors down with a small factor, so that only the really bright lights get a visible glare. If your engine is using actual high dynamic range lighting this should be the way you are supposed to do it. Edited by CryZe