Shader lighting diffuse white out, how!? What?!

This may sound stupid, but what’s is this white-out called?

It’s not a specular highlight and a simple multiplication of the albedo is not going to achieve that effect. And more importantly, How is it achieved?

Thanks for helping a dude out!

The white-out itself can indeed by accomplished by multiplying albedo with a large enough number. If you’re using a regular, 8-bit frame buffer (the kind Unity uses by default), you’ll get white by multiplying anything other than black by 255 or more. Portal 2 is doing something slightly more complicated: using HDR and tone mapping in conjunction with a bloom postprocess in order to have the brightly lit area bleed in screen space. You can do this in Unity, too:

HDR Rendering in Unity

Hey Daniel,

My problem figuring this thing out is the fact that the colour the light is reflecting off needs to have a bit of value in each colour channel, otherwise no matter how bright your light the only result you will be able to achieve is rgb or cmy.

After changing my material’s colour from rgb (1,0,0) to rgb (1, .1, .1) I got a lovely looking whiteout effect.

Thanks :slight_smile:

Right. Hence “anything other than black”. (:

You can sort of get a cheap version if you throw this finalColor into your shaders and have a global _Exposure float - higher values = more over-exposure.

void finalColor (Input IN, SurfaceOutputSkinShader o, inout fixed4 color)
{
	color.rgb *= pow(2.0, _Exposure);
	color.rgb = color.rgb / (1.0 + color.rgb);
}

But really, you’d want this as a post-process effect using an HDR camera or something like that.