diff options
| author | yum <yum.food.vr@gmail.com> | 2023-04-10 00:33:11 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-04-10 00:33:11 -0700 |
| commit | 9b92208015b07a7bfd0bdf42482985ebae1f17a2 (patch) | |
| tree | e244e13434aaca23aad6c312b914f6fa1c31b8d5 /Shaders | |
| parent | 7d69c268cb20d8264b903cfaebb3b84564e56eed (diff) | |
Update parallax shader defaults
Fixes a minor visual bug when looking at a plane up close.
Diffstat (limited to 'Shaders')
| -rw-r--r-- | Shaders/parallax/parallax.shader | 2 | ||||
| -rw-r--r-- | Shaders/parallax/pbr.cginc | 6 | ||||
| -rw-r--r-- | Shaders/parallax/poi.cginc | 5 |
3 files changed, 9 insertions, 4 deletions
diff --git a/Shaders/parallax/parallax.shader b/Shaders/parallax/parallax.shader index 662a59e..4f71fb8 100644 --- a/Shaders/parallax/parallax.shader +++ b/Shaders/parallax/parallax.shader @@ -3,7 +3,7 @@ Properties { _Curvature_Step("Curvature step", float) = .0001 - _Min_Hit_Dist("Min hit distance", float) = .001 + _Min_Hit_Dist("Min hit distance", float) = .0001 _Max_Dist("Max ray length", float) = 100.0 _Ray_March_Steps("Ray march steps", float) = 32 _Cubemap("Cubemap", Cube) = "" {} diff --git a/Shaders/parallax/pbr.cginc b/Shaders/parallax/pbr.cginc index e5548c7..d41209c 100644 --- a/Shaders/parallax/pbr.cginc +++ b/Shaders/parallax/pbr.cginc @@ -69,7 +69,7 @@ UnityIndirect GetIndirect(v2f i, float3 view_dir, float3 normal, return indirect; } -fixed4 getLitColor(v2f i, fixed4 albedo, float3 worldPos, float3 normal, +float4 getLitColor(v2f i, float4 albedo, float3 worldPos, float3 normal, float metallic, float smoothness, bool custom_cubemap) { @@ -80,13 +80,13 @@ fixed4 getLitColor(v2f i, fixed4 albedo, float3 worldPos, float3 normal, float3 view_dir = normalize(_WorldSpaceCameraPos - i.worldPos); - fixed3 pbr = UNITY_BRDF_PBS(albedo, specular_tint, + float3 pbr = UNITY_BRDF_PBS(albedo, specular_tint, one_minus_reflectivity, smoothness, view_dir, normal, GetLight(i, worldPos, normal), GetIndirect(i, view_dir, normal, smoothness, custom_cubemap)).rgb; - return fixed4(saturate(pbr), albedo.a); + return float4(saturate(pbr), albedo.a); } #endif // __PBR_INC diff --git a/Shaders/parallax/poi.cginc b/Shaders/parallax/poi.cginc index aaf6e5c..5e31a42 100644 --- a/Shaders/parallax/poi.cginc +++ b/Shaders/parallax/poi.cginc @@ -1,3 +1,6 @@ +#ifndef __POI_INC +#define __POI_INC + /* MIT License @@ -53,3 +56,5 @@ float3 HSVtoRGB(in float3 HSV) float3 RGB = HUEtoRGB(HSV.x); return ((RGB - 1) * HSV.y + 1) * HSV.z; } + +#endif // __POI_INC |
