24 marzo 2013

HDR IBL for Unity

Yeah! Some friends wanted to see some hdr reflections in the shader, so I have started learning about it with the help of Christopher Schiefer:

The file format is .exr and is treated as a lightmap, so I have done this:

final.rgb=DecodeLightmap(tex2Dlod(LongLat_Map, float4 ( coords, 0.0, MIP ))).rgb;

Internally this is just Source.a*8*Source.rgb
Coordinates are obtained this way:

Where RoV is just to change between V or R. I have to fix this :P



No hay comentarios:

Publicar un comentario