#version 150 #extension GL_ARB_sample_shading : enable #define SAMPLER_BINDING(x) #define float2 vec2 #define float3 vec3 #define float4 vec4 #define uint2 uvec2 #define uint3 uvec3 #define uint4 uvec4 #define int2 ivec2 #define int3 ivec3 #define int4 ivec4 #define frac fract #define lerp mix //Pixel Shader for TEV stages //1 TEV stages, 0 texgens, 16 IND stages int idot(int3 x, int3 y) { int3 tmp = x * y; return tmp.x + tmp.y + tmp.z; } int idot(int4 x, int4 y) { int4 tmp = x * y; return tmp.x + tmp.y + tmp.z + tmp.w; } int iround(float x) { return int (round(x)); } int2 iround(float2 x) { return int2(round(x)); } int3 iround(float3 x) { return int3(round(x)); } int4 iround(float4 x) { return int4(round(x)); } int itrunc(float x) { return int (trunc(x)); } int2 itrunc(float2 x) { return int2(trunc(x)); } int3 itrunc(float3 x) { return int3(trunc(x)); } int4 itrunc(float4 x) { return int4(trunc(x)); } SAMPLER_BINDING(0) uniform sampler2DArray samp0; SAMPLER_BINDING(1) uniform sampler2DArray samp1; SAMPLER_BINDING(2) uniform sampler2DArray samp2; SAMPLER_BINDING(3) uniform sampler2DArray samp3; SAMPLER_BINDING(4) uniform sampler2DArray samp4; SAMPLER_BINDING(5) uniform sampler2DArray samp5; SAMPLER_BINDING(6) uniform sampler2DArray samp6; SAMPLER_BINDING(7) uniform sampler2DArray samp7; layout(std140) uniform PSBlock { int4 color[4]; int4 k[4]; int4 alphaRef; float4 texdim[8]; int4 czbias[2]; int4 cindscale[2]; int4 cindmtx[6]; int4 cfogcolor; int4 cfogi; float4 cfogf[2]; float4 czslope; float4 cefbscale; }; struct Light { int4 color; float4 cosatt; float4 distatt; float4 pos; float4 dir; }; layout(std140) uniform VSBlock { float4 cpnmtx[6]; float4 cproj[4]; int4 cmtrl[4]; Light clights[8]; float4 ctexmtx[24]; float4 ctrmtx[64]; float4 cnmtx[32]; float4 cpostmtx[64]; float4 cpixelcenter; }; struct VS_OUTPUT { float4 pos; float4 colors_0; float4 colors_1; float4 clipPos; float3 Normal; float3 WorldPos; }; out vec4 ocol0; in VertexData { centroid in float4 pos; centroid in float4 colors_0; centroid in float4 colors_1; centroid in float4 clipPos; centroid in float3 Normal; centroid in float3 WorldPos; }; void main() { float4 rawpos = gl_FragCoord; int4 c0 = color[1], c1 = color[2], c2 = color[3], prev = color[0]; int4 rastemp = int4(0, 0, 0, 0), textemp = int4(0, 0, 0, 0), konsttemp = int4(0, 0, 0, 0); int3 comp16 = int3(1, 256, 0), comp24 = int3(1, 256, 256*256); int alphabump=0; int3 tevcoord=int3(0, 0, 0); int2 wrappedcoord=int2(0,0), tempcoord=int2(0,0); int4 tevin_a=int4(0,0,0,0),tevin_b=int4(0,0,0,0),tevin_c=int4(0,0,0,0),tevin_d=int4(0,0,0,0); float4 col0 = colors_0; float4 col1 = colors_1; float3 _norm0 = normalize(Normal.xyz); float3 pos = WorldPos; int4 lacc; float3 ldir, h, cosAttn, distAttn; float dist, dist2, attn; { int4 mat = int4(round(colors_0 * 255.0)); lacc = int4(255, 255, 255, 255); lacc.w = 255; lacc = clamp(lacc, 0, 255); col0 = float4((mat * (lacc + (lacc >> 7))) >> 8) / 255.0; } int2 fixpoint_uv0 = int2(0, 0); // TEV stage 0 rastemp = iround(col0 * 255.0).rgba; textemp = int4(255, 255, 255, 255); tevin_a = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255); tevin_b = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255); tevin_c = int4(int3(0,0,0), 0)&int4(255, 255, 255, 255); tevin_d = int4(rastemp.rgb, rastemp.a); // color combine prev.rgb = clamp((((tevin_d.rgb)) + (((((tevin_a.rgb<<8) + (tevin_b.rgb-tevin_a.rgb)*(tevin_c.rgb+(tevin_c.rgb>>7)))) + 128)>>8)), int3(0,0,0), int3(255,255,255)); // alpha combine prev.a = clamp((((tevin_d.a)) + (((((tevin_a.a<<8) + (tevin_b.a-tevin_a.a)*(tevin_c.a+(tevin_c.a>>7)))) + 128)>>8)), 0, 255); prev = prev & 255; int zCoord = czbias[1].x + int((clipPos.z / clipPos.w) * float(czbias[1].y)); zCoord = clamp(zCoord, 0, 0xFFFFFF); ocol0 = float4(prev) / 255.0; } Fragment shader failed to compile with the following errors: ERROR: 1:74: error(#335) Input variables, output variables, and uniform variables can only be in in blocks, out blocks, and uniform blocks ERROR: 1:93: error(#143) Undeclared identifier: colors_0 ERROR: 1:93: error(#160) Cannot convert from: "float" to: "highp 4-component vector of vec4" ERROR: 1:94: error(#143) Undeclared identifier: colors_1 ERROR: 1:94: error(#160) Cannot convert from: "float" to: "highp 4-component vector of vec4" ERROR: 1:95: error(#143) Undeclared identifier: Normal ERROR: 1:95: error(#216) Vector field selection out of range "xyz" ERROR: 1:95: error(#160) Cannot convert from: "float" to: "highp 3-component vector of vec3" ERROR: 1:97: error(#143) Undeclared identifier: WorldPos ERROR: 1:97: error(#160) Cannot convert from: "float" to: "highp 3-component vector of vec3" ERROR: 1:123: error(#143) Undeclared identifier: clipPos ERROR: 1:123: error(#216) Vector field selection out of range "z" ERROR: 1:123: error(#216) Vector field selection out of range "w" ERROR: error(#273) 13 compilation errors. No code generated