mirror of
https://github.com/weihuoya/citra.git
synced 2026-01-25 04:18:23 +00:00
17578 lines
564 KiB
GLSL
17578 lines
564 KiB
GLSL
// shader: 8B31, AC1E05AC1AB5ABAD
|
|
|
|
#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 sub_1();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp15.x = dot_s(uniforms.f[4], vs_in_reg0);
|
|
reg_tmp15.y = dot_s(uniforms.f[5], vs_in_reg0);
|
|
reg_tmp15.z = dot_s(uniforms.f[6], vs_in_reg0);
|
|
reg_tmp15.w = dot_s(uniforms.f[7], vs_in_reg0);
|
|
reg_tmp14.z = (vs_in_reg0.zzzz).z;
|
|
reg_tmp15.z = (uniforms.f[93].xxxx).z;
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp14.z = (abs(reg_tmp14.zzzz)).z;
|
|
reg_tmp14.z = (uniforms.f[91].zzzz + reg_tmp14.zzzz).z;
|
|
reg_tmp14.x = (uniforms.f[91].xxxx).x;
|
|
conditional_code = notEqual(uniforms.f[93].xx, reg_tmp14.xz);
|
|
if (all(conditional_code)) {
|
|
sub_1();
|
|
}
|
|
vs_out_attr0.x = dot_s(uniforms.f[0], reg_tmp15);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1], reg_tmp15);
|
|
vs_out_attr0.z = dot_s(uniforms.f[2], reg_tmp15);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3], reg_tmp15);
|
|
vs_out_attr1 = vs_in_reg1;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp14.x = (uniforms.f[91].xxxx).x;
|
|
reg_tmp14.y = (-uniforms.f[91].yyyy + reg_tmp14.zzzz).y;
|
|
reg_tmp14.z = rcp_s(reg_tmp14.z);
|
|
reg_tmp14.z = (mul_s(reg_tmp14.yyyy, reg_tmp14.zzzz)).z;
|
|
reg_tmp15.x = (fma_s(reg_tmp14.xxxx, reg_tmp14.zzzz, reg_tmp15.xxxx)).x;
|
|
return false;
|
|
}
|
|
// reference: 9821948648D1E191, AC1E05AC1AB5ABAD
|
|
// 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, B35EFE43E319BB63
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
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: D4F4BEF94A19E284, B35EFE43E319BB63
|
|
// program: AC1E05AC1AB5ABAD, CBBC43C38774091B, B35EFE43E319BB63
|
|
// shader: 8B31, 4AC344BC6E622851
|
|
|
|
#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 exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp15.x = dot_s(uniforms.f[4], vs_in_reg0);
|
|
reg_tmp15.y = dot_s(uniforms.f[5], vs_in_reg0);
|
|
reg_tmp15.z = dot_s(uniforms.f[6], vs_in_reg0);
|
|
reg_tmp15.w = dot_s(uniforms.f[7], vs_in_reg0);
|
|
reg_tmp14.z = (vs_in_reg0.zzzz).z;
|
|
reg_tmp15.z = (uniforms.f[93].xxxx).z;
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp14.z = (abs(reg_tmp14.zzzz)).z;
|
|
reg_tmp14.z = (uniforms.f[91].zzzz + reg_tmp14.zzzz).z;
|
|
reg_tmp14.x = (uniforms.f[91].xxxx).x;
|
|
conditional_code = notEqual(uniforms.f[93].xx, reg_tmp14.xz);
|
|
if (all(conditional_code)) {
|
|
sub_1();
|
|
}
|
|
reg_tmp1.x = dot_s(uniforms.f[0], reg_tmp15);
|
|
reg_tmp1.y = dot_s(uniforms.f[1], reg_tmp15);
|
|
reg_tmp1.z = dot_s(uniforms.f[2], reg_tmp15);
|
|
reg_tmp1.w = dot_s(uniforms.f[3], reg_tmp15);
|
|
reg_tmp2.xy = (mul_s(uniforms.f[92].xyyy, -reg_tmp1.wwww)).xy;
|
|
conditional_code.x = reg_tmp1.xxxx.x < reg_tmp2.xyyy.x;
|
|
conditional_code.y = reg_tmp1.xxxx.y > reg_tmp2.xyyy.y;
|
|
if (all(conditional_code)) {
|
|
sub_2();
|
|
}
|
|
vs_out_attr0 = reg_tmp1;
|
|
vs_out_attr1 = vs_in_reg1;
|
|
vs_out_attr2 = vs_in_reg2;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp14.x = (uniforms.f[91].xxxx).x;
|
|
reg_tmp14.y = (-uniforms.f[91].yyyy + reg_tmp14.zzzz).y;
|
|
reg_tmp14.z = rcp_s(reg_tmp14.z);
|
|
reg_tmp14.z = (mul_s(reg_tmp14.yyyy, reg_tmp14.zzzz)).z;
|
|
reg_tmp15.x = (fma_s(reg_tmp14.xxxx, reg_tmp14.zzzz, reg_tmp15.xxxx)).x;
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp1.x = (-reg_tmp1.wwww).x;
|
|
return false;
|
|
}
|
|
// reference: 376506C196BDC838, 4AC344BC6E622851
|
|
// 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
|
|
// shader: 8B30, 7974F3663498993D
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
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: D4F4BEF91328FB4C, 7974F3663498993D
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 7974F3663498993D
|
|
// reference: 7931F9811548AE4A, 4AC344BC6E622851
|
|
// shader: 8B30, 9A4719A519F0D3B1
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: CE312E68D672CA48, 9A4719A519F0D3B1
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 9A4719A519F0D3B1
|
|
// shader: 8B30, F6B6F838D1CE558E
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
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 = (rounded_primary_color.rgb);
|
|
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;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 10807477763B8BAF, F6B6F838D1CE558E
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, F6B6F838D1CE558E
|
|
// shader: 8B30, 30B703594147E54C
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
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: D4F4BEF9E2FC3054, 30B703594147E54C
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 30B703594147E54C
|
|
// reference: D6756BC6CB2487E3, AC1E05AC1AB5ABAD
|
|
// shader: 8B30, 370761F478D5E560
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = (rounded_primary_color.rgb);
|
|
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;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2FC15C0D763B8BAF, 370761F478D5E560
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 370761F478D5E560
|
|
// shader: 8B30, 0803E1FD60D3E38E
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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: EBB596834A19E284, 0803E1FD60D3E38E
|
|
// program: AC1E05AC1AB5ABAD, CBBC43C38774091B, 0803E1FD60D3E38E
|
|
// reference: 887AAA0C83086634, 9A4719A519F0D3B1
|
|
// reference: 56CBF013234127D3, F6B6F838D1CE558E
|
|
// reference: 698AD869234127D3, 370761F478D5E560
|
|
// reference: 92BF3A9D46525730, 7974F3663498993D
|
|
// shader: 8B31, 4CE8EC673CE76DDE
|
|
|
|
#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 = 3) in vec4 vs_in_reg3;
|
|
|
|
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() {
|
|
address_registers.xy = ivec2(vs_in_reg3.xy);
|
|
reg_tmp1.w = dot_3(uniforms.f[10 + address_registers.x].xyz, vs_in_reg0.xyz);
|
|
reg_tmp3.w = dot_3(uniforms.f[10 + address_registers.y].xyz, vs_in_reg0.xyz);
|
|
reg_tmp1.xyz = (mul_s(-uniforms.f[10 + address_registers.x].zxyy, vs_in_reg0.yzxx)).xyz;
|
|
reg_tmp3.xyz = (mul_s(-uniforms.f[10 + address_registers.y].zxyy, vs_in_reg0.yzxx)).xyz;
|
|
reg_tmp1.xyz = (fma_s(vs_in_reg0.zxyy, uniforms.f[10 + address_registers.x].yzxx, reg_tmp1.xyzz)).xyz;
|
|
reg_tmp3.xyz = (fma_s(vs_in_reg0.zxyy, uniforms.f[10 + address_registers.y].yzxx, reg_tmp3.xyzz)).xyz;
|
|
reg_tmp1.xyz = (fma_s(vs_in_reg0.xyzz, uniforms.f[10 + address_registers.x].wwww, reg_tmp1)).xyz;
|
|
reg_tmp3.xyz = (fma_s(vs_in_reg0.xyzz, uniforms.f[10 + address_registers.y].wwww, reg_tmp3)).xyz;
|
|
reg_tmp0 = mul_s(uniforms.f[94].xxxx, vs_in_reg3);
|
|
reg_tmp14.w = dot_3(uniforms.f[10 + address_registers.x].xyz, -reg_tmp1.xyz);
|
|
reg_tmp15.w = dot_3(uniforms.f[10 + address_registers.y].xyz, -reg_tmp3.xyz);
|
|
reg_tmp14.xyz = (mul_s(uniforms.f[10 + address_registers.x].yzxx, reg_tmp1.zxyy)).xyz;
|
|
reg_tmp15.xyz = (mul_s(uniforms.f[10 + address_registers.y].yzxx, reg_tmp3.zxyy)).xyz;
|
|
reg_tmp14.xyz = (fma_s(-reg_tmp1.yzxx, uniforms.f[10 + address_registers.x].zxyy, reg_tmp14.xyzz)).xyz;
|
|
reg_tmp15.xyz = (fma_s(-reg_tmp3.yzxx, uniforms.f[10 + address_registers.y].zxyy, reg_tmp15.xyzz)).xyz;
|
|
reg_tmp14.xyz = (fma_s(reg_tmp1.xyzz, uniforms.f[10 + address_registers.x].wwww, reg_tmp14.xyzz)).xyz;
|
|
reg_tmp15.xyz = (fma_s(reg_tmp3.xyzz, uniforms.f[10 + address_registers.y].wwww, reg_tmp15.xyzz)).xyz;
|
|
reg_tmp14 = fma_s(reg_tmp1.wwww, uniforms.f[10 + address_registers.x], reg_tmp14);
|
|
reg_tmp15 = fma_s(reg_tmp3.wwww, uniforms.f[10 + address_registers.y], reg_tmp15);
|
|
reg_tmp14 = mul_s(uniforms.f[11 + address_registers.x].wwww, reg_tmp14);
|
|
reg_tmp15 = mul_s(uniforms.f[11 + address_registers.y].wwww, reg_tmp15);
|
|
reg_tmp14 = uniforms.f[11 + address_registers.x] + reg_tmp14;
|
|
reg_tmp15 = uniforms.f[11 + address_registers.y] + reg_tmp15;
|
|
reg_tmp14 = mul_s(reg_tmp14, reg_tmp0.zzzz);
|
|
reg_tmp14 = fma_s(reg_tmp15, reg_tmp0.wwww, reg_tmp14);
|
|
reg_tmp15.x = dot_s(vec4(reg_tmp14.xyz, 1.0), uniforms.f[0]);
|
|
reg_tmp15.y = dot_s(vec4(reg_tmp14.xyz, 1.0), uniforms.f[1]);
|
|
reg_tmp15.z = dot_s(vec4(reg_tmp14.xyz, 1.0), uniforms.f[2]);
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[86]);
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[87]);
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[88]);
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[89]);
|
|
return true;
|
|
}
|
|
// reference: B29D240EA2170139, 4CE8EC673CE76DDE
|
|
// 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
|
|
// reference: FCC9DB4E21E2674B, 4CE8EC673CE76DDE
|
|
// shader: 8B31, CABD7FF7677EC71E
|
|
|
|
#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;
|
|
|
|
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);
|
|
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() {
|
|
address_registers.xy = ivec2(vs_in_reg3.xy);
|
|
reg_tmp1.w = dot_3(uniforms.f[10 + address_registers.x].xyz, vs_in_reg0.xyz);
|
|
reg_tmp3.w = dot_3(uniforms.f[10 + address_registers.y].xyz, vs_in_reg0.xyz);
|
|
reg_tmp1.xyz = (mul_s(-uniforms.f[10 + address_registers.x].zxyy, vs_in_reg0.yzxx)).xyz;
|
|
reg_tmp3.xyz = (mul_s(-uniforms.f[10 + address_registers.y].zxyy, vs_in_reg0.yzxx)).xyz;
|
|
reg_tmp2 = uniforms.f[10 + address_registers.x];
|
|
reg_tmp1.xyz = (fma_s(vs_in_reg0.zxyy, uniforms.f[10 + address_registers.x].yzxx, reg_tmp1.xyzz)).xyz;
|
|
reg_tmp3.xyz = (fma_s(vs_in_reg0.zxyy, uniforms.f[10 + address_registers.y].yzxx, reg_tmp3.xyzz)).xyz;
|
|
reg_tmp2 = vec4(dot_s(uniforms.f[10 + address_registers.y], reg_tmp2));
|
|
reg_tmp1.xyz = (fma_s(vs_in_reg0.xyzz, uniforms.f[10 + address_registers.x].wwww, reg_tmp1)).xyz;
|
|
reg_tmp3.xyz = (fma_s(vs_in_reg0.xyzz, uniforms.f[10 + address_registers.y].wwww, reg_tmp3)).xyz;
|
|
reg_tmp0 = mul_s(uniforms.f[94].xxxx, vs_in_reg3);
|
|
conditional_code = lessThanEqual(uniforms.f[93].xx, reg_tmp2.xy);
|
|
reg_tmp13.w = dot_3(uniforms.f[10 + address_registers.x].xyz, -reg_tmp1.xyz);
|
|
reg_tmp14.w = dot_3(uniforms.f[10 + address_registers.y].xyz, -reg_tmp3.xyz);
|
|
reg_tmp15 = mul_s(uniforms.f[10 + address_registers.x], reg_tmp0.zzzz);
|
|
reg_tmp13.xyz = (mul_s(uniforms.f[10 + address_registers.x].yzxx, reg_tmp1.zxyy)).xyz;
|
|
reg_tmp14.xyz = (mul_s(uniforms.f[10 + address_registers.y].yzxx, reg_tmp3.zxyy)).xyz;
|
|
if (conditional_code.x) {
|
|
sub_1();
|
|
} else {
|
|
sub_2();
|
|
}
|
|
reg_tmp13.xyz = (fma_s(-reg_tmp1.yzxx, uniforms.f[10 + address_registers.x].zxyy, reg_tmp13.xyzz)).xyz;
|
|
reg_tmp14.xyz = (fma_s(-reg_tmp3.yzxx, uniforms.f[10 + address_registers.y].zxyy, reg_tmp14.xyzz)).xyz;
|
|
reg_tmp2 = vec4(dot_s(reg_tmp15, reg_tmp15));
|
|
vs_out_attr3 = vs_in_reg1.xyxy;
|
|
reg_tmp13.xyz = (fma_s(reg_tmp1.xyzz, uniforms.f[10 + address_registers.x].wwww, reg_tmp13.xyzz)).xyz;
|
|
reg_tmp14.xyz = (fma_s(reg_tmp3.xyzz, uniforms.f[10 + address_registers.y].wwww, reg_tmp14.xyzz)).xyz;
|
|
reg_tmp2 = vec4(rsq_s(reg_tmp2.x));
|
|
reg_tmp13 = fma_s(reg_tmp1.wwww, uniforms.f[10 + address_registers.x], reg_tmp13);
|
|
reg_tmp14 = fma_s(reg_tmp3.wwww, uniforms.f[10 + address_registers.y], reg_tmp14);
|
|
reg_tmp15 = mul_s(reg_tmp15, reg_tmp2.xxxx);
|
|
reg_tmp13 = mul_s(uniforms.f[11 + address_registers.x].wwww, reg_tmp13);
|
|
reg_tmp14 = mul_s(uniforms.f[11 + address_registers.y].wwww, reg_tmp14);
|
|
reg_tmp2.w = dot_3(reg_tmp15.xyz, -vs_in_reg2.xyz);
|
|
reg_tmp13 = uniforms.f[11 + address_registers.x] + reg_tmp13;
|
|
reg_tmp14 = uniforms.f[11 + address_registers.y] + reg_tmp14;
|
|
reg_tmp2.xyz = (mul_s(reg_tmp15.yzxx, vs_in_reg2.zxyy)).xyz;
|
|
reg_tmp13 = mul_s(reg_tmp13, reg_tmp0.zzzz);
|
|
reg_tmp13 = fma_s(reg_tmp14, reg_tmp0.wwww, reg_tmp13);
|
|
reg_tmp2.xyz = (fma_s(reg_tmp15.zxyy, -vs_in_reg2.yzxx, reg_tmp2.xyzz)).xyz;
|
|
reg_tmp14.x = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[0]);
|
|
reg_tmp14.y = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[1]);
|
|
reg_tmp14.z = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[2]);
|
|
reg_tmp2.xyz = (fma_s(reg_tmp15.wwww, vs_in_reg2.xyzz, reg_tmp2.xyzz)).xyz;
|
|
vs_out_attr2 = vs_in_reg1;
|
|
reg_tmp6 = fma_s(reg_tmp15, vs_in_reg2.wwww, reg_tmp2);
|
|
vs_out_attr4 = uniforms.f[90] + -reg_tmp14;
|
|
reg_tmp7.w = dot_3(uniforms.f[3].xyz, -reg_tmp6.xyz);
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp14.xyz, 1.0), uniforms.f[86]);
|
|
reg_tmp7.xyz = (mul_s(uniforms.f[3].yzxx, reg_tmp6.zxyy)).xyz;
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp14.xyz, 1.0), uniforms.f[87]);
|
|
reg_tmp7.xyz = (fma_s(-reg_tmp6.yzxx, uniforms.f[3].zxyy, reg_tmp7.xyzz)).xyz;
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp14.xyz, 1.0), uniforms.f[88]);
|
|
reg_tmp7.xyz = (fma_s(reg_tmp6.xyzz, uniforms.f[3].wwww, reg_tmp7.xyzz)).xyz;
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp14.xyz, 1.0), uniforms.f[89]);
|
|
vs_out_attr1 = fma_s(reg_tmp6.wwww, uniforms.f[3], reg_tmp7);
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp15 = fma_s(reg_tmp0.wwww, uniforms.f[10 + address_registers.y], reg_tmp15);
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp15 = fma_s(reg_tmp0.wwww, -uniforms.f[10 + address_registers.y], reg_tmp15);
|
|
return false;
|
|
}
|
|
// reference: E586DB637C92A987, CABD7FF7677EC71E
|
|
// shader: 8DD9, BCFD13684549D2B2
|
|
|
|
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[];
|
|
struct Vertex {
|
|
vec4 attributes[5];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(vtx.attributes[1].x, vtx.attributes[1].y, vtx.attributes[1].z, vtx.attributes[1].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(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[2].x, vtx.attributes[2].y);
|
|
texcoord1 = vec2(vtx.attributes[3].x, vtx.attributes[3].y);
|
|
|
|
texcoord0_w = vtx.attributes[2].z;
|
|
view = vec3(vtx.attributes[4].x, vtx.attributes[4].y, vtx.attributes[4].z);
|
|
texcoord2 = vec2(vtx.attributes[3].z, vtx.attributes[3].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[5](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0], vs_out_attr3[0], vs_out_attr4[0]);
|
|
prim_buffer[1].attributes = vec4[5](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1], vs_out_attr3[1], vs_out_attr4[1]);
|
|
prim_buffer[2].attributes = vec4[5](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2], vs_out_attr3[2], vs_out_attr4[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 4FE46847320F1EC0, BCFD13684549D2B2
|
|
// shader: 8B30, A453279F963EF650
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[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);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.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 += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) * geo_factor) + (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((primary_fragment_color.rgb) * (textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) + (secondary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((texcolor0.aaa) * (vec3(1.0) - const_color[2].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((vec3(1.0) - 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((textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) * (const_color[4].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((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;
|
|
|
|
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: 3C111F917CCF1C45, A453279F963EF650
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, A453279F963EF650
|
|
// shader: 8B30, 8FFF40937EB91414
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
|
|
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[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);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.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 += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) * geo_factor) + (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((primary_fragment_color.rgb) * (textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) + (secondary_fragment_color.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) + (vec3(1.0) - primary_fragment_color.aaa), 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) * (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((textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) * (const_color[4].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((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;
|
|
|
|
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: 8E74321337F25F17, 8FFF40937EB91414
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, 8FFF40937EB91414
|
|
// shader: 8B30, 7639F41487FD0FB0
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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[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);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.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 += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) * geo_factor) + (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((primary_fragment_color.rgb) * (textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) + (secondary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((vec3(1.0) - texcolor1.aaa) + (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((last_tex_env_out.rgb) * (combiner_buffer.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) * (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((textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) * (const_color[4].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((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;
|
|
|
|
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: 33BFCAC4F731C3E1, 7639F41487FD0FB0
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, 7639F41487FD0FB0
|
|
// shader: 8B30, B5DB15264CA222B6
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.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 += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) * geo_factor) + (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((primary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((texcolor0.ggg) + (const_color[1].rgb), vec3(1.0)) * (texcolor0.ggg), 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((secondary_fragment_color.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) * (const_color[3].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(min((vec3(1.0) - texcolor0.aaa) + (const_color[4].rgb), vec3(1.0)) * (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((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;
|
|
|
|
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: 200394BADB625EFC, B5DB15264CA222B6
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, B5DB15264CA222B6
|
|
// shader: 8B30, 0E48B126B5A1F0CD
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[1].position);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTSigned(3, dot(normal, normalize(view))));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTSigned(3, dot(normal, normalize(view))));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((((lut_scale_d0 * LookupLightingLUTSigned(0, dot(normal, normalize(half_vector)))) * light_src[1].specular_0) * geo_factor) + (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));
|
|
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(min((const_color[0].rgb) + (vec3(1.0) - primary_fragment_color.aaa), vec3(1.0)) * (primary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = (primary_fragment_color.rgb);
|
|
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((texcolor0.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) * (const_color[3].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;
|
|
|
|
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;
|
|
|
|
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: B0C0A4886738F0F8, 0E48B126B5A1F0CD
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, 0E48B126B5A1F0CD
|
|
// reference: C65F091EB15A4A64, 9A4719A519F0D3B1
|
|
// reference: DC9A998F74007B60, 7974F3663498993D
|
|
// reference: 27AF7B7B11130B83, 370761F478D5E560
|
|
// reference: C65F091EB0982053, 9A4719A519F0D3B1
|
|
// reference: 3C111F917D0D7672, A453279F963EF650
|
|
// reference: 8E74321336303520, 8FFF40937EB91414
|
|
// reference: 33BFCAC4F6F3A9D6, 7639F41487FD0FB0
|
|
// reference: 200394BADAA034CB, B5DB15264CA222B6
|
|
// reference: B0C0A48866FA9ACF, 0E48B126B5A1F0CD
|
|
// reference: DC9A998F75C21157, 7974F3663498993D
|
|
// reference: 27AF7B7B10D161B4, 370761F478D5E560
|
|
// reference: D4F4BEF94BDB88B3, B35EFE43E319BB63
|
|
// reference: CE312E68D7B0A07F, 9A4719A519F0D3B1
|
|
// reference: D4F4BEF912EA917B, 7974F3663498993D
|
|
// reference: 1080747777F9E198, F6B6F838D1CE558E
|
|
// reference: D4F4BEF9E33E5A63, 30B703594147E54C
|
|
// shader: 8B30, D098787893B2A669
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
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 = 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;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 10807477E33E5A63, D098787893B2A669
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, D098787893B2A669
|
|
// shader: 8B30, D64F785DB695D4B5
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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].rrr), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.ggg) * (const_color[1].ggg) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (rounded_primary_color.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((texcolor0.bbb) * (const_color[2].bbb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = (rounded_primary_color.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((texcolor0.rgb) * (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (rounded_primary_color.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 54B41806B55C92C5, D64F785DB695D4B5
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, D64F785DB695D4B5
|
|
// shader: 8B30, BE79C96A183B7C35
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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;
|
|
|
|
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: 713A998F458F323A, BE79C96A183B7C35
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, BE79C96A183B7C35
|
|
// reference: 22BB0D9EBE6F4383, 0803E1FD60D3E38E
|
|
// shader: 8B31, 940333C8A0C882B5
|
|
|
|
#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;
|
|
|
|
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);
|
|
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() {
|
|
address_registers.xy = ivec2(vs_in_reg3.xy);
|
|
reg_tmp0 = mul_s(uniforms.f[94].xxxx, vs_in_reg3);
|
|
reg_tmp13.x = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[10 + address_registers.x]);
|
|
reg_tmp13.y = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[11 + address_registers.x]);
|
|
reg_tmp13.z = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[12 + address_registers.x]);
|
|
reg_tmp14.x = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[10 + address_registers.y]);
|
|
reg_tmp14.y = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[11 + address_registers.y]);
|
|
reg_tmp14.z = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[12 + address_registers.y]);
|
|
vs_out_attr1 = mul_s(uniforms.f[94].xxxx, vs_in_reg2);
|
|
reg_tmp13 = mul_s(reg_tmp13, reg_tmp0.zzzz);
|
|
vs_out_attr3.x = dot_s(vec4(vs_in_reg1.xyyy.xyz, 1.0), uniforms.f[82]);
|
|
vs_out_attr3.y = dot_s(vec4(vs_in_reg1.xyyy.xyz, 1.0), uniforms.f[83]);
|
|
reg_tmp13 = fma_s(reg_tmp14, reg_tmp0.wwww, reg_tmp13);
|
|
vs_out_attr2.x = dot_s(vec4(vs_in_reg1.xyyy.xyz, 1.0), uniforms.f[79]);
|
|
vs_out_attr2.yzw = vec3(dot_s(vec4(vs_in_reg1.xyyy.xyz, 1.0), uniforms.f[80]));
|
|
vs_out_attr3.z = dot_s(vec4(vs_in_reg1.xyyy.xyz, 1.0), uniforms.f[84]);
|
|
vs_out_attr3.w = dot_s(vec4(vs_in_reg1.xyyy.xyz, 1.0), uniforms.f[85]);
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[86]);
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[87]);
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[88]);
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[89]);
|
|
return true;
|
|
}
|
|
// reference: D288B27F2FDD9723, 940333C8A0C882B5
|
|
// shader: 8DD9, 8C3EE1C6135E31E3
|
|
|
|
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[];
|
|
struct Vertex {
|
|
vec4 attributes[4];
|
|
};
|
|
|
|
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(vtx.attributes[3].x, vtx.attributes[3].y);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(vtx.attributes[3].z, vtx.attributes[3].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[4](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0], vs_out_attr3[0]);
|
|
prim_buffer[1].attributes = vec4[4](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1], vs_out_attr3[1]);
|
|
prim_buffer[2].attributes = vec4[4](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2], vs_out_attr3[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: FD61970B2C76F264, 8C3EE1C6135E31E3
|
|
// shader: 8B30, A65608349203942D
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
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 = (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;
|
|
|
|
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: 558BF1DF42EC023F, A65608349203942D
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, A65608349203942D
|
|
// reference: 9CDC4D3FAC28F151, 940333C8A0C882B5
|
|
// shader: 8B30, 1814F3193E26B890
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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((last_tex_env_out.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 * 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;
|
|
|
|
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: 91FF3B5142EC023F, 1814F3193E26B890
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 1814F3193E26B890
|
|
// shader: 8B30, 567B7A2E50172D64
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
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 = (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;
|
|
|
|
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: 558BF1DFC9AC7D4A, 567B7A2E50172D64
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 567B7A2E50172D64
|
|
// shader: 8B30, 24E125F765838BB2
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (light_src[0].specular_1)) * clamp_highlights * 1.0;
|
|
light_vector = normalize(light_src[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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((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 * 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;
|
|
|
|
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: 7E8AC2CDA50937BB, 24E125F765838BB2
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 24E125F765838BB2
|
|
// shader: 8B31, 6BC2ABEB69D37DBC
|
|
|
|
#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 sub_6();
|
|
bool sub_7();
|
|
bool sub_8();
|
|
bool sub_9();
|
|
bool sub_10();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp15 = mul_s(uniforms.f[95].zzzz, vs_in_reg3);
|
|
reg_tmp0.x = dot_s(vec4(vs_in_reg0.xyzz.xyz, 1.0), uniforms.f[0]);
|
|
reg_tmp0.y = dot_s(vec4(vs_in_reg0.xyzz.xyz, 1.0), uniforms.f[1]);
|
|
reg_tmp2.xyz = (mul_s(uniforms.f[3].yzxx, reg_tmp15.zxyy)).xyz;
|
|
reg_tmp0.z = dot_s(vec4(vs_in_reg0.xyzz.xyz, 1.0), uniforms.f[2]);
|
|
vs_out_attr2 = mul_s(uniforms.f[94].xxxx, vs_in_reg2);
|
|
reg_tmp2.w = dot_3(uniforms.f[3].xyz, -reg_tmp15.xyz);
|
|
if (uniforms.b[1]) {
|
|
sub_1();
|
|
} else {
|
|
sub_6();
|
|
}
|
|
vs_out_attr5 = uniforms.f[90] + -reg_tmp0;
|
|
vs_out_attr1 = fma_s(reg_tmp15.wwww, uniforms.f[3], reg_tmp2);
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
if (uniforms.b[4]) {
|
|
sub_2();
|
|
} else {
|
|
sub_5();
|
|
}
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[87]);
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[88]);
|
|
reg_tmp2.xyz = (fma_s(-reg_tmp15.yzxx, uniforms.f[3].zxyy, reg_tmp2.xyzz)).xyz;
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[89]);
|
|
vs_out_attr3.x = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[79]);
|
|
vs_out_attr3.y = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[80]);
|
|
reg_tmp2.xyz = (fma_s(reg_tmp15.xyzz, uniforms.f[3].wwww, reg_tmp2.xyzz)).xyz;
|
|
vs_out_attr3.zw = vec2(dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[81]));
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
if (uniforms.b[5]) {
|
|
sub_3();
|
|
} else {
|
|
sub_4();
|
|
}
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[86]);
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
vs_out_attr4 = mul_s(uniforms.f[95].yyyy, vs_in_reg1.zwzw);
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
vs_out_attr4 = mul_s(uniforms.f[95].yyyy, vs_in_reg1);
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
vs_out_attr4 = mul_s(uniforms.f[95].yyyy, vs_in_reg1.xyxy);
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[86]);
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
vs_out_attr3 = mul_s(uniforms.f[95].yyyy, vs_in_reg1);
|
|
if (uniforms.b[4]) {
|
|
sub_7();
|
|
} else {
|
|
sub_10();
|
|
}
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[86]);
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[87]);
|
|
reg_tmp2.xyz = (fma_s(reg_tmp15.xyzz, uniforms.f[3].wwww, reg_tmp2.xyzz)).xyz;
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[88]);
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp0.xyz, 1.0), uniforms.f[89]);
|
|
return false;
|
|
}
|
|
bool sub_7() {
|
|
if (uniforms.b[5]) {
|
|
sub_8();
|
|
} else {
|
|
sub_9();
|
|
}
|
|
reg_tmp2.xyz = (fma_s(-reg_tmp15.yzxx, uniforms.f[3].zxyy, reg_tmp2.xyzz)).xyz;
|
|
return false;
|
|
}
|
|
bool sub_8() {
|
|
vs_out_attr4 = mul_s(uniforms.f[95].yyyy, vs_in_reg1.zwzw);
|
|
return false;
|
|
}
|
|
bool sub_9() {
|
|
vs_out_attr4 = mul_s(uniforms.f[95].yyyy, vs_in_reg1);
|
|
return false;
|
|
}
|
|
bool sub_10() {
|
|
reg_tmp2.xyz = (fma_s(-reg_tmp15.yzxx, uniforms.f[3].zxyy, reg_tmp2.xyzz)).xyz;
|
|
vs_out_attr4 = mul_s(uniforms.f[95].yyyy, vs_in_reg1.xyxy);
|
|
return false;
|
|
}
|
|
// reference: CF3A6BEBD2098CB1, 6BC2ABEB69D37DBC
|
|
// shader: 8DD9, 91A2A4284D9D0125
|
|
|
|
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[1].x, vtx.attributes[1].y, vtx.attributes[1].z, vtx.attributes[1].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[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[3].x, vtx.attributes[3].y);
|
|
texcoord1 = vec2(vtx.attributes[4].x, vtx.attributes[4].y);
|
|
|
|
texcoord0_w = vtx.attributes[3].z;
|
|
view = vec3(vtx.attributes[5].x, vtx.attributes[5].y, vtx.attributes[5].z);
|
|
texcoord2 = vec2(vtx.attributes[4].z, vtx.attributes[4].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: EDDDC23AE7F85894, 91A2A4284D9D0125
|
|
// shader: 8B30, A94E0AFE11430C03
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (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 = byteround(clamp((texcolor0.rgb) * (rounded_primary_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (const_color[2].rgb), vec3(1.0)) * (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;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) * (texcolor0.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;
|
|
|
|
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: 75BD325F02465EED, A94E0AFE11430C03
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, A94E0AFE11430C03
|
|
// shader: 8B30, 35F64DD418C43AE8
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTSigned(0, dot(normal, normalize(half_vector)))) * light_src[0].specular_0) + (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 = byteround(clamp((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor0.rgb) + (secondary_fragment_color.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(min((last_tex_env_out.rgb) + (const_color[3].rgb), vec3(1.0)) * (last_tex_env_out.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) * (const_color[4].rgb) + (secondary_fragment_color.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;
|
|
|
|
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: BE777BFC8DF6D90E, 35F64DD418C43AE8
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 35F64DD418C43AE8
|
|
// shader: 8B30, 7C5E11B0D08F71E7
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (rounded_primary_color.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((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor1.rgb) + (secondary_fragment_color.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) * (const_color[3].rgb) + (last_tex_env_out.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[4].rgb), vec3(1.0)) * (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;
|
|
|
|
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: EB55C8225869955C, 7C5E11B0D08F71E7
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 7C5E11B0D08F71E7
|
|
// shader: 8B30, C5F9704A41D985AA
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTSigned(0, dot(normal, normalize(half_vector)))) * light_src[0].specular_0) + (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 = byteround(clamp((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
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 = (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;
|
|
|
|
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: EF0A1DD889093FE0, C5F9704A41D985AA
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, C5F9704A41D985AA
|
|
// shader: 8B30, 5BFFB4E7C22168B0
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTSigned(0, dot(normal, normalize(half_vector)))) * light_src[0].specular_0) + (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 = byteround(clamp((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (const_color[2].rgb), vec3(1.0)) * (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;
|
|
|
|
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: 23A11B00C69CC665, 5BFFB4E7C22168B0
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 5BFFB4E7C22168B0
|
|
// shader: 8B30, 2288F3BC2137A8B1
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb) + (texcolor1.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[3].rgb), vec3(1.0)) * (last_tex_env_out.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;
|
|
|
|
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: 86A8F9BE6DDEE38B, 2288F3BC2137A8B1
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 2288F3BC2137A8B1
|
|
// shader: 8B30, 7A001056D544A63A
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (rounded_primary_color.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 1.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(min((last_tex_env_out.rgb) + (texcolor1.rgb), vec3(1.0)) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_2 = byteround(clamp((last_tex_env_out.a) * (rounded_primary_color.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[3].rgb), vec3(1.0)) * (last_tex_env_out.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;
|
|
|
|
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: B43CAA7790CBD27A, 7A001056D544A63A
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 7A001056D544A63A
|
|
// shader: 8B30, 231341ADE983B0EF
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (texcolor1.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;
|
|
|
|
vec3 color_output_3 = byteround(clamp((last_tex_env_out.rgb) + (secondary_fragment_color.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[4].rgb), vec3(1.0)) * (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;
|
|
|
|
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: 0096F541545B8E7B, 231341ADE983B0EF
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 231341ADE983B0EF
|
|
// shader: 8B30, 165FC9AA441D1A81
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (rounded_primary_color.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((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (const_color[2].rgb), vec3(1.0)) * (texcolor1.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) + (secondary_fragment_color.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[4].rgb), vec3(1.0)) * (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;
|
|
|
|
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: 0096F5417C038DC3, 165FC9AA441D1A81
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 165FC9AA441D1A81
|
|
// shader: 8B30, 96CD7DCF818F673D
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp(min((last_tex_env_out.rgb) + (secondary_fragment_color.rgb), vec3(1.0)) * (rounded_primary_color.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(min((last_tex_env_out.rgb) + (const_color[3].rgb), vec3(1.0)) * (texcolor1.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[4].rgb), vec3(1.0)) * (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;
|
|
|
|
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: CD9ED5AD82E23BF3, 96CD7DCF818F673D
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 96CD7DCF818F673D
|
|
// shader: 8B30, 6A1BB71D3D0E9148
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor1.rgb) + (secondary_fragment_color.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(min((last_tex_env_out.rgb) + (const_color[3].rgb), vec3(1.0)) * (texcolor1.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[4].rgb), vec3(1.0)) * (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;
|
|
|
|
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: D40BB57645D5EBA4, 6A1BB71D3D0E9148
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 6A1BB71D3D0E9148
|
|
// reference: C9567B3216911C46, 7C5E11B0D08F71E7
|
|
// reference: EB55C82216911C46, 7C5E11B0D08F71E7
|
|
// shader: 8B30, 6EFFB7CE13972D01
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTSigned(0, dot(normal, normalize(half_vector)))) * light_src[0].specular_0) + (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 = 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 * 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((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
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 = (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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[3].rgb), vec3(1.0)) * (last_tex_env_out.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 49138ED1874F59BC, 6EFFB7CE13972D01
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 6EFFB7CE13972D01
|
|
// shader: 8B30, 30F59EF34F255F55
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = 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 * 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((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
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 = (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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[3].rgb), vec3(1.0)) * (last_tex_env_out.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 19A0E40D3AEADCDF, 30F59EF34F255F55
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 30F59EF34F255F55
|
|
// shader: 8B30, 30C0BDB7C999CA5D
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor1.rgb) + (secondary_fragment_color.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) * (const_color[3].rgb) + (last_tex_env_out.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(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[4].rgb), vec3(1.0)) * (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;
|
|
|
|
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: EB55C822E37590C3, 30C0BDB7C999CA5D
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 30C0BDB7C999CA5D
|
|
// shader: 8B30, 2C5AAADC3943A339
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor1.rgb) + (secondary_fragment_color.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) * (const_color[3].rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_3 * 2.0, alpha_output_3 * 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_4 = byteround(clamp(min((shadowTexture(texcoord0, texcoord0_w).rgb) + (const_color[4].rgb), vec3(1.0)) * (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;
|
|
|
|
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: EB55C8220021AB23, 2C5AAADC3943A339
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 2C5AAADC3943A339
|
|
// shader: 8B31, CBBEE036EBC5C5CD
|
|
|
|
#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 exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp15.x = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[0]);
|
|
reg_tmp15.y = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[1]);
|
|
reg_tmp15.z = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[2]);
|
|
vs_out_attr1 = vs_in_reg1;
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[86]);
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[87]);
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[88]);
|
|
vs_out_attr2 = vs_in_reg2.xyyy;
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[89]);
|
|
return true;
|
|
}
|
|
// reference: 7931F98138FA2D72, CBBEE036EBC5C5CD
|
|
// shader: 8B30, 7545061F2AD2E2E2
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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: AA3FAD15334F86DA, 7545061F2AD2E2E2
|
|
// program: CBBEE036EBC5C5CD, 219384019281D7FD, 7545061F2AD2E2E2
|
|
// reference: 9DBA831B40E859F5, D64F785DB695D4B5
|
|
// reference: F9BE39045C35D8D1, BE79C96A183B7C35
|
|
// shader: 8B30, 35B6A52B3D768E86
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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;
|
|
|
|
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: 3DCAF38A0F307BB8, 35B6A52B3D768E86
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 35B6A52B3D768E86
|
|
// shader: 8B30, C14170987499741F
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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.aaa) + (rounded_primary_color.rgb) * (vec3(1.0) - (rounded_primary_color.aaa)), 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;
|
|
|
|
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: 3879FF150F307BB8, C14170987499741F
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, C14170987499741F
|
|
// shader: 8B30, B8AE6BC68B244DDA
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
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: E37BA9952CA2733F, B8AE6BC68B244DDA
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, B8AE6BC68B244DDA
|
|
// reference: AA3FAD15A7D5A968, 0803E1FD60D3E38E
|
|
// shader: 8B30, 5779A24412A1FEDC
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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: AA3FAD150F307BB8, 5779A24412A1FEDC
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 5779A24412A1FEDC
|
|
// reference: 8FBB15FE3BBE81A4, 9A4719A519F0D3B1
|
|
// reference: 6E4B679B9BF7C043, 370761F478D5E560
|
|
// shader: 8B30, 8C3FC0D439811C7F
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (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));
|
|
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) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
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 = (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;
|
|
|
|
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: E0EDB721AD153333, 8C3FC0D439811C7F
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 8C3FC0D439811C7F
|
|
// shader: 8B30, 02E4FC843CD44F4F
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (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));
|
|
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) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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((last_tex_env_out.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 * 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;
|
|
|
|
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: 24997DAFAD153333, 02E4FC843CD44F4F
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 02E4FC843CD44F4F
|
|
// shader: 8B30, D819F6645F9EDCFD
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (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));
|
|
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) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
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 = (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;
|
|
|
|
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: E0EDB72126554C46, D819F6645F9EDCFD
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, D819F6645F9EDCFD
|
|
// shader: 8B30, 630E8F86E494C6DB
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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) + (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));
|
|
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) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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((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 * 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;
|
|
|
|
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: CBEC84334AF006B7, 630E8F86E494C6DB
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 630E8F86E494C6DB
|
|
// shader: 8B31, E47A25CAEDE18CE0
|
|
|
|
#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 exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
address_registers.xy = ivec2(vs_in_reg4.xy);
|
|
reg_tmp0 = mul_s(uniforms.f[94].xxxx, vs_in_reg4);
|
|
reg_tmp8.x = dot_3(uniforms.f[10 + address_registers.x].xyz, vs_in_reg1.xyz);
|
|
reg_tmp8.y = dot_3(uniforms.f[11 + address_registers.x].xyz, vs_in_reg1.xyz);
|
|
reg_tmp8.z = dot_3(uniforms.f[12 + address_registers.x].xyz, vs_in_reg1.xyz);
|
|
reg_tmp9.x = dot_3(uniforms.f[10 + address_registers.y].xyz, vs_in_reg1.xyz);
|
|
reg_tmp9.y = dot_3(uniforms.f[11 + address_registers.y].xyz, vs_in_reg1.xyz);
|
|
reg_tmp9.z = dot_3(uniforms.f[12 + address_registers.y].xyz, vs_in_reg1.xyz);
|
|
reg_tmp13.x = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[10 + address_registers.x]);
|
|
reg_tmp8 = mul_s(reg_tmp8, reg_tmp0.zzzz);
|
|
reg_tmp13.y = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[11 + address_registers.x]);
|
|
reg_tmp13.z = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[12 + address_registers.x]);
|
|
reg_tmp8 = fma_s(reg_tmp9, reg_tmp0.wwww, reg_tmp8);
|
|
reg_tmp14.x = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[10 + address_registers.y]);
|
|
reg_tmp14.y = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[11 + address_registers.y]);
|
|
reg_tmp14.z = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[12 + address_registers.y]);
|
|
reg_tmp13 = mul_s(reg_tmp13, reg_tmp0.zzzz);
|
|
reg_tmp2.x = dot_3(reg_tmp8.xyz, reg_tmp8.xyz);
|
|
vs_out_attr3.x = dot_s(vec4(vs_in_reg3.xyyy.xyz, 1.0), uniforms.f[82]);
|
|
vs_out_attr3.y = dot_s(vec4(vs_in_reg3.xyyy.xyz, 1.0), uniforms.f[83]);
|
|
reg_tmp13 = fma_s(reg_tmp14, reg_tmp0.wwww, reg_tmp13);
|
|
vs_out_attr2.x = dot_s(vec4(vs_in_reg3.xyyy.xyz, 1.0), uniforms.f[79]);
|
|
reg_tmp2.x = rsq_s(reg_tmp2.x);
|
|
vs_out_attr2.yzw = vec3(dot_s(vec4(vs_in_reg3.xyyy.xyz, 1.0), uniforms.f[80]));
|
|
vs_out_attr3.z = dot_s(vec4(vs_in_reg3.xyyy.xyz, 1.0), uniforms.f[84]);
|
|
vs_out_attr3.w = dot_s(vec4(vs_in_reg3.xyyy.xyz, 1.0), uniforms.f[85]);
|
|
reg_tmp8 = mul_s(reg_tmp8, reg_tmp2.xxxx);
|
|
vs_out_attr4 = uniforms.f[90] + -reg_tmp13;
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[86]);
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[87]);
|
|
conditional_code = equal(-uniforms.f[93].yy, reg_tmp8.zz);
|
|
reg_tmp4 = uniforms.f[93].yyyy + reg_tmp8.zzzz;
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[88]);
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp13.xyz, 1.0), uniforms.f[89]);
|
|
reg_tmp4 = mul_s(uniforms.f[93].wwww, reg_tmp4);
|
|
reg_tmp15 = uniforms.f[93].yxxx;
|
|
vs_out_attr1 = mul_s(uniforms.f[94].xxxx, vs_in_reg2);
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[93].wwww, reg_tmp8);
|
|
if (!conditional_code.x) {
|
|
sub_1();
|
|
}
|
|
vs_out_attr5 = reg_tmp15;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp15.z = rcp_s(reg_tmp4.x);
|
|
reg_tmp15.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
return false;
|
|
}
|
|
// reference: 04AC4A54BC20340C, E47A25CAEDE18CE0
|
|
// shader: 8DD9, 4B59102A98868B38
|
|
|
|
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[5].x, vtx.attributes[5].y, vtx.attributes[5].z, vtx.attributes[5].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[2].x, vtx.attributes[2].y);
|
|
texcoord1 = vec2(vtx.attributes[3].x, vtx.attributes[3].y);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(vtx.attributes[4].x, vtx.attributes[4].y, vtx.attributes[4].z);
|
|
texcoord2 = vec2(vtx.attributes[3].z, vtx.attributes[3].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: 1145DC3262254B61, 4B59102A98868B38
|
|
// shader: 8B30, 224324BE8AA9D348
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb) + (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor1.rgb) + (secondary_fragment_color.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) * (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: 437E63A79493C2AD, 224324BE8AA9D348
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 224324BE8AA9D348
|
|
// shader: 8B30, B9821BE4ED10E3CE
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((rounded_primary_color.rgb) * (texcolor1.rgb) + (const_color[0].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) * (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 * 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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_color.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;
|
|
|
|
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: F01EB4E9836EDA4C, B9821BE4ED10E3CE
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, B9821BE4ED10E3CE
|
|
// shader: 8B30, F90BF3D91D4758FD
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((texcolor1.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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 * 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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor1.rgb) + (secondary_fragment_color.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) * (const_color[3].rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = byteround(clamp((const_color[3].a) * (last_tex_env_out.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: 0B40F97101E0BB80, F90BF3D91D4758FD
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, F90BF3D91D4758FD
|
|
// shader: 8B30, 5F8CD5FE885BCA84
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.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), 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) * (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;
|
|
|
|
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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 8BB95A96D147F6BB, 5F8CD5FE885BCA84
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 5F8CD5FE885BCA84
|
|
// reference: D9F8E8720B00B6F0, 7545061F2AD2E2E2
|
|
// reference: 8A797C63647AE8FB, BE79C96A183B7C35
|
|
// reference: 4E0DB6ED377F4B92, 35B6A52B3D768E86
|
|
// reference: 4BBEBA72377F4B92, C14170987499741F
|
|
// reference: 90BCECF214ED4315, B8AE6BC68B244DDA
|
|
// shader: 8B30, 6562A6B303FBEFF1
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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;
|
|
|
|
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;
|
|
|
|
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: 4E0DB6ED766FB467, 6562A6B303FBEFF1
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 6562A6B303FBEFF1
|
|
// reference: D9F8E8729F9A9942, 0803E1FD60D3E38E
|
|
// reference: D9F8E872377F4B92, 5779A24412A1FEDC
|
|
// reference: FC7C509903F1B18E, 9A4719A519F0D3B1
|
|
// reference: 1D8C22FCA3B8F069, 370761F478D5E560
|
|
// reference: 067EAF3B17272EE5, 7545061F2AD2E2E2
|
|
// reference: 55FF3B2A785D70EE, BE79C96A183B7C35
|
|
// reference: 918BF1A42B58D387, 35B6A52B3D768E86
|
|
// reference: 9438FD3B2B58D387, C14170987499741F
|
|
// reference: 4F3AABBB08CADB00, B8AE6BC68B244DDA
|
|
// reference: 918BF1A46A482C72, 6562A6B303FBEFF1
|
|
// reference: 067EAF3B83BD0157, 0803E1FD60D3E38E
|
|
// reference: 067EAF3B2B58D387, 5779A24412A1FEDC
|
|
// reference: 23FA17D01FD6299B, 9A4719A519F0D3B1
|
|
// reference: C20A65B5BF9F687C, 370761F478D5E560
|
|
// shader: 8B31, A9D268AF4B4A9C66
|
|
|
|
#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;
|
|
|
|
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);
|
|
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 exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
reg_tmp15.x = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[0]);
|
|
reg_tmp15.y = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[1]);
|
|
reg_tmp15.z = dot_s(vec4(vs_in_reg0.xyz, 1.0), uniforms.f[2]);
|
|
reg_tmp13.x = dot_3(uniforms.f[0].xyz, vs_in_reg2.xyz);
|
|
reg_tmp13.y = dot_3(uniforms.f[1].xyz, vs_in_reg2.xyz);
|
|
reg_tmp13.z = dot_3(uniforms.f[2].xyz, vs_in_reg2.xyz);
|
|
vs_out_attr1 = vs_in_reg1;
|
|
vs_out_attr0.x = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[86]);
|
|
vs_out_attr0.y = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[87]);
|
|
vs_out_attr0.z = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[88]);
|
|
reg_tmp0.x = dot_3(reg_tmp13.xyz, reg_tmp13.xyz);
|
|
vs_out_attr0.w = dot_s(vec4(reg_tmp15.xyz, 1.0), uniforms.f[89]);
|
|
vs_out_attr3 = uniforms.f[90] + -reg_tmp15;
|
|
vs_out_attr4 = vs_in_reg3.xyyy;
|
|
reg_tmp14 = uniforms.f[93].yxxx;
|
|
reg_tmp0.x = rsq_s(reg_tmp0.x);
|
|
reg_tmp13.xyz = (mul_s(reg_tmp13.xyzz, reg_tmp0.xxxx)).xyz;
|
|
conditional_code = equal(-uniforms.f[93].yy, reg_tmp13.zz);
|
|
if (!conditional_code.x) {
|
|
sub_1();
|
|
}
|
|
vs_out_attr2 = reg_tmp14;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp11 = uniforms.f[93].yyyy + reg_tmp13.zzzz;
|
|
reg_tmp11 = mul_s(uniforms.f[93].wwww, reg_tmp11);
|
|
reg_tmp11 = vec4(rsq_s(reg_tmp11.z));
|
|
reg_tmp12.xy = (mul_s(uniforms.f[93].wwww, reg_tmp13)).xy;
|
|
reg_tmp14.z = rcp_s(reg_tmp11.z);
|
|
reg_tmp14.xy = (mul_s(reg_tmp12.xyyy, reg_tmp11.xxxx)).xy;
|
|
return false;
|
|
}
|
|
// reference: E586DB63FBD2E89F, A9D268AF4B4A9C66
|
|
// shader: 8DD9, 238E382D0072C345
|
|
|
|
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[];
|
|
struct Vertex {
|
|
vec4 attributes[5];
|
|
};
|
|
|
|
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[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[4].x, vtx.attributes[4].y);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(vtx.attributes[3].x, vtx.attributes[3].y, vtx.attributes[3].z);
|
|
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[5](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0], vs_out_attr3[0], vs_out_attr4[0]);
|
|
prim_buffer[1].attributes = vec4[5](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1], vs_out_attr3[1], vs_out_attr4[1]);
|
|
prim_buffer[2].attributes = vec4[5](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2], vs_out_attr3[2], vs_out_attr4[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 7E424AC856749C8E, 238E382D0072C345
|
|
// shader: 8B30, 1F3CF8780CD39572
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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;
|
|
|
|
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: F1700612BB7357F3, 1F3CF8780CD39572
|
|
// program: A9D268AF4B4A9C66, 238E382D0072C345, 1F3CF8780CD39572
|
|
// reference: 3DCAF38A4E20844D, 6562A6B303FBEFF1
|
|
// shader: 8B30, 1C9E4DFDE7692E61
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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: AA3FAD155C35D8D1, 1C9E4DFDE7692E61
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 1C9E4DFDE7692E61
|
|
// reference: 067EAF3B785D70EE, 1C9E4DFDE7692E61
|
|
// shader: 8B30, E98844A9767F3156
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
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 = (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;
|
|
|
|
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: 94EB4DB4045E5302, E98844A9767F3156
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, E98844A9767F3156
|
|
// shader: 8B30, 8E071DD2D37C1643
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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((last_tex_env_out.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 * 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;
|
|
|
|
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: 509F873A045E5302, 8E071DD2D37C1643
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 8E071DD2D37C1643
|
|
// shader: 8B30, 41075A3770C2BEB6
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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;
|
|
|
|
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 = (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;
|
|
|
|
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: 94EB4DB48F1E2C77, 41075A3770C2BEB6
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 41075A3770C2BEB6
|
|
// shader: 8B30, 3DE6162D5E2667C7
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += (((light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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((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 * 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;
|
|
|
|
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: BFEA7EA6E3BB6686, 3DE6162D5E2667C7
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 3DE6162D5E2667C7
|
|
// shader: 8B30, 1F29A24E1EFD4DB7
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.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[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[7].specular_0) * geo_factor) + (light_src[7].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((primary_fragment_color.rgb) * (textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) + (secondary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((texcolor0.aaa) * (vec3(1.0) - const_color[2].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((vec3(1.0) - 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((textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) * (const_color[4].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((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;
|
|
|
|
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: 3C111F91A9236C53, 1F29A24E1EFD4DB7
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, 1F29A24E1EFD4DB7
|
|
// shader: 8B30, A87E2CAB5E616A45
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
|
|
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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.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[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[7].specular_0) * geo_factor) + (light_src[7].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((primary_fragment_color.rgb) * (textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) + (secondary_fragment_color.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) + (vec3(1.0) - primary_fragment_color.aaa), 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) * (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((textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) * (const_color[4].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((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;
|
|
|
|
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: 8E743213E21E2F01, A87E2CAB5E616A45
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, A87E2CAB5E616A45
|
|
// shader: 8B30, 3B579410BD1F3F14
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.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[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[7].specular_0) * geo_factor) + (light_src[7].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((primary_fragment_color.rgb) * (textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) + (secondary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((vec3(1.0) - texcolor1.aaa) + (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((last_tex_env_out.rgb) * (combiner_buffer.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) * (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((textureLod(tex2, texcoord1, getLod(texcoord1 * vec2(textureSize(tex2, 0)))).rgb) * (const_color[4].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((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;
|
|
|
|
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: 33BFCAC422DDB3F7, 3B579410BD1F3F14
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, 3B579410BD1F3F14
|
|
// shader: 8B30, E51A55B59EF71EFC
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[7].specular_0) * geo_factor) + (light_src[7].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((primary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((texcolor0.ggg) + (const_color[1].rgb), vec3(1.0)) * (texcolor0.ggg), 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((secondary_fragment_color.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) * (const_color[3].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(min((vec3(1.0) - texcolor0.aaa) + (const_color[4].rgb), vec3(1.0)) * (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((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;
|
|
|
|
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: 200394BA0E8E2EEA, E51A55B59EF71EFC
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, E51A55B59EF71EFC
|
|
// shader: 8B30, FD77385CCB9FC275
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.a = (lut_scale_fr * LookupLightingLUTSigned(3, dot(normal, normalize(view))));
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTSigned(3, dot(normal, normalize(view))));
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += ((((lut_scale_d0 * LookupLightingLUTSigned(0, dot(normal, normalize(half_vector)))) * light_src[7].specular_0) * geo_factor) + (light_src[7].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_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(min((const_color[0].rgb) + (vec3(1.0) - primary_fragment_color.aaa), vec3(1.0)) * (primary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = (primary_fragment_color.rgb);
|
|
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((texcolor0.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) * (const_color[3].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;
|
|
|
|
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;
|
|
|
|
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: B0C0A488B2D480EE, FD77385CCB9FC275
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, FD77385CCB9FC275
|
|
// shader: 8B30, 3E6D5EDB0E32411C
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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[7].position);
|
|
spot_dir = light_src[7].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
geo_factor = dot(half_vector, half_vector);
|
|
geo_factor = geo_factor == 0.0 ? 0.0 : min(dot_product / geo_factor, 1.0);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
diffuse_sum.rgb += ((light_src[7].diffuse * dot_product) + light_src[7].ambient) * 1.0;
|
|
specular_sum.rgb += ((((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[7].specular_0) * geo_factor) + (light_src[7].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((primary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((texcolor0.ggg) + (const_color[1].rgb), vec3(1.0)) * (texcolor0.ggg), 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((secondary_fragment_color.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) * (const_color[3].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;
|
|
|
|
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;
|
|
|
|
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: 19BAA0E056EF7AB5, 3E6D5EDB0E32411C
|
|
// program: CABD7FF7677EC71E, BCFD13684549D2B2, 3E6D5EDB0E32411C
|
|
// reference: C9F2D38DB7097399, 7545061F2AD2E2E2
|
|
// reference: C9F2D38DD8732D92, 1C9E4DFDE7692E61
|
|
// reference: 9A73479CD8732D92, BE79C96A183B7C35
|
|
// reference: 5E078D128B768EFB, 35B6A52B3D768E86
|
|
// reference: 5BB4818D8B768EFB, C14170987499741F
|
|
// reference: 80B6D70DA8E4867C, B8AE6BC68B244DDA
|
|
// reference: C9F2D38D8B768EFB, 5779A24412A1FEDC
|
|
// reference: EC766B66BFF874E7, 9A4719A519F0D3B1
|
|
// reference: 0D8619031FB13500, 370761F478D5E560
|
|
// shader: 8B30, 10B4F62F985652EB
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 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);
|
|
refl_value.r = 1.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 += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_0) + (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 = byteround(clamp((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.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;
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
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: CC42EEA0BAB5F078, 10B4F62F985652EB
|
|
// program: 6BC2ABEB69D37DBC, 91A2A4284D9D0125, 10B4F62F985652EB
|
|
// reference: E6B9C008C6AB808A, 7974F3663498993D
|
|
// shader: 8B30, 34D2DFB61EF1C5FA
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = byteround(clamp((rounded_primary_color.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;
|
|
|
|
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;
|
|
|
|
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: 4E0DB6EDDED7F2FE, 34D2DFB61EF1C5FA
|
|
// program: AC1E05AC1AB5ABAD, CBBC43C38774091B, 34D2DFB61EF1C5FA
|
|
// shader: 8B30, 915BFAF2367A95BA
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = (rounded_primary_color.rgb);
|
|
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;
|
|
|
|
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: 4E0DB6EDA3B8F069, 915BFAF2367A95BA
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 915BFAF2367A95BA
|
|
// shader: 8B30, 0D2C0CDC80018144
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
last_tex_env_out = vec4(color_output_0 * 2.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;
|
|
|
|
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) * (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;
|
|
|
|
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: A4A9EA2303724CD6, 0D2C0CDC80018144
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 0D2C0CDC80018144
|
|
// reference: 6B84566F1548AE4A, 4AC344BC6E622851
|
|
// reference: C4C0C428CB2487E3, AC1E05AC1AB5ABAD
|
|
// reference: EE7C74A021E2674B, 4CE8EC673CE76DDE
|
|
// reference: F733748D7C92A987, CABD7FF7677EC71E
|
|
// reference: 8E69E2D1AC28F151, 940333C8A0C882B5
|
|
// reference: DD8FC405D2098CB1, 6BC2ABEB69D37DBC
|
|
// reference: 6B84566F38FA2D72, CBBEE036EBC5C5CD
|
|
// reference: 1619E5BABC20340C, E47A25CAEDE18CE0
|
|
// reference: F733748DFBD2E89F, A9D268AF4B4A9C66
|
|
// shader: 8B30, 4500F8CBA236EA54
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = (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: 3504CC9CE876F49A, 4500F8CBA236EA54
|
|
// program: A9D268AF4B4A9C66, 238E382D0072C345, 4500F8CBA236EA54
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 7545061F2AD2E2E2
|
|
// shader: 8B30, 8A7B64C96E414CF3
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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;
|
|
|
|
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: 8A797C630B00B6F0, 8A7B64C96E414CF3
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, 8A7B64C96E414CF3
|
|
// shader: 8B30, E2336507D115048F
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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;
|
|
|
|
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: 8A797C63377F4B92, E2336507D115048F
|
|
// program: 4AC344BC6E622851, 219384019281D7FD, E2336507D115048F
|
|
// reference: 5E078D1262DE3797, 34D2DFB61EF1C5FA
|
|
// reference: 5E078D121FB13500, 915BFAF2367A95BA
|
|
// reference: 9A73479C8B768EFB, E2336507D115048F
|
|
// reference: F6B3FBF77AA245E3, 7974F3663498993D
|
|
// reference: 97DD4B60C50C5D3D, 7545061F2AD2E2E2
|
|
// reference: C45CDF71AA760336, BE79C96A183B7C35
|
|
// reference: 002815FF10DB1933, 34D2DFB61EF1C5FA
|
|
// reference: 002815FF6DB41BA4, 915BFAF2367A95BA
|
|
// reference: 002815FFF973A05F, 35B6A52B3D768E86
|
|
// reference: 059B1960F973A05F, C14170987499741F
|
|
// reference: DE994FE0DAE1A8D8, B8AE6BC68B244DDA
|
|
// reference: 97DD4B60F973A05F, 5779A24412A1FEDC
|
|
// reference: B259F38BCDFD5A43, 9A4719A519F0D3B1
|
|
// reference: 53A981EE6DB41BA4, 370761F478D5E560
|
|
// reference: C45CDF71F973A05F, E2336507D115048F
|
|
// shader: 8B30, E8DE42F53A8F6D43
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
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) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor0.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;
|
|
|
|
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: AC4D1BAD662143F3, E8DE42F53A8F6D43
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, E8DE42F53A8F6D43
|
|
// shader: 8B30, 9D00FD53DE0AE4FB
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
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) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.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;
|
|
|
|
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;
|
|
|
|
vec3 color_output_4 = byteround(clamp(min((last_tex_env_out.rgb) + (texcolor1.rgb), vec3(1.0)) * (const_color[4].rgb), 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;
|
|
|
|
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: D29F2F3A0A03BF72, 9D00FD53DE0AE4FB
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 9D00FD53DE0AE4FB
|
|
// shader: 8B30, FF859E7CB65A9737
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.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) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.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;
|
|
|
|
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;
|
|
|
|
vec3 color_output_4 = byteround(clamp(min((last_tex_env_out.rgb) + (texcolor1.rgb), vec3(1.0)) * (const_color[4].rgb), 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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 456A71A53A0E9A25, FF859E7CB65A9737
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, FF859E7CB65A9737
|
|
// shader: 8B30, 94151A1D58B257A1
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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 * 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;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: BD3C8AF8D96A0C3E, 94151A1D58B257A1
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 94151A1D58B257A1
|
|
// shader: 8B30, 9C4117B9C0F36A06
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (primary_fragment_color.rgb) + (secondary_fragment_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;
|
|
|
|
vec3 color_output_2 = byteround(clamp((last_tex_env_out.rgb) * (texcolor0.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: FFCC8FBCD521A7B3, 9C4117B9C0F36A06
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 9C4117B9C0F36A06
|
|
// reference: BD83475094522833, BE79C96A183B7C35
|
|
// reference: 79F78DDE2EFF3236, 34D2DFB61EF1C5FA
|
|
// reference: 79F78DDE539030A1, 915BFAF2367A95BA
|
|
// reference: 79F78DDEC7578B5A, 35B6A52B3D768E86
|
|
// reference: 7C448141C7578B5A, C14170987499741F
|
|
// reference: A746D7C1E4C583DD, B8AE6BC68B244DDA
|
|
// reference: EE02D341C7578B5A, 5779A24412A1FEDC
|
|
// reference: CB866BAAF3D97146, 9A4719A519F0D3B1
|
|
// reference: 2A7619CF539030A1, 370761F478D5E560
|
|
// reference: C9F2D38D803E2002, 1C9E4DFDE7692E61
|
|
// program: A9D268AF4B4A9C66, 238E382D0072C345, 1C9E4DFDE7692E61
|
|
// shader: 8B30, 67B4F31684021479
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = (const_color[0].rgb);
|
|
float alpha_output_0 = byteround(clamp((texcolor0.r) * (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;
|
|
|
|
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: F1CB72FD19FFABCB, 67B4F31684021479
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 67B4F31684021479
|
|
// program: 940333C8A0C882B5, 8C3EE1C6135E31E3, 67B4F31684021479
|
|
// shader: 8B30, 5AB0911C44B56E92
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
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: E0EE30564BDFCE94, 5AB0911C44B56E92
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 5AB0911C44B56E92
|
|
// shader: 8B30, 9A7578D5BD5DE94B
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
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: 3E5F6A494BDFCE94, 9A7578D5BD5DE94B
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 9A7578D5BD5DE94B
|
|
// shader: 8B30, BA83D9C2BD5DE94B
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 2.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
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: 3E5F6A49BE3B4211, BA83D9C2BD5DE94B
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, BA83D9C2BD5DE94B
|
|
// shader: 8B30, C7431134887C9728
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
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: 3E5F6A49DF18756F, C7431134887C9728
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, C7431134887C9728
|
|
// reference: EE02D341FB287638, 7545061F2AD2E2E2
|
|
// reference: BD834750FB287638, 8A7B64C96E414CF3
|
|
// shader: 8B30, 546C74A431B2122D
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = 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;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 0D8619038B768EFB, 546C74A431B2122D
|
|
// program: CBBEE036EBC5C5CD, 219384019281D7FD, 546C74A431B2122D
|
|
// shader: 8B30, 1D1D77C029E2FD04
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 6D5332480527478E, 1D1D77C029E2FD04
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 1D1D77C029E2FD04
|
|
// shader: 8B30, 2813669BAAB6A216
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: B3E268570527478E, 2813669BAAB6A216
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 2813669BAAB6A216
|
|
// shader: 8B30, A08E0CF2AAB6A216
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 2.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: B3E26857F0C3CB0B, A08E0CF2AAB6A216
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, A08E0CF2AAB6A216
|
|
// shader: 8B30, 0C953E62AA44E62F
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texcolor0.r), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0 * 1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.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 * 1.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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: B3E2685791E0FC75, 0C953E62AA44E62F
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 0C953E62AA44E62F
|
|
// reference: D143FB3B36834042, 7974F3663498993D
|
|
// reference: 054C51F6647AE8FB, BE79C96A183B7C35
|
|
// reference: 56CDC5E70B00B6F0, 7545061F2AD2E2E2
|
|
// reference: 054C51F60B00B6F0, 8A7B64C96E414CF3
|
|
// reference: C1389B78DED7F2FE, 34D2DFB61EF1C5FA
|
|
// reference: C1389B78A3B8F069, 915BFAF2367A95BA
|
|
// reference: C1389B78377F4B92, 35B6A52B3D768E86
|
|
// reference: C48B97E7377F4B92, C14170987499741F
|
|
// reference: 1F89C16714ED4315, B8AE6BC68B244DDA
|
|
// reference: 56CDC5E7377F4B92, 5779A24412A1FEDC
|
|
// reference: 73497D0C03F1B18E, 9A4719A519F0D3B1
|
|
// reference: 92B90F69A3B8F069, 370761F478D5E560
|
|
// shader: 8B30, 0D2C0CDC1AFB3250
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (rounded_primary_color.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((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) * (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;
|
|
|
|
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: A4A9EA238EBA9D5C, 0D2C0CDC1AFB3250
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 0D2C0CDC1AFB3250
|
|
// shader: 8B30, 8EC44935AE69341F
|
|
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);
|
|
if (!(gl_FragCoord.x >= float(scissor_x1) && gl_FragCoord.y >= float(scissor_y1) && gl_FragCoord.x < float(scissor_x2) && gl_FragCoord.y < float(scissor_y2))) discard;
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
depth /= gl_FragCoord.w;
|
|
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((rounded_primary_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
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;
|
|
|
|
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) * (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;
|
|
|
|
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: A4A9EA237B5E11D9, 8EC44935AE69341F
|
|
// program: E47A25CAEDE18CE0, 4B59102A98868B38, 8EC44935AE69341F
|
|
// reference: 9A73479CB7097399, 8A7B64C96E414CF3
|