Fix formatting on shaders

This commit is contained in:
Sweet Tini
2020-01-30 21:38:52 -05:00
parent afd03f2e3a
commit 19215a353c
3 changed files with 136 additions and 116 deletions

View File

@@ -1,50 +1,56 @@
Shader "Oxysoft/RetroPixelMax" {
Properties {
_ColorCount ("Color Count", Int) = 8
_MainTex ("", 2D) = "white" {}
Shader "Oxysoft/RetroPixelMax"
{
Properties
{
_ColorCount("Color Count", Int) = 8
_MainTex("", 2D) = "white" {}
}
SubShader {
SubShader
{
Lighting Off
ZTest Always
Cull Off
ZWrite Off
Fog { Mode Off }
Pass {
CGPROGRAM
Pass
{
CGPROGRAM
// Upgrade NOTE: excluded shader from DX11, Xbox360, OpenGL ES 2.0 because it uses unsized arrays
#pragma exclude_renderers flash
#pragma vertex vert_img
#pragma fragment frag
#pragma exclude_renderers flash
#pragma vertex vert_img
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
#include "UnityCG.cginc"
uniform int _ColorCount;
uniform int _ColorCount;
uniform fixed4 _Colors[256];
uniform sampler2D _MainTex;
uniform sampler2D _MainTex;
fixed4 frag (v2f_img i) : COLOR
{
fixed3 original = tex2D (_MainTex, i.uv).rgb;
fixed4 frag(v2f_img i) : COLOR
{
fixed3 original = tex2D(_MainTex, i.uv).rgb;
fixed4 col = fixed4 (0,0,0,0);
fixed dist = 10000000.0;
fixed4 col = fixed4(0,0,0,0);
fixed dist = 10000000.0;
for (int i = 0; i < _ColorCount; i++) {
fixed4 c = _Colors[i];
fixed d = distance(original, c);
for (int i = 0; i < _ColorCount; i++)
{
fixed4 c = _Colors[i];
fixed d = distance(original, c);
if (d < dist) {
dist = d;
col = c;
}
}
if (d < dist)
{
dist = d;
col = c;
}
}
return col;
}
ENDCG
}
}
ENDCG
}
}
FallBack "Diffuse"