Advertisement
KoBeWi

Naive palette lol

Sep 19th, 2021
2,358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uniform sampler2D in_Texture;
  2.  
  3. uniform vec3[32] in_Src;
  4. uniform vec4[32] in_Dst;
  5. uniform int in_Count;
  6.  
  7. varying vec2 var_TexCoord;
  8.  
  9. void main()
  10. {
  11.   vec4 color = texture2D(in_Texture, var_TexCoord);
  12.   vec3 round = vec3((int)(color.r*255), (int)(color.g*255), (int)(color.b*255));
  13.  
  14.   if (in_Count >= 0 && round == in_Src[0])
  15.     gl_FragColor = in_Dst[0];
  16.   else if (in_Count >= 1 && round == in_Src[1])
  17.     gl_FragColor = in_Dst[1];
  18.   else if (in_Count >= 2 && round == in_Src[2])
  19.     gl_FragColor = in_Dst[2];
  20.   else if (in_Count >= 3 && round == in_Src[3])
  21.     gl_FragColor = in_Dst[3];
  22.   else if (in_Count >= 4 && round == in_Src[4])
  23.     gl_FragColor = in_Dst[4];
  24.   else if (in_Count >= 5 && round == in_Src[5])
  25.     gl_FragColor = in_Dst[5];
  26.   else if (in_Count >= 6 && round == in_Src[6])
  27.     gl_FragColor = in_Dst[6];
  28.   else if (in_Count >= 7 && round == in_Src[7])
  29.     gl_FragColor = in_Dst[7];
  30.   else if (in_Count >= 8 && round == in_Src[8])
  31.     gl_FragColor = in_Dst[8];
  32.   else if (in_Count >= 9 && round == in_Src[9])
  33.     gl_FragColor = in_Dst[9];
  34.   else if (in_Count >= 10 && round == in_Src[10])
  35.     gl_FragColor = in_Dst[10];
  36.   else if (in_Count >= 11 && round == in_Src[11])
  37.     gl_FragColor = in_Dst[11];
  38.   else if (in_Count >= 12 && round == in_Src[12])
  39.     gl_FragColor = in_Dst[12];
  40.   else if (in_Count >= 13 && round == in_Src[13])
  41.     gl_FragColor = in_Dst[13];
  42.   else if (in_Count >= 14 && round == in_Src[14])
  43.     gl_FragColor = in_Dst[14];
  44.   else if (in_Count >= 15 && round == in_Src[15])
  45.     gl_FragColor = in_Dst[15];
  46.   else if (in_Count >= 16 && round == in_Src[16])
  47.     gl_FragColor = in_Dst[16];
  48.   else if (in_Count >= 17 && round == in_Src[17])
  49.     gl_FragColor = in_Dst[17];
  50.   else if (in_Count >= 18 && round == in_Src[18])
  51.     gl_FragColor = in_Dst[18];
  52.   else if (in_Count >= 19 && round == in_Src[19])
  53.     gl_FragColor = in_Dst[19];
  54.   else if (in_Count >= 20 && round == in_Src[20])
  55.     gl_FragColor = in_Dst[20];
  56.   else if (in_Count >= 21 && round == in_Src[21])
  57.     gl_FragColor = in_Dst[21];
  58.   else if (in_Count >= 22 && round == in_Src[22])
  59.     gl_FragColor = in_Dst[22];
  60.   else if (in_Count >= 23 && round == in_Src[23])
  61.     gl_FragColor = in_Dst[23];
  62.   else if (in_Count >= 24 && round == in_Src[24])
  63.     gl_FragColor = in_Dst[24];
  64.   else if (in_Count >= 25 && round == in_Src[25])
  65.     gl_FragColor = in_Dst[25];
  66.   else if (in_Count >= 26 && round == in_Src[26])
  67.     gl_FragColor = in_Dst[26];
  68.   else if (in_Count >= 27 && round == in_Src[27])
  69.     gl_FragColor = in_Dst[27];
  70.   else if (in_Count >= 28 && round == in_Src[28])
  71.     gl_FragColor = in_Dst[28];
  72.   else if (in_Count >= 29 && round == in_Src[29])
  73.     gl_FragColor = in_Dst[29];
  74.   else if (in_Count >= 30 && round == in_Src[30])
  75.     gl_FragColor = in_Dst[30];
  76.   else if (in_Count >= 31 && round == in_Src[31])
  77.     gl_FragColor = in_Dst[31];
  78.   else
  79.     gl_FragColor = color;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement