the_lab_renderer icon indicating copy to clipboard operation
the_lab_renderer copied to clipboard

Still Uses Phong Shading and Not GGX

Open TheSchaeff opened this issue 8 years ago • 3 comments

It appears that the lighting model in the shaders is based off of the phong lighting that Unity had at the time The Lab Renderer was created. Unity now has the more physically correct GGX lighting which is crucial when working with PBR in things like Substance Painter, as a lack of consistency makes it impossible to make things look right. Is there any way to use GGX with this renderer?

TheSchaeff avatar Oct 13 '16 01:10 TheSchaeff

That's intentional, Phong shading is much cheaper than GGX. GGX would not be optimal for VR. However it wouldn't take much to switch from Phong to GGXto test for your self. As for consistency issues, they should be fairly minimal as this is still a pbr based renderer.

k0091601 avatar Dec 02 '16 14:12 k0091601

I know it was intentional, especially since that's what Unity used at the time, but the consistency issues are too much unless the assets are designed specifically for it. I've been trying to switch from Phong to GGX, but still haven't been able to find exactly where in the code to do that. It seems that the functions that affect the lighting are quite spread out.

TheSchaeff avatar Dec 02 '16 21:12 TheSchaeff

shaders/vr_lighting ComputeDiffuseAndSpecularTerms is the function your looking for, It computes both diffuse and specular terms.

k0091601 avatar Dec 02 '16 21:12 k0091601