diff --git a/Assets/Shaders/Reflective/psx-unlit-add.shader b/Assets/Shaders/Reflective/psx-unlit-add.shader index 186edc6..8ae9751 100644 --- a/Assets/Shaders/Reflective/psx-unlit-add.shader +++ b/Assets/Shaders/Reflective/psx-unlit-add.shader @@ -1,7 +1,8 @@ Shader "psx/reflective/unlit-Add" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} - _Cube("Cubemap", CUBE) = "" {} + _Cube("Cubemap", CUBE) = "" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "RenderType" = "Opaque" } @@ -26,6 +27,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -37,8 +39,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Reflective/psx-unlit-mult.shader b/Assets/Shaders/Reflective/psx-unlit-mult.shader index 5e9f621..48ea505 100644 --- a/Assets/Shaders/Reflective/psx-unlit-mult.shader +++ b/Assets/Shaders/Reflective/psx-unlit-mult.shader @@ -1,7 +1,8 @@ Shader "psx/reflective/unlit-Mult" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} - _Cube("Cubemap", CUBE) = "" {} + _Cube("Cubemap", CUBE) = "" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "RenderType" = "Opaque" } @@ -26,6 +27,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -37,8 +39,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Reflective/psx-unlit_noambient-add.shader b/Assets/Shaders/Reflective/psx-unlit_noambient-add.shader index 1390a4a..3be5bd6 100644 --- a/Assets/Shaders/Reflective/psx-unlit_noambient-add.shader +++ b/Assets/Shaders/Reflective/psx-unlit_noambient-add.shader @@ -2,6 +2,7 @@ Properties{ _MainTex("Base (RGB)", 2D) = "white" {} _Cube("Cubemap", CUBE) = "" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "RenderType" = "Opaque" } @@ -26,6 +27,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -37,8 +39,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Reflective/psx-unlit_noambient-mult.shader b/Assets/Shaders/Reflective/psx-unlit_noambient-mult.shader index 2a5b38b..c57448a 100644 --- a/Assets/Shaders/Reflective/psx-unlit_noambient-mult.shader +++ b/Assets/Shaders/Reflective/psx-unlit_noambient-mult.shader @@ -2,6 +2,7 @@ Properties{ _MainTex("Base (RGB)", 2D) = "white" {} _Cube("Cubemap", CUBE) = "" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "RenderType" = "Opaque" } @@ -26,6 +27,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -37,8 +39,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Reflective/psx-vertexlit-add.shader b/Assets/Shaders/Reflective/psx-vertexlit-add.shader index fb8bbc5..65c1444 100644 --- a/Assets/Shaders/Reflective/psx-vertexlit-add.shader +++ b/Assets/Shaders/Reflective/psx-vertexlit-add.shader @@ -2,6 +2,7 @@ Properties{ _MainTex("Base (RGB)", 2D) = "white" {} _Cube("Cubemap", CUBE) = "" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags { "RenderType" = "Opaque" } @@ -26,6 +27,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -37,8 +39,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Reflective/psx-vertexlit-mult.shader b/Assets/Shaders/Reflective/psx-vertexlit-mult.shader index c42fea9..3b42319 100644 --- a/Assets/Shaders/Reflective/psx-vertexlit-mult.shader +++ b/Assets/Shaders/Reflective/psx-vertexlit-mult.shader @@ -2,6 +2,7 @@ Properties{ _MainTex("Base (RGB)", 2D) = "white" {} _Cube("Cubemap", CUBE) = "" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags { "RenderType" = "Opaque" } @@ -26,6 +27,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -37,8 +39,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Trasparent/psx-trasparent-unlit-noambient.shader b/Assets/Shaders/Trasparent/psx-trasparent-unlit-noambient.shader index a1558cd..419a868 100644 --- a/Assets/Shaders/Trasparent/psx-trasparent-unlit-noambient.shader +++ b/Assets/Shaders/Trasparent/psx-trasparent-unlit-noambient.shader @@ -1,6 +1,7 @@ Shader "psx/trasparent/unlit_noambient" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } @@ -25,6 +26,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -36,8 +38,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Trasparent/psx-trasparent-unlit.shader b/Assets/Shaders/Trasparent/psx-trasparent-unlit.shader index 713635c..18b5f77 100644 --- a/Assets/Shaders/Trasparent/psx-trasparent-unlit.shader +++ b/Assets/Shaders/Trasparent/psx-trasparent-unlit.shader @@ -1,6 +1,7 @@ Shader "psx/trasparent/unlit" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } @@ -25,6 +26,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -36,8 +38,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/Trasparent/psx-trasparent-vertexlit.shader b/Assets/Shaders/Trasparent/psx-trasparent-vertexlit.shader index d9f8f48..28cd7ee 100644 --- a/Assets/Shaders/Trasparent/psx-trasparent-vertexlit.shader +++ b/Assets/Shaders/Trasparent/psx-trasparent-vertexlit.shader @@ -1,6 +1,7 @@ Shader "psx/trasparent/vertexlit" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } @@ -24,6 +25,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -35,8 +37,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/psx-unlit.shader b/Assets/Shaders/psx-unlit.shader index e093721..d4a9e15 100644 --- a/Assets/Shaders/psx-unlit.shader +++ b/Assets/Shaders/psx-unlit.shader @@ -1,6 +1,7 @@ Shader "psx/unlit" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "RenderType" = "Opaque" } @@ -24,6 +25,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -35,8 +37,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/psx-unlit_noambient.shader b/Assets/Shaders/psx-unlit_noambient.shader index 56534d6..3c9b852 100644 --- a/Assets/Shaders/psx-unlit_noambient.shader +++ b/Assets/Shaders/psx-unlit_noambient.shader @@ -1,6 +1,7 @@ Shader "psx/unlit_noambient" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags{ "RenderType" = "Opaque" } @@ -24,6 +25,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -35,8 +37,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex; diff --git a/Assets/Shaders/psx-vertexlit.shader b/Assets/Shaders/psx-vertexlit.shader index 892aea2..446c25b 100644 --- a/Assets/Shaders/psx-vertexlit.shader +++ b/Assets/Shaders/psx-vertexlit.shader @@ -1,6 +1,7 @@ Shader "psx/vertexlit" { Properties{ _MainTex("Base (RGB)", 2D) = "white" {} + _SnapPrecision("Snap Precision", Range (10,1000)) = 160 } SubShader{ Tags { "RenderType" = "Opaque" } @@ -24,6 +25,7 @@ }; float4 _MainTex_ST; + uniform float _SnapPrecision; uniform half4 unity_FogStart; uniform half4 unity_FogEnd; @@ -35,8 +37,8 @@ float4 snapToPixel = mul(UNITY_MATRIX_MVP,v.vertex); float4 vertex = snapToPixel; vertex.xyz = snapToPixel.xyz / snapToPixel.w; - vertex.x = floor(160 * vertex.x) / 160; - vertex.y = floor(120 * vertex.y) / 120; + vertex.x = floor(_SnapPrecision * vertex.x) / _SnapPrecision; + vertex.y = floor((_SnapPrecision * 0.75) * vertex.y) / (_SnapPrecision * 0.75); vertex.xyz *= snapToPixel.w; o.pos = vertex;