diff options
| author | yum <yum.food.vr@gmail.com> | 2024-07-15 01:21:33 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-07-15 01:21:33 -0700 |
| commit | 09de70448b051e20fbfbd56ee00b24168bdd90ab (patch) | |
| tree | 9622cadbc6a7fd559d4abf1ab713c2cb4becef2e /pbr.cginc | |
| parent | d4a703fffb2de50d43c25c4b607b7c7b252fd70e (diff) | |
Fix metallics
Diffstat (limited to 'pbr.cginc')
| -rw-r--r-- | pbr.cginc | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -216,10 +216,8 @@ float4 getLitColor( i.worldPos, normal, view_dir, - 1.0 - smoothness, + GetRoughness(smoothness), 0); - direct_light.color += acc.diffuse; - direct_light.color += acc.specular; indirect_light.diffuse += acc.diffuse; indirect_light.specular += acc.specular; } @@ -231,14 +229,8 @@ float4 getLitColor( float2 screenUVs = 0; float4 screenPos = 0; -#if defined(SSR_ENABLED) - screenUVs = i.screenPos.xy / (i.screenPos.w+0.0000000001); -#if UNITY_SINGLE_PASS_STEREO || defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) - screenUVs.x *= 2; -#endif - screenPos = i.screenPos; -#endif +#if 1 float4 pbr = BRDF1_Mochie_PBS( albedo, specular_tint, @@ -257,6 +249,17 @@ float4 getLitColor( vertexLightColor, direct_light, indirect_light); +#else + float3 pbr = UNITY_BRDF_PBS( + albedo, + specular_tint, + one_minus_reflectivity, + smoothness, + normal, + view_dir, + direct_light, + indirect_light).xyz; +#endif return float4(pbr.rgb, albedo.a); } |
