[SOLVED] Reading directional lightmaps manually in a custom shader differs from unity_Lightmap

My lightmap works fine if I sample the scene’s lightmap like this:
half3 lm = UNITY_SAMPLE_TEX2D( unity_Lightmap, i.lmuv ).rgb

But if I take the lightmap texture (Lightmap-0_comp_dir.exr) and sample it like this its colors are wrong (tinted to green):
half3 lm = UNITY_SAMPLE_TEX2D( _LightmapColor, i.lmuv ).rgb;

What causes the difference? How can I supply Unity’s lightmaps manually into my shader (without using unity_Lightmap* for various reasons)

Have you tried decoding the sampled color with DecodeLightmap(fixed4) from UnityCG.cginc? Might be worth a shot.

Thanks for the help but I think I managed to fix this myself using this link:

So it seems like lightmaps only work right if they are set in Unity’s lightmap system and won’t work if they are sent manually into shaders.