I’ve got a terrain rendering problem on a fairly large-scale Unity 5 project, that requires a custom BRDF, using the new Unity 5 deferred renderer.
Unlike what the current documentation suggests, custom lighting models no longer work like they did in Unity 4 – deferred or forward. They can be used, but they simply modify terms as they are written to the deferred buffers – they can’t meaningfully use lighting terms as suggested by even the simplest example in the docs (SimpleLambert, as discussed here)
Which brings me to a custom BRDF – In my case, I’d like to essentially override the UNITY_BRDF_PBS macro as defined in UnityPBSLighting.cging, or more specifically (for the PC platform) provide a custom variant of the BRDF1_Unity_PBS shading model as seen in UnityStandardBRDF.cginc to my surface shader.
The reason: the default PBR BRDF model used by Unity simple isn’t doing the job – it takes a few (questionable) shortcuts, and the way refractive terms (fresnel) are handled result in unacceptable results at glancing angles. Which for terrain is a total deal breaker, since your typical panorama invariably includes expanses of such areas.
Is this possible? I’m hoping there’s some undocumented Unity 5 shader magic, that would allow me to override the BRDF used by the surface shader – some comments in the include files hint at this, but I’ve yet to find some means to do it.
Any help is appreciated, and thanks,
(PS: I’m not looking for some kind of global override, but a BRDF override for a specific surface shader)
I’ve read somewhere Unity is using blinn-phong BRDF. I wonder if I can try Torrance-Sparrow ones. Sorry for non-informative post, I’m going to watch this thread. Thanks!