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 | |
| parent | d4a703fffb2de50d43c25c4b607b7c7b252fd70e (diff) | |
Fix metallics
| -rw-r--r-- | pbr.cginc | 23 | ||||
| -rw-r--r-- | tooner.shader | 8 |
2 files changed, 17 insertions, 14 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); } diff --git a/tooner.shader b/tooner.shader index cd2371f..a5cca46 100644 --- a/tooner.shader +++ b/tooner.shader @@ -287,10 +287,10 @@ Shader "yum_food/tooner" _GSAAStrength("_GSAAStrength", Float) = 0 _WrappingFactor("_WrappingFactor", Float) = 0 _Subsurface("_Subsurface", Float) = 0 - _SpecularStrength("_SpecularStrength", Float) = 0 - _FresnelStrength("_FresnelStrength", Float) = 0 - _UseFresnel("_UseFresnel", Float) = 0 - _ReflectionStrength("_ReflectionStrength", Float) = 0 + _SpecularStrength("_SpecularStrength", Float) = 1 + _FresnelStrength("_FresnelStrength", Float) = 1 + _UseFresnel("_UseFresnel", Float) = 1 + _ReflectionStrength("_ReflectionStrength", Float) = 1 shadowedReflections("shadowedReflections", Vector) = (0, 0, 0, 0) _ReflShadows("_ReflShadows", Vector) = (0, 0, 0, 0) _ReflShadowStrength("_ReflShadowStrength", Vector) = (0, 0, 0, 0) |
