Box projection Reflection Probes

Hi all,

While doing a bit of cool looking visualization in the URP, I’ve noticed that box projection reflection probes don’t seem to be available anymore. I have looked at the official documentation and it’s currently in the “in research” category.

Does anyone happen to know a work around to get it work? I do desperately need this component of Unity back in my life.

Any help is greatly appreciated :slight_smile:

1 Like

most likely you will have to write a custom shader using a tweaked lighting function where you skip the sampling of the fed in cube map but sample your own cube map using box params you probably will have to send to the material yourself…

At now(2019.2) unity pass to shader some random stuff instead of actual BoxMin/BoxMax values. So, at least i, can not recreate that manually at my pipeline.

it is all but convenient – assuming that box projection will be applied or needed by “static geometry” like a floor or wall one may grab the box volume parameters by script and send it to the materials which need it… lods of materials or materialpropertyblocks which will break srp batching.

I have just realised that box projections are once again working. I deleted my library while using Unity 2020.1.0a11 with URP 7.1.2 and it seemed to fix it all up for me. Happy days!

i have not checked 2020 – but if URP 7.1.2 is URP 7.1.2 then there is no code for box projection in the function GlossyEnvironmentReflection… so it should not work.

That;s very strange then, because when I do tick box projection on my reflections do change for the better

strange…
i had a look into the last version of the lighting functions on github: still node codeto support box projection.

https://github.com/Unity-Technologies/ScriptableRenderPipeline/blob/master/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl

half3 GlobalIllumination(BRDFData brdfData, half3 bakedGI, half occlusion, half3 normalWS, half3 viewDirectionWS)
{
    half3 reflectVector = reflect(-viewDirectionWS, normalWS);
    half fresnelTerm = Pow4(1.0 - saturate(dot(normalWS, viewDirectionWS)));

    half3 indirectDiffuse = bakedGI * occlusion;
    half3 indirectSpecular = GlossyEnvironmentReflection(reflectVector, brdfData.perceptualRoughness, occlusion);

    return EnvironmentBRDF(brdfData, indirectDiffuse, indirectSpecular, fresnelTerm);
}

I’ve gone back to it today, and it seems to make no difference again whether or not I tick the box projection. I have no clue what was happening last week. Hopefully it’s implemented properly soon enough.