Skip to content

Instantly share code, notes, and snippets.

@okuoku

okuoku/frag.asm Secret

Created January 13, 2020 09:31
Show Gist options
  • Save okuoku/4422deccab18648138c2f9f450dc7a4a to your computer and use it in GitHub Desktop.
Save okuoku/4422deccab18648138c2f9f450dc7a4a to your computer and use it in GitHub Desktop.
Compiled UnityChanToonShaderVer2 (partial)
!!ARBfp1.0
# cgc version 3.1.0013, build date Apr 18 2012
# command line args: -ogles -profile arbfp1
# source file: 1.frag
#vendor NVIDIA Corporation
#version 3.1.0.13
#profile arbfp1
#program main
#semantic _ClippingMask_ST
#semantic _Clipping_Level
#semantic _Inverse_Clipping
#semantic _ClippingMask
#var float4 gl_FragData[0] : $vout.COL : COL : -1 : 1
#var float4 gl_FragData[1] : : : -1 : 0
#var float4 gl_FragData[2] : : : -1 : 0
#var float4 gl_FragData[3] : : : -1 : 0
#var float4 gl_FragData[4] : : : -1 : 0
#var float4 gl_FragData[5] : : : -1 : 0
#var float4 gl_FragData[6] : : : -1 : 0
#var float4 gl_FragData[7] : : : -1 : 0
#var half4 _ClippingMask_ST : : c[0] : -1 : 1
#var half _Clipping_Level : : c[1] : -1 : 1
#var half _Inverse_Clipping : : c[2] : -1 : 1
#var sampler2D _ClippingMask : : texunit 0 : -1 : 1
#var float2 vs_TEXCOORD1 : $vin.TEX0 : TEX0 : -1 : 1
#var <none>4 $kill_0000 : $vout.$kill : $kill : -1 : 0
#const c[3] = 0 1 -2 -0.5
PARAM c[4] = { program.local[0..2],
{ 0, 1, -2, -0.5 } };
TEMP R0;
MAD R0.xy, fragment.texcoord[0], c[0], c[0].zwzw;
TEX R0.x, R0, texture[0], 2D;
MAD R0.y, R0.x, c[3].z, c[3];
MAD R0.x, R0.y, c[2], R0;
ADD_SAT R0.x, R0, c[1];
SLT R0.x, R0, -c[3].w;
ABS R0.x, -R0;
CMP R0.x, -R0, c[3].y, c[3];
MOV result.color, c[3].x;
KIL -R0.x;
END
# 10 instructions, 1 R-regs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment