// Fast, imprecise version:
//float4 diffuse = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, normalWorld, 0.8 * UNITY_SPECCUBE_LOD_STEPS).rgb;
//gi.indirect.diffuse = DecodeHDR(diffuse, unity_SpecCube0_HDR).rgb;
// Smoother but slower version:
float3 right = normalize(cross(float3(0.0, 1.0, 0.0), normalWorld));
float3 up = normalize(cross(normalWorld, right));
const float sampleFactor = 0.9 * UNITY_SPECCUBE_LOD_STEPS;
const float jitterFactor = 0.3;
float4 diffuse = (UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, normalWorld, sampleFactor) +
UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, lerp(normalWorld, up, jitterFactor), sampleFactor) +
UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, lerp(normalWorld, -up, jitterFactor), sampleFactor) +
UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, lerp(normalWorld, right, jitterFactor), sampleFactor) +
UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, lerp(normalWorld, -right, jitterFactor), sampleFactor)) * 0.2;
gi.indirect.diffuse = DecodeHDR(diffuse, unity_SpecCube0_HDR).rgb;