mirror of
https://github.com/weihuoya/citra.git
synced 2026-01-25 04:18:23 +00:00
19587 lines
722 KiB
GLSL
19587 lines
722 KiB
GLSL
// shader: 8B31, 77C3EE176B2D5FFB
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
vs_out_attr0.xy = (vs_in_reg0.xyyy).xy;
|
|
vs_out_attr0.z = (-uniforms.f[5].wwww).z;
|
|
vs_out_attr0.w = (uniforms.f[95].wwww).w;
|
|
vs_out_attr1 = uniforms.f[6].wzyx;
|
|
return true;
|
|
}
|
|
// reference: E07DBC51AABECCAB, 77C3EE176B2D5FFB
|
|
// shader: 8DD9, CBBC43C38774091B
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
struct Vertex {
|
|
vec4 attributes[2];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(vtx.attributes[1].x, vtx.attributes[1].y, vtx.attributes[1].z, vtx.attributes[1].w);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(0.0, 0.0);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[2](vs_out_attr0[0], vs_out_attr1[0]);
|
|
prim_buffer[1].attributes = vec4[2](vs_out_attr0[1], vs_out_attr1[1]);
|
|
prim_buffer[2].attributes = vec4[2](vs_out_attr0[2], vs_out_attr1[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 6D98C2C476DC3F58, CBBC43C38774091B
|
|
// shader: 8B30, 122AF7252C3959A4
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (rounded_primary_color.rgb);
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287A12097B5D, 122AF7252C3959A4
|
|
// program: 77C3EE176B2D5FFB, CBBC43C38774091B, 122AF7252C3959A4
|
|
// shader: 8B31, 75C7F5FD26A5FF54
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
vs_out_attr0.xy = (vs_in_reg0.xyyy).xy;
|
|
vs_out_attr0.z = (uniforms.f[95].wwww).z;
|
|
vs_out_attr0.w = (uniforms.f[95].zzzz).w;
|
|
vs_out_attr1 = mul_s(uniforms.f[5].wzyx, vs_in_reg0.zwzw);
|
|
vs_out_attr2 = vs_in_reg0.zwzw;
|
|
return true;
|
|
}
|
|
// reference: C726286140453EB9, 75C7F5FD26A5FF54
|
|
// shader: 8DD9, 075A5034223F1416
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
in vec4 vs_out_attr2[];
|
|
struct Vertex {
|
|
vec4 attributes[3];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
texcoord1 = vec2(vtx.attributes[2].x, vtx.attributes[2].y);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[3](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0]);
|
|
prim_buffer[1].attributes = vec4[3](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1]);
|
|
prim_buffer[2].attributes = vec4[3](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 91BCC71FEF9EA286, 075A5034223F1416
|
|
// shader: 8B30, 4F691F5A00C1A34B
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287A86CEC0A6, 4F691F5A00C1A34B
|
|
// program: 75C7F5FD26A5FF54, 075A5034223F1416, 4F691F5A00C1A34B
|
|
// shader: 8B30, 160B6F5646BAD397
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor0.a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1 * 2.0, alpha_output_1 * 2.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) + (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) + (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 9B0CCA40CE4EC181, 160B6F5646BAD397
|
|
// program: 0000000000000000, 0000000000000000, 160B6F5646BAD397
|
|
// shader: 8B30, 9E7AD459914932FF
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((rounded_primary_color.rgb) * (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (const_color[0].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 2.0, alpha_output_0 * 2.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) + (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) + (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: EE853262C1FBD683, 9E7AD459914932FF
|
|
// program: 0000000000000000, 0000000000000000, 9E7AD459914932FF
|
|
// shader: 8B31, 80D1D7D314667808
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
vs_out_attr0.xy = (vs_in_reg0.xyyy).xy;
|
|
vs_out_attr0.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp0 = vs_in_reg0.zwzw;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp1.x = dot_s(uniforms.f[5].wzyx, reg_tmp0);
|
|
reg_tmp1.y = dot_s(uniforms.f[6].wzyx, reg_tmp0);
|
|
vs_out_attr1 = reg_tmp1.xyxy;
|
|
return true;
|
|
}
|
|
// reference: AF4AEC0EB4F347AF, 80D1D7D314667808
|
|
// shader: 8DD9, 6B49BF5FD5349480
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
struct Vertex {
|
|
vec4 attributes[2];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[2](vs_out_attr0[0], vs_out_attr1[0]);
|
|
prim_buffer[1].attributes = vec4[2](vs_out_attr0[1], vs_out_attr1[1]);
|
|
prim_buffer[2].attributes = vec4[2](vs_out_attr0[2], vs_out_attr1[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: E0A3E62E72D05152, 6B49BF5FD5349480
|
|
// shader: 8B30, 7F06759B2FE3343D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor0.a) * (const_color[0].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D51EEC4736F49F59, 7F06759B2FE3343D
|
|
// program: 80D1D7D314667808, 6B49BF5FD5349480, 7F06759B2FE3343D
|
|
// shader: 8B30, 77A0240D939DC4D1
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor0.a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2584B8EB0E4BDB57, 77A0240D939DC4D1
|
|
// program: 0000000000000000, 0000000000000000, 77A0240D939DC4D1
|
|
// shader: 8B31, 6448448D3C7C8F64
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
layout(location = 4) in vec4 vs_in_reg4;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
out vec4 vs_out_attr3;
|
|
out vec4 vs_out_attr4;
|
|
out vec4 vs_out_attr5;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
bool sub_7();
|
|
bool sub_8();
|
|
bool sub_9();
|
|
bool sub_10();
|
|
bool sub_11();
|
|
bool sub_12();
|
|
bool sub_13();
|
|
bool sub_14();
|
|
bool sub_15();
|
|
bool sub_16();
|
|
bool sub_17();
|
|
bool sub_18();
|
|
bool sub_19();
|
|
bool sub_20();
|
|
bool sub_6();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp1 = vs_in_reg0.xyzz;
|
|
reg_tmp1.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp8.x = dot_s(uniforms.f[5].wzyx, reg_tmp1);
|
|
reg_tmp8.y = dot_s(uniforms.f[6].wzyx, reg_tmp1);
|
|
reg_tmp8.z = dot_s(uniforms.f[7].wzyx, reg_tmp1);
|
|
reg_tmp8.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp5 = vs_in_reg1.xyzz;
|
|
reg_tmp7.x = dot_3(uniforms.f[5].wzy, reg_tmp5.xyz);
|
|
reg_tmp7.y = dot_3(uniforms.f[6].wzy, reg_tmp5.xyz);
|
|
reg_tmp7.z = dot_3(uniforms.f[7].wzy, reg_tmp5.xyz);
|
|
reg_tmp7.w = (uniforms.f[95].zzzz).w;
|
|
if (uniforms.b[0]) {
|
|
sub_1();
|
|
}
|
|
vs_out_attr0.x = dot_s(uniforms.f[0].wzyx, reg_tmp8);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1].wzyx, reg_tmp8);
|
|
vs_out_attr0.z = dot_s(-uniforms.f[2].wzyx, reg_tmp8);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3].wzyx, reg_tmp8);
|
|
reg_tmp2.x = dot_3(uniforms.f[24].wzy, reg_tmp7.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[25].wzy, reg_tmp7.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[26].wzy, reg_tmp7.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp6.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp6 = mul_s(reg_tmp2, reg_tmp6.xxxx);
|
|
if (uniforms.b[8]) {
|
|
sub_9();
|
|
} else {
|
|
sub_10();
|
|
}
|
|
if (uniforms.b[4]) {
|
|
sub_13();
|
|
} else {
|
|
sub_14();
|
|
}
|
|
vs_out_attr5 = reg_tmp7.xyzz;
|
|
reg_tmp0.w = (mul_s(uniforms.f[95].xxxx, vs_in_reg1.wwww)).w;
|
|
reg_tmp11 = vs_in_reg2.xyxy;
|
|
if (uniforms.b[9]) {
|
|
sub_15();
|
|
} else {
|
|
sub_17();
|
|
}
|
|
reg_tmp10.x = dot_s(uniforms.f[24].wzyx, reg_tmp8);
|
|
reg_tmp10.y = dot_s(uniforms.f[25].wzyx, reg_tmp8);
|
|
reg_tmp10.z = dot_s(uniforms.f[26].wzyx, reg_tmp8);
|
|
reg_tmp10.w = dot_s(uniforms.f[27].wzyx, reg_tmp8);
|
|
reg_tmp3 = uniforms.f[41].wzyx;
|
|
reg_tmp4 = fma_s(reg_tmp11, uniforms.f[42].wzyx, reg_tmp3);
|
|
if (uniforms.b[6]) {
|
|
sub_20();
|
|
}
|
|
vs_out_attr2 = reg_tmp4;
|
|
vs_out_attr4 = -reg_tmp10;
|
|
vs_out_attr1 = reg_tmp0;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
if (uniforms.b[1]) {
|
|
sub_2();
|
|
} else {
|
|
sub_3();
|
|
}
|
|
reg_tmp4 = uniforms.f[95].zzzz;
|
|
if (uniforms.b[2]) {
|
|
sub_4();
|
|
}
|
|
if (uniforms.b[3]) {
|
|
sub_7();
|
|
}
|
|
reg_tmp8.y = (reg_tmp8.yyyy + reg_tmp4.yyyy).y;
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp6 = reg_tmp8;
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
reg_tmp5 = uniforms.f[95].zzzz;
|
|
reg_tmp6.x = dot_s(uniforms.f[5].wzyx, reg_tmp5);
|
|
reg_tmp6.y = dot_s(uniforms.f[6].wzyx, reg_tmp5);
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
address_registers.z = int(uniforms.i[1].y);
|
|
for (uint loop19 = 0u; loop19 <= uniforms.i[1].x; address_registers.z += int(uniforms.i[1].z), ++loop19) {
|
|
sub_5();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
reg_tmp3.x = dot_3(uniforms.f[8 + address_registers.z].wzy, reg_tmp6.xyz);
|
|
reg_tmp3.yz = (uniforms.f[16 + address_registers.z].wzyx).yz;
|
|
reg_tmp3.x = (fma_s(reg_tmp3.xxxx, reg_tmp3.yyyy, reg_tmp3.zzzz)).x;
|
|
{
|
|
sub_6();
|
|
}
|
|
reg_tmp4 = fma_s(reg_tmp2.xyxx, uniforms.f[16 + address_registers.z].wwww, reg_tmp4);
|
|
return false;
|
|
}
|
|
bool sub_7() {
|
|
address_registers.z = int(uniforms.i[2].y);
|
|
for (uint loop27 = 0u; loop27 <= uniforms.i[2].x; address_registers.z += int(uniforms.i[2].z), ++loop27) {
|
|
sub_8();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_8() {
|
|
reg_tmp10 = -uniforms.f[8 + address_registers.z].wzyx + reg_tmp6;
|
|
reg_tmp11.x = dot_3(reg_tmp10.xyz, reg_tmp10.xyz);
|
|
reg_tmp11.x = rsq_s(reg_tmp11.x);
|
|
reg_tmp10.w = rcp_s(reg_tmp11.x);
|
|
reg_tmp10.xyz = (mul_s(reg_tmp10, reg_tmp11.xxxx)).xyz;
|
|
reg_tmp3.yz = (uniforms.f[16 + address_registers.z].wzyx).yz;
|
|
reg_tmp3.x = (fma_s(reg_tmp10.wwww, reg_tmp3.yyyy, reg_tmp3.zzzz)).x;
|
|
{
|
|
sub_6();
|
|
}
|
|
reg_tmp3.x = (mul_s(-uniforms.f[8 + address_registers.z].xxxx, reg_tmp10.wwww)).x;
|
|
reg_tmp3.x = (uniforms.f[95].wwww + reg_tmp3.xxxx).x;
|
|
reg_tmp3.x = (min(uniforms.f[95].wwww, reg_tmp3.xxxx)).x;
|
|
reg_tmp3.x = (max(uniforms.f[95].zzzz, reg_tmp3.xxxx)).x;
|
|
reg_tmp11.x = (mul_s(uniforms.f[16 + address_registers.z].wwww, reg_tmp3.xxxx)).x;
|
|
reg_tmp3.x = (mul_s(reg_tmp3.xxxx, reg_tmp3.xxxx)).x;
|
|
reg_tmp10.xyz = (reg_tmp10.xyzz + -reg_tmp2.xyxx).xyz;
|
|
reg_tmp3.xyz = (fma_s(reg_tmp3.xxxx, reg_tmp10.xyzz, reg_tmp2.xyxx)).xyz;
|
|
reg_tmp4 = fma_s(reg_tmp3, reg_tmp11.xxxx, reg_tmp4);
|
|
return false;
|
|
}
|
|
bool sub_9() {
|
|
reg_tmp9 = vs_in_reg4.xyzz;
|
|
reg_tmp2.x = dot_3(uniforms.f[24].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[25].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[26].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp9.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp9.x = rsq_s(reg_tmp9.x);
|
|
reg_tmp9 = mul_s(reg_tmp2, reg_tmp9.xxxx);
|
|
reg_tmp9.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp2 = vec4(lessThan(vs_in_reg4.wwww, -vs_in_reg4.wwww));
|
|
reg_tmp3 = vec4(lessThan(-vs_in_reg4.wwww, vs_in_reg4.wwww));
|
|
reg_tmp0 = reg_tmp3 + -reg_tmp2;
|
|
reg_tmp7 = mul_s(reg_tmp6.yzxx, reg_tmp9.zxyy);
|
|
reg_tmp7 = fma_s(-reg_tmp9.yzxx, reg_tmp6.zxyy, reg_tmp7);
|
|
reg_tmp7.w = dot_3(reg_tmp7.xyz, reg_tmp7.xyz);
|
|
reg_tmp7.w = rsq_s(reg_tmp7.w);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp7.wwww);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp0);
|
|
reg_tmp11.w = (reg_tmp6.zzzz + reg_tmp7.yyyy).w;
|
|
reg_tmp9 = mul_s(reg_tmp7.yzxx, reg_tmp6.zxyy);
|
|
reg_tmp9 = fma_s(-reg_tmp6.yzxx, reg_tmp7.zxyy, reg_tmp9);
|
|
reg_tmp11.w = (reg_tmp9.xxxx + reg_tmp11).w;
|
|
reg_tmp9.w = (reg_tmp7.zzzz).w;
|
|
reg_tmp7.z = (reg_tmp9.xxxx).z;
|
|
reg_tmp11.w = (uniforms.f[95].wwww + reg_tmp11).w;
|
|
reg_tmp6.w = (reg_tmp7.xxxx).w;
|
|
reg_tmp7.x = (reg_tmp6.zzzz).x;
|
|
reg_tmp11.x = (uniforms.f[95].wwww).x;
|
|
reg_tmp11.y = (-uniforms.f[95].wwww).y;
|
|
reg_tmp7.xz = (reg_tmp9.wwyy + -reg_tmp6.yyww).xz;
|
|
reg_tmp7.y = (reg_tmp6.xxxx + -reg_tmp9.zzzz).y;
|
|
reg_tmp7.w = (reg_tmp11).w;
|
|
reg_tmp11 = vec4(dot_s(reg_tmp7, reg_tmp7));
|
|
reg_tmp11 = vec4(rsq_s(reg_tmp11.x));
|
|
vs_out_attr3 = mul_s(reg_tmp7, reg_tmp11);
|
|
return false;
|
|
}
|
|
bool sub_10() {
|
|
conditional_code = equal(-uniforms.f[95].ww, reg_tmp6.zz);
|
|
reg_tmp4 = uniforms.f[95].wwww + reg_tmp6.zzzz;
|
|
reg_tmp4 = mul_s(uniforms.f[95].yyyy, reg_tmp4);
|
|
vs_out_attr3.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[95].yyyy, reg_tmp6);
|
|
if (!conditional_code.x) {
|
|
sub_11();
|
|
} else {
|
|
sub_12();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_11() {
|
|
vs_out_attr3.z = rcp_s(reg_tmp4.x);
|
|
vs_out_attr3.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
return false;
|
|
}
|
|
bool sub_12() {
|
|
vs_out_attr3.x = (uniforms.f[95].wwww).x;
|
|
vs_out_attr3.yzw = (uniforms.f[95].zzzz).yzw;
|
|
return false;
|
|
}
|
|
bool sub_13() {
|
|
reg_tmp4 = -uniforms.f[28].wzyx + reg_tmp8;
|
|
reg_tmp4.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp5.x = dot_s(reg_tmp4, reg_tmp4);
|
|
reg_tmp5.x = rsq_s(reg_tmp5.x);
|
|
reg_tmp5 = mul_s(reg_tmp4, reg_tmp5.xxxx);
|
|
reg_tmp7.x = dot_s(uniforms.f[29].wzyx, reg_tmp5);
|
|
reg_tmp7.y = dot_s(uniforms.f[30].wzyx, reg_tmp5);
|
|
reg_tmp7.z = dot_s(uniforms.f[31].wzyx, reg_tmp5);
|
|
return false;
|
|
}
|
|
bool sub_14() {
|
|
reg_tmp7.x = dot_s(uniforms.f[29].wzyx, reg_tmp8);
|
|
reg_tmp7.y = dot_s(uniforms.f[30].wzyx, reg_tmp8);
|
|
reg_tmp7.z = dot_s(uniforms.f[31].wzyx, reg_tmp8);
|
|
return false;
|
|
}
|
|
bool sub_15() {
|
|
reg_tmp5 = mul_s(uniforms.f[94].wwww, vs_in_reg3);
|
|
reg_tmp1 = uniforms.f[94].zzzz + -reg_tmp5;
|
|
reg_tmp2.x = rcp_s(reg_tmp1.x);
|
|
reg_tmp2.y = rcp_s(reg_tmp1.y);
|
|
reg_tmp2.z = rcp_s(reg_tmp1.z);
|
|
reg_tmp5.xyz = (mul_s(reg_tmp5, reg_tmp2)).xyz;
|
|
reg_tmp0.xyz = (mul_s(uniforms.f[32].wzyx, reg_tmp5.xyzz)).xyz;
|
|
if (uniforms.b[5]) {
|
|
sub_16();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_16() {
|
|
reg_tmp0.w = (reg_tmp5.wwww).w;
|
|
return false;
|
|
}
|
|
bool sub_17() {
|
|
if (uniforms.b[10]) {
|
|
sub_18();
|
|
} else {
|
|
sub_19();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_18() {
|
|
reg_tmp11.zw = (mul_s(uniforms.f[94].yyyy, vs_in_reg3.xyxy)).zw;
|
|
reg_tmp0.xyz = (uniforms.f[33].wzyx).xyz;
|
|
return false;
|
|
}
|
|
bool sub_19() {
|
|
reg_tmp10 = mul_s(reg_tmp6, reg_tmp6);
|
|
reg_tmp5 = mul_s(reg_tmp6.xyzz, reg_tmp6.yzzx);
|
|
reg_tmp7 = reg_tmp6;
|
|
reg_tmp7.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp14 = reg_tmp10.xxxx + -reg_tmp10.yyyy;
|
|
reg_tmp1.x = dot_s(uniforms.f[34].wzyx, reg_tmp7);
|
|
reg_tmp1.y = dot_s(uniforms.f[35].wzyx, reg_tmp7);
|
|
reg_tmp1.z = dot_s(uniforms.f[36].wzyx, reg_tmp7);
|
|
reg_tmp2.x = dot_s(uniforms.f[37].wzyx, reg_tmp5);
|
|
reg_tmp2.y = dot_s(uniforms.f[38].wzyx, reg_tmp5);
|
|
reg_tmp2.z = dot_s(uniforms.f[39].wzyx, reg_tmp5);
|
|
reg_tmp7 = fma_s(reg_tmp14.xxxx, uniforms.f[40].wzyx, reg_tmp1);
|
|
reg_tmp0.xyz = (reg_tmp7 + reg_tmp2).xyz;
|
|
reg_tmp0.xyz = (mul_s(uniforms.f[95].yyyy, reg_tmp0)).xyz;
|
|
return false;
|
|
}
|
|
bool sub_20() {
|
|
reg_tmp1 = uniforms.f[95].yyyy;
|
|
reg_tmp4.zw = (fma_s(reg_tmp6.xyxy, reg_tmp1, reg_tmp1)).zw;
|
|
reg_tmp4.zw = (fma_s(reg_tmp4, uniforms.f[42].wzyx, reg_tmp3)).zw;
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
reg_tmp2.x = (uniforms.f[94].xxxx).x;
|
|
reg_tmp2.y = (uniforms.f[95].wwww).y;
|
|
reg_tmp2.z = (uniforms.f[93].wwww).z;
|
|
reg_tmp2.w = (uniforms.f[93].zzzz).w;
|
|
reg_tmp3.x = (mul_s(uniforms.f[93].yyyy, reg_tmp3.xxxx)).x;
|
|
reg_tmp3.y = (reg_tmp3.xxxx + -reg_tmp2.xxxx).y;
|
|
reg_tmp3.zw = (floor(reg_tmp3.xyxy)).zw;
|
|
reg_tmp3.xy = (reg_tmp3.xyyy + -reg_tmp3.zwww).xy;
|
|
reg_tmp3.xy = (fma_s(reg_tmp3.xyyy, reg_tmp2.zzzz, -reg_tmp2.yyyy)).xy;
|
|
reg_tmp3.xy = (abs(reg_tmp3.xyyy)).xy;
|
|
reg_tmp2.xy = (fma_s(reg_tmp3.xyxy, -reg_tmp2.zzzz, reg_tmp2.wwww)).xy;
|
|
reg_tmp3.xy = (mul_s(reg_tmp3.xyyy, reg_tmp3.xyyy)).xy;
|
|
reg_tmp3.xy = (mul_s(reg_tmp2.xyyy, reg_tmp3.xyyy)).xy;
|
|
reg_tmp2.xy = (fma_s(reg_tmp3.xyyy, reg_tmp2.zzzz, -reg_tmp2.yyyy)).xy;
|
|
return false;
|
|
}
|
|
// reference: 2A59938C5FB1165B, 6448448D3C7C8F64
|
|
// shader: 8DD9, B99A1F5927E7BF45
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
in vec4 vs_out_attr2[];
|
|
in vec4 vs_out_attr3[];
|
|
in vec4 vs_out_attr4[];
|
|
in vec4 vs_out_attr5[];
|
|
struct Vertex {
|
|
vec4 attributes[6];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(vtx.attributes[3].x, vtx.attributes[3].y, vtx.attributes[3].z, vtx.attributes[3].w);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(vtx.attributes[1].x, vtx.attributes[1].y, vtx.attributes[1].z, vtx.attributes[1].w);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[5].x, vtx.attributes[5].y);
|
|
texcoord1 = vec2(vtx.attributes[2].x, vtx.attributes[2].y);
|
|
|
|
texcoord0_w = vtx.attributes[5].z;
|
|
view = vec3(vtx.attributes[4].x, vtx.attributes[4].y, vtx.attributes[4].z);
|
|
texcoord2 = vec2(vtx.attributes[2].z, vtx.attributes[2].w);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[6](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0], vs_out_attr3[0], vs_out_attr4[0], vs_out_attr5[0]);
|
|
prim_buffer[1].attributes = vec4[6](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1], vs_out_attr3[1], vs_out_attr4[1], vs_out_attr5[1]);
|
|
prim_buffer[2].attributes = vec4[6](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2], vs_out_attr3[2], vs_out_attr4[2], vs_out_attr5[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 46D4F628ABD6EA28, B99A1F5927E7BF45
|
|
// shader: 8B30, 94C16133CD8EF1BD
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texcolor0;
|
|
light_vector = normalize(light_src[0].position + view);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: EBA17E0B0306BB46, 94C16133CD8EF1BD
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, 94C16133CD8EF1BD
|
|
// shader: 8B31, F716967CDB751652
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
out vec4 vs_out_attr3;
|
|
out vec4 vs_out_attr4;
|
|
out vec4 vs_out_attr5;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp1 = vs_in_reg0.xyzz;
|
|
reg_tmp1.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp8.x = dot_s(uniforms.f[5].wzyx, reg_tmp1);
|
|
reg_tmp8.y = dot_s(uniforms.f[6].wzyx, reg_tmp1);
|
|
reg_tmp8.z = dot_s(uniforms.f[7].wzyx, reg_tmp1);
|
|
reg_tmp8.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp5 = vs_in_reg1.xyzz;
|
|
reg_tmp7.x = dot_3(uniforms.f[5].wzy, reg_tmp5.xyz);
|
|
reg_tmp7.y = dot_3(uniforms.f[6].wzy, reg_tmp5.xyz);
|
|
reg_tmp7.z = dot_3(uniforms.f[7].wzy, reg_tmp5.xyz);
|
|
reg_tmp7.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp9.x = dot_s(uniforms.f[0].wzyx, reg_tmp8);
|
|
reg_tmp9.y = dot_s(uniforms.f[1].wzyx, reg_tmp8);
|
|
reg_tmp9.z = dot_s(-uniforms.f[2].wzyx, reg_tmp8);
|
|
reg_tmp9.w = dot_s(uniforms.f[3].wzyx, reg_tmp8);
|
|
reg_tmp10.x = (uniforms.f[95].wwww).x;
|
|
reg_tmp10.x = (-uniforms.f[95].yyyy + reg_tmp10.xxxx).x;
|
|
reg_tmp10.y = (uniforms.f[95].wwww).y;
|
|
reg_tmp2.xy = (mul_s(-reg_tmp9.wwww, reg_tmp10.xyyy)).xy;
|
|
conditional_code.x = reg_tmp9.xxxx.x < reg_tmp2.xyyy.x;
|
|
conditional_code.y = reg_tmp9.xxxx.y > reg_tmp2.xyyy.y;
|
|
if (all(conditional_code)) {
|
|
sub_1();
|
|
}
|
|
vs_out_attr0 = reg_tmp9;
|
|
reg_tmp2.x = dot_3(uniforms.f[8].wzy, reg_tmp7.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[9].wzy, reg_tmp7.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[10].wzy, reg_tmp7.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp6.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp6 = mul_s(reg_tmp2, reg_tmp6.xxxx);
|
|
conditional_code = equal(-uniforms.f[95].ww, reg_tmp6.zz);
|
|
reg_tmp4 = uniforms.f[95].wwww + reg_tmp6.zzzz;
|
|
reg_tmp4 = mul_s(uniforms.f[95].xxxx, reg_tmp4);
|
|
vs_out_attr3.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[95].xxxx, reg_tmp6);
|
|
if (!conditional_code.x) {
|
|
sub_2();
|
|
} else {
|
|
sub_3();
|
|
}
|
|
reg_tmp11 = vs_in_reg2.xyxy;
|
|
if (uniforms.b[9]) {
|
|
sub_4();
|
|
} else {
|
|
sub_5();
|
|
}
|
|
vs_out_attr5.xy = (uniforms.f[95].wwww).xy;
|
|
vs_out_attr5 = uniforms.f[95].wwww;
|
|
reg_tmp10.x = dot_s(uniforms.f[8].wzyx, reg_tmp8);
|
|
reg_tmp10.y = dot_s(uniforms.f[9].wzyx, reg_tmp8);
|
|
reg_tmp10.z = dot_s(uniforms.f[10].wzyx, reg_tmp8);
|
|
reg_tmp10.w = dot_s(uniforms.f[11].wzyx, reg_tmp8);
|
|
reg_tmp3 = uniforms.f[12].wzyx;
|
|
reg_tmp3.y = (mul_s(uniforms.f[95].wwww, reg_tmp3.yyyy)).y;
|
|
reg_tmp4 = fma_s(reg_tmp11, uniforms.f[13].wzyx, reg_tmp3);
|
|
vs_out_attr2 = reg_tmp4;
|
|
vs_out_attr4 = -reg_tmp10;
|
|
vs_out_attr1 = reg_tmp0;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp9.x = (-reg_tmp9.wwww).x;
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
vs_out_attr3.z = rcp_s(reg_tmp4.x);
|
|
vs_out_attr3.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
vs_out_attr3.x = (uniforms.f[95].wwww).x;
|
|
vs_out_attr3.yzw = (uniforms.f[95].zzzz).yzw;
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
reg_tmp5 = mul_s(uniforms.f[94].wwww, vs_in_reg3);
|
|
reg_tmp1 = uniforms.f[94].zzzz + -reg_tmp5;
|
|
reg_tmp2.x = rcp_s(reg_tmp1.x);
|
|
reg_tmp2.y = rcp_s(reg_tmp1.y);
|
|
reg_tmp2.z = rcp_s(reg_tmp1.z);
|
|
reg_tmp5.xyz = (mul_s(reg_tmp5, reg_tmp2)).xyz;
|
|
reg_tmp0.xyz = (reg_tmp5.xyzz).xyz;
|
|
reg_tmp0.w = (reg_tmp5.wwww).w;
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
reg_tmp0 = uniforms.f[95].wwww;
|
|
return false;
|
|
}
|
|
// reference: 627651AD6B258161, F716967CDB751652
|
|
// shader: 8B30, C7AE76949226084D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((rounded_primary_color.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor1.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = (last_tex_env_out.rgb);
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = byteround(clamp((last_tex_env_out.a) * (const_color[3].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 54F3E0D3ACFAFD9E, C7AE76949226084D
|
|
// program: F716967CDB751652, B99A1F5927E7BF45, C7AE76949226084D
|
|
// shader: 8B30, A7254C859D9B158E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((rounded_primary_color.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor1.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = (last_tex_env_out.rgb);
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = byteround(clamp((last_tex_env_out.a) * (const_color[3].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 077274C2ACFAFD9E, A7254C859D9B158E
|
|
// program: F716967CDB751652, B99A1F5927E7BF45, A7254C859D9B158E
|
|
// shader: 8B31, BA4BDCC0340F9785
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
layout(location = 4) in vec4 vs_in_reg4;
|
|
layout(location = 5) in vec4 vs_in_reg5;
|
|
layout(location = 6) in vec4 vs_in_reg6;
|
|
layout(location = 7) in vec4 vs_in_reg7;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
out vec4 vs_out_attr3;
|
|
out vec4 vs_out_attr4;
|
|
out vec4 vs_out_attr5;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
bool sub_6();
|
|
bool sub_7();
|
|
bool sub_8();
|
|
bool sub_9();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp2.xy = (uniforms.f[95].wwww).xy;
|
|
reg_tmp2.zw = (uniforms.f[95].zzzz).zw;
|
|
reg_tmp1 = vs_in_reg0.xyzz;
|
|
reg_tmp1.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp4 = mul_s(vs_in_reg3, reg_tmp2);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = mul_s(uniforms.f[5 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp13 = mul_s(uniforms.f[6 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp14 = mul_s(uniforms.f[7 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
if (uniforms.b[11]) {
|
|
sub_1();
|
|
}
|
|
reg_tmp8.x = dot_s(reg_tmp1, reg_tmp12);
|
|
reg_tmp8.y = dot_s(reg_tmp1, reg_tmp13);
|
|
reg_tmp8.z = dot_s(reg_tmp1, reg_tmp14);
|
|
reg_tmp8.w = (uniforms.f[95].yyyy).w;
|
|
vs_out_attr0.x = dot_s(uniforms.f[0].wzyx, reg_tmp8);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1].wzyx, reg_tmp8);
|
|
vs_out_attr0.z = dot_s(-uniforms.f[2].wzyx, reg_tmp8);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3].wzyx, reg_tmp8);
|
|
reg_tmp10 = vs_in_reg1.xyzz;
|
|
reg_tmp9.x = dot_3(reg_tmp10.xyz, reg_tmp12.xyz);
|
|
reg_tmp9.y = dot_3(reg_tmp10.xyz, reg_tmp13.xyz);
|
|
reg_tmp9.z = dot_3(reg_tmp10.xyz, reg_tmp14.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[77].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[78].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[79].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp6.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp6 = mul_s(reg_tmp2, reg_tmp6.xxxx);
|
|
reg_tmp6.w = (uniforms.f[95].yyyy).w;
|
|
if (uniforms.b[8]) {
|
|
sub_3();
|
|
} else {
|
|
sub_4();
|
|
}
|
|
reg_tmp3 = uniforms.f[81].wzyx;
|
|
reg_tmp4 = fma_s(vs_in_reg2.xyxy, uniforms.f[82].wzyx, reg_tmp3);
|
|
if (uniforms.b[0]) {
|
|
sub_7();
|
|
}
|
|
reg_tmp10 = mul_s(reg_tmp6, reg_tmp6);
|
|
reg_tmp5 = mul_s(reg_tmp6.xyzz, reg_tmp6.yzzx);
|
|
reg_tmp7 = reg_tmp6;
|
|
reg_tmp7.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp11 = reg_tmp10.xxxx + -reg_tmp10.yyyy;
|
|
reg_tmp1.x = dot_s(uniforms.f[83].wzyx, reg_tmp7);
|
|
reg_tmp1.y = dot_s(uniforms.f[84].wzyx, reg_tmp7);
|
|
reg_tmp1.z = dot_s(uniforms.f[85].wzyx, reg_tmp7);
|
|
reg_tmp2.x = dot_s(uniforms.f[86].wzyx, reg_tmp5);
|
|
reg_tmp2.y = dot_s(uniforms.f[87].wzyx, reg_tmp5);
|
|
reg_tmp2.z = dot_s(uniforms.f[88].wzyx, reg_tmp5);
|
|
reg_tmp6 = fma_s(reg_tmp11.xxxx, uniforms.f[89].wzyx, reg_tmp1);
|
|
reg_tmp10.x = dot_s(uniforms.f[77].wzyx, reg_tmp8);
|
|
reg_tmp10.y = dot_s(uniforms.f[78].wzyx, reg_tmp8);
|
|
reg_tmp10.z = dot_s(uniforms.f[79].wzyx, reg_tmp8);
|
|
reg_tmp0 = reg_tmp6 + reg_tmp2;
|
|
if (uniforms.b[1]) {
|
|
sub_8();
|
|
} else {
|
|
sub_9();
|
|
}
|
|
vs_out_attr1 = reg_tmp4;
|
|
vs_out_attr3 = -reg_tmp10;
|
|
vs_out_attr4.xyz = (mul_s(uniforms.f[94].wwww, reg_tmp0)).xyz;
|
|
vs_out_attr4.w = (mul_s(uniforms.f[94].yyyy, vs_in_reg1.wwww)).w;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp4 = mul_s(vs_in_reg5, reg_tmp2);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp4.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
if (uniforms.b[12]) {
|
|
sub_2();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp4 = mul_s(uniforms.f[95].wwww, vs_in_reg6);
|
|
reg_tmp5 = mul_s(uniforms.f[95].zzzz, vs_in_reg7);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp5.xxxx, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.xxxx, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.xxxx, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.yyyy, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.yyyy, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.yyyy, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
address_registers.xy = ivec2(reg_tmp4.zw);
|
|
reg_tmp12 = fma_s(reg_tmp5.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
reg_tmp15 = reg_tmp9;
|
|
reg_tmp10 = vs_in_reg4.xyzz;
|
|
reg_tmp9.x = dot_3(reg_tmp10.xyz, reg_tmp12.xyz);
|
|
reg_tmp9.y = dot_3(reg_tmp10.xyz, reg_tmp13.xyz);
|
|
reg_tmp9.z = dot_3(reg_tmp10.xyz, reg_tmp14.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[77].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[78].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[79].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp9.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp9.x = rsq_s(reg_tmp9.x);
|
|
reg_tmp9 = mul_s(reg_tmp2, reg_tmp9.xxxx);
|
|
reg_tmp9.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp2 = vec4(lessThan(vs_in_reg4.wwww, -vs_in_reg4.wwww));
|
|
reg_tmp3 = vec4(lessThan(-vs_in_reg4.wwww, vs_in_reg4.wwww));
|
|
reg_tmp0 = reg_tmp3 + -reg_tmp2;
|
|
reg_tmp7 = mul_s(reg_tmp6.yzxx, reg_tmp9.zxyy);
|
|
reg_tmp7 = fma_s(-reg_tmp9.yzxx, reg_tmp6.zxyy, reg_tmp7);
|
|
reg_tmp7.w = dot_3(reg_tmp7.xyz, reg_tmp7.xyz);
|
|
reg_tmp7.w = rsq_s(reg_tmp7.w);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp7.wwww);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp0);
|
|
reg_tmp11.w = (reg_tmp6.zzzz + reg_tmp7.yyyy).w;
|
|
reg_tmp9 = mul_s(reg_tmp7.yzxx, reg_tmp6.zxyy);
|
|
reg_tmp9 = fma_s(-reg_tmp6.yzxx, reg_tmp7.zxyy, reg_tmp9);
|
|
reg_tmp11.w = (reg_tmp9.xxxx + reg_tmp11).w;
|
|
reg_tmp9.w = (reg_tmp7.zzzz).w;
|
|
reg_tmp7.z = (reg_tmp9.xxxx).z;
|
|
reg_tmp11.w = (uniforms.f[95].yyyy + reg_tmp11).w;
|
|
reg_tmp6.w = (reg_tmp7.xxxx).w;
|
|
reg_tmp7.x = (reg_tmp6.zzzz).x;
|
|
reg_tmp11.x = (uniforms.f[95].yyyy).x;
|
|
reg_tmp11.y = (-uniforms.f[95].yyyy).y;
|
|
reg_tmp7.xz = (reg_tmp9.wwyy + -reg_tmp6.yyww).xz;
|
|
reg_tmp7.y = (reg_tmp6.xxxx + -reg_tmp9.zzzz).y;
|
|
reg_tmp7.w = (reg_tmp11).w;
|
|
reg_tmp11 = vec4(dot_s(reg_tmp7, reg_tmp7));
|
|
reg_tmp11 = vec4(rsq_s(reg_tmp11.x));
|
|
vs_out_attr2 = mul_s(reg_tmp7, reg_tmp11);
|
|
reg_tmp9 = reg_tmp15;
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
conditional_code = equal(-uniforms.f[95].yy, reg_tmp6.zz);
|
|
reg_tmp4 = uniforms.f[95].yyyy + reg_tmp6.zzzz;
|
|
reg_tmp4 = mul_s(uniforms.f[94].wwww, reg_tmp4);
|
|
vs_out_attr2.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[94].wwww, reg_tmp6);
|
|
if (!conditional_code.x) {
|
|
sub_5();
|
|
} else {
|
|
sub_6();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
vs_out_attr2.z = rcp_s(reg_tmp4.x);
|
|
vs_out_attr2.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
vs_out_attr2.x = (uniforms.f[95].yyyy).x;
|
|
vs_out_attr2.yzw = (uniforms.f[95].xxxx).yzw;
|
|
return false;
|
|
}
|
|
bool sub_7() {
|
|
reg_tmp1 = uniforms.f[94].wwww;
|
|
reg_tmp4.zw = (fma_s(reg_tmp6.xyxy, reg_tmp1, reg_tmp1)).zw;
|
|
reg_tmp4.zw = (fma_s(reg_tmp4, uniforms.f[82].wzyx, reg_tmp3)).zw;
|
|
return false;
|
|
}
|
|
bool sub_8() {
|
|
reg_tmp3 = -uniforms.f[90].wzyx + reg_tmp8;
|
|
reg_tmp3.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp11.x = dot_s(reg_tmp3, reg_tmp3);
|
|
reg_tmp11.x = rsq_s(reg_tmp11.x);
|
|
reg_tmp11 = mul_s(reg_tmp3, reg_tmp11.xxxx);
|
|
reg_tmp9.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp12.x = dot_s(reg_tmp9, reg_tmp9);
|
|
reg_tmp12.x = rsq_s(reg_tmp12.x);
|
|
reg_tmp12 = mul_s(reg_tmp9, reg_tmp12.xxxx);
|
|
reg_tmp2 = vec4(dot_3(reg_tmp11.xyz, reg_tmp12.xyz));
|
|
reg_tmp2 = mul_s(uniforms.f[94].zzzz, reg_tmp2);
|
|
reg_tmp2 = mul_s(reg_tmp12, reg_tmp2.xxxx);
|
|
vs_out_attr5 = reg_tmp11 + -reg_tmp2;
|
|
return false;
|
|
}
|
|
bool sub_9() {
|
|
vs_out_attr5 = reg_tmp4;
|
|
return false;
|
|
}
|
|
// reference: F3004FF94338FA42, BA4BDCC0340F9785
|
|
// shader: 8DD9, A29BAEF5C1BA44F2
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
in vec4 vs_out_attr2[];
|
|
in vec4 vs_out_attr3[];
|
|
in vec4 vs_out_attr4[];
|
|
in vec4 vs_out_attr5[];
|
|
struct Vertex {
|
|
vec4 attributes[6];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(vtx.attributes[2].x, vtx.attributes[2].y, vtx.attributes[2].z, vtx.attributes[2].w);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(vtx.attributes[4].x, vtx.attributes[4].y, vtx.attributes[4].z, vtx.attributes[4].w);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[5].x, vtx.attributes[5].y);
|
|
texcoord1 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
|
|
texcoord0_w = vtx.attributes[5].z;
|
|
view = vec3(vtx.attributes[3].x, vtx.attributes[3].y, vtx.attributes[3].z);
|
|
texcoord2 = vec2(vtx.attributes[1].z, vtx.attributes[1].w);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[6](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0], vs_out_attr3[0], vs_out_attr4[0], vs_out_attr5[0]);
|
|
prim_buffer[1].attributes = vec4[6](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1], vs_out_attr3[1], vs_out_attr4[1], vs_out_attr5[1]);
|
|
prim_buffer[2].attributes = vec4[6](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2], vs_out_attr3[2], vs_out_attr4[2], vs_out_attr5[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 2999884939626C3C, A29BAEF5C1BA44F2
|
|
// shader: 8B30, 086C2C9D93FF82D9
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[1].position + view);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * LookupLightingLUTUnsigned(17, clamp(light_src[1].dist_atten_scale * length(-view - light_src[1].position) + light_src[1].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(17, clamp(light_src[1].dist_atten_scale * length(-view - light_src[1].position) + light_src[1].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((rounded_primary_color.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((texture(tex_cube, vec3(texcoord0, texcoord0_w)).rgb) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp(min((last_tex_env_out.rgb) + (secondary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 60495226E983C6EC, 086C2C9D93FF82D9
|
|
// program: BA4BDCC0340F9785, A29BAEF5C1BA44F2, 086C2C9D93FF82D9
|
|
// shader: 8B31, 821B2E6F196E4B62
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
vs_out_attr0.xy = (vs_in_reg0.xyyy).xy;
|
|
vs_out_attr0.z = (uniforms.f[95].wwww).z;
|
|
vs_out_attr0.w = (uniforms.f[95].zzzz).w;
|
|
reg_tmp0 = vs_in_reg0.zwzw;
|
|
vs_out_attr1 = reg_tmp0.xyxy;
|
|
return true;
|
|
}
|
|
// reference: DABAE56B9B2790A3, 821B2E6F196E4B62
|
|
// shader: 8B30, 2C483463ACBF24A9
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287ABAB13DC4, 2C483463ACBF24A9
|
|
// program: 821B2E6F196E4B62, 6B49BF5FD5349480, 2C483463ACBF24A9
|
|
// shader: 8B30, B67EBC3EF2E40082
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texcolor0;
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D85E8B380306BB46, B67EBC3EF2E40082
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, B67EBC3EF2E40082
|
|
// shader: 8B30, 675610FC3029B6FB
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287AE9B49EAD, 675610FC3029B6FB
|
|
// program: 821B2E6F196E4B62, 6B49BF5FD5349480, 675610FC3029B6FB
|
|
// reference: AE294311294BAAD9, 77C3EE176B2D5FFB
|
|
// reference: 94EE1A2B18D2F6D1, 821B2E6F196E4B62
|
|
// reference: 3F41287ABF687954, 2C483463ACBF24A9
|
|
// shader: 8B31, BBEFD7895AEB1557
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
vs_out_attr0 = reg_tmp0;
|
|
vs_out_attr1 = vs_in_reg0.zwzw;
|
|
vs_out_attr2 = vs_in_reg0.zwzw;
|
|
return true;
|
|
}
|
|
// reference: E4150D24CAA693E5, BBEFD7895AEB1557
|
|
// shader: 8DD9, 2FFCFD3BCBB0B878
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
in vec4 vs_out_attr2[];
|
|
struct Vertex {
|
|
vec4 attributes[3];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
texcoord1 = vec2(vtx.attributes[1].z, vtx.attributes[1].w);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(vtx.attributes[2].x, vtx.attributes[2].y);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[3](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0]);
|
|
prim_buffer[1].attributes = vec4[3](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1]);
|
|
prim_buffer[2].attributes = vec4[3](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 740EEEAAB290EC56, 2FFCFD3BCBB0B878
|
|
// shader: 8B30, D003608795651294
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rrr) - (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0 * 2.0, alpha_output_0 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.ggg) - (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.r);
|
|
last_tex_env_out = vec4(color_output_1 * 2.0, alpha_output_1 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((texcolor0.bbb) - (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_2 * 2.0, alpha_output_2 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) + (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4 * 2.0, alpha_output_4 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (const_color[5].a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: B914AB323360B5D9, D003608795651294
|
|
// program: BBEFD7895AEB1557, 2FFCFD3BCBB0B878, D003608795651294
|
|
// shader: 8B31, 2D0364BAC493DE81
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
vs_out_attr0 = reg_tmp0;
|
|
reg_tmp1 = vs_in_reg0.zwzw;
|
|
reg_tmp2 = vs_in_reg0.zwzw;
|
|
reg_tmp1 = uniforms.f[5].wzyx + reg_tmp1;
|
|
vs_out_attr1 = reg_tmp1;
|
|
vs_out_attr2 = reg_tmp2;
|
|
return true;
|
|
}
|
|
// reference: 8CF2D508E095ECE2, 2D0364BAC493DE81
|
|
// shader: 8B30, B334870986C88A59
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (const_color[0].rgb) + (texcolor1.rgb) * (vec3(1.0) - (const_color[0].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb) + (texcolor2.rgb) * (vec3(1.0) - (const_color[1].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 87ED12B628F68BDC, B334870986C88A59
|
|
// program: 2D0364BAC493DE81, 2FFCFD3BCBB0B878, B334870986C88A59
|
|
// program: BBEFD7895AEB1557, 2FFCFD3BCBB0B878, 2C483463ACBF24A9
|
|
// shader: 8B30, 4D1EA55CBD549670
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) + (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) + (texcolor2.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (const_color[1].a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 7A8255C7190B91C2, 4D1EA55CBD549670
|
|
// program: BBEFD7895AEB1557, 2FFCFD3BCBB0B878, 4D1EA55CBD549670
|
|
// shader: 8B31, 70334CCBBF56C39B
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp1.xy = (vs_in_reg0.zwzw).xy;
|
|
reg_tmp1.zw = (vs_in_reg1.xyxy).zw;
|
|
reg_tmp2 = vs_in_reg1.zwzw;
|
|
vs_out_attr0 = reg_tmp0;
|
|
vs_out_attr1 = reg_tmp1;
|
|
vs_out_attr2 = reg_tmp2;
|
|
return true;
|
|
}
|
|
// reference: 8E774ABE21AAFFB6, 70334CCBBF56C39B
|
|
// shader: 8B30, 2F701B488EAFE05D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (const_color[1].rgb) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[1].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((texcolor2.rgb) * (const_color[2].rgb) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[2].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2D9FF524F890616E, 2F701B488EAFE05D
|
|
// program: 70334CCBBF56C39B, 2FFCFD3BCBB0B878, 2F701B488EAFE05D
|
|
// shader: 8B31, D5D3DFDC8E53FEDF
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp1.xy = (vs_in_reg0.zwzw).xy;
|
|
reg_tmp1.zw = (vs_in_reg1.xyxy).zw;
|
|
vs_out_attr0 = reg_tmp0;
|
|
vs_out_attr1 = reg_tmp1;
|
|
return true;
|
|
}
|
|
// reference: 426CE04B8F2A009A, D5D3DFDC8E53FEDF
|
|
// shader: 8DD9, CA7A5FBE4D339F65
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
struct Vertex {
|
|
vec4 attributes[2];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
texcoord1 = vec2(vtx.attributes[1].z, vtx.attributes[1].w);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[2](vs_out_attr0[0], vs_out_attr1[0]);
|
|
prim_buffer[1].attributes = vec4[2](vs_out_attr0[1], vs_out_attr1[1]);
|
|
prim_buffer[2].attributes = vec4[2](vs_out_attr0[2], vs_out_attr1[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 4A90D8FC4D93BB15, CA7A5FBE4D339F65
|
|
// shader: 8B30, DF8E8C50B1B22456
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor1.a) * (const_color[0].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 2.0, alpha_output_0 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2584B8EB95501D64, DF8E8C50B1B22456
|
|
// program: D5D3DFDC8E53FEDF, CA7A5FBE4D339F65, DF8E8C50B1B22456
|
|
// reference: C21FE054ACFAFD9E, A7254C859D9B158E
|
|
// reference: 919E7445ACFAFD9E, C7AE76949226084D
|
|
// shader: 8B31, 8BAA172D61C6018D
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
layout(location = 4) in vec4 vs_in_reg4;
|
|
layout(location = 5) in vec4 vs_in_reg5;
|
|
layout(location = 6) in vec4 vs_in_reg6;
|
|
layout(location = 7) in vec4 vs_in_reg7;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
out vec4 vs_out_attr3;
|
|
out vec4 vs_out_attr4;
|
|
out vec4 vs_out_attr5;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
bool sub_6();
|
|
bool sub_7();
|
|
bool sub_8();
|
|
bool sub_9();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp2.xy = (uniforms.f[95].wwww).xy;
|
|
reg_tmp2.zw = (uniforms.f[95].zzzz).zw;
|
|
reg_tmp1 = vs_in_reg0.xyzz;
|
|
reg_tmp1.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp4 = mul_s(vs_in_reg3, reg_tmp2);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = mul_s(uniforms.f[5 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp13 = mul_s(uniforms.f[6 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp14 = mul_s(uniforms.f[7 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
if (uniforms.b[11]) {
|
|
sub_1();
|
|
}
|
|
reg_tmp8.x = dot_s(reg_tmp1, reg_tmp12);
|
|
reg_tmp8.y = dot_s(reg_tmp1, reg_tmp13);
|
|
reg_tmp8.z = dot_s(reg_tmp1, reg_tmp14);
|
|
reg_tmp8.w = (uniforms.f[95].yyyy).w;
|
|
vs_out_attr0.x = dot_s(uniforms.f[0].wzyx, reg_tmp8);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1].wzyx, reg_tmp8);
|
|
vs_out_attr0.z = dot_s(-uniforms.f[2].wzyx, reg_tmp8);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3].wzyx, reg_tmp8);
|
|
reg_tmp10 = vs_in_reg1.xyzz;
|
|
reg_tmp9.x = dot_3(reg_tmp10.xyz, reg_tmp12.xyz);
|
|
reg_tmp9.y = dot_3(reg_tmp10.xyz, reg_tmp13.xyz);
|
|
reg_tmp9.z = dot_3(reg_tmp10.xyz, reg_tmp14.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[77].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[78].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[79].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp6.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp6 = mul_s(reg_tmp2, reg_tmp6.xxxx);
|
|
reg_tmp6.w = (uniforms.f[95].yyyy).w;
|
|
if (uniforms.b[8]) {
|
|
sub_3();
|
|
} else {
|
|
sub_4();
|
|
}
|
|
if (uniforms.b[0]) {
|
|
sub_7();
|
|
} else {
|
|
sub_8();
|
|
}
|
|
vs_out_attr5 = reg_tmp7.xyzz;
|
|
reg_tmp3 = uniforms.f[85].wzyx;
|
|
reg_tmp4 = fma_s(vs_in_reg2.xyxy, uniforms.f[86].wzyx, reg_tmp3);
|
|
if (uniforms.b[1]) {
|
|
sub_9();
|
|
}
|
|
reg_tmp10 = mul_s(reg_tmp6, reg_tmp6);
|
|
reg_tmp5 = mul_s(reg_tmp6.xyzz, reg_tmp6.yzzx);
|
|
reg_tmp7 = reg_tmp6;
|
|
reg_tmp7.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp11 = reg_tmp10.xxxx + -reg_tmp10.yyyy;
|
|
reg_tmp1.x = dot_s(uniforms.f[87].wzyx, reg_tmp7);
|
|
reg_tmp1.y = dot_s(uniforms.f[88].wzyx, reg_tmp7);
|
|
reg_tmp1.z = dot_s(uniforms.f[89].wzyx, reg_tmp7);
|
|
reg_tmp2.x = dot_s(uniforms.f[90].wzyx, reg_tmp5);
|
|
reg_tmp2.y = dot_s(uniforms.f[91].wzyx, reg_tmp5);
|
|
reg_tmp2.z = dot_s(uniforms.f[92].wzyx, reg_tmp5);
|
|
reg_tmp6 = fma_s(reg_tmp11.xxxx, uniforms.f[93].wzyx, reg_tmp1);
|
|
reg_tmp10.x = dot_s(uniforms.f[77].wzyx, reg_tmp8);
|
|
reg_tmp10.y = dot_s(uniforms.f[78].wzyx, reg_tmp8);
|
|
reg_tmp10.z = dot_s(uniforms.f[79].wzyx, reg_tmp8);
|
|
reg_tmp0 = reg_tmp6 + reg_tmp2;
|
|
vs_out_attr1 = reg_tmp4;
|
|
vs_out_attr3 = -reg_tmp10;
|
|
vs_out_attr4.xyz = (mul_s(uniforms.f[94].wwww, reg_tmp0)).xyz;
|
|
vs_out_attr4.w = (mul_s(uniforms.f[94].zzzz, vs_in_reg1.wwww)).w;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp4 = mul_s(vs_in_reg5, reg_tmp2);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp4.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
if (uniforms.b[12]) {
|
|
sub_2();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp4 = mul_s(uniforms.f[95].wwww, vs_in_reg6);
|
|
reg_tmp5 = mul_s(uniforms.f[95].zzzz, vs_in_reg7);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp5.xxxx, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.xxxx, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.xxxx, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.yyyy, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.yyyy, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.yyyy, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
address_registers.xy = ivec2(reg_tmp4.zw);
|
|
reg_tmp12 = fma_s(reg_tmp5.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
reg_tmp10 = vs_in_reg4.xyzz;
|
|
reg_tmp9.x = dot_3(reg_tmp10.xyz, reg_tmp12.xyz);
|
|
reg_tmp9.y = dot_3(reg_tmp10.xyz, reg_tmp13.xyz);
|
|
reg_tmp9.z = dot_3(reg_tmp10.xyz, reg_tmp14.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[77].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[78].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[79].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp9.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp9.x = rsq_s(reg_tmp9.x);
|
|
reg_tmp9 = mul_s(reg_tmp2, reg_tmp9.xxxx);
|
|
reg_tmp9.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp2 = vec4(lessThan(vs_in_reg4.wwww, -vs_in_reg4.wwww));
|
|
reg_tmp3 = vec4(lessThan(-vs_in_reg4.wwww, vs_in_reg4.wwww));
|
|
reg_tmp0 = reg_tmp3 + -reg_tmp2;
|
|
reg_tmp7 = mul_s(reg_tmp6.yzxx, reg_tmp9.zxyy);
|
|
reg_tmp7 = fma_s(-reg_tmp9.yzxx, reg_tmp6.zxyy, reg_tmp7);
|
|
reg_tmp7.w = dot_3(reg_tmp7.xyz, reg_tmp7.xyz);
|
|
reg_tmp7.w = rsq_s(reg_tmp7.w);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp7.wwww);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp0);
|
|
reg_tmp11.w = (reg_tmp6.zzzz + reg_tmp7.yyyy).w;
|
|
reg_tmp9 = mul_s(reg_tmp7.yzxx, reg_tmp6.zxyy);
|
|
reg_tmp9 = fma_s(-reg_tmp6.yzxx, reg_tmp7.zxyy, reg_tmp9);
|
|
reg_tmp11.w = (reg_tmp9.xxxx + reg_tmp11).w;
|
|
reg_tmp9.w = (reg_tmp7.zzzz).w;
|
|
reg_tmp7.z = (reg_tmp9.xxxx).z;
|
|
reg_tmp11.w = (uniforms.f[95].yyyy + reg_tmp11).w;
|
|
reg_tmp6.w = (reg_tmp7.xxxx).w;
|
|
reg_tmp7.x = (reg_tmp6.zzzz).x;
|
|
reg_tmp11.x = (uniforms.f[95].yyyy).x;
|
|
reg_tmp11.y = (-uniforms.f[95].yyyy).y;
|
|
reg_tmp7.xz = (reg_tmp9.wwyy + -reg_tmp6.yyww).xz;
|
|
reg_tmp7.y = (reg_tmp6.xxxx + -reg_tmp9.zzzz).y;
|
|
reg_tmp7.w = (reg_tmp11).w;
|
|
reg_tmp11 = vec4(dot_s(reg_tmp7, reg_tmp7));
|
|
reg_tmp11 = vec4(rsq_s(reg_tmp11.x));
|
|
vs_out_attr2 = mul_s(reg_tmp7, reg_tmp11);
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
conditional_code = equal(-uniforms.f[95].yy, reg_tmp6.zz);
|
|
reg_tmp4 = uniforms.f[95].yyyy + reg_tmp6.zzzz;
|
|
reg_tmp4 = mul_s(uniforms.f[94].wwww, reg_tmp4);
|
|
vs_out_attr2.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[94].wwww, reg_tmp6);
|
|
if (!conditional_code.x) {
|
|
sub_5();
|
|
} else {
|
|
sub_6();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
vs_out_attr2.z = rcp_s(reg_tmp4.x);
|
|
vs_out_attr2.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
vs_out_attr2.x = (uniforms.f[95].yyyy).x;
|
|
vs_out_attr2.yzw = (uniforms.f[95].xxxx).yzw;
|
|
return false;
|
|
}
|
|
bool sub_7() {
|
|
reg_tmp4 = -uniforms.f[81].wzyx + reg_tmp8;
|
|
reg_tmp4.w = (uniforms.f[95].xxxx).w;
|
|
reg_tmp5.x = dot_s(reg_tmp4, reg_tmp4);
|
|
reg_tmp5.x = rsq_s(reg_tmp5.x);
|
|
reg_tmp5 = mul_s(reg_tmp4, reg_tmp5.xxxx);
|
|
reg_tmp7.x = dot_s(uniforms.f[82].wzyx, reg_tmp5);
|
|
reg_tmp7.y = dot_s(uniforms.f[83].wzyx, reg_tmp5);
|
|
reg_tmp7.z = dot_s(uniforms.f[84].wzyx, reg_tmp5);
|
|
return false;
|
|
}
|
|
bool sub_8() {
|
|
reg_tmp7.x = dot_s(uniforms.f[82].wzyx, reg_tmp8);
|
|
reg_tmp7.y = dot_s(uniforms.f[83].wzyx, reg_tmp8);
|
|
reg_tmp7.z = dot_s(uniforms.f[84].wzyx, reg_tmp8);
|
|
return false;
|
|
}
|
|
bool sub_9() {
|
|
reg_tmp1 = uniforms.f[94].wwww;
|
|
reg_tmp4.zw = (fma_s(reg_tmp6.xyxy, reg_tmp1, reg_tmp1)).zw;
|
|
reg_tmp4.zw = (fma_s(reg_tmp4, uniforms.f[86].wzyx, reg_tmp3)).zw;
|
|
return false;
|
|
}
|
|
// reference: 2987BECA2A8D306B, 8BAA172D61C6018D
|
|
// shader: 8B30, F4C898A5006ABA30
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texcolor0;
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D85E8B38EFB15045, F4C898A5006ABA30
|
|
// program: 8BAA172D61C6018D, A29BAEF5C1BA44F2, F4C898A5006ABA30
|
|
// shader: 8B30, BD6465BD1EE5A274
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texcolor0;
|
|
light_vector = normalize(light_src[0].position + view);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * LookupLightingLUTUnsigned(16, clamp(light_src[0].dist_atten_scale * length(-view - light_src[0].position) + light_src[0].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(16, clamp(light_src[0].dist_atten_scale * length(-view - light_src[0].position) + light_src[0].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2FACD72EEFB15045, BD6465BD1EE5A274
|
|
// program: 8BAA172D61C6018D, A29BAEF5C1BA44F2, BD6465BD1EE5A274
|
|
// shader: 8B30, 8B5DCD1DC7525B2F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texture(tex_cube, vec3(texcoord0, texcoord0_w));
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 1D331FAEEFB15045, 8B5DCD1DC7525B2F
|
|
// program: 8BAA172D61C6018D, A29BAEF5C1BA44F2, 8B5DCD1DC7525B2F
|
|
// reference: F0529EA584E52BF2, A7254C859D9B158E
|
|
// reference: 06C0FF0084E52BF2, A7254C859D9B158E
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, 8B5DCD1DC7525B2F
|
|
// shader: 8B30, 8D64D882D03B9AD7
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texture(tex_cube, vec3(texcoord0, texcoord0_w));
|
|
light_vector = normalize(light_src[0].position + view);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * LookupLightingLUTUnsigned(16, clamp(light_src[0].dist_atten_scale * length(-view - light_src[0].position) + light_src[0].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(16, clamp(light_src[0].dist_atten_scale * length(-view - light_src[0].position) + light_src[0].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: EAC143B8EFB15045, 8D64D882D03B9AD7
|
|
// program: 8BAA172D61C6018D, A29BAEF5C1BA44F2, 8D64D882D03B9AD7
|
|
// shader: 8B30, 7F9790C7E50A525D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texture(tex_cube, vec3(texcoord0, texcoord0_w));
|
|
light_vector = normalize(light_src[0].position + view);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2ECCEA9DEFB15045, 7F9790C7E50A525D
|
|
// program: 8BAA172D61C6018D, A29BAEF5C1BA44F2, 7F9790C7E50A525D
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, 7F9790C7E50A525D
|
|
// reference: C3AD6B9684E52BF2, A7254C859D9B158E
|
|
// shader: 8B30, 12C71535A5281A38
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texture(tex_cube, vec3(texcoord0, texcoord0_w));
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[1].position + view);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * LookupLightingLUTUnsigned(17, clamp(light_src[1].dist_atten_scale * length(-view - light_src[1].position) + light_src[1].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(17, clamp(light_src[1].dist_atten_scale * length(-view - light_src[1].position) + light_src[1].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 9E7EB3FE491D1D08, 12C71535A5281A38
|
|
// program: 8BAA172D61C6018D, A29BAEF5C1BA44F2, 12C71535A5281A38
|
|
// shader: 8B30, BD8F10C62CC05E35
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = texture(tex_cube, vec3(texcoord0, texcoord0_w));
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
float fog_index = depth * 128.0;
|
|
int fog_i = int(fog_index);
|
|
float fog_f = fract(fog_index);
|
|
vec2 fog_lut_entry = texelFetch(texture_buffer_lut_lf, fog_i + fog_lut_offset).rg;
|
|
float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;
|
|
fog_factor = clamp(fog_factor, 0.0, 1.0);
|
|
last_tex_env_out.rgb = mix(fog_color.rgb, last_tex_env_out.rgb, fog_factor);
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 1D331FAE0306BB46, BD8F10C62CC05E35
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, BD8F10C62CC05E35
|
|
// shader: 8B30, 73AB35B154919C6B
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (rounded_primary_color.rgb);
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287AA32AD95E, 73AB35B154919C6B
|
|
// program: 0000000000000000, 0000000000000000, 73AB35B154919C6B
|
|
// shader: 8B31, F910B80DE3D8A6F4
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp1.xy = (vs_in_reg0.xyyy).xy;
|
|
reg_tmp1.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp0 = vs_in_reg0.zwzw;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp2.x = dot_s(uniforms.f[5].wzyx, reg_tmp0);
|
|
reg_tmp2.y = dot_s(uniforms.f[6].wzyx, reg_tmp0);
|
|
vs_out_attr0 = reg_tmp1;
|
|
vs_out_attr1 = reg_tmp2.xyxy;
|
|
return true;
|
|
}
|
|
// reference: CE84BD1FBCFCBF76, F910B80DE3D8A6F4
|
|
// program: F910B80DE3D8A6F4, 6B49BF5FD5349480, 675610FC3029B6FB
|
|
// shader: 8B31, 936161AC6FA48122
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
bool sub_6();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp1.x = dot_s(uniforms.f[5].wzyx, reg_tmp0);
|
|
reg_tmp1.y = dot_s(uniforms.f[6].wzyx, reg_tmp0);
|
|
reg_tmp2.xy = (mul_s(uniforms.f[9].wzzz, reg_tmp1.xyyy)).xy;
|
|
reg_tmp0.xy = (uniforms.f[9].yxxx + reg_tmp2.xyyy).xy;
|
|
if (uniforms.b[0]) {
|
|
sub_1();
|
|
} else {
|
|
sub_6();
|
|
}
|
|
reg_tmp1.z = (uniforms.f[10].yyyy).z;
|
|
reg_tmp0.z = (min(-uniforms.f[95].wwww, reg_tmp1.zzzz)).z;
|
|
vs_out_attr0.z = (max(-uniforms.f[95].zzzz, reg_tmp0.zzzz)).z;
|
|
vs_out_attr0.w = (uniforms.f[95].zzzz).w;
|
|
vs_out_attr1 = mul_s(uniforms.f[95].yyyy, vs_in_reg1);
|
|
reg_tmp0 = mul_s(uniforms.f[11].wzyx, vs_in_reg2.xyyy);
|
|
reg_tmp0.y = (uniforms.f[95].zzzz + -reg_tmp0.yyyy).y;
|
|
vs_out_attr2 = reg_tmp0.xyyy;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp4 = uniforms.f[90].wzyx;
|
|
conditional_code = equal(uniforms.f[4].wz, reg_tmp4.xy);
|
|
if (conditional_code.x) {
|
|
sub_2();
|
|
} else {
|
|
sub_3();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
vs_out_attr0.xy = (reg_tmp0.xyyy).xy;
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
if (!conditional_code.y) {
|
|
sub_4();
|
|
} else {
|
|
sub_5();
|
|
}
|
|
vs_out_attr0.x = (reg_tmp0.xxxx).x;
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
vs_out_attr0.y = (-uniforms.f[10].zzzz + reg_tmp0.yyyy).y;
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
vs_out_attr0.y = (uniforms.f[10].zzzz + reg_tmp0.yyyy).y;
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
vs_out_attr0.xy = (reg_tmp0.xyyy).xy;
|
|
return false;
|
|
}
|
|
// reference: C15F9B4997564EE9, 936161AC6FA48122
|
|
// shader: 8DD9, 219384019281D7FD
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
in vec4 vs_out_attr2[];
|
|
struct Vertex {
|
|
vec4 attributes[3];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(vtx.attributes[1].x, vtx.attributes[1].y, vtx.attributes[1].z, vtx.attributes[1].w);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[2].x, vtx.attributes[2].y);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[3](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0]);
|
|
prim_buffer[1].attributes = vec4[3](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1]);
|
|
prim_buffer[2].attributes = vec4[3](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 7B07DA3E334A19B0, 219384019281D7FD
|
|
// reference: 3F41287A4A4476CD, 122AF7252C3959A4
|
|
// program: 936161AC6FA48122, 219384019281D7FD, 122AF7252C3959A4
|
|
// shader: 8B31, D5B27A5698350198
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
layout(location = 4) in vec4 vs_in_reg4;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
out vec4 vs_out_attr3;
|
|
out vec4 vs_out_attr4;
|
|
out vec4 vs_out_attr5;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp1 = vs_in_reg0.xyzz;
|
|
reg_tmp1.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp8.x = dot_s(uniforms.f[5].wzyx, reg_tmp1);
|
|
reg_tmp8.y = dot_s(uniforms.f[6].wzyx, reg_tmp1);
|
|
reg_tmp8.z = dot_s(uniforms.f[7].wzyx, reg_tmp1);
|
|
reg_tmp8.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp9.x = dot_s(uniforms.f[0].wzyx, reg_tmp8);
|
|
reg_tmp9.y = dot_s(uniforms.f[1].wzyx, reg_tmp8);
|
|
reg_tmp9.z = dot_s(-uniforms.f[2].wzyx, reg_tmp8);
|
|
reg_tmp9.w = dot_s(uniforms.f[3].wzyx, reg_tmp8);
|
|
reg_tmp10.x = (uniforms.f[95].wwww).x;
|
|
reg_tmp10.x = (-uniforms.f[95].zzzz + reg_tmp10.xxxx).x;
|
|
reg_tmp10.y = (uniforms.f[95].wwww).y;
|
|
reg_tmp2.xy = (mul_s(-reg_tmp9.wwww, reg_tmp10.xyyy)).xy;
|
|
conditional_code.x = reg_tmp9.xxxx.x < reg_tmp2.xyyy.x;
|
|
conditional_code.y = reg_tmp9.xxxx.y > reg_tmp2.xyyy.y;
|
|
if (all(conditional_code)) {
|
|
sub_1();
|
|
}
|
|
vs_out_attr0 = reg_tmp9;
|
|
reg_tmp10 = vs_in_reg1.xyzz;
|
|
reg_tmp9.x = dot_3(uniforms.f[5].wzy, reg_tmp10.xyz);
|
|
reg_tmp9.y = dot_3(uniforms.f[6].wzy, reg_tmp10.xyz);
|
|
reg_tmp9.z = dot_3(uniforms.f[7].wzy, reg_tmp10.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[8].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[9].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[10].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp6.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp6 = mul_s(reg_tmp2, reg_tmp6.xxxx);
|
|
reg_tmp6.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp10 = vs_in_reg4.xyzz;
|
|
reg_tmp9.x = dot_3(uniforms.f[5].wzy, reg_tmp10.xyz);
|
|
reg_tmp9.y = dot_3(uniforms.f[6].wzy, reg_tmp10.xyz);
|
|
reg_tmp9.z = dot_3(uniforms.f[7].wzy, reg_tmp10.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[8].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[9].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[10].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp9.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp9.x = rsq_s(reg_tmp9.x);
|
|
reg_tmp9 = mul_s(reg_tmp2, reg_tmp9.xxxx);
|
|
reg_tmp9.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp7 = mul_s(reg_tmp6.yzxx, reg_tmp9.zxyy);
|
|
reg_tmp7 = fma_s(-reg_tmp9.yzxx, reg_tmp6.zxyy, reg_tmp7);
|
|
reg_tmp7.w = dot_3(reg_tmp7.xyz, reg_tmp7.xyz);
|
|
reg_tmp7.w = rsq_s(reg_tmp7.w);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp7.wwww);
|
|
reg_tmp11.w = (reg_tmp6.zzzz + reg_tmp7.yyyy).w;
|
|
reg_tmp9 = mul_s(reg_tmp7.yzxx, reg_tmp6.zxyy);
|
|
reg_tmp9 = fma_s(-reg_tmp6.yzxx, reg_tmp7.zxyy, reg_tmp9);
|
|
reg_tmp11.w = (reg_tmp9.xxxx + reg_tmp11).w;
|
|
reg_tmp9.w = (reg_tmp7.zzzz).w;
|
|
reg_tmp7.z = (reg_tmp9.xxxx).z;
|
|
reg_tmp11.w = (uniforms.f[95].wwww + reg_tmp11).w;
|
|
reg_tmp6.w = (reg_tmp7.xxxx).w;
|
|
reg_tmp7.x = (reg_tmp6.zzzz).x;
|
|
reg_tmp11.x = (uniforms.f[95].wwww).x;
|
|
reg_tmp11.y = (-uniforms.f[95].wwww).y;
|
|
reg_tmp7.xz = (reg_tmp9.wwyy + -reg_tmp6.yyww).xz;
|
|
reg_tmp7.y = (reg_tmp6.xxxx + -reg_tmp9.zzzz).y;
|
|
reg_tmp7.w = (reg_tmp11).w;
|
|
reg_tmp11 = vec4(dot_s(reg_tmp7, reg_tmp7));
|
|
reg_tmp11 = vec4(rsq_s(reg_tmp11.x));
|
|
vs_out_attr3 = mul_s(reg_tmp7, reg_tmp11);
|
|
if (uniforms.b[0]) {
|
|
sub_2();
|
|
} else {
|
|
sub_3();
|
|
}
|
|
vs_out_attr5 = reg_tmp7.xyzz;
|
|
if (uniforms.b[9]) {
|
|
sub_4();
|
|
} else {
|
|
sub_5();
|
|
}
|
|
reg_tmp10.x = dot_s(uniforms.f[8].wzyx, reg_tmp8);
|
|
reg_tmp10.y = dot_s(uniforms.f[9].wzyx, reg_tmp8);
|
|
reg_tmp10.z = dot_s(uniforms.f[10].wzyx, reg_tmp8);
|
|
vs_out_attr4 = -reg_tmp10;
|
|
vs_out_attr2 = vs_in_reg2.xyxy;
|
|
vs_out_attr1.xyz = (reg_tmp0).xyz;
|
|
vs_out_attr1.w = (mul_s(uniforms.f[94].zzzz, vs_in_reg1.wwww)).w;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp9.x = (-reg_tmp9.wwww).x;
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp4 = -uniforms.f[12].wzyx + reg_tmp8;
|
|
reg_tmp4.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp5.x = dot_s(reg_tmp4, reg_tmp4);
|
|
reg_tmp5.x = rsq_s(reg_tmp5.x);
|
|
reg_tmp5 = mul_s(reg_tmp4, reg_tmp5.xxxx);
|
|
reg_tmp7.x = dot_s(uniforms.f[13].wzyx, reg_tmp5);
|
|
reg_tmp7.y = dot_s(uniforms.f[14].wzyx, reg_tmp5);
|
|
reg_tmp7.z = dot_s(uniforms.f[15].wzyx, reg_tmp5);
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
reg_tmp7.x = dot_s(uniforms.f[13].wzyx, reg_tmp8);
|
|
reg_tmp7.y = dot_s(uniforms.f[14].wzyx, reg_tmp8);
|
|
reg_tmp7.z = dot_s(uniforms.f[15].wzyx, reg_tmp8);
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
reg_tmp5 = mul_s(uniforms.f[95].xxxx, vs_in_reg3);
|
|
reg_tmp1 = uniforms.f[94].wwww + -reg_tmp5;
|
|
reg_tmp2.x = rcp_s(reg_tmp1.x);
|
|
reg_tmp2.y = rcp_s(reg_tmp1.y);
|
|
reg_tmp2.z = rcp_s(reg_tmp1.z);
|
|
reg_tmp5.xyz = (mul_s(reg_tmp5, reg_tmp2)).xyz;
|
|
reg_tmp0.xyz = (reg_tmp5.xyzz).xyz;
|
|
reg_tmp0.w = (reg_tmp5.wwww).w;
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
reg_tmp0 = uniforms.f[95].wwww;
|
|
return false;
|
|
}
|
|
// reference: C39D550084FC9B44, D5B27A5698350198
|
|
// shader: 8B30, 50E8FF4C6853C719
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor1.a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 5B5C67C80880F1C3, 50E8FF4C6853C719
|
|
// program: D5B27A5698350198, B99A1F5927E7BF45, 50E8FF4C6853C719
|
|
// shader: 8B30, B19D21D67537479A
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor1.a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 5B5C67C8E4371AC0, B19D21D67537479A
|
|
// program: D5B27A5698350198, B99A1F5927E7BF45, B19D21D67537479A
|
|
// shader: 8B31, 36C6098A28182693
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
vs_out_attr0.xy = (vs_in_reg0.xyyy).xy;
|
|
vs_out_attr0.zw = (uniforms.f[90].wzwz).zw;
|
|
vs_out_attr1 = vs_in_reg0.zwzw;
|
|
reg_tmp0 = uniforms.f[5].wzyx;
|
|
vs_out_attr2 = reg_tmp0.xxxx;
|
|
return true;
|
|
}
|
|
// reference: 19F8A4266C98EFDF, 36C6098A28182693
|
|
// shader: 8DD9, 86F5543306698380
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
in vec4 vs_out_attr2[];
|
|
struct Vertex {
|
|
vec4 attributes[3];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(vtx.attributes[2].x, vtx.attributes[2].y, vtx.attributes[2].z, vtx.attributes[2].w);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[3](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0]);
|
|
prim_buffer[1].attributes = vec4[3](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1]);
|
|
prim_buffer[2].attributes = vec4[3](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 5144ABDD19096853, 86F5543306698380
|
|
// shader: 8B30, 3310BFDCDD4578F8
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (rounded_primary_color.rgb) + (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(vec3(dot((last_tex_env_out.rgb) - vec3(0.5), (const_color[1].rgb) - vec3(0.5)) * 4.0), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = color_output_1[0];
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp(vec3(dot((combiner_buffer.rgb) - vec3(0.5), (const_color[2].rgb) - vec3(0.5)) * 4.0), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) + (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp(vec3(dot((combiner_buffer.rgb) - vec3(0.5), (const_color[3].rgb) - vec3(0.5)) * 4.0), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = byteround(clamp((last_tex_env_out.r) + (const_color[3].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.aaa) * (const_color[4].rgb) + (last_tex_env_out.aaa) * (vec3(1.0) - (const_color[4].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((last_tex_env_out.r) + (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (const_color[5].rgb) + (last_tex_env_out.aaa) * (vec3(1.0) - (const_color[5].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5 * 4.0, alpha_output_5 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 81B87CC38C659787, 3310BFDCDD4578F8
|
|
// program: 36C6098A28182693, 86F5543306698380, 3310BFDCDD4578F8
|
|
// shader: 8B30, C51BC51BDA34EB94
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb) + (texcolor0.rgb) * (vec3(1.0) - (const_color[1].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((combiner_buffer.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb) + (combiner_buffer.rgb) * (vec3(1.0) - (const_color[3].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (const_color[5].rgb) + (combiner_buffer.rgb) * (vec3(1.0) - (const_color[5].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: E75A04236BE99149, C51BC51BDA34EB94
|
|
// program: 36C6098A28182693, 86F5543306698380, C51BC51BDA34EB94
|
|
// shader: 8B31, 0798BFDE1862A6DD
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
vs_out_attr0.xy = (vs_in_reg0.xyyy).xy;
|
|
vs_out_attr0.zw = (uniforms.f[90].wzwz).zw;
|
|
vs_out_attr1.xy = (vs_in_reg0.zwzw).xy;
|
|
vs_out_attr1.zw = (uniforms.f[5].wzwz + vs_in_reg0.zwzw).zw;
|
|
return true;
|
|
}
|
|
// reference: 83994B3604222238, 0798BFDE1862A6DD
|
|
// shader: 8B30, 1E1BA5B5A5E4F603
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rrr) - (texcolor0.rrr), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0 * 4.0, alpha_output_0 * 4.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.rrr) - (texcolor1.rrr), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_1 * 4.0, alpha_output_1 * 4.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_2 * 4.0, alpha_output_2 * 4.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = (last_tex_env_out.rgb);
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3 * 4.0, alpha_output_3 * 4.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = (last_tex_env_out.rgb);
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4 * 4.0, alpha_output_4 * 4.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = (const_color[5].rgb);
|
|
float alpha_output_5 = byteround(clamp((last_tex_env_out.r) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5 * 1.0, alpha_output_5 * 4.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 498B9EE71F417CF8, 1E1BA5B5A5E4F603
|
|
// program: 0798BFDE1862A6DD, CA7A5FBE4D339F65, 1E1BA5B5A5E4F603
|
|
// shader: 8B30, 53E83525B960FD38
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((const_color[0].rgb) * (texcolor1.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((const_color[0].a) * (const_color[0].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = (vec3(1.0) - last_tex_env_out.rgb);
|
|
float alpha_output_1 = (const_color[1].a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 5A55DAEBCF6EB794, 53E83525B960FD38
|
|
// program: 0798BFDE1862A6DD, CA7A5FBE4D339F65, 53E83525B960FD38
|
|
// shader: 8B31, BEFDB4035EB82649
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
layout(location = 5) in vec4 vs_in_reg5;
|
|
layout(location = 6) in vec4 vs_in_reg6;
|
|
layout(location = 7) in vec4 vs_in_reg7;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp1 = vs_in_reg0.xyzz;
|
|
reg_tmp1.w = (uniforms.f[95].wwww).w;
|
|
reg_tmp4 = mul_s(uniforms.f[92].wzyx, vs_in_reg3);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = mul_s(uniforms.f[5 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp13 = mul_s(uniforms.f[6 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp14 = mul_s(uniforms.f[7 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
if (uniforms.b[11]) {
|
|
sub_1();
|
|
}
|
|
if (uniforms.b[12]) {
|
|
sub_2();
|
|
}
|
|
reg_tmp8.x = dot_s(reg_tmp1, reg_tmp12);
|
|
reg_tmp8.y = dot_s(reg_tmp1, reg_tmp13);
|
|
reg_tmp8.z = dot_s(reg_tmp1, reg_tmp14);
|
|
reg_tmp8.w = (uniforms.f[95].wwww).w;
|
|
vs_out_attr0.x = dot_s(uniforms.f[0].wzyx, reg_tmp8);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1].wzyx, reg_tmp8);
|
|
vs_out_attr0.z = dot_s(-uniforms.f[2].wzyx, reg_tmp8);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3].wzyx, reg_tmp8);
|
|
reg_tmp3 = uniforms.f[77].wzyx;
|
|
reg_tmp4 = fma_s(vs_in_reg2.xyxy, uniforms.f[78].wzyx, reg_tmp3);
|
|
vs_out_attr1 = reg_tmp4;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp4 = mul_s(uniforms.f[92].wzyx, vs_in_reg5);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp4.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp4 = mul_s(uniforms.f[95].zzzz, vs_in_reg6);
|
|
reg_tmp5 = mul_s(uniforms.f[95].yyyy, vs_in_reg7);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp5.xxxx, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.xxxx, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.xxxx, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.yyyy, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.yyyy, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.yyyy, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
address_registers.xy = ivec2(reg_tmp4.zw);
|
|
reg_tmp12 = fma_s(reg_tmp5.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
return false;
|
|
}
|
|
// reference: 011954698E7C8D46, BEFDB4035EB82649
|
|
// shader: 8DD9, B08A1382F46AA708
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
struct Vertex {
|
|
vec4 attributes[2];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(0.0, 0.0);
|
|
texcoord1 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(vtx.attributes[1].z, vtx.attributes[1].w);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[2](vs_out_attr0[0], vs_out_attr1[0]);
|
|
prim_buffer[1].attributes = vec4[2](vs_out_attr0[1], vs_out_attr1[1]);
|
|
prim_buffer[2].attributes = vec4[2](vs_out_attr0[2], vs_out_attr1[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: F155A33764C29FD9, B08A1382F46AA708
|
|
// shader: 8B31, 7B5C334FBC63BF67
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
layout(location = 4) in vec4 vs_in_reg4;
|
|
layout(location = 5) in vec4 vs_in_reg5;
|
|
layout(location = 6) in vec4 vs_in_reg6;
|
|
layout(location = 7) in vec4 vs_in_reg7;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
out vec4 vs_out_attr3;
|
|
out vec4 vs_out_attr4;
|
|
out vec4 vs_out_attr5;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
bool sub_6();
|
|
bool sub_7();
|
|
bool sub_8();
|
|
bool sub_9();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp2.xy = (uniforms.f[95].wwww).xy;
|
|
reg_tmp2.zw = (uniforms.f[95].zzzz).zw;
|
|
reg_tmp1 = vs_in_reg0.xyzz;
|
|
reg_tmp1.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp4 = mul_s(vs_in_reg3, reg_tmp2);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = mul_s(uniforms.f[5 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp13 = mul_s(uniforms.f[6 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp14 = mul_s(uniforms.f[7 + address_registers.x].wzyx, reg_tmp4.zzzz);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
if (uniforms.b[11]) {
|
|
sub_1();
|
|
}
|
|
reg_tmp8.x = dot_s(reg_tmp1, reg_tmp12);
|
|
reg_tmp8.y = dot_s(reg_tmp1, reg_tmp13);
|
|
reg_tmp8.z = dot_s(reg_tmp1, reg_tmp14);
|
|
reg_tmp8.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp9.x = dot_s(uniforms.f[0].wzyx, reg_tmp8);
|
|
reg_tmp9.y = dot_s(uniforms.f[1].wzyx, reg_tmp8);
|
|
reg_tmp9.z = dot_s(-uniforms.f[2].wzyx, reg_tmp8);
|
|
reg_tmp9.w = dot_s(uniforms.f[3].wzyx, reg_tmp8);
|
|
reg_tmp10.x = (uniforms.f[95].yyyy).x;
|
|
reg_tmp10.x = (-uniforms.f[95].xxxx + reg_tmp10.xxxx).x;
|
|
reg_tmp10.y = (uniforms.f[95].yyyy).y;
|
|
reg_tmp2.xy = (mul_s(-reg_tmp9.wwww, reg_tmp10.xyyy)).xy;
|
|
conditional_code.x = reg_tmp9.xxxx.x < reg_tmp2.xyyy.x;
|
|
conditional_code.y = reg_tmp9.xxxx.y > reg_tmp2.xyyy.y;
|
|
if (all(conditional_code)) {
|
|
sub_3();
|
|
}
|
|
vs_out_attr0 = reg_tmp9;
|
|
reg_tmp10 = vs_in_reg1.xyzz;
|
|
reg_tmp9.x = dot_3(reg_tmp10.xyz, reg_tmp12.xyz);
|
|
reg_tmp9.y = dot_3(reg_tmp10.xyz, reg_tmp13.xyz);
|
|
reg_tmp9.z = dot_3(reg_tmp10.xyz, reg_tmp14.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[77].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[78].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[79].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[94].wwww).w;
|
|
reg_tmp6.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp6 = mul_s(reg_tmp2, reg_tmp6.xxxx);
|
|
reg_tmp6.w = (uniforms.f[95].yyyy).w;
|
|
if (uniforms.b[8]) {
|
|
sub_4();
|
|
} else {
|
|
sub_5();
|
|
}
|
|
if (uniforms.b[0]) {
|
|
sub_8();
|
|
} else {
|
|
sub_9();
|
|
}
|
|
vs_out_attr5 = reg_tmp7.xyzz;
|
|
reg_tmp10.x = dot_s(uniforms.f[77].wzyx, reg_tmp8);
|
|
reg_tmp10.y = dot_s(uniforms.f[78].wzyx, reg_tmp8);
|
|
reg_tmp10.z = dot_s(uniforms.f[79].wzyx, reg_tmp8);
|
|
vs_out_attr3 = -reg_tmp10;
|
|
vs_out_attr1 = vs_in_reg2.xyxy;
|
|
vs_out_attr4.xyz = (uniforms.f[94].wwww).xyz;
|
|
vs_out_attr4.w = (mul_s(uniforms.f[94].yyyy, vs_in_reg1.wwww)).w;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp4 = mul_s(vs_in_reg5, reg_tmp2);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp4.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp4.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp4.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp4.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
if (uniforms.b[12]) {
|
|
sub_2();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp4 = mul_s(uniforms.f[95].wwww, vs_in_reg6);
|
|
reg_tmp5 = mul_s(uniforms.f[95].zzzz, vs_in_reg7);
|
|
address_registers.xy = ivec2(reg_tmp4.xy);
|
|
reg_tmp12 = fma_s(reg_tmp5.xxxx, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.xxxx, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.xxxx, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.yyyy, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.yyyy, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.yyyy, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
address_registers.xy = ivec2(reg_tmp4.zw);
|
|
reg_tmp12 = fma_s(reg_tmp5.zzzz, uniforms.f[5 + address_registers.x].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.zzzz, uniforms.f[6 + address_registers.x].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.zzzz, uniforms.f[7 + address_registers.x].wzyx, reg_tmp14);
|
|
reg_tmp12 = fma_s(reg_tmp5.wwww, uniforms.f[5 + address_registers.y].wzyx, reg_tmp12);
|
|
reg_tmp13 = fma_s(reg_tmp5.wwww, uniforms.f[6 + address_registers.y].wzyx, reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp5.wwww, uniforms.f[7 + address_registers.y].wzyx, reg_tmp14);
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
reg_tmp9.x = (-reg_tmp9.wwww).x;
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
reg_tmp10 = vs_in_reg4.xyzz;
|
|
reg_tmp9.x = dot_3(reg_tmp10.xyz, reg_tmp12.xyz);
|
|
reg_tmp9.y = dot_3(reg_tmp10.xyz, reg_tmp13.xyz);
|
|
reg_tmp9.z = dot_3(reg_tmp10.xyz, reg_tmp14.xyz);
|
|
reg_tmp2.x = dot_3(uniforms.f[77].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.y = dot_3(uniforms.f[78].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.z = dot_3(uniforms.f[79].wzy, reg_tmp9.xyz);
|
|
reg_tmp2.w = (uniforms.f[94].wwww).w;
|
|
reg_tmp9.x = dot_s(reg_tmp2, reg_tmp2);
|
|
reg_tmp9.x = rsq_s(reg_tmp9.x);
|
|
reg_tmp9 = mul_s(reg_tmp2, reg_tmp9.xxxx);
|
|
reg_tmp9.w = (uniforms.f[95].yyyy).w;
|
|
reg_tmp7 = mul_s(reg_tmp6.yzxx, reg_tmp9.zxyy);
|
|
reg_tmp7 = fma_s(-reg_tmp9.yzxx, reg_tmp6.zxyy, reg_tmp7);
|
|
reg_tmp7.w = dot_3(reg_tmp7.xyz, reg_tmp7.xyz);
|
|
reg_tmp7.w = rsq_s(reg_tmp7.w);
|
|
reg_tmp7 = mul_s(reg_tmp7, reg_tmp7.wwww);
|
|
reg_tmp11.w = (reg_tmp6.zzzz + reg_tmp7.yyyy).w;
|
|
reg_tmp9 = mul_s(reg_tmp7.yzxx, reg_tmp6.zxyy);
|
|
reg_tmp9 = fma_s(-reg_tmp6.yzxx, reg_tmp7.zxyy, reg_tmp9);
|
|
reg_tmp11.w = (reg_tmp9.xxxx + reg_tmp11).w;
|
|
reg_tmp9.w = (reg_tmp7.zzzz).w;
|
|
reg_tmp7.z = (reg_tmp9.xxxx).z;
|
|
reg_tmp11.w = (uniforms.f[95].yyyy + reg_tmp11).w;
|
|
reg_tmp6.w = (reg_tmp7.xxxx).w;
|
|
reg_tmp7.x = (reg_tmp6.zzzz).x;
|
|
reg_tmp11.x = (uniforms.f[95].yyyy).x;
|
|
reg_tmp11.y = (-uniforms.f[95].yyyy).y;
|
|
reg_tmp7.xz = (reg_tmp9.wwyy + -reg_tmp6.yyww).xz;
|
|
reg_tmp7.y = (reg_tmp6.xxxx + -reg_tmp9.zzzz).y;
|
|
reg_tmp7.w = (reg_tmp11).w;
|
|
reg_tmp11 = vec4(dot_s(reg_tmp7, reg_tmp7));
|
|
reg_tmp11 = vec4(rsq_s(reg_tmp11.x));
|
|
vs_out_attr2 = mul_s(reg_tmp7, reg_tmp11);
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
conditional_code = equal(-uniforms.f[95].yy, reg_tmp6.zz);
|
|
reg_tmp4 = uniforms.f[95].yyyy + reg_tmp6.zzzz;
|
|
reg_tmp4 = mul_s(uniforms.f[94].zzzz, reg_tmp4);
|
|
vs_out_attr2.w = (uniforms.f[94].wwww).w;
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[94].zzzz, reg_tmp6);
|
|
if (!conditional_code.x) {
|
|
sub_6();
|
|
} else {
|
|
sub_7();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
vs_out_attr2.z = rcp_s(reg_tmp4.x);
|
|
vs_out_attr2.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
return false;
|
|
}
|
|
bool sub_7() {
|
|
vs_out_attr2.x = (uniforms.f[95].yyyy).x;
|
|
vs_out_attr2.yzw = (uniforms.f[94].wwww).yzw;
|
|
return false;
|
|
}
|
|
bool sub_8() {
|
|
reg_tmp4 = -uniforms.f[81].wzyx + reg_tmp8;
|
|
reg_tmp4.w = (uniforms.f[94].wwww).w;
|
|
reg_tmp5.x = dot_s(reg_tmp4, reg_tmp4);
|
|
reg_tmp5.x = rsq_s(reg_tmp5.x);
|
|
reg_tmp5 = mul_s(reg_tmp4, reg_tmp5.xxxx);
|
|
reg_tmp7.x = dot_s(uniforms.f[82].wzyx, reg_tmp5);
|
|
reg_tmp7.y = dot_s(uniforms.f[83].wzyx, reg_tmp5);
|
|
reg_tmp7.z = dot_s(uniforms.f[84].wzyx, reg_tmp5);
|
|
return false;
|
|
}
|
|
bool sub_9() {
|
|
reg_tmp7.x = dot_s(uniforms.f[82].wzyx, reg_tmp8);
|
|
reg_tmp7.y = dot_s(uniforms.f[83].wzyx, reg_tmp8);
|
|
reg_tmp7.z = dot_s(uniforms.f[84].wzyx, reg_tmp8);
|
|
return false;
|
|
}
|
|
// reference: 6C8B7E98216E2D81, 7B5C334FBC63BF67
|
|
// shader: 8B30, 7A00CBA7B5E89B91
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: CB2E148493A34C92, 7A00CBA7B5E89B91
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 7A00CBA7B5E89B91
|
|
// reference: 898026158A13A93D, B19D21D67537479A
|
|
// shader: 8B30, D74436DB071CA0EE
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.a *= shadow.a;
|
|
specular_sum.a *= shadow.a;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: EBA472E3B250B528, D74436DB071CA0EE
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, D74436DB071CA0EE
|
|
// shader: 8B30, 8A2706BB8BA65FA0
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((vec3(1.0) - shadowTexture(texcoord0, texcoord0_w).rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (const_color[1].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((shadowTexture(texcoord0, texcoord0_w).rgb) * (texcolor1.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = byteround(clamp((last_tex_env_out.a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (const_color[4].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((last_tex_env_out.a) * (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (const_color[5].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((last_tex_env_out.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: B9F1B1D6DEB630C2, 8A2706BB8BA65FA0
|
|
// program: D5B27A5698350198, B99A1F5927E7BF45, 8A2706BB8BA65FA0
|
|
// reference: 8980261566A4423E, 50E8FF4C6853C719
|
|
// reference: D51EEC473736F56E, 7F06759B2FE3343D
|
|
// shader: 8B30, EE30CFDDABA6A016
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: CB2E14847F14A791, EE30CFDDABA6A016
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, EE30CFDDABA6A016
|
|
// reference: 81B87CC38DA7FDB0, 3310BFDCDD4578F8
|
|
// reference: E75A04236A2BFB7E, C51BC51BDA34EB94
|
|
// reference: 498B9EE71E8316CF, 1E1BA5B5A5E4F603
|
|
// reference: 5A55DAEBCEACDDA3, 53E83525B960FD38
|
|
// reference: 3F41287A870CAA91, 4F691F5A00C1A34B
|
|
// reference: 3F41287A13CB116A, 122AF7252C3959A4
|
|
// reference: 2584B8EB0F89B160, 77A0240D939DC4D1
|
|
// reference: 3F41287AA2E8B369, 73AB35B154919C6B
|
|
// reference: 9B0CCA40CF8CABB6, 160B6F5646BAD397
|
|
// shader: 8B30, 2109F1BC7F1E0B6E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (secondary_fragment_color.b);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.aaa) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 58D88BF34B3FC743, 2109F1BC7F1E0B6E
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 2109F1BC7F1E0B6E
|
|
// reference: 3F41287ABEAA1363, 2C483463ACBF24A9
|
|
// shader: 8B31, 7B3E831C3A32D090
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
reg_tmp0.z = (uniforms.f[95].wwww).z;
|
|
vs_out_attr0 = reg_tmp0;
|
|
return true;
|
|
}
|
|
// reference: 375EF1B8E8B04975, 7B3E831C3A32D090
|
|
// shader: 8DD9, 6F77F38530E7A871
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
struct Vertex {
|
|
vec4 attributes[1];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(0.0, 0.0);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[1](vs_out_attr0[0]);
|
|
prim_buffer[1].attributes = vec4[1](vs_out_attr0[1]);
|
|
prim_buffer[2].attributes = vec4[1](vs_out_attr0[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: B0EECBB083D64E3E, 6F77F38530E7A871
|
|
// shader: 8B30, 12433E7DDE265EFC
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (const_color[0].rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287A164FC1B3, 12433E7DDE265EFC
|
|
// program: 7B3E831C3A32D090, 6F77F38530E7A871, 12433E7DDE265EFC
|
|
// shader: 8B31, CC2C8FBD661C0C27
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
vs_out_attr0 = reg_tmp0;
|
|
vs_out_attr1 = vs_in_reg0.zwzw;
|
|
return true;
|
|
}
|
|
// reference: 4B519F632FD9F576, CC2C8FBD661C0C27
|
|
// shader: 8B30, 0FDD6E2ACC1F2ABA
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (const_color[0].rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = (const_color[5].rgb);
|
|
float alpha_output_5 = (const_color[5].a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
color = vec4(0.0);
|
|
}// reference: 960A484B62A95733, 0FDD6E2ACC1F2ABA
|
|
// program: CC2C8FBD661C0C27, CA7A5FBE4D339F65, 0FDD6E2ACC1F2ABA
|
|
// shader: 8B31, A24F05527DBF1D58
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp0 = vs_in_reg0.xyyy;
|
|
reg_tmp0.zw = (uniforms.f[90].wzwz).zw;
|
|
vs_out_attr0 = reg_tmp0;
|
|
reg_tmp1 = vs_in_reg0.zwzw;
|
|
reg_tmp2 = vs_in_reg0.zwzw;
|
|
reg_tmp1 = uniforms.f[5].wzyx + reg_tmp1;
|
|
reg_tmp2 = uniforms.f[6].wzyx + reg_tmp2;
|
|
vs_out_attr1 = reg_tmp1;
|
|
vs_out_attr2 = reg_tmp2;
|
|
return true;
|
|
}
|
|
// reference: 8CF2D508A0E87D19, A24F05527DBF1D58
|
|
// shader: 8B30, 1D2EA5099DD6F0E6
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (const_color[0].rgb) + (texcolor1.rgb) * (vec3(1.0) - (const_color[0].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: F3664C84CA5126B8, 1D2EA5099DD6F0E6
|
|
// program: A24F05527DBF1D58, 2FFCFD3BCBB0B878, 1D2EA5099DD6F0E6
|
|
// shader: 8B30, 033FF112CCB1F668
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) * (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0 * 2.0, alpha_output_0 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: E1F07265B6008429, 033FF112CCB1F668
|
|
// program: CC2C8FBD661C0C27, CA7A5FBE4D339F65, 033FF112CCB1F668
|
|
// reference: 3F41287ABB7357F3, 2C483463ACBF24A9
|
|
// reference: 3F41287AE876F49A, 675610FC3029B6FB
|
|
// shader: 8B30, DACE79D9F3CC1122
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D4394141A1D5F083, DACE79D9F3CC1122
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, DACE79D9F3CC1122
|
|
// reference: 969773D0B865152C, B19D21D67537479A
|
|
// shader: 8B30, E4B156380D5C4B7E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.a *= shadow.a;
|
|
specular_sum.a *= shadow.a;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: F4B3272680260939, E4B156380D5C4B7E
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, E4B156380D5C4B7E
|
|
// reference: A6E6E413ECC08CD3, 8A2706BB8BA65FA0
|
|
// reference: 969773D054D2FE2F, 50E8FF4C6853C719
|
|
// shader: 8B30, 29F639C012D43236
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D43941414D621B80, 29F639C012D43236
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 29F639C012D43236
|
|
// reference: 54F3E0D3AD3897A9, C7AE76949226084D
|
|
// reference: C892DBA6F0A8F272, C7AE76949226084D
|
|
// reference: D7858E63C2DE4E63, C7AE76949226084D
|
|
// reference: 66BE9E22852741C5, C7AE76949226084D
|
|
// shader: 8B31, A1E6B82C2B73A490
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_4();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
uint jmp_to = 0u;
|
|
while (true) {
|
|
switch (jmp_to) {
|
|
case 0u: {
|
|
reg_tmp14.z = (mul_s(uniforms.f[5].wwww, vs_in_reg2.zzzz)).z;
|
|
reg_tmp15 = uniforms.f[6].wzyx;
|
|
reg_tmp0 = vs_in_reg0.xyzz;
|
|
reg_tmp0.z = (reg_tmp0.zzzz + reg_tmp14.zzzz).z;
|
|
reg_tmp0.w = (uniforms.f[95].wwww).w;
|
|
vs_out_attr1 = mul_s(uniforms.f[90].zzzz, vs_in_reg1);
|
|
conditional_code = greaterThan(uniforms.f[7].wz, reg_tmp15.xy);
|
|
if (conditional_code.y) {
|
|
{ jmp_to = 20u; break; }
|
|
}
|
|
vs_out_attr0.x = dot_s(uniforms.f[8].wzyx, reg_tmp0);
|
|
vs_out_attr0.y = dot_s(uniforms.f[9].wzyx, reg_tmp0);
|
|
vs_out_attr0.z = dot_s(uniforms.f[10].wzyx, reg_tmp0);
|
|
vs_out_attr0.w = dot_s(uniforms.f[11].wzyx, reg_tmp0);
|
|
if (conditional_code.x) {
|
|
sub_1();
|
|
} else {
|
|
sub_2();
|
|
}
|
|
return true;
|
|
}
|
|
case 20u: {
|
|
vs_out_attr0.x = dot_s(uniforms.f[0].wzyx, reg_tmp0);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1].wzyx, reg_tmp0);
|
|
reg_tmp1.w = dot_s(uniforms.f[3].wzyx, reg_tmp0);
|
|
reg_tmp4.x = (mul_s(uniforms.f[12].yyyy, reg_tmp14.zzzz)).x;
|
|
reg_tmp4.y = (mul_s(uniforms.f[13].yyyy, reg_tmp14.zzzz)).y;
|
|
reg_tmp4.z = (mul_s(uniforms.f[14].yyyy, reg_tmp14.zzzz)).z;
|
|
reg_tmp4.xyz = (reg_tmp4.xyzz + reg_tmp0.xyzz).xyz;
|
|
reg_tmp4.w = (uniforms.f[90].xxxx).w;
|
|
reg_tmp6.w = dot_s(uniforms.f[3].wzyx, reg_tmp4);
|
|
reg_tmp6.z = dot_s(-uniforms.f[2].wzyx, reg_tmp4);
|
|
reg_tmp6.z = (mul_s(reg_tmp1.wwww, reg_tmp6.zzzz)).z;
|
|
reg_tmp2 = vec4(rcp_s(reg_tmp6.w));
|
|
vs_out_attr0.z = (mul_s(reg_tmp6.zzzz, reg_tmp2.zzzz)).z;
|
|
vs_out_attr0.w = (reg_tmp1.wwww).w;
|
|
if (conditional_code.x) {
|
|
sub_3();
|
|
} else {
|
|
sub_4();
|
|
}
|
|
return true;
|
|
}
|
|
default: return false;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp1.xy = (vs_in_reg2.xyyy).xy;
|
|
reg_tmp1.xy = (mul_s(uniforms.f[90].yyyy, reg_tmp1.xyyy)).xy;
|
|
reg_tmp1.y = (uniforms.f[95].wwww + -reg_tmp1.yyyy).y;
|
|
vs_out_attr2 = reg_tmp1.xyyy;
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
vs_out_attr2 = uniforms.f[90].wwww;
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
reg_tmp5.xy = (vs_in_reg2.xyyy).xy;
|
|
reg_tmp5.xy = (mul_s(uniforms.f[90].yyyy, reg_tmp5.xyyy)).xy;
|
|
reg_tmp5.y = (uniforms.f[95].wwww + -reg_tmp5.yyyy).y;
|
|
vs_out_attr2 = reg_tmp5.xyyy;
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
vs_out_attr2 = uniforms.f[90].wwww;
|
|
return false;
|
|
}
|
|
// reference: E7B8AE6CC577D63E, A1E6B82C2B73A490
|
|
// program: A1E6B82C2B73A490, 219384019281D7FD, 77A0240D939DC4D1
|
|
// shader: 8B30, 44883F1DD9CCA7A4
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor0.a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 2.0, alpha_output_0 * 1.0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2584B8EBFA6D3DE5, 44883F1DD9CCA7A4
|
|
// program: 0000000000000000, 0000000000000000, 44883F1DD9CCA7A4
|
|
// shader: 8B30, C944D5EE0BB9CA2E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: A2739AC4A1D5F083, C944D5EE0BB9CA2E
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, C944D5EE0BB9CA2E
|
|
// reference: E0DDA855B865152C, B19D21D67537479A
|
|
// shader: 8B30, B4B6E8F00A0B92D9
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.a *= shadow.a;
|
|
specular_sum.a *= shadow.a;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 82F9FCA380260939, B4B6E8F00A0B92D9
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, B4B6E8F00A0B92D9
|
|
// reference: D0AC3F96ECC08CD3, 8A2706BB8BA65FA0
|
|
// reference: E0DDA85554D2FE2F, 50E8FF4C6853C719
|
|
// shader: 8B30, 7251ACE22A13EA75
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: A2739AC44D621B80, 7251ACE22A13EA75
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 7251ACE22A13EA75
|
|
// shader: 8B30, F3C0982697BA765E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 08BCE49C0E1CFEE1, F3C0982697BA765E
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, F3C0982697BA765E
|
|
// reference: 4A12D60D17AC1B4E, B19D21D67537479A
|
|
// shader: 8B30, 84AD4A8716361E1A
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.a *= shadow.a;
|
|
specular_sum.a *= shadow.a;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 283682FB2FEF075B, 84AD4A8716361E1A
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, 84AD4A8716361E1A
|
|
// reference: 7A6341CE430982B1, 8A2706BB8BA65FA0
|
|
// reference: 4A12D60DFB1BF04D, 50E8FF4C6853C719
|
|
// shader: 8B30, 50ED0570605B9058
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 08BCE49CE2AB15E2, 50ED0570605B9058
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 50ED0570605B9058
|
|
// program: A1E6B82C2B73A490, 219384019281D7FD, 44883F1DD9CCA7A4
|
|
// shader: 8B30, F1EB0169FDE5EA17
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: ABBF50A9ABB45F27, F1EB0169FDE5EA17
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, F1EB0169FDE5EA17
|
|
// shader: 8B30, 02AB23D61467A54C
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: ABBF50A94703B424, 02AB23D61467A54C
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 02AB23D61467A54C
|
|
// shader: 8B30, EA59604368944506
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: DDF58B2CABB45F27, EA59604368944506
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, EA59604368944506
|
|
// shader: 8B30, EDCC0F6635C2F55D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: DDF58B2C4703B424, EDCC0F6635C2F55D
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, EDCC0F6635C2F55D
|
|
// reference: BED80023F0A8F272, C7AE76949226084D
|
|
// shader: 8B30, 3209FC75B38C1D60
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 773AF574047D5145, 3209FC75B38C1D60
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 3209FC75B38C1D60
|
|
// shader: 8B30, 2380F1B04687B775
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 773AF574E8CABA46, 2380F1B04687B775
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 2380F1B04687B775
|
|
// reference: 14177E7B5F61FC10, C7AE76949226084D
|
|
// shader: 8B30, D521FD43FC7AADD0
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2CD44CA35A9CA8EF, D521FD43FC7AADD0
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, D521FD43FC7AADD0
|
|
// shader: 8B30, 9600C57B0DFA82FD
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 53525D4B50FD074B, 9600C57B0DFA82FD
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 9600C57B0DFA82FD
|
|
// reference: 6E7A7E32432C4D40, B19D21D67537479A
|
|
// shader: 8B30, 5EAC9D3A6DC7146F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.a *= shadow.a;
|
|
specular_sum.a *= shadow.a;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 0C5E2AC47B6F5155, 5EAC9D3A6DC7146F
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, 5EAC9D3A6DC7146F
|
|
// reference: 5E0BE9F11789D4BF, 8A2706BB8BA65FA0
|
|
// reference: 6E7A7E32AF9BA643, 50E8FF4C6853C719
|
|
// shader: 8B30, 1E2893503C4CD4AB
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2CD44CA3B62B43EC, 1E2893503C4CD4AB
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 1E2893503C4CD4AB
|
|
// shader: 8B30, 5A6F46C95B8CCD69
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 53525D4BBC4AEC48, 5A6F46C95B8CCD69
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 5A6F46C95B8CCD69
|
|
// reference: 307FD6440BE1AA1E, C7AE76949226084D
|
|
// shader: 8B30, 8B31938B7558391D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (secondary_fragment_color.b);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.aaa) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 47CFDE3679497B52, 8B31938B7558391D
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 8B31938B7558391D
|
|
// shader: 8B30, 0C68512436FC01FD
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.a *= shadow.a;
|
|
specular_sum.a *= shadow.a;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((const_color[4].a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: E1A7DE8180260939, 0C68512436FC01FD
|
|
// program: 8BAA172D61C6018D, A29BAEF5C1BA44F2, 0C68512436FC01FD
|
|
// shader: 8B30, C31D1C04A2BFFE72
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: B4A8056C99C2E336, C31D1C04A2BFFE72
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, C31D1C04A2BFFE72
|
|
// shader: 8B30, 2A12464FEFE1758F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: B4A8056C75750835, 2A12464FEFE1758F
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 2A12464FEFE1758F
|
|
// shader: 8B30, 4B5E9F13440A99F1
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (secondary_fragment_color.b);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.aaa) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 9B4A7BEBD6807530, 4B5E9F13440A99F1
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 4B5E9F13440A99F1
|
|
// shader: 8B30, 287AEE8398B2DA34
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (secondary_fragment_color.b);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.aaa) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: BF22D3D48200233E, 287AEE8398B2DA34
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 287AEE8398B2DA34
|
|
// shader: 8B30, 19B93588C3DBD2F2
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[6].position + view);
|
|
spot_dir = light_src[6].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[6].diffuse * dot_product) + light_src[6].ambient) * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[6].specular_0) + (refl_value * light_src[6].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 50AF1E103EA6CE35, 19B93588C3DBD2F2
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 19B93588C3DBD2F2
|
|
// shader: 8B30, 77AF6E2EA4AB5993
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[6].position + view);
|
|
spot_dir = light_src[6].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[6].diffuse * dot_product) + light_src[6].ambient) * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[6].specular_0) + (refl_value * light_src[6].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (secondary_fragment_color.b);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.aaa) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: C3598167E63A45E4, 77AF6E2EA4AB5993
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 77AF6E2EA4AB5993
|
|
// reference: 12012C8127162B9A, B19D21D67537479A
|
|
// shader: 8B30, 2DD5862C28FA471E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[6].position + view);
|
|
spot_dir = light_src[6].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[6].diffuse * dot_product) + light_src[6].ambient) * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[6].specular_0) + (refl_value * light_src[6].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.a *= shadow.a;
|
|
specular_sum.a *= shadow.a;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((const_color[1].aaa) + (const_color[1].rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.rgb), vec3(1.0)) * (combiner_buffer.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (const_color[2].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((last_tex_env_out.rgb) * (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (const_color[4].a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((combiner_buffer.a) * (const_color[5].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 702578771F55378F, 2DD5862C28FA471E
|
|
// program: 6448448D3C7C8F64, B99A1F5927E7BF45, 2DD5862C28FA471E
|
|
// reference: 2270BB4273B3B265, 8A2706BB8BA65FA0
|
|
// reference: 12012C81CBA1C099, 50E8FF4C6853C719
|
|
// shader: 8B30, 4499EB7743050700
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[4].position + view);
|
|
spot_dir = light_src[4].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[4].diffuse * dot_product) + light_src[4].ambient) * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[4].specular_0) + (refl_value * light_src[4].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(20, clamp(light_src[4].dist_atten_scale * length(-view - light_src[4].position) + light_src[4].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[5].position + view);
|
|
spot_dir = light_src[5].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[5].diffuse * dot_product) + light_src[5].ambient) * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[5].specular_0) + (refl_value * light_src[5].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(21, clamp(light_src[5].dist_atten_scale * length(-view - light_src[5].position) + light_src[5].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[6].position + view);
|
|
spot_dir = light_src[6].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[6].diffuse * dot_product) + light_src[6].ambient) * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[6].specular_0) + (refl_value * light_src[6].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(22, clamp(light_src[6].dist_atten_scale * length(-view - light_src[6].position) + light_src[6].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (secondary_fragment_color.g);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((const_color[2].rgb) * (last_tex_env_out.aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (last_tex_env_out.aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((secondary_fragment_color.b) * (texcolor2.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.aaa) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - rounded_primary_color.a) - (const_color[4].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) - (last_tex_env_out.aaa), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (combiner_buffer.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 50AF1E10D2112536, 4499EB7743050700
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, 4499EB7743050700
|
|
// shader: 8B30, E35B8B33ACD72186
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 2.0 * (texcolor2).rgb - 1.0;
|
|
surface_normal.z = sqrt(max((1.0 - (surface_normal.x*surface_normal.x + surface_normal.y*surface_normal.y)), 0.0));
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = shadowTexture(texcoord0, texcoord0_w);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[0].diffuse * dot_product) + light_src[0].ambient) * 1.0 * shadow.rgb;
|
|
specular_sum.rgb += ((light_src[0].specular_0) + (refl_value * light_src[0].specular_1)) * clamp_highlights * 1.0 * shadow.rgb;
|
|
light_vector = normalize(light_src[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (refl_value * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[2].position + view);
|
|
spot_dir = light_src[2].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[2].diffuse * dot_product) + light_src[2].ambient) * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[2].specular_0) + (refl_value * light_src[2].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(18, clamp(light_src[2].dist_atten_scale * length(-view - light_src[2].position) + light_src[2].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
light_vector = normalize(light_src[3].position + view);
|
|
spot_dir = light_src[3].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = (lut_scale_rr * LookupLightingLUTUnsigned(6, max(dot(light_vector, normal), 0.0)));
|
|
refl_value.g = (lut_scale_rg * LookupLightingLUTUnsigned(5, max(dot(normal, normalize(view)), 0.0)));
|
|
refl_value.b = (lut_scale_rb * LookupLightingLUTUnsigned(4, max(dot(normal, normalize(half_vector)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[3].diffuse * dot_product) + light_src[3].ambient) * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
specular_sum.rgb += ((light_src[3].specular_0) + (refl_value * light_src[3].specular_1)) * clamp_highlights * LookupLightingLUTUnsigned(19, clamp(light_src[3].dist_atten_scale * length(-view - light_src[3].position) + light_src[3].dist_atten_bias, 0.0, 1.0)) * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor1.rgb) * (secondary_fragment_color.rrr) + (last_tex_env_out.rgb) * (vec3(1.0) - (secondary_fragment_color.rrr)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (secondary_fragment_color.b);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
next_combiner_buffer.a = last_tex_env_out.a;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.aaa) * (const_color[2].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3, alpha_output_3);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_4 = byteround(clamp((combiner_buffer.rgb) * (primary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((const_color[5].rgb) * (const_color[5].aaa) + (last_tex_env_out.rgb) * (vec3(1.0) - (const_color[5].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 318505B379497B52, E35B8B33ACD72186
|
|
// program: 7B5C334FBC63BF67, A29BAEF5C1BA44F2, E35B8B33ACD72186
|
|
// reference: EE853262C039BCB4, 9E7AD459914932FF
|