mirror of
https://github.com/weihuoya/citra.git
synced 2026-01-25 04:18:23 +00:00
15483 lines
474 KiB
GLSL
15483 lines
474 KiB
GLSL
// shader: 8B30, 828B17C8889F4FA8
|
|
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;
|
|
|
|
vec3 color_output_5 = (const_color[5].rgb);
|
|
float alpha_output_5 = (const_color[5].a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D4F4BEF94D2020B6, 828B17C8889F4FA8
|
|
// program: 0000000000000000, 0000000000000000, 828B17C8889F4FA8
|
|
// shader: 8B30, EE9D59D3D057292A
|
|
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 = (const_color[0].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;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D4F4BEF9ADE6A77E, EE9D59D3D057292A
|
|
// program: 0000000000000000, 0000000000000000, EE9D59D3D057292A
|
|
// shader: 8B30, F789075555A6DC0C
|
|
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((texcolor0.rrr) * (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0, 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].rgb) + (last_tex_env_out.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.bbb) * (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;
|
|
|
|
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: 3A146E84CBA07E21, F789075555A6DC0C
|
|
// program: 0000000000000000, 0000000000000000, F789075555A6DC0C
|
|
// 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: D4F4BEF91254EF14, B35EFE43E319BB63
|
|
// program: 0000000000000000, 0000000000000000, B35EFE43E319BB63
|
|
// shader: 8B30, DC12E218392F9BDB
|
|
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;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: D4F4BEF95606D6C7, DC12E218392F9BDB
|
|
// program: 0000000000000000, 0000000000000000, DC12E218392F9BDB
|
|
// reference: E6B9C008653FF6DA, 828B17C8889F4FA8
|
|
// reference: E6B9C00885F97112, EE9D59D3D057292A
|
|
// reference: 08591075E3BFA84D, F789075555A6DC0C
|
|
// reference: E6B9C0083A4B3978, B35EFE43E319BB63
|
|
// reference: E6B9C0087E1900AB, DC12E218392F9BDB
|
|
// shader: 8B31, 5967366291052A93
|
|
|
|
#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;
|
|
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_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_1() {
|
|
reg_tmp13.x = dot_s(uniforms.f[4], vs_in_reg0);
|
|
reg_tmp13.y = dot_s(uniforms.f[5], vs_in_reg0);
|
|
reg_tmp13.z = dot_s(uniforms.f[6], vs_in_reg0);
|
|
reg_tmp13.w = (uniforms.f[93].yyyy).w;
|
|
vs_out_attr2 = -reg_tmp13;
|
|
reg_tmp14.x = dot_3(uniforms.f[7].xyz, vs_in_reg1.xyz);
|
|
reg_tmp14.y = dot_3(uniforms.f[8].xyz, vs_in_reg1.xyz);
|
|
reg_tmp14.z = dot_3(uniforms.f[9].xyz, vs_in_reg1.xyz);
|
|
vs_out_attr0.x = dot_s(uniforms.f[0], reg_tmp13);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1], reg_tmp13);
|
|
vs_out_attr0.z = dot_s(uniforms.f[2], reg_tmp13);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3], reg_tmp13);
|
|
reg_tmp3.x = dot_3(reg_tmp14.xyz, reg_tmp14.xyz);
|
|
reg_tmp3.x = rsq_s(reg_tmp3.x);
|
|
reg_tmp14 = mul_s(reg_tmp14, reg_tmp3.xxxx);
|
|
reg_tmp4 = uniforms.f[93].yyyy + reg_tmp14.zzzz;
|
|
reg_tmp4 = mul_s(uniforms.f[94].zzzz, reg_tmp4);
|
|
conditional_code = greaterThanEqual(uniforms.f[93].xx, reg_tmp4.xx);
|
|
vs_out_attr1.w = (uniforms.f[93].xxxx).w;
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[94].zzzz, reg_tmp14);
|
|
if (!conditional_code.x) {
|
|
sub_2();
|
|
} else {
|
|
sub_3();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
vs_out_attr1.z = rcp_s(reg_tmp4.x);
|
|
vs_out_attr1.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
vs_out_attr1.xyz = (uniforms.f[93].yxxx).xyz;
|
|
return false;
|
|
}
|
|
bool sub_0() {
|
|
{
|
|
sub_1();
|
|
}
|
|
reg_tmp15.x = dot_s(uniforms.f[10], vs_in_reg2);
|
|
reg_tmp15.y = dot_s(uniforms.f[11], vs_in_reg2);
|
|
vs_out_attr3 = reg_tmp15.xyxy;
|
|
return true;
|
|
}
|
|
// reference: F1E8FC18214D9E17, 5967366291052A93
|
|
// shader: 8DD9, 0CB5B5B0F7196203
|
|
|
|
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(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[3].x, vtx.attributes[3].y);
|
|
texcoord1 = vec2(vtx.attributes[3].z, vtx.attributes[3].w);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(vtx.attributes[2].x, vtx.attributes[2].y, vtx.attributes[2].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[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: 1EA377C1D7B39071, 0CB5B5B0F7196203
|
|
// shader: 8B30, C857C65468DA7B4B
|
|
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 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = 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 = (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;
|
|
|
|
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;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2A12C6D0D961E2C0, C857C65468DA7B4B
|
|
// program: 5967366291052A93, 0CB5B5B0F7196203, C857C65468DA7B4B
|
|
// shader: 8B30, B0BF543E69958D08
|
|
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 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = 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 = (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;
|
|
|
|
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;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2A12C6D071843010, B0BF543E69958D08
|
|
// program: 5967366291052A93, 0CB5B5B0F7196203, B0BF543E69958D08
|
|
// shader: 8B31, 52F532DC13FDB976
|
|
|
|
#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() {
|
|
reg_tmp1.x = dot_s(uniforms.f[8], vs_in_reg0);
|
|
reg_tmp1.y = dot_s(uniforms.f[9], vs_in_reg0);
|
|
reg_tmp1.z = dot_s(uniforms.f[10], vs_in_reg0);
|
|
reg_tmp1.w = dot_s(uniforms.f[11], vs_in_reg0);
|
|
reg_tmp2.x = dot_s(uniforms.f[90], reg_tmp1);
|
|
reg_tmp2.y = dot_s(uniforms.f[91], reg_tmp1);
|
|
reg_tmp2.z = dot_s(uniforms.f[92], reg_tmp1);
|
|
reg_tmp2.w = dot_s(uniforms.f[93], reg_tmp1);
|
|
vs_out_attr0.x = dot_s(uniforms.f[86], reg_tmp2);
|
|
vs_out_attr0.y = dot_s(uniforms.f[87], reg_tmp2);
|
|
vs_out_attr0.z = dot_s(uniforms.f[88], reg_tmp2);
|
|
vs_out_attr0.w = dot_s(uniforms.f[89], reg_tmp2);
|
|
vs_out_attr1 = vs_in_reg1;
|
|
vs_out_attr2 = vs_in_reg2.xyyy;
|
|
vs_out_attr3 = vs_in_reg3.xyyy;
|
|
return true;
|
|
}
|
|
// reference: 1A30E0F44A218F2A, 52F532DC13FDB976
|
|
// shader: 8DD9, 13A54CCD8AA1DDA2
|
|
|
|
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(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[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: A55C6948CCF76B42, 13A54CCD8AA1DDA2
|
|
// shader: 8B30, 68CFCEC8317BD02C
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2584B8EB2DD9D3D0, 68CFCEC8317BD02C
|
|
// program: 52F532DC13FDB976, 13A54CCD8AA1DDA2, 68CFCEC8317BD02C
|
|
// shader: 8B30, D6CF77C4E705FFC9
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = 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 = (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;
|
|
|
|
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;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: C1A75053D961E2C0, D6CF77C4E705FFC9
|
|
// program: 5967366291052A93, 0CB5B5B0F7196203, D6CF77C4E705FFC9
|
|
// shader: 8B30, 7003E80548762ED7
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
clamp_highlights = sign(dot_product);
|
|
refl_value.r = 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 = (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;
|
|
|
|
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;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: C1A7505371843010, 7003E80548762ED7
|
|
// program: 5967366291052A93, 0CB5B5B0F7196203, 7003E80548762ED7
|
|
// shader: 8B30, 8086B9975CDCCB52
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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: 2584B8EBC16E38D3, 8086B9975CDCCB52
|
|
// program: 52F532DC13FDB976, 13A54CCD8AA1DDA2, 8086B9975CDCCB52
|
|
// shader: 8B30, 122AF7252C3959A4
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (rounded_primary_color.rgb);
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287AC16E38D3, 122AF7252C3959A4
|
|
// program: 52F532DC13FDB976, 13A54CCD8AA1DDA2, 122AF7252C3959A4
|
|
// reference: 54641FB4C9D4E958, 52F532DC13FDB976
|
|
// shader: 8B31, CC0DDD2223EBE363
|
|
|
|
#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_tmp1.x = dot_s(uniforms.f[4], vs_in_reg0);
|
|
reg_tmp1.y = dot_s(uniforms.f[5], vs_in_reg0);
|
|
reg_tmp1.z = dot_s(uniforms.f[6], vs_in_reg0);
|
|
reg_tmp1.w = dot_s(uniforms.f[7], vs_in_reg0);
|
|
vs_out_attr0.x = dot_s(uniforms.f[0], reg_tmp1);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1], reg_tmp1);
|
|
vs_out_attr0.z = dot_s(uniforms.f[2], reg_tmp1);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3], reg_tmp1);
|
|
vs_out_attr1 = vs_in_reg1.xyyy;
|
|
vs_out_attr2 = vs_in_reg2;
|
|
return true;
|
|
}
|
|
// reference: E4BB8487671A01C5, CC0DDD2223EBE363
|
|
// shader: 8DD9, 86F5543306698380
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
in vec4 vs_out_attr2[];
|
|
struct Vertex {
|
|
vec4 attributes[3];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(vtx.attributes[2].x, vtx.attributes[2].y, vtx.attributes[2].z, vtx.attributes[2].w);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[3](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0]);
|
|
prim_buffer[1].attributes = vec4[3](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1]);
|
|
prim_buffer[2].attributes = vec4[3](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: 5144ABDD19096853, 86F5543306698380
|
|
// program: CC0DDD2223EBE363, 86F5543306698380, 8086B9975CDCCB52
|
|
// shader: 8B31, FC7F4467554D34E5
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
out vec4 vs_out_attr2;
|
|
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 sub_3();
|
|
bool sub_4();
|
|
bool sub_5();
|
|
bool sub_6();
|
|
bool sub_7();
|
|
bool sub_8();
|
|
bool sub_9();
|
|
bool sub_10();
|
|
bool sub_11();
|
|
bool sub_12();
|
|
bool sub_13();
|
|
bool sub_14();
|
|
bool sub_15();
|
|
bool sub_16();
|
|
bool sub_17();
|
|
bool sub_18();
|
|
bool sub_19();
|
|
bool sub_20();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
address_registers.x = (ivec2(vs_in_reg0.xy)).x;
|
|
reg_tmp0 = uniforms.f[6 + address_registers.x].wzyx;
|
|
reg_tmp1.xy = (vs_in_reg0.zwzw).xy;
|
|
reg_tmp1.zw = (uniforms.f[5].xyxy).zw;
|
|
address_registers.xy = ivec2(reg_tmp0.xy);
|
|
reg_tmp2.xw = (uniforms.f[64 + address_registers.y].wwyy).xw;
|
|
reg_tmp2.yz = (uniforms.f[5].xxxx).yz;
|
|
reg_tmp4.x = dot_s(reg_tmp1, reg_tmp2);
|
|
reg_tmp2.yw = (uniforms.f[64 + address_registers.y].zzxx).yw;
|
|
reg_tmp2.xz = (uniforms.f[5].xxxx).xz;
|
|
reg_tmp4.y = dot_s(reg_tmp1, reg_tmp2);
|
|
reg_tmp4.zw = (reg_tmp1.zwzw).zw;
|
|
reg_tmp3.x = dot_s(uniforms.f[32 + address_registers.x].wzyx, reg_tmp4);
|
|
reg_tmp3.y = dot_s(uniforms.f[33 + address_registers.x].wzyx, reg_tmp4);
|
|
reg_tmp3.z = dot_s(uniforms.f[34 + address_registers.x].wzyx, reg_tmp4);
|
|
reg_tmp3.w = (reg_tmp1.wwww).w;
|
|
reg_tmp4.z = (uniforms.f[34 + address_registers.x].xxxx).z;
|
|
reg_tmp4.z = (abs(reg_tmp4.zzzz)).z;
|
|
reg_tmp4.z = (uniforms.f[4].yyyy + reg_tmp4.zzzz).z;
|
|
reg_tmp4.x = (uniforms.f[4].wwww).x;
|
|
conditional_code = notEqual(uniforms.f[5].xx, reg_tmp4.xz);
|
|
if (all(conditional_code)) {
|
|
sub_1();
|
|
}
|
|
vs_out_attr0.x = dot_s(uniforms.f[0].wzyx, reg_tmp3);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1].wzyx, reg_tmp3);
|
|
vs_out_attr0.z = dot_s(uniforms.f[2].wzyx, reg_tmp3);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3].wzyx, reg_tmp3);
|
|
conditional_code = greaterThanEqual(uniforms.f[5].yy, reg_tmp0.ww);
|
|
if (all(conditional_code)) {
|
|
sub_2();
|
|
} else {
|
|
sub_3();
|
|
}
|
|
conditional_code = notEqual(uniforms.f[5].xx, reg_tmp1.xy);
|
|
if (all(not(conditional_code))) {
|
|
sub_8();
|
|
}
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_9();
|
|
}
|
|
if (all(bvec2(!conditional_code.x, conditional_code.y))) {
|
|
sub_10();
|
|
}
|
|
if (all(conditional_code)) {
|
|
sub_11();
|
|
}
|
|
reg_tmp8 = uniforms.f[5].xxxx;
|
|
address_registers.z = int(uniforms.i[0].y);
|
|
for (uint loop64 = 0u; loop64 <= uniforms.i[0].x; address_registers.z += int(uniforms.i[0].z), ++loop64) {
|
|
sub_12();
|
|
}
|
|
vs_out_attr2 = reg_tmp5;
|
|
vs_out_attr3 = reg_tmp6;
|
|
vs_out_attr4 = reg_tmp7;
|
|
return true;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp4.x = (uniforms.f[4].wwww).x;
|
|
reg_tmp4.y = (-uniforms.f[4].zzzz + reg_tmp4.zzzz).y;
|
|
reg_tmp4.z = rcp_s(reg_tmp4.z);
|
|
reg_tmp4.z = (mul_s(reg_tmp4.yyyy, reg_tmp4.zzzz)).z;
|
|
reg_tmp3.x = (fma_s(reg_tmp4.xxxx, reg_tmp4.zzzz, reg_tmp3.xxxx)).x;
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
vs_out_attr1.xyz = (uniforms.f[5].yyyy).xyz;
|
|
vs_out_attr1.w = (reg_tmp0.wwww).w;
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
address_registers.y = (ivec2(reg_tmp0.ww)).y;
|
|
conditional_code = notEqual(uniforms.f[5].xx, reg_tmp1.xy);
|
|
if (all(not(conditional_code))) {
|
|
sub_4();
|
|
}
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_5();
|
|
}
|
|
if (all(bvec2(!conditional_code.x, conditional_code.y))) {
|
|
sub_6();
|
|
}
|
|
if (all(conditional_code)) {
|
|
sub_7();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
vs_out_attr1 = uniforms.f[32 + address_registers.y].wzyx;
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
vs_out_attr1 = uniforms.f[33 + address_registers.y].wzyx;
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
vs_out_attr1 = uniforms.f[34 + address_registers.y].wzyx;
|
|
return false;
|
|
}
|
|
bool sub_7() {
|
|
vs_out_attr1 = uniforms.f[35 + address_registers.y].wzyx;
|
|
return false;
|
|
}
|
|
bool sub_8() {
|
|
reg_tmp5 = uniforms.f[5].xyyy;
|
|
reg_tmp6 = uniforms.f[5].xyyy;
|
|
reg_tmp7 = uniforms.f[5].xyyy;
|
|
return false;
|
|
}
|
|
bool sub_9() {
|
|
reg_tmp5 = uniforms.f[5].yyyy;
|
|
reg_tmp6 = uniforms.f[5].yyyy;
|
|
reg_tmp7 = uniforms.f[5].yyyy;
|
|
return false;
|
|
}
|
|
bool sub_10() {
|
|
reg_tmp5 = uniforms.f[5].xxyy;
|
|
reg_tmp6 = uniforms.f[5].xxyy;
|
|
reg_tmp7 = uniforms.f[5].xxyy;
|
|
return false;
|
|
}
|
|
bool sub_11() {
|
|
reg_tmp5 = uniforms.f[5].yxyy;
|
|
reg_tmp6 = uniforms.f[5].yxyy;
|
|
reg_tmp7 = uniforms.f[5].yxyy;
|
|
return false;
|
|
}
|
|
bool sub_12() {
|
|
conditional_code = equal(uniforms.f[5].yy, reg_tmp8.xy);
|
|
if (all(conditional_code)) {
|
|
sub_13();
|
|
}
|
|
conditional_code = lessThan(uniforms.f[5].ww, reg_tmp8.xy);
|
|
if (all(conditional_code)) {
|
|
sub_18();
|
|
}
|
|
reg_tmp8 = uniforms.f[5].yyyy + reg_tmp8;
|
|
return false;
|
|
}
|
|
bool sub_13() {
|
|
address_registers.y = (ivec2(reg_tmp0.zz)).y;
|
|
conditional_code = notEqual(uniforms.f[5].xx, reg_tmp1.xy);
|
|
if (all(not(conditional_code))) {
|
|
sub_14();
|
|
}
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_15();
|
|
}
|
|
if (all(bvec2(!conditional_code.x, conditional_code.y))) {
|
|
sub_16();
|
|
}
|
|
if (all(conditional_code)) {
|
|
sub_17();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_14() {
|
|
reg_tmp5.xy = (uniforms.f[64 + address_registers.y].wzzz).xy;
|
|
reg_tmp6.xy = (uniforms.f[65 + address_registers.y].wzzz).xy;
|
|
reg_tmp7.xy = (uniforms.f[66 + address_registers.y].wzzz).xy;
|
|
return false;
|
|
}
|
|
bool sub_15() {
|
|
reg_tmp5.xy = (uniforms.f[64 + address_registers.y].yzzz).xy;
|
|
reg_tmp6.xy = (uniforms.f[65 + address_registers.y].yzzz).xy;
|
|
reg_tmp7.xy = (uniforms.f[66 + address_registers.y].yzzz).xy;
|
|
return false;
|
|
}
|
|
bool sub_16() {
|
|
reg_tmp5.xy = (uniforms.f[64 + address_registers.y].wxxx).xy;
|
|
reg_tmp6.xy = (uniforms.f[65 + address_registers.y].wxxx).xy;
|
|
reg_tmp7.xy = (uniforms.f[66 + address_registers.y].wxxx).xy;
|
|
return false;
|
|
}
|
|
bool sub_17() {
|
|
reg_tmp5.xy = (uniforms.f[64 + address_registers.y].yxxx).xy;
|
|
reg_tmp6.xy = (uniforms.f[65 + address_registers.y].yxxx).xy;
|
|
reg_tmp7.xy = (uniforms.f[66 + address_registers.y].yxxx).xy;
|
|
return false;
|
|
}
|
|
bool sub_18() {
|
|
conditional_code = notEqual(uniforms.f[5].xx, reg_tmp1.xy);
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_19();
|
|
}
|
|
if (all(bvec2(!conditional_code.x, conditional_code.y))) {
|
|
sub_20();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_19() {
|
|
reg_tmp5.xy = (uniforms.f[67 + address_registers.y].yxxx).xy;
|
|
reg_tmp6.xy = (uniforms.f[68 + address_registers.y].yxxx).xy;
|
|
reg_tmp7.xy = (uniforms.f[69 + address_registers.y].yxxx).xy;
|
|
return false;
|
|
}
|
|
bool sub_20() {
|
|
reg_tmp5.xy = (uniforms.f[67 + address_registers.y].wzzz).xy;
|
|
reg_tmp6.xy = (uniforms.f[68 + address_registers.y].wzzz).xy;
|
|
reg_tmp7.xy = (uniforms.f[69 + address_registers.y].wzzz).xy;
|
|
return false;
|
|
}
|
|
// reference: B382E5C3F31AC733, FC7F4467554D34E5
|
|
// shader: 8DD9, 1C4CBC8096EA16CD
|
|
|
|
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(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[4].x, vtx.attributes[4].y);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[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: 5DAD5699F59B3586, 1C4CBC8096EA16CD
|
|
// shader: 8B30, 17CED8BB32C3952B
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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;
|
|
|
|
vec3 color_output_3 = byteround(clamp((vec3(1.0) - texcolor0.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = byteround(clamp((texcolor0.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((texcolor0.rgb) * (const_color[4].rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - texcolor0.a) * (const_color[4].a) + (last_tex_env_out.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((rounded_primary_color.rgb) * (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((rounded_primary_color.a) * (last_tex_env_out.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: FBFB78E9E9676B03, 17CED8BB32C3952B
|
|
// program: FC7F4467554D34E5, 1C4CBC8096EA16CD, 17CED8BB32C3952B
|
|
// reference: AAEF7BC7E4EF67B7, CC0DDD2223EBE363
|
|
// shader: 8B31, 3CA7A851CA30C3C2
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
|
|
out vec4 vs_out_attr0;
|
|
out vec4 vs_out_attr1;
|
|
|
|
void main() {
|
|
vs_out_attr0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vs_out_attr1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
exec_shader();
|
|
}
|
|
bvec2 conditional_code = bvec2(false);
|
|
ivec3 address_registers = ivec3(0);
|
|
vec4 reg_tmp0 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp1 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp2 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp3 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp4 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp5 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp6 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp7 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp8 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp9 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp10 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp11 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp12 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp13 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp14 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 reg_tmp15 = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
bool sub_0();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
vs_out_attr1 = vs_in_reg1.xyyy;
|
|
reg_tmp0.x = dot_s(uniforms.f[4], vs_in_reg0);
|
|
reg_tmp0.y = dot_s(uniforms.f[5], vs_in_reg0);
|
|
reg_tmp0.z = dot_s(uniforms.f[6], vs_in_reg0);
|
|
reg_tmp0.w = dot_s(uniforms.f[7], vs_in_reg0);
|
|
vs_out_attr0.x = dot_s(uniforms.f[0], reg_tmp0);
|
|
vs_out_attr0.y = dot_s(uniforms.f[1], reg_tmp0);
|
|
vs_out_attr0.z = dot_s(uniforms.f[2], reg_tmp0);
|
|
vs_out_attr0.w = dot_s(uniforms.f[3], reg_tmp0);
|
|
return true;
|
|
}
|
|
// reference: E00F415C2F74EE9A, 3CA7A851CA30C3C2
|
|
// shader: 8DD9, 6B49BF5FD5349480
|
|
|
|
layout(triangles) in;
|
|
layout(triangle_strip, max_vertices = 3) out;
|
|
|
|
out vec4 primary_color;
|
|
out vec2 texcoord0;
|
|
out vec2 texcoord1;
|
|
out vec2 texcoord2;
|
|
out float texcoord0_w;
|
|
out vec4 normquat;
|
|
out vec3 view;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
in vec4 vs_out_attr0[];
|
|
in vec4 vs_out_attr1[];
|
|
struct Vertex {
|
|
vec4 attributes[2];
|
|
};
|
|
|
|
vec4 GetVertexQuaternion(Vertex vtx) {
|
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
void EmitVtx(Vertex vtx, bool quats_opposite) {
|
|
vec4 vtx_pos = vec4(vtx.attributes[0].x, vtx.attributes[0].y, vtx.attributes[0].z, vtx.attributes[0].w);
|
|
gl_Position = vtx_pos;
|
|
#if !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
gl_ClipDistance[0] = -vtx_pos.z;
|
|
gl_ClipDistance[1] = dot(clip_coef, vtx_pos);
|
|
#endif // !defined(CITRA_GLES) || defined(GL_EXT_clip_cull_distance)
|
|
|
|
vec4 vtx_quat = GetVertexQuaternion(vtx);
|
|
normquat = mix(vtx_quat, -vtx_quat, bvec4(quats_opposite));
|
|
|
|
vec4 vtx_color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[1].x, vtx.attributes[1].y);
|
|
texcoord1 = vec2(0.0, 0.0);
|
|
|
|
texcoord0_w = 0.0;
|
|
view = vec3(0.0, 0.0, 0.0);
|
|
texcoord2 = vec2(0.0, 0.0);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[2](vs_out_attr0[0], vs_out_attr1[0]);
|
|
prim_buffer[1].attributes = vec4[2](vs_out_attr0[1], vs_out_attr1[1]);
|
|
prim_buffer[2].attributes = vec4[2](vs_out_attr0[2], vs_out_attr1[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: E0A3E62E72D05152, 6B49BF5FD5349480
|
|
// shader: 8B30, A29CAA99F089D4EF
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (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;
|
|
|
|
vec3 color_output_2 = (texcolor0.rgb);
|
|
float alpha_output_2 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_2, alpha_output_2);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287A1B671334, A29CAA99F089D4EF
|
|
// program: 3CA7A851CA30C3C2, 6B49BF5FD5349480, A29CAA99F089D4EF
|
|
// shader: 8B31, 3A54D4180A96F052
|
|
|
|
#define mul_s(x, y) (x * y)
|
|
#define fma_s(x, y, z) fma(x, y, z)
|
|
#define rcp_s(x) (1.0 / x)
|
|
#define rsq_s(x) inversesqrt(x)
|
|
#define dot_s(x, y) dot(x, y)
|
|
#define dot_3(x, y) dot(x, y)
|
|
|
|
struct pica_uniforms {
|
|
bool b[16];
|
|
uvec4 i[4];
|
|
vec4 f[96];
|
|
};
|
|
|
|
bool exec_shader();
|
|
|
|
#define uniforms vs_uniforms
|
|
layout (std140) uniform vs_config {
|
|
pica_uniforms uniforms;
|
|
};
|
|
layout(location = 0) in vec4 vs_in_reg0;
|
|
layout(location = 1) in vec4 vs_in_reg1;
|
|
layout(location = 2) in vec4 vs_in_reg2;
|
|
layout(location = 3) in vec4 vs_in_reg3;
|
|
layout(location = 4) in vec4 vs_in_reg4;
|
|
layout(location = 5) in vec4 vs_in_reg5;
|
|
layout(location = 6) in vec4 vs_in_reg6;
|
|
layout(location = 7) in vec4 vs_in_reg7;
|
|
layout(location = 8) in vec4 vs_in_reg8;
|
|
|
|
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;
|
|
out vec4 vs_out_attr6;
|
|
|
|
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);
|
|
vs_out_attr6 = 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_21();
|
|
bool sub_4();
|
|
bool sub_9();
|
|
bool sub_1();
|
|
bool sub_2();
|
|
bool sub_3();
|
|
bool sub_5();
|
|
bool sub_7();
|
|
bool sub_8();
|
|
bool sub_10();
|
|
bool sub_20();
|
|
bool sub_22();
|
|
bool sub_23();
|
|
bool sub_24();
|
|
bool sub_25();
|
|
bool sub_26();
|
|
bool sub_27();
|
|
bool sub_28();
|
|
bool sub_29();
|
|
bool sub_6();
|
|
bool sub_11();
|
|
bool sub_12();
|
|
bool sub_13();
|
|
bool sub_14();
|
|
bool sub_15();
|
|
bool sub_16();
|
|
bool sub_17();
|
|
bool sub_18();
|
|
bool sub_19();
|
|
bool sub_30();
|
|
bool sub_31();
|
|
bool sub_32();
|
|
bool sub_44();
|
|
bool sub_33();
|
|
bool sub_34();
|
|
bool sub_35();
|
|
bool sub_36();
|
|
bool sub_37();
|
|
bool sub_38();
|
|
bool sub_39();
|
|
bool sub_40();
|
|
bool sub_41();
|
|
bool sub_42();
|
|
bool sub_43();
|
|
bool sub_45();
|
|
bool sub_46();
|
|
bool sub_52();
|
|
bool sub_53();
|
|
bool sub_54();
|
|
bool sub_55();
|
|
bool sub_57();
|
|
bool sub_47();
|
|
bool sub_48();
|
|
bool sub_49();
|
|
bool sub_50();
|
|
bool sub_51();
|
|
bool sub_56();
|
|
bool sub_58();
|
|
bool sub_59();
|
|
bool sub_60();
|
|
bool sub_61();
|
|
bool sub_62();
|
|
bool sub_63();
|
|
bool sub_64();
|
|
bool sub_65();
|
|
bool sub_66();
|
|
bool sub_67();
|
|
bool sub_68();
|
|
bool sub_69();
|
|
bool sub_70();
|
|
|
|
bool exec_shader() {
|
|
sub_0();
|
|
return true;
|
|
}
|
|
|
|
bool sub_0() {
|
|
{
|
|
sub_1();
|
|
}
|
|
{
|
|
sub_30();
|
|
}
|
|
{
|
|
sub_45();
|
|
}
|
|
{
|
|
sub_59();
|
|
}
|
|
{
|
|
sub_66();
|
|
}
|
|
return true;
|
|
}
|
|
bool sub_21() {
|
|
address_registers.x = (ivec2(reg_tmp1.xx)).x;
|
|
reg_tmp3.x = dot_s(uniforms.f[25 + address_registers.x], reg_tmp15);
|
|
reg_tmp3.y = dot_s(uniforms.f[26 + address_registers.x], reg_tmp15);
|
|
reg_tmp3.z = dot_s(uniforms.f[27 + address_registers.x], reg_tmp15);
|
|
reg_tmp7 = fma_s(reg_tmp1.wwww, reg_tmp3, reg_tmp7);
|
|
return false;
|
|
}
|
|
bool sub_4() {
|
|
address_registers.x = (ivec2(reg_tmp1.xx)).x;
|
|
reg_tmp3.x = dot_s(uniforms.f[25 + address_registers.x], reg_tmp15);
|
|
reg_tmp3.y = dot_s(uniforms.f[26 + address_registers.x], reg_tmp15);
|
|
reg_tmp3.z = dot_s(uniforms.f[27 + address_registers.x], reg_tmp15);
|
|
reg_tmp4.x = dot_3(uniforms.f[25 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp4.y = dot_3(uniforms.f[26 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp4.z = dot_3(uniforms.f[27 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp7 = fma_s(reg_tmp1.wwww, reg_tmp3, reg_tmp7);
|
|
reg_tmp12 = fma_s(reg_tmp1.wwww, reg_tmp4, reg_tmp12);
|
|
return false;
|
|
}
|
|
bool sub_9() {
|
|
address_registers.x = (ivec2(reg_tmp1.xx)).x;
|
|
reg_tmp3.x = dot_s(uniforms.f[25 + address_registers.x], reg_tmp15);
|
|
reg_tmp3.y = dot_s(uniforms.f[26 + address_registers.x], reg_tmp15);
|
|
reg_tmp3.z = dot_s(uniforms.f[27 + address_registers.x], reg_tmp15);
|
|
reg_tmp4.x = dot_3(uniforms.f[25 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp4.y = dot_3(uniforms.f[26 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp4.z = dot_3(uniforms.f[27 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp5.x = dot_3(uniforms.f[25 + address_registers.x].xyz, reg_tmp13.xyz);
|
|
reg_tmp5.y = dot_3(uniforms.f[26 + address_registers.x].xyz, reg_tmp13.xyz);
|
|
reg_tmp5.z = dot_3(uniforms.f[27 + address_registers.x].xyz, reg_tmp13.xyz);
|
|
reg_tmp7 = fma_s(reg_tmp1.wwww, reg_tmp3, reg_tmp7);
|
|
reg_tmp12 = fma_s(reg_tmp1.wwww, reg_tmp4, reg_tmp12);
|
|
reg_tmp11 = fma_s(reg_tmp1.wwww, reg_tmp5, reg_tmp11);
|
|
return false;
|
|
}
|
|
bool sub_1() {
|
|
reg_tmp15.xyz = (mul_s(uniforms.f[7].xxxx, vs_in_reg0)).xyz;
|
|
reg_tmp14.xyz = (mul_s(uniforms.f[7].yyyy, vs_in_reg1)).xyz;
|
|
reg_tmp13.xyz = (mul_s(uniforms.f[7].zzzz, vs_in_reg2)).xyz;
|
|
reg_tmp15.xyz = (uniforms.f[6] + reg_tmp15).xyz;
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
if (uniforms.b[1]) {
|
|
sub_2();
|
|
} else {
|
|
sub_23();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_2() {
|
|
reg_tmp0 = uniforms.f[7];
|
|
conditional_code = notEqual(uniforms.f[93].xx, reg_tmp0.yz);
|
|
reg_tmp7 = uniforms.f[93].xxxx;
|
|
reg_tmp12 = uniforms.f[93].xxxx;
|
|
reg_tmp11 = uniforms.f[93].xxxx;
|
|
reg_tmp2 = mul_s(uniforms.f[93].wwww, vs_in_reg7);
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_3();
|
|
} else {
|
|
sub_7();
|
|
}
|
|
vs_out_attr2 = -reg_tmp15;
|
|
vs_out_attr0.x = dot_s(uniforms.f[86], reg_tmp15);
|
|
vs_out_attr0.y = dot_s(uniforms.f[87], reg_tmp15);
|
|
vs_out_attr0.z = dot_s(uniforms.f[88], reg_tmp15);
|
|
vs_out_attr0.w = dot_s(uniforms.f[89], reg_tmp15);
|
|
return false;
|
|
}
|
|
bool sub_3() {
|
|
conditional_code = notEqual(uniforms.f[93].xx, vs_in_reg8.zw);
|
|
reg_tmp1.xy = (reg_tmp2.xxxx).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.xxxx)).w;
|
|
{
|
|
sub_4();
|
|
}
|
|
reg_tmp1.xy = (reg_tmp2.yyyy).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.yyyy)).w;
|
|
{
|
|
sub_4();
|
|
}
|
|
reg_tmp1.xy = (reg_tmp2.zzzz).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.zzzz)).w;
|
|
if (conditional_code.x) {
|
|
sub_4();
|
|
}
|
|
if (uniforms.b[8]) {
|
|
sub_5();
|
|
}
|
|
reg_tmp7.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp10.x = dot_s(uniforms.f[0], reg_tmp7);
|
|
reg_tmp10.y = dot_s(uniforms.f[1], reg_tmp7);
|
|
reg_tmp10.z = dot_s(uniforms.f[2], reg_tmp7);
|
|
reg_tmp10.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp15.x = dot_s(uniforms.f[90], reg_tmp10);
|
|
reg_tmp15.y = dot_s(uniforms.f[91], reg_tmp10);
|
|
reg_tmp15.z = dot_s(uniforms.f[92], reg_tmp10);
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp14.x = dot_3(uniforms.f[3].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.y = dot_3(uniforms.f[4].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.z = dot_3(uniforms.f[5].xyz, reg_tmp12.xyz);
|
|
{
|
|
sub_6();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_5() {
|
|
reg_tmp1.xy = (reg_tmp2.wwww).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.wwww)).w;
|
|
if (conditional_code.y) {
|
|
sub_4();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_7() {
|
|
if (all(conditional_code)) {
|
|
sub_8();
|
|
} else {
|
|
sub_20();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_8() {
|
|
conditional_code = notEqual(uniforms.f[93].xx, vs_in_reg8.zw);
|
|
reg_tmp1.xy = (reg_tmp2.xxxx).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.xxxx)).w;
|
|
{
|
|
sub_9();
|
|
}
|
|
reg_tmp1.xy = (reg_tmp2.yyyy).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.yyyy)).w;
|
|
{
|
|
sub_9();
|
|
}
|
|
reg_tmp1.xy = (reg_tmp2.zzzz).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.zzzz)).w;
|
|
if (conditional_code.x) {
|
|
sub_9();
|
|
}
|
|
if (uniforms.b[8]) {
|
|
sub_10();
|
|
}
|
|
reg_tmp7.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp10.x = dot_s(uniforms.f[0], reg_tmp7);
|
|
reg_tmp10.y = dot_s(uniforms.f[1], reg_tmp7);
|
|
reg_tmp10.z = dot_s(uniforms.f[2], reg_tmp7);
|
|
reg_tmp10.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp13.x = dot_3(uniforms.f[3].xyz, reg_tmp11.xyz);
|
|
reg_tmp13.y = dot_3(uniforms.f[4].xyz, reg_tmp11.xyz);
|
|
reg_tmp13.z = dot_3(uniforms.f[5].xyz, reg_tmp11.xyz);
|
|
reg_tmp14.x = dot_3(uniforms.f[3].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.y = dot_3(uniforms.f[4].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.z = dot_3(uniforms.f[5].xyz, reg_tmp12.xyz);
|
|
reg_tmp15.x = dot_s(uniforms.f[90], reg_tmp10);
|
|
reg_tmp15.y = dot_s(uniforms.f[91], reg_tmp10);
|
|
reg_tmp15.z = dot_s(uniforms.f[92], reg_tmp10);
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
{
|
|
sub_11();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_10() {
|
|
reg_tmp1.xy = (reg_tmp2.wwww).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.wwww)).w;
|
|
if (conditional_code.y) {
|
|
sub_9();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_20() {
|
|
conditional_code = notEqual(uniforms.f[93].xx, vs_in_reg8.zw);
|
|
reg_tmp1.xy = (reg_tmp2.xxxx).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.xxxx)).w;
|
|
{
|
|
sub_21();
|
|
}
|
|
reg_tmp1.xy = (reg_tmp2.yyyy).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.yyyy)).w;
|
|
{
|
|
sub_21();
|
|
}
|
|
reg_tmp1.xy = (reg_tmp2.zzzz).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.zzzz)).w;
|
|
if (conditional_code.x) {
|
|
sub_21();
|
|
}
|
|
if (uniforms.b[8]) {
|
|
sub_22();
|
|
}
|
|
reg_tmp7.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp10.x = dot_s(uniforms.f[0], reg_tmp7);
|
|
reg_tmp10.y = dot_s(uniforms.f[1], reg_tmp7);
|
|
reg_tmp10.z = dot_s(uniforms.f[2], reg_tmp7);
|
|
reg_tmp10.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp15.x = dot_s(uniforms.f[90], reg_tmp10);
|
|
reg_tmp15.y = dot_s(uniforms.f[91], reg_tmp10);
|
|
reg_tmp15.z = dot_s(uniforms.f[92], reg_tmp10);
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
vs_out_attr1 = uniforms.f[93].xxxx;
|
|
return false;
|
|
}
|
|
bool sub_22() {
|
|
reg_tmp1.xy = (reg_tmp2.wwww).xy;
|
|
reg_tmp1.w = (mul_s(uniforms.f[8].wwww, vs_in_reg8.wwww)).w;
|
|
if (conditional_code.y) {
|
|
sub_21();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_23() {
|
|
reg_tmp0 = uniforms.f[7];
|
|
conditional_code = notEqual(uniforms.f[93].xx, reg_tmp0.yz);
|
|
if (uniforms.b[2]) {
|
|
sub_24();
|
|
} else {
|
|
sub_25();
|
|
}
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_26();
|
|
} else {
|
|
sub_27();
|
|
}
|
|
vs_out_attr2 = -reg_tmp15;
|
|
vs_out_attr0.x = dot_s(uniforms.f[86], reg_tmp15);
|
|
vs_out_attr0.y = dot_s(uniforms.f[87], reg_tmp15);
|
|
vs_out_attr0.z = dot_s(uniforms.f[88], reg_tmp15);
|
|
vs_out_attr0.w = dot_s(uniforms.f[89], reg_tmp15);
|
|
return false;
|
|
}
|
|
bool sub_24() {
|
|
reg_tmp1.x = (mul_s(uniforms.f[93].wwww, vs_in_reg7.xxxx)).x;
|
|
address_registers.x = (ivec2(reg_tmp1.xx)).x;
|
|
reg_tmp7.x = dot_s(uniforms.f[25 + address_registers.x], reg_tmp15);
|
|
reg_tmp7.y = dot_s(uniforms.f[26 + address_registers.x], reg_tmp15);
|
|
reg_tmp7.z = dot_s(uniforms.f[27 + address_registers.x], reg_tmp15);
|
|
reg_tmp7.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp10.x = dot_s(uniforms.f[0], reg_tmp7);
|
|
reg_tmp10.y = dot_s(uniforms.f[1], reg_tmp7);
|
|
reg_tmp10.z = dot_s(uniforms.f[2], reg_tmp7);
|
|
reg_tmp10.w = (uniforms.f[93].yyyy).w;
|
|
return false;
|
|
}
|
|
bool sub_25() {
|
|
address_registers.x = (ivec2(uniforms.f[93].xx)).x;
|
|
reg_tmp10.x = dot_s(uniforms.f[25], reg_tmp15);
|
|
reg_tmp10.y = dot_s(uniforms.f[26], reg_tmp15);
|
|
reg_tmp10.z = dot_s(uniforms.f[27], reg_tmp15);
|
|
reg_tmp10.w = (uniforms.f[93].yyyy).w;
|
|
return false;
|
|
}
|
|
bool sub_26() {
|
|
reg_tmp12.x = dot_3(uniforms.f[25 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp12.y = dot_3(uniforms.f[26 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp12.z = dot_3(uniforms.f[27 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp15.x = dot_s(uniforms.f[90], reg_tmp10);
|
|
reg_tmp15.y = dot_s(uniforms.f[91], reg_tmp10);
|
|
reg_tmp15.z = dot_s(uniforms.f[92], reg_tmp10);
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp14.x = dot_3(uniforms.f[3].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.y = dot_3(uniforms.f[4].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.z = dot_3(uniforms.f[5].xyz, reg_tmp12.xyz);
|
|
{
|
|
sub_6();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_27() {
|
|
if (all(conditional_code)) {
|
|
sub_28();
|
|
} else {
|
|
sub_29();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_28() {
|
|
reg_tmp12.x = dot_3(uniforms.f[25 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp12.y = dot_3(uniforms.f[26 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp12.z = dot_3(uniforms.f[27 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp11.x = dot_3(uniforms.f[25 + address_registers.x].xyz, reg_tmp13.xyz);
|
|
reg_tmp11.y = dot_3(uniforms.f[26 + address_registers.x].xyz, reg_tmp13.xyz);
|
|
reg_tmp11.z = dot_3(uniforms.f[27 + address_registers.x].xyz, reg_tmp13.xyz);
|
|
reg_tmp15.x = dot_s(uniforms.f[90], reg_tmp10);
|
|
reg_tmp15.y = dot_s(uniforms.f[91], reg_tmp10);
|
|
reg_tmp15.z = dot_s(uniforms.f[92], reg_tmp10);
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
reg_tmp14.x = dot_3(uniforms.f[3].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.y = dot_3(uniforms.f[4].xyz, reg_tmp12.xyz);
|
|
reg_tmp14.z = dot_3(uniforms.f[5].xyz, reg_tmp12.xyz);
|
|
reg_tmp13.x = dot_3(uniforms.f[3].xyz, reg_tmp11.xyz);
|
|
reg_tmp13.y = dot_3(uniforms.f[4].xyz, reg_tmp11.xyz);
|
|
reg_tmp13.z = dot_3(uniforms.f[5].xyz, reg_tmp11.xyz);
|
|
{
|
|
sub_11();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_29() {
|
|
reg_tmp15.x = dot_s(uniforms.f[90], reg_tmp10);
|
|
reg_tmp15.y = dot_s(uniforms.f[91], reg_tmp10);
|
|
reg_tmp15.z = dot_s(uniforms.f[92], reg_tmp10);
|
|
reg_tmp15.w = (uniforms.f[93].yyyy).w;
|
|
vs_out_attr1 = uniforms.f[93].xxxx;
|
|
return false;
|
|
}
|
|
bool sub_6() {
|
|
uint jmp_to = 202u;
|
|
while (true) {
|
|
switch (jmp_to) {
|
|
case 202u: {
|
|
reg_tmp6.x = dot_3(reg_tmp14.xyz, reg_tmp14.xyz);
|
|
reg_tmp7.x = dot_3(reg_tmp12.xyz, reg_tmp12.xyz);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp7.x = rsq_s(reg_tmp7.x);
|
|
reg_tmp14.xyz = (mul_s(reg_tmp14.xyzz, reg_tmp6.xxxx)).xyz;
|
|
reg_tmp12.xyz = (mul_s(reg_tmp12.xyzz, reg_tmp7.xxxx)).xyz;
|
|
reg_tmp0 = uniforms.f[93].yxxx;
|
|
if (!uniforms.b[15]) {
|
|
{ jmp_to = 218u; break; }
|
|
}
|
|
reg_tmp4 = uniforms.f[93].yyyy + reg_tmp14.zzzz;
|
|
reg_tmp4 = mul_s(uniforms.f[94].zzzz, reg_tmp4);
|
|
conditional_code = greaterThanEqual(uniforms.f[93].xx, reg_tmp4.xx);
|
|
reg_tmp4 = vec4(rsq_s(reg_tmp4.x));
|
|
reg_tmp5 = mul_s(uniforms.f[94].zzzz, reg_tmp14);
|
|
if (conditional_code.x) {
|
|
{ jmp_to = 218u; break; }
|
|
}
|
|
reg_tmp0.z = rcp_s(reg_tmp4.x);
|
|
reg_tmp0.xy = (mul_s(reg_tmp5, reg_tmp4)).xy;
|
|
}
|
|
case 218u: {
|
|
vs_out_attr1 = reg_tmp0;
|
|
}
|
|
default: return false;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_11() {
|
|
uint jmp_to = 219u;
|
|
while (true) {
|
|
switch (jmp_to) {
|
|
case 219u: {
|
|
reg_tmp6.x = dot_3(reg_tmp14.xyz, reg_tmp14.xyz);
|
|
reg_tmp7.x = dot_3(reg_tmp12.xyz, reg_tmp12.xyz);
|
|
reg_tmp6.x = rsq_s(reg_tmp6.x);
|
|
reg_tmp7.x = rsq_s(reg_tmp7.x);
|
|
reg_tmp14.xyz = (mul_s(reg_tmp14.xyzz, reg_tmp6.xxxx)).xyz;
|
|
reg_tmp12.xyz = (mul_s(reg_tmp12.xyzz, reg_tmp7.xxxx)).xyz;
|
|
reg_tmp13.xyz = (mul_s(reg_tmp13.xyzz, reg_tmp6.xxxx)).xyz;
|
|
reg_tmp11.xyz = (mul_s(reg_tmp11.xyzz, reg_tmp7.xxxx)).xyz;
|
|
reg_tmp0 = uniforms.f[93].yxxx;
|
|
if (!uniforms.b[15]) {
|
|
{ jmp_to = 294u; break; }
|
|
}
|
|
reg_tmp13.xyz = (mul_s(reg_tmp13.xyzz, reg_tmp6.xxxx)).xyz;
|
|
reg_tmp11.xyz = (mul_s(reg_tmp11.xyzz, reg_tmp7.xxxx)).xyz;
|
|
reg_tmp5 = mul_s(reg_tmp14.yzxx, reg_tmp13.zxyy);
|
|
reg_tmp5 = fma_s(-reg_tmp13.yzxx, reg_tmp14.zxyy, reg_tmp5);
|
|
reg_tmp5.w = dot_3(reg_tmp5.xyz, reg_tmp5.xyz);
|
|
reg_tmp5.w = rsq_s(reg_tmp5.w);
|
|
reg_tmp5 = mul_s(reg_tmp5, reg_tmp5.wwww);
|
|
reg_tmp6.w = (reg_tmp14.zzzz + reg_tmp5.yyyy).w;
|
|
reg_tmp13 = mul_s(reg_tmp5.yzxx, reg_tmp14.zxyy);
|
|
reg_tmp13 = fma_s(-reg_tmp14.yzxx, reg_tmp5.zxyy, reg_tmp13);
|
|
reg_tmp6.w = (reg_tmp13.xxxx + reg_tmp6).w;
|
|
reg_tmp13.w = (reg_tmp5.zzzz).w;
|
|
reg_tmp5.z = (reg_tmp13.xxxx).z;
|
|
reg_tmp6.w = (uniforms.f[93].yyyy + reg_tmp6).w;
|
|
reg_tmp14.w = (reg_tmp5.xxxx).w;
|
|
reg_tmp5.x = (reg_tmp14.zzzz).x;
|
|
conditional_code = lessThan(uniforms.f[94].yy, reg_tmp6.ww);
|
|
reg_tmp6.x = (uniforms.f[93].yyyy).x;
|
|
reg_tmp6.y = (-uniforms.f[93].yyyy).y;
|
|
if (!conditional_code.x) {
|
|
{ jmp_to = 256u; break; }
|
|
}
|
|
reg_tmp7.xz = (reg_tmp13.wwyy + -reg_tmp14.yyww).xz;
|
|
reg_tmp7.y = (reg_tmp14.xxxx + -reg_tmp13.zzzz).y;
|
|
reg_tmp7.w = (reg_tmp6).w;
|
|
reg_tmp6 = vec4(dot_s(reg_tmp7, reg_tmp7));
|
|
reg_tmp6 = vec4(rsq_s(reg_tmp6.x));
|
|
reg_tmp0 = mul_s(reg_tmp7, reg_tmp6);
|
|
if (uniforms.b[0]) {
|
|
{ jmp_to = 294u; break; }
|
|
}
|
|
}
|
|
case 256u: {
|
|
conditional_code = greaterThan(reg_tmp5.zy, reg_tmp5.yx);
|
|
if (conditional_code.x) {
|
|
sub_12();
|
|
} else {
|
|
sub_17();
|
|
}
|
|
reg_tmp6 = vec4(dot_s(reg_tmp8, reg_tmp8));
|
|
reg_tmp6 = vec4(rsq_s(reg_tmp6.x));
|
|
reg_tmp0 = mul_s(reg_tmp8, reg_tmp6);
|
|
}
|
|
case 294u: {
|
|
vs_out_attr1 = reg_tmp0;
|
|
}
|
|
default: return false;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_12() {
|
|
if (conditional_code.y) {
|
|
sub_13();
|
|
} else {
|
|
sub_14();
|
|
}
|
|
reg_tmp8.w = (-reg_tmp8).w;
|
|
return false;
|
|
}
|
|
bool sub_13() {
|
|
reg_tmp8 = mul_s(reg_tmp13.yyzw, reg_tmp6.xxxy);
|
|
reg_tmp8.x = (uniforms.f[93].yyyy + -reg_tmp5.yyyy).x;
|
|
reg_tmp9 = reg_tmp5.zzzz + -reg_tmp5.xxxx;
|
|
reg_tmp8.yzw = (reg_tmp8 + reg_tmp14.wwxy).yzw;
|
|
reg_tmp8.x = (reg_tmp9 + reg_tmp8).x;
|
|
return false;
|
|
}
|
|
bool sub_14() {
|
|
conditional_code = greaterThan(reg_tmp5.zz, reg_tmp5.xx);
|
|
reg_tmp8 = mul_s(reg_tmp13.yyzw, reg_tmp6.xxxy);
|
|
reg_tmp8.x = (uniforms.f[93].yyyy + -reg_tmp5.yyyy).x;
|
|
if (conditional_code.x) {
|
|
sub_15();
|
|
} else {
|
|
sub_16();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_15() {
|
|
reg_tmp9 = reg_tmp5.zzzz + -reg_tmp5.xxxx;
|
|
reg_tmp8.yzw = (reg_tmp8 + reg_tmp14.wwxy).yzw;
|
|
reg_tmp8.x = (reg_tmp9 + reg_tmp8).x;
|
|
return false;
|
|
}
|
|
bool sub_16() {
|
|
reg_tmp8 = mul_s(reg_tmp13.zwwy, reg_tmp6.xxxy);
|
|
reg_tmp8.z = (uniforms.f[93].yyyy + -reg_tmp5.zzzz).z;
|
|
reg_tmp9 = reg_tmp5.xxxx + -reg_tmp5.yyyy;
|
|
reg_tmp8.xyw = (reg_tmp8 + reg_tmp14.xyyw).xyw;
|
|
reg_tmp8.z = (reg_tmp9 + reg_tmp8).z;
|
|
return false;
|
|
}
|
|
bool sub_17() {
|
|
if (conditional_code.y) {
|
|
sub_18();
|
|
} else {
|
|
sub_19();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_18() {
|
|
reg_tmp8 = mul_s(reg_tmp13.yywz, reg_tmp6.xxxy);
|
|
reg_tmp8.y = (uniforms.f[93].yyyy + -reg_tmp5.zzzz).y;
|
|
reg_tmp9 = reg_tmp5.yyyy + -reg_tmp5.xxxx;
|
|
reg_tmp8.xzw = (reg_tmp8 + reg_tmp14.wwyx).xzw;
|
|
reg_tmp8.y = (reg_tmp9 + reg_tmp8).y;
|
|
return false;
|
|
}
|
|
bool sub_19() {
|
|
reg_tmp8 = mul_s(reg_tmp13.zwwy, reg_tmp6.xxxy);
|
|
reg_tmp8.z = (uniforms.f[93].yyyy + -reg_tmp5.zzzz).z;
|
|
reg_tmp9 = reg_tmp5.xxxx + -reg_tmp5.yyyy;
|
|
reg_tmp8.xyw = (reg_tmp8 + reg_tmp14.xyyw).xyw;
|
|
reg_tmp8.z = (reg_tmp9 + reg_tmp8).z;
|
|
reg_tmp8.w = (-reg_tmp8).w;
|
|
return false;
|
|
}
|
|
bool sub_30() {
|
|
reg_tmp8.xy = (uniforms.f[93].xxxx).xy;
|
|
reg_tmp0.y = (uniforms.f[7].wwww).y;
|
|
conditional_code = notEqual(uniforms.f[93].xx, reg_tmp0.xy);
|
|
reg_tmp9.xyz = (uniforms.f[93].xxxx).xyz;
|
|
reg_tmp9.w = (uniforms.f[21].wwww).w;
|
|
if (conditional_code.y) {
|
|
sub_31();
|
|
}
|
|
if (uniforms.b[12]) {
|
|
sub_33();
|
|
}
|
|
if (uniforms.b[5]) {
|
|
sub_42();
|
|
}
|
|
conditional_code = equal(uniforms.f[93].xx, reg_tmp8.xy);
|
|
if (all(conditional_code)) {
|
|
sub_44();
|
|
}
|
|
vs_out_attr3 = max(uniforms.f[93].xxxx, reg_tmp9);
|
|
return false;
|
|
}
|
|
bool sub_31() {
|
|
reg_tmp0 = mul_s(uniforms.f[7].wwww, vs_in_reg3);
|
|
if (uniforms.b[7]) {
|
|
sub_32();
|
|
}
|
|
reg_tmp9.xyz = (mul_s(uniforms.f[20].wwww, reg_tmp0.xyzz)).xyz;
|
|
reg_tmp8.x = (uniforms.f[93].yyyy).x;
|
|
return false;
|
|
}
|
|
bool sub_32() {
|
|
reg_tmp9.w = (mul_s(reg_tmp9.wwww, reg_tmp0.wwww)).w;
|
|
return false;
|
|
}
|
|
bool sub_44() {
|
|
reg_tmp9 = uniforms.f[21];
|
|
return false;
|
|
}
|
|
bool sub_33() {
|
|
reg_tmp1 = uniforms.f[20];
|
|
reg_tmp2 = uniforms.f[21];
|
|
reg_tmp3 = uniforms.f[93].xxxx;
|
|
address_registers.z = int(uniforms.i[0].y);
|
|
for (uint loop315 = 0u; loop315 <= uniforms.i[0].x; address_registers.z += int(uniforms.i[0].z), ++loop315) {
|
|
sub_34();
|
|
}
|
|
reg_tmp8.x = (uniforms.f[93].yyyy).x;
|
|
return false;
|
|
}
|
|
bool sub_34() {
|
|
address_registers.x = (ivec2(reg_tmp3.xy)).x;
|
|
reg_tmp4.x = (uniforms.f[81 + address_registers.x].wwww).x;
|
|
reg_tmp4.y = (uniforms.f[83 + address_registers.x].wwww).y;
|
|
conditional_code = equal(uniforms.f[93].xy, reg_tmp4.xy);
|
|
if (conditional_code.x) {
|
|
sub_35();
|
|
} else {
|
|
sub_36();
|
|
}
|
|
conditional_code.x = uniforms.f[93].xxxx.x == reg_tmp6.xyyy.x;
|
|
conditional_code.y = uniforms.f[93].xxxx.y < reg_tmp6.xyyy.y;
|
|
if (conditional_code.y) {
|
|
sub_41();
|
|
}
|
|
reg_tmp3 = -uniforms.f[95].wwww + reg_tmp3;
|
|
return false;
|
|
}
|
|
bool sub_35() {
|
|
reg_tmp6.x = dot_3(uniforms.f[81 + address_registers.x].xyz, reg_tmp14.xyz);
|
|
reg_tmp6.y = (uniforms.f[93].yyyy).y;
|
|
return false;
|
|
}
|
|
bool sub_36() {
|
|
reg_tmp4 = uniforms.f[81 + address_registers.x] + -reg_tmp15;
|
|
reg_tmp6.y = (uniforms.f[93].yyyy).y;
|
|
if (conditional_code.y) {
|
|
sub_37();
|
|
}
|
|
reg_tmp5 = uniforms.f[82 + address_registers.x];
|
|
conditional_code = equal(uniforms.f[93].yy, reg_tmp5.ww);
|
|
reg_tmp4.w = dot_3(reg_tmp4.xyz, reg_tmp4.xyz);
|
|
reg_tmp4.w = rsq_s(reg_tmp4.w);
|
|
reg_tmp4 = mul_s(reg_tmp4, reg_tmp4.wwww);
|
|
if (conditional_code.x) {
|
|
sub_38();
|
|
}
|
|
reg_tmp6.x = dot_3(reg_tmp14.xyz, reg_tmp4.xyz);
|
|
return false;
|
|
}
|
|
bool sub_37() {
|
|
reg_tmp5.x = (uniforms.f[93].yyyy).x;
|
|
reg_tmp5.z = dot_3(reg_tmp4.xyz, reg_tmp4.xyz);
|
|
reg_tmp5.y = (mul_s(reg_tmp5.zzzz, reg_tmp5.zzzz)).y;
|
|
reg_tmp6.y = dot_3(uniforms.f[83 + address_registers.x].xyz, reg_tmp5.xyz);
|
|
reg_tmp6.y = rcp_s(reg_tmp6.y);
|
|
return false;
|
|
}
|
|
bool sub_38() {
|
|
reg_tmp5.x = dot_3(uniforms.f[82 + address_registers.x].xyz, -reg_tmp4.xyz);
|
|
reg_tmp5.y = (vec4(lessThan(reg_tmp5.xxxx, uniforms.f[84 + address_registers.x].yyyy))).y;
|
|
conditional_code = equal(uniforms.f[93].yy, reg_tmp5.xy);
|
|
if (conditional_code.y) {
|
|
sub_39();
|
|
} else {
|
|
sub_40();
|
|
}
|
|
reg_tmp6.y = (mul_s(reg_tmp6.yyyy, reg_tmp5.xxxx)).y;
|
|
return false;
|
|
}
|
|
bool sub_39() {
|
|
reg_tmp5.x = (uniforms.f[93].xxxx).x;
|
|
return false;
|
|
}
|
|
bool sub_40() {
|
|
reg_tmp5.y = log2(reg_tmp5.x);
|
|
reg_tmp5.y = (mul_s(uniforms.f[84 + address_registers.x].xxxx, reg_tmp5.yyyy)).y;
|
|
reg_tmp5.x = exp2(reg_tmp5.y);
|
|
return false;
|
|
}
|
|
bool sub_41() {
|
|
reg_tmp6.x = (max(uniforms.f[93].xxxx, reg_tmp6.xxxx)).x;
|
|
reg_tmp9.xyz = (fma_s(reg_tmp1.xyzz, uniforms.f[79 + address_registers.x].xyzz, reg_tmp9.xyzz)).xyz;
|
|
reg_tmp4 = mul_s(uniforms.f[80 + address_registers.x], reg_tmp2);
|
|
reg_tmp5.xyz = (mul_s(reg_tmp6.xxxx, reg_tmp4.xyzz)).xyz;
|
|
reg_tmp5.xyz = (mul_s(reg_tmp6.yyyy, reg_tmp5.xyzz)).xyz;
|
|
reg_tmp9.xyz = (reg_tmp9.xyzz + reg_tmp5.xyzz).xyz;
|
|
reg_tmp9.w = (reg_tmp9.wwww + reg_tmp4.wwww).w;
|
|
return false;
|
|
}
|
|
bool sub_42() {
|
|
reg_tmp1 = vec4(dot_3(uniforms.f[24].xyz, reg_tmp14.xyz));
|
|
reg_tmp2 = uniforms.f[24].wwww;
|
|
reg_tmp1 = fma_s(reg_tmp1, reg_tmp2, reg_tmp2);
|
|
reg_tmp3 = uniforms.f[22];
|
|
reg_tmp2 = uniforms.f[23] + -reg_tmp3;
|
|
reg_tmp4 = fma_s(reg_tmp2, reg_tmp1, reg_tmp3);
|
|
if (uniforms.b[6]) {
|
|
sub_43();
|
|
}
|
|
reg_tmp9.xyz = (fma_s(reg_tmp4, uniforms.f[21], reg_tmp9)).xyz;
|
|
reg_tmp8.x = (uniforms.f[93].yyyy).x;
|
|
return false;
|
|
}
|
|
bool sub_43() {
|
|
reg_tmp4 = mul_s(reg_tmp4, reg_tmp9.wwww);
|
|
return false;
|
|
}
|
|
bool sub_45() {
|
|
reg_tmp0.xy = (uniforms.f[10].xxxx).xy;
|
|
if (uniforms.b[9]) {
|
|
sub_46();
|
|
} else {
|
|
sub_52();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_46() {
|
|
{
|
|
sub_47();
|
|
}
|
|
reg_tmp3.x = dot_s(uniforms.f[11].xywz, reg_tmp6);
|
|
reg_tmp3.y = dot_s(uniforms.f[12].xywz, reg_tmp6);
|
|
reg_tmp3.zw = (uniforms.f[93].xxxx).zw;
|
|
vs_out_attr4 = reg_tmp3;
|
|
return false;
|
|
}
|
|
bool sub_52() {
|
|
conditional_code = equal(uniforms.f[95].xy, reg_tmp0.xy);
|
|
reg_tmp6.zw = (uniforms.f[93].xxyy).zw;
|
|
if (all(not(conditional_code))) {
|
|
sub_53();
|
|
} else {
|
|
sub_54();
|
|
}
|
|
vs_out_attr4 = reg_tmp3;
|
|
return false;
|
|
}
|
|
bool sub_53() {
|
|
reg_tmp6 = reg_tmp10;
|
|
reg_tmp3.x = dot_s(uniforms.f[11], reg_tmp6);
|
|
reg_tmp3.y = dot_s(uniforms.f[12], reg_tmp6);
|
|
reg_tmp3.z = dot_s(uniforms.f[13], reg_tmp6);
|
|
reg_tmp0.xy = (mul_s(uniforms.f[19].xyyy, reg_tmp3.zzzz)).xy;
|
|
reg_tmp3.xy = (reg_tmp3.xyyy + reg_tmp0.xyyy).xy;
|
|
return false;
|
|
}
|
|
bool sub_54() {
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_55();
|
|
} else {
|
|
sub_57();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_55() {
|
|
{
|
|
sub_56();
|
|
}
|
|
reg_tmp3.x = dot_3(uniforms.f[11].xyz, reg_tmp6.xyz);
|
|
reg_tmp3.y = dot_3(uniforms.f[12].xyz, reg_tmp6.xyz);
|
|
reg_tmp3.z = dot_3(uniforms.f[13].xyz, reg_tmp6.xyz);
|
|
return false;
|
|
}
|
|
bool sub_57() {
|
|
{
|
|
sub_58();
|
|
}
|
|
reg_tmp3.x = dot_s(uniforms.f[11], reg_tmp6);
|
|
reg_tmp3.y = dot_s(uniforms.f[12], reg_tmp6);
|
|
return false;
|
|
}
|
|
bool sub_47() {
|
|
conditional_code = equal(uniforms.f[93].yz, reg_tmp0.xy);
|
|
if (all(not(conditional_code))) {
|
|
sub_48();
|
|
} else {
|
|
sub_49();
|
|
}
|
|
reg_tmp6.zw = (uniforms.f[93].xxyy).zw;
|
|
return false;
|
|
}
|
|
bool sub_48() {
|
|
reg_tmp6.xy = (mul_s(uniforms.f[8].xxxx, vs_in_reg4.xyyy)).xy;
|
|
return false;
|
|
}
|
|
bool sub_49() {
|
|
if (all(bvec2(conditional_code.x, !conditional_code.y))) {
|
|
sub_50();
|
|
} else {
|
|
sub_51();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_50() {
|
|
reg_tmp6.xy = (mul_s(uniforms.f[8].yyyy, vs_in_reg5.xyyy)).xy;
|
|
return false;
|
|
}
|
|
bool sub_51() {
|
|
reg_tmp6.xy = (mul_s(uniforms.f[8].zzzz, vs_in_reg6.xyyy)).xy;
|
|
return false;
|
|
}
|
|
bool sub_56() {
|
|
reg_tmp2 = -reg_tmp15;
|
|
reg_tmp2.w = dot_3(reg_tmp2.xyz, reg_tmp2.xyz);
|
|
reg_tmp2.w = rsq_s(reg_tmp2.w);
|
|
reg_tmp2 = mul_s(reg_tmp2, reg_tmp2.wwww);
|
|
reg_tmp1 = vec4(dot_3(reg_tmp2.xyz, reg_tmp14.xyz));
|
|
reg_tmp1 = reg_tmp1 + reg_tmp1;
|
|
reg_tmp6 = fma_s(reg_tmp1, reg_tmp14, -reg_tmp2);
|
|
return false;
|
|
}
|
|
bool sub_58() {
|
|
reg_tmp1.xy = (uniforms.f[94].zzzz).xy;
|
|
reg_tmp1.zw = (uniforms.f[93].xxxx).zw;
|
|
reg_tmp6 = fma_s(reg_tmp14, reg_tmp1, reg_tmp1);
|
|
reg_tmp6.zw = (uniforms.f[93].xxyy).zw;
|
|
return false;
|
|
}
|
|
bool sub_59() {
|
|
reg_tmp0.xy = (uniforms.f[10].yyyy).xy;
|
|
if (uniforms.b[10]) {
|
|
sub_60();
|
|
} else {
|
|
sub_61();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_60() {
|
|
{
|
|
sub_47();
|
|
}
|
|
reg_tmp4.x = dot_s(uniforms.f[14].xywz, reg_tmp6);
|
|
reg_tmp4.y = dot_s(uniforms.f[15].xywz, reg_tmp6);
|
|
reg_tmp4.zw = (reg_tmp6.zwww).zw;
|
|
vs_out_attr5 = reg_tmp4;
|
|
return false;
|
|
}
|
|
bool sub_61() {
|
|
if (uniforms.b[13]) {
|
|
sub_62();
|
|
} else {
|
|
sub_65();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_62() {
|
|
conditional_code = equal(uniforms.f[95].xy, reg_tmp0.xy);
|
|
reg_tmp6.zw = (uniforms.f[93].xxyy).zw;
|
|
reg_tmp4.zw = (reg_tmp6.zwww).zw;
|
|
if (all(not(conditional_code))) {
|
|
sub_63();
|
|
} else {
|
|
sub_64();
|
|
}
|
|
vs_out_attr5 = reg_tmp4;
|
|
return false;
|
|
}
|
|
bool sub_63() {
|
|
reg_tmp6 = reg_tmp10;
|
|
reg_tmp4.x = dot_s(uniforms.f[14], reg_tmp6);
|
|
reg_tmp4.y = dot_s(uniforms.f[15], reg_tmp6);
|
|
reg_tmp4.z = dot_s(uniforms.f[16], reg_tmp6);
|
|
reg_tmp6.w = rcp_s(reg_tmp4.z);
|
|
reg_tmp4.xy = (mul_s(reg_tmp4.xyyy, reg_tmp6.wwww)).xy;
|
|
reg_tmp4.xy = (uniforms.f[19].zwww + reg_tmp4.xyyy).xy;
|
|
return false;
|
|
}
|
|
bool sub_64() {
|
|
{
|
|
sub_58();
|
|
}
|
|
reg_tmp4.x = dot_s(uniforms.f[14], reg_tmp6);
|
|
reg_tmp4.y = dot_s(uniforms.f[15], reg_tmp6);
|
|
return false;
|
|
}
|
|
bool sub_65() {
|
|
vs_out_attr5 = uniforms.f[93].xxxx;
|
|
return false;
|
|
}
|
|
bool sub_66() {
|
|
reg_tmp0.xy = (uniforms.f[10].zzzz).xy;
|
|
if (uniforms.b[11]) {
|
|
sub_67();
|
|
} else {
|
|
sub_68();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_67() {
|
|
{
|
|
sub_47();
|
|
}
|
|
reg_tmp5.x = dot_s(uniforms.f[17].xywz, reg_tmp6);
|
|
reg_tmp5.y = dot_s(uniforms.f[18].xywz, reg_tmp6);
|
|
reg_tmp5.zw = (reg_tmp6.zwww).zw;
|
|
vs_out_attr6 = reg_tmp5;
|
|
return false;
|
|
}
|
|
bool sub_68() {
|
|
if (uniforms.b[14]) {
|
|
sub_69();
|
|
} else {
|
|
sub_70();
|
|
}
|
|
return false;
|
|
}
|
|
bool sub_69() {
|
|
reg_tmp6.zw = (uniforms.f[93].xxyy).zw;
|
|
reg_tmp5.zw = (reg_tmp6.zwww).zw;
|
|
{
|
|
sub_58();
|
|
}
|
|
reg_tmp5.x = dot_s(uniforms.f[17], reg_tmp6);
|
|
reg_tmp5.y = dot_s(uniforms.f[18], reg_tmp6);
|
|
vs_out_attr6 = reg_tmp5;
|
|
return false;
|
|
}
|
|
bool sub_70() {
|
|
vs_out_attr6 = uniforms.f[93].xxxx;
|
|
return false;
|
|
}
|
|
// reference: 15DAECED5B962F99, 3A54D4180A96F052
|
|
// shader: 8DD9, 0D30074279C2FEED
|
|
|
|
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[];
|
|
in vec4 vs_out_attr6[];
|
|
struct Vertex {
|
|
vec4 attributes[7];
|
|
};
|
|
|
|
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[3].x, vtx.attributes[3].y, vtx.attributes[3].z, vtx.attributes[3].w);
|
|
primary_color = min(abs(vtx_color), vec4(1.0));
|
|
|
|
texcoord0 = vec2(vtx.attributes[4].x, vtx.attributes[4].y);
|
|
texcoord1 = vec2(vtx.attributes[5].x, vtx.attributes[5].y);
|
|
|
|
texcoord0_w = vtx.attributes[4].z;
|
|
view = vec3(vtx.attributes[2].x, vtx.attributes[2].y, vtx.attributes[2].z);
|
|
texcoord2 = vec2(vtx.attributes[6].x, vtx.attributes[6].y);
|
|
|
|
EmitVertex();
|
|
}
|
|
|
|
bool AreQuaternionsOpposite(vec4 qa, vec4 qb) {
|
|
return (dot(qa, qb) < 0.0);
|
|
}
|
|
|
|
void EmitPrim(Vertex vtx0, Vertex vtx1, Vertex vtx2) {
|
|
EmitVtx(vtx0, false);
|
|
EmitVtx(vtx1, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx1)));
|
|
EmitVtx(vtx2, AreQuaternionsOpposite(GetVertexQuaternion(vtx0), GetVertexQuaternion(vtx2)));
|
|
EndPrimitive();
|
|
}
|
|
|
|
void main() {
|
|
Vertex prim_buffer[3];
|
|
prim_buffer[0].attributes = vec4[7](vs_out_attr0[0], vs_out_attr1[0], vs_out_attr2[0], vs_out_attr3[0], vs_out_attr4[0], vs_out_attr5[0], vs_out_attr6[0]);
|
|
prim_buffer[1].attributes = vec4[7](vs_out_attr0[1], vs_out_attr1[1], vs_out_attr2[1], vs_out_attr3[1], vs_out_attr4[1], vs_out_attr5[1], vs_out_attr6[1]);
|
|
prim_buffer[2].attributes = vec4[7](vs_out_attr0[2], vs_out_attr1[2], vs_out_attr2[2], vs_out_attr3[2], vs_out_attr4[2], vs_out_attr5[2], vs_out_attr6[2]);
|
|
EmitPrim(prim_buffer[0], prim_buffer[1], prim_buffer[2]);
|
|
}
|
|
// reference: FC74FA4ACA1C8C74, 0D30074279C2FEED
|
|
// shader: 8B30, 4F691F5A00C1A34B
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = (rounded_primary_color.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287A3EE2589E, 4F691F5A00C1A34B
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 4F691F5A00C1A34B
|
|
// reference: 3F41287A3F2032A9, 4F691F5A00C1A34B
|
|
// reference: 5B8E13ADD86349EB, 3A54D4180A96F052
|
|
// shader: 8B30, 00CFF6D036842029
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = 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: B850ED3AB751FE57, 00CFF6D036842029
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 00CFF6D036842029
|
|
// reference: B850ED3AB6939460, 00CFF6D036842029
|
|
// shader: 8B30, E53B0D2873A4D170
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (const_color[0].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, 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 = (last_tex_env_out.rgb);
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 4D3A2E7810FCEDA0, E53B0D2873A4D170
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, E53B0D2873A4D170
|
|
// shader: 8B30, BDAB6ED55800EA81
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
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;
|
|
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);
|
|
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) + (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((texture(tex_cube, vec3(texcoord0, texcoord0_w)).rgb) * (const_color[0].rgb) + (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texture(tex_cube, vec3(texcoord0, texcoord0_w)).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), 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: 85C08DB556FBB016, BDAB6ED55800EA81
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, BDAB6ED55800EA81
|
|
// shader: 8B30, FD5D90C5DDE6ADF1
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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) * (texcolor1.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texture(tex_cube, vec3(texcoord0, texcoord0_w)).rgb) * (const_color[1].rgb) + (last_tex_env_out.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.aaa), 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;
|
|
|
|
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: 0C76843C60425264, FD5D90C5DDE6ADF1
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, FD5D90C5DDE6ADF1
|
|
// shader: 8B30, 5A60529A7F41E21F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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((primary_fragment_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) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 520F29070DE39983, 5A60529A7F41E21F
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 5A60529A7F41E21F
|
|
// shader: 8B30, 12433E7DDE265EFC
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (const_color[0].rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3F41287A154432C2, 12433E7DDE265EFC
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 12433E7DDE265EFC
|
|
// shader: 8B30, B72D3A8FB1384E37
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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((texcolor0.rgb) * (primary_fragment_color.rgb) + (secondary_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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 40B4913075E6B17F, B72D3A8FB1384E37
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, B72D3A8FB1384E37
|
|
// shader: 8B30, 70190960383B890F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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)));
|
|
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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (const_color[0].rgb) + (texcolor2.rgb) * (vec3(1.0) - (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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((vec3(1.0) - texcolor2.aaa) * (vec3(1.0) - secondary_fragment_color.aaa) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
|
|
vec3 color_output_2 = byteround(clamp((primary_fragment_color.aaa) * (texture(tex_cube, vec3(texcoord0, texcoord0_w)).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((secondary_fragment_color.rgb) * (texcolor2.aaa) + (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((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (primary_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;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3A5CC4D9B2E01DB1, 70190960383B890F
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 70190960383B890F
|
|
// shader: 8B30, 18B3AC778A823B54
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (const_color[0].rgb) + (texcolor2.rgb) * (vec3(1.0) - (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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor2.aaa) * (secondary_fragment_color.ggg) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
|
|
vec3 color_output_2 = byteround(clamp((texture(tex_cube, vec3(texcoord0, texcoord0_w)).rgb) * (texcolor2.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(min((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (primary_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;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3D2076B3D2AD4A32, 18B3AC778A823B54
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 18B3AC778A823B54
|
|
// shader: 8B30, 9CB3C8ECB00A3451
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = 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: FB35E2F48DACC545, 9CB3C8ECB00A3451
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 9CB3C8ECB00A3451
|
|
// shader: 8B30, 4CBB549D39DB351F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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((primary_fragment_color.rgb) * (texcolor0.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((const_color[0].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) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 967BE3896299C788, 4CBB549D39DB351F
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 4CBB549D39DB351F
|
|
// shader: 8B30, F774D0340B24A81F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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) + (secondary_fragment_color.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) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 84C05BBE02C68667, F774D0340B24A81F
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, F774D0340B24A81F
|
|
// shader: 8B30, 5C0D6336E6537060
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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((primary_fragment_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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: A2957DAB5B541098, 5C0D6336E6537060
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 5C0D6336E6537060
|
|
// shader: 8B30, 07CB9B868DC81C92
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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((primary_fragment_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) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 967BE389E1547280, 07CB9B868DC81C92
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 07CB9B868DC81C92
|
|
// shader: 8B30, E5698CA062CC9D0D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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) + (secondary_fragment_color.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(min((secondary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 6DD6E7DA4E0F8413, E5698CA062CC9D0D
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, E5698CA062CC9D0D
|
|
// shader: 8B30, 75C1F9AC255E7531
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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) + (secondary_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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 40B49130D20E9006, 75C1F9AC255E7531
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 75C1F9AC255E7531
|
|
// shader: 8B30, C79EC961E11066CD
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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) * (texcolor1.rgb) + (secondary_fragment_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texture(tex_cube, vec3(texcoord0, texcoord0_w)).rgb) * (const_color[1].rgb) + (last_tex_env_out.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.aaa), 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;
|
|
|
|
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: 0C76843C8787E576, C79EC961E11066CD
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, C79EC961E11066CD
|
|
// shader: 8B30, 05B9B50C975EF331
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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 = (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) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 520F2907D20E9006, 05B9B50C975EF331
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 05B9B50C975EF331
|
|
// shader: 8B30, 9B99CEC26430CF02
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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) + (secondary_fragment_color.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) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 84C05BBEEE716D64, 9B99CEC26430CF02
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 9B99CEC26430CF02
|
|
// shader: 8B30, A2E44ED8C401C603
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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((texcolor0.rgb) * (primary_fragment_color.rgb) + (secondary_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;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((last_tex_env_out.rgb) + (secondary_fragment_color.aaa), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 9526119EC5DE8F2F, A2E44ED8C401C603
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, A2E44ED8C401C603
|
|
// reference: 4D3A2E78113E8797, E53B0D2873A4D170
|
|
// reference: 85C08DB55739DA21, BDAB6ED55800EA81
|
|
// reference: 0C76843C61803853, FD5D90C5DDE6ADF1
|
|
// reference: 520F29070C21F3B4, 5A60529A7F41E21F
|
|
// reference: 3F41287A148658F5, 12433E7DDE265EFC
|
|
// reference: 40B491307424DB48, B72D3A8FB1384E37
|
|
// reference: 3A5CC4D9B3227786, 70190960383B890F
|
|
// reference: 3D2076B3D36F2005, 18B3AC778A823B54
|
|
// reference: FB35E2F48C6EAF72, 9CB3C8ECB00A3451
|
|
// reference: 967BE389635BADBF, 4CBB549D39DB351F
|
|
// reference: 84C05BBE0304EC50, F774D0340B24A81F
|
|
// reference: A2957DAB5A967AAF, 5C0D6336E6537060
|
|
// reference: 967BE389E09618B7, 07CB9B868DC81C92
|
|
// reference: 6DD6E7DA4FCDEE24, E5698CA062CC9D0D
|
|
// reference: 40B49130D3CCFA31, 75C1F9AC255E7531
|
|
// reference: 0C76843C86458F41, C79EC961E11066CD
|
|
// reference: 520F2907D3CCFA31, 05B9B50C975EF331
|
|
// reference: 84C05BBEEFB30753, 9B99CEC26430CF02
|
|
// reference: 9526119EC41CE518, A2E44ED8C401C603
|
|
// reference: B850ED3A64C8064D, 00CFF6D036842029
|
|
// reference: 4D3A2E78C36515BA, E53B0D2873A4D170
|
|
// reference: 85C08DB58562480C, BDAB6ED55800EA81
|
|
// reference: B850ED3A650A6C7A, 00CFF6D036842029
|
|
// reference: 4D3A2E78C2A77F8D, E53B0D2873A4D170
|
|
// reference: 85C08DB584A0223B, BDAB6ED55800EA81
|
|
// shader: 8B30, BA86932691684AD3
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((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: 2584B8EB7BE989CC, BA86932691684AD3
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, BA86932691684AD3
|
|
// reference: 2584B8EBF9AE4D88, 68CFCEC8317BD02C
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 68CFCEC8317BD02C
|
|
// shader: 8B30, 7066EA6A19E3FCCD
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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: 76052CFA1519A68B, 7066EA6A19E3FCCD
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 7066EA6A19E3FCCD
|
|
// shader: 8B30, 1F32ED79725D93A6
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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;
|
|
|
|
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: 76052CFAF9AE4D88, 1F32ED79725D93A6
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 1F32ED79725D93A6
|
|
// shader: 8B30, E1E061AEA098445E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((rounded_primary_color.rgb) * (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texture(tex_cube, vec3(texcoord0, texcoord0_w)).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: B368B86CDAC5F819, E1E061AEA098445E
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, E1E061AEA098445E
|
|
// shader: 8B30, 52A786387744C969
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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((secondary_fragment_color.rgb) * (texcolor0.aaa) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 543B2EE021607113, 52A786387744C969
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 52A786387744C969
|
|
// reference: 2584B8EB1519A68B, 8086B9975CDCCB52
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 8086B9975CDCCB52
|
|
// reference: 2584B8EB7A2BE3FB, BA86932691684AD3
|
|
// reference: 2584B8EBF86C27BF, 68CFCEC8317BD02C
|
|
// reference: 76052CFA14DBCCBC, 7066EA6A19E3FCCD
|
|
// reference: 76052CFAF86C27BF, 1F32ED79725D93A6
|
|
// reference: B368B86CDB07922E, E1E061AEA098445E
|
|
// reference: 543B2EE020A21B24, 52A786387744C969
|
|
// reference: 2584B8EB14DBCCBC, 8086B9975CDCCB52
|
|
// shader: 8B30, F07EF37857A04D78
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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;
|
|
|
|
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: B271E6741519A68B, F07EF37857A04D78
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, F07EF37857A04D78
|
|
// reference: B271E67414DBCCBC, F07EF37857A04D78
|
|
// shader: 8B30, 5763B8B96BE11604
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((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) * (rounded_primary_color.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: CC92048FC36F1004, 5763B8B96BE11604
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 5763B8B96BE11604
|
|
// shader: 8B30, 280BEEEBF0AB0E85
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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;
|
|
|
|
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: D51EEC47D85F9839, 280BEEEBF0AB0E85
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 280BEEEBF0AB0E85
|
|
// reference: CC92048FC2AD7A33, 5763B8B96BE11604
|
|
// reference: D51EEC47D99DF20E, 280BEEEBF0AB0E85
|
|
// shader: 8B30, 98975334ACC5F6DC
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor1.rgb);
|
|
float alpha_output_0 = byteround(clamp((rounded_primary_color.a) * (texture(tex_cube, vec3(texcoord0, texcoord0_w)).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) * (texcolor1.aaa) + (texture(tex_cube, vec3(texcoord0, texcoord0_w)).rgb) * (vec3(1.0) - (texcolor1.aaa)), 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), 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: 3C1951662B30DCDF, 98975334ACC5F6DC
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 98975334ACC5F6DC
|
|
// reference: 3C195166D1074863, 98975334ACC5F6DC
|
|
// reference: 3C1951662AF2B6E8, 98975334ACC5F6DC
|
|
// reference: 3C195166D0C52254, 98975334ACC5F6DC
|
|
// shader: 8B30, 6810B033B5FCC1DD
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (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;
|
|
|
|
vec3 color_output_3 = byteround(clamp((vec3(1.0) - texcolor0.rgb) * (const_color[3].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_3 = byteround(clamp((texcolor0.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((texcolor0.rgb) * (const_color[4].rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_4 = byteround(clamp((1.0 - texcolor0.a) * (const_color[4].a) + (last_tex_env_out.a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_4, alpha_output_4);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_5 = byteround(clamp((rounded_primary_color.rgb) * (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = byteround(clamp((rounded_primary_color.a) * (last_tex_env_out.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: E13EE878E9676B03, 6810B033B5FCC1DD
|
|
// program: FC7F4467554D34E5, 1C4CBC8096EA16CD, 6810B033B5FCC1DD
|
|
// shader: 8B30, 3FA2A474066159A4
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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((secondary_fragment_color.rgb) * (texcolor0.aaa) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: BC03A4843CB32066, 3FA2A474066159A4
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 3FA2A474066159A4
|
|
// shader: 8B30, 53DC57443FA26D0C
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = 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;
|
|
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((secondary_fragment_color.rgb) * (texcolor1.rgb) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 24AA8EEBF5981B81, 53DC57443FA26D0C
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 53DC57443FA26D0C
|
|
// shader: 8B30, 55B7D4A8A952D31C
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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((primary_fragment_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: 42891F1ACDA76368, 55B7D4A8A952D31C
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 55B7D4A8A952D31C
|
|
// reference: 42891F1A08CAF7FE, 8086B9975CDCCB52
|
|
// shader: 8B30, CAE015E9283BD061
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (primary_fragment_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: 3F41287AD67C3698, CAE015E9283BD061
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, CAE015E9283BD061
|
|
// reference: BC03A4843D714A51, 3FA2A474066159A4
|
|
// reference: 24AA8EEBF45A71B6, 53DC57443FA26D0C
|
|
// reference: 42891F1ACC65095F, 55B7D4A8A952D31C
|
|
// reference: 42891F1A09089DC9, 8086B9975CDCCB52
|
|
// reference: 3F41287AD7BE5CAF, CAE015E9283BD061
|
|
// reference: 69528647855E702B, E53B0D2873A4D170
|
|
// shader: 8B30, 7199897E8DB3C445
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = 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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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((texcolor0.rgb) * (const_color[0].rgb) + (texcolor1.rgb) * (vec3(1.0) - (const_color[0].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((last_tex_env_out.rgb) + (secondary_fragment_color.rgb), vec3(1.0)) * (primary_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), 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: B84847A518ED18C0, 7199897E8DB3C445
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 7199897E8DB3C445
|
|
// reference: 0C76843C3F48A55A, FD5D90C5DDE6ADF1
|
|
// shader: 8B30, 4C4A987265B2212D
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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((texcolor0.rgb) * (primary_fragment_color.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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 40B49130CB969322, 4C4A987265B2212D
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 4C4A987265B2212D
|
|
// shader: 8B30, F4F9F460FB3A6ADE
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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((texcolor0.rgb) * (primary_fragment_color.rgb) + (secondary_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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 40B491309893304B, F4F9F460FB3A6ADE
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, F4F9F460FB3A6ADE
|
|
// shader: 8B30, B62A81F94BE7598E
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
refl_value.r = 1.0;
|
|
refl_value.g = refl_value.r;
|
|
refl_value.b = refl_value.r;
|
|
specular_sum.a = (lut_scale_fr * LookupLightingLUTUnsigned(3, max(dot(normal, normalize(view)), 0.0)));
|
|
diffuse_sum.rgb += ((light_src[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += (((lut_scale_d0 * LookupLightingLUTUnsigned(0, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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((texcolor0.rgb) * (primary_fragment_color.rgb) + (secondary_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;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((last_tex_env_out.rgb) + (secondary_fragment_color.aaa), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 9526119E28AB0E1B, B62A81F94BE7598E
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, B62A81F94BE7598E
|
|
// shader: 8B30, ECBA8C03859A1A02
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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 = (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) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 520F29070F763465, ECBA8C03859A1A02
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, ECBA8C03859A1A02
|
|
// shader: 8B30, 2460E403B44971E1
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = 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;
|
|
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);
|
|
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) + (light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (const_color[0].aaa) + (texcolor0.rgb) * (vec3(1.0) - (const_color[0].aaa)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((texcolor1.a) * (const_color[0].a) + (texcolor0.a) * (1.0 - (const_color[0].a)), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (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), 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: 65643635A82B4952, 2460E403B44971E1
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 2460E403B44971E1
|
|
// shader: 8B30, 75057E011C57B2C5
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = 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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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((const_color[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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.rgb) * (last_tex_env_out.rgb) + (texcolor1.rgb) * (vec3(1.0) - (last_tex_env_out.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) * (primary_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) * (rounded_primary_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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 6226E99AF6E256C6, 75057E011C57B2C5
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 75057E011C57B2C5
|
|
// shader: 8B30, 628803D3E68EE07A
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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((primary_fragment_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;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 66E1B72566E987CD, 628803D3E68EE07A
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 628803D3E68EE07A
|
|
// shader: 8B30, AE28DE1611A8E376
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) + (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor0.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 59529A056B3ADC02, AE28DE1611A8E376
|
|
// program: 52F532DC13FDB976, 13A54CCD8AA1DDA2, AE28DE1611A8E376
|
|
// reference: 69528647849C1A1C, E53B0D2873A4D170
|
|
// reference: 6226E99AF7203CF1, 75057E011C57B2C5
|
|
// reference: 66E1B725672BEDFA, 628803D3E68EE07A
|
|
// reference: 0C76843C3E8ACF6D, FD5D90C5DDE6ADF1
|
|
// reference: 40B49130CA54F915, 4C4A987265B2212D
|
|
// reference: 40B4913099515A7C, F4F9F460FB3A6ADE
|
|
// reference: 9526119E2969642C, B62A81F94BE7598E
|
|
// reference: 520F29070EB45E52, ECBA8C03859A1A02
|
|
// reference: 65643635A9E92365, 2460E403B44971E1
|
|
// shader: 8B30, 9FDE154D73E8A718
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = vec4(1.0);
|
|
light_vector = normalize(light_src[0].position);
|
|
spot_dir = light_src[0].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
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;
|
|
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);
|
|
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) + (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((texture(tex_cube, vec3(texcoord0, texcoord0_w)).rgb) * (const_color[0].rgb) + (texcolor1.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((last_tex_env_out.rgb) * (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), 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: 85C08DB55F67E429, 9FDE154D73E8A718
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 9FDE154D73E8A718
|
|
// shader: 8B30, E7A0659774C09F57
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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) + (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) + (secondary_fragment_color.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(min((secondary_fragment_color.rgb) + (last_tex_env_out.rgb), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 6DD6E7DAA2B86F10, E7A0659774C09F57
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, E7A0659774C09F57
|
|
// reference: 85C08DB55EA58E1E, 9FDE154D73E8A718
|
|
// reference: 6DD6E7DAA37A0527, E7A0659774C09F57
|
|
// reference: B84847A5192F72F7, 7199897E8DB3C445
|
|
// reference: 2584B8EBA5F86EBF, 68CFCEC8317BD02C
|
|
// reference: 2584B8EBA1852B99, 8086B9975CDCCB52
|
|
// program: 0000000000000000, 0000000000000000, 8086B9975CDCCB52
|
|
// reference: 2584B8EBA04741AE, 8086B9975CDCCB52
|
|
// shader: 8B30, ADBF317026A2C9BB
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((const_color[0].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;
|
|
|
|
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: 86FDD594389A46E0, ADBF317026A2C9BB
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, ADBF317026A2C9BB
|
|
// shader: 8B30, 675610FC3029B6FB
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = (texcolor0.rgb);
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 584C8F8B4D893DD7, 675610FC3029B6FB
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 675610FC3029B6FB
|
|
// reference: 0E5F21B6994F4B69, E53B0D2873A4D170
|
|
// shader: 8B30, 4D59557D137B9626
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = 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(view)), 0.0))) * light_src[0].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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(view)), 0.0))) * light_src[1].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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((texcolor0.rgb) * (const_color[0].rgb) + (texcolor1.rgb) * (vec3(1.0) - (const_color[0].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (const_color[0].a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((last_tex_env_out.rgb) + (secondary_fragment_color.rgb), vec3(1.0)) * (primary_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), 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: F69E5CFA18ED18C0, 4D59557D137B9626
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 4D59557D137B9626
|
|
// shader: 8B30, F3FD6476D55BDFF6
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position + view);
|
|
spot_dir = light_src[1].spot_direction;
|
|
half_vector = normalize(view) + light_vector;
|
|
dot_product = max(dot(light_vector, normal), 0.0);
|
|
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 += ((light_src[1].specular_0) + (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((primary_fragment_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;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 66E1B72512EF7D58, F3FD6476D55BDFF6
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, F3FD6476D55BDFF6
|
|
// shader: 8B30, FE926235DD2F4D22
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((const_color[0].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 = (last_tex_env_out.rgb);
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 5D26AA237F9A02A1, FE926235DD2F4D22
|
|
// program: 0000000000000000, 0000000000000000, FE926235DD2F4D22
|
|
// reference: 2584B8EBF9B50CF1, 68CFCEC8317BD02C
|
|
// shader: 8B30, DB099577AD2DBFFF
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = vec3(0.0, 0.0, 1.0);
|
|
vec3 surface_tangent = vec3(1.0, 0.0, 0.0);
|
|
vec4 normalized_normquat = normalize(normquat);
|
|
vec3 normal = quaternion_rotate(normalized_normquat, surface_normal);
|
|
vec3 tangent = quaternion_rotate(normalized_normquat, surface_tangent);
|
|
vec4 shadow = 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(view)), 0.0))) * light_src[0].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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(view)), 0.0))) * light_src[1].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * 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((const_color[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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((texcolor0.rgb) * (last_tex_env_out.rgb) + (texcolor1.rgb) * (vec3(1.0) - (last_tex_env_out.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) * (primary_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) * (rounded_primary_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;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2CF0F2C5F6E256C6, DB099577AD2DBFFF
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, DB099577AD2DBFFF
|
|
// shader: 8B30, F8B41DF09FA3FFC2
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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[1].position);
|
|
spot_dir = light_src[1].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[1].diffuse * dot_product) + light_src[1].ambient) * 1.0;
|
|
specular_sum.rgb += ((light_src[1].specular_0) + (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((primary_fragment_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: 66E1B7258A5E6CCE, F8B41DF09FA3FFC2
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, F8B41DF09FA3FFC2
|
|
// shader: 8B30, 4C4EC28F9AB434A9
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 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(view)), 0.0))) * light_src[0].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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)));
|
|
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(view)), 0.0))) * light_src[1].specular_0) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (const_color[0].rgb) + (texcolor2.rgb) * (vec3(1.0) - (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;
|
|
|
|
vec3 color_output_1 = byteround(clamp((vec3(1.0) - texcolor2.aaa) * (vec3(1.0) - const_color[1].aaa) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
|
|
vec3 color_output_2 = byteround(clamp((primary_fragment_color.aaa) * (texture(tex_cube, vec3(texcoord0, texcoord0_w)).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((secondary_fragment_color.rgb) * (texcolor2.aaa) + (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((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (primary_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;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 748ADF862F95EEFB, 4C4EC28F9AB434A9
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 4C4EC28F9AB434A9
|
|
// reference: 2584B8EB4CF0AAAD, 68CFCEC8317BD02C
|
|
// program: 0000000000000000, 0000000000000000, 68CFCEC8317BD02C
|
|
// shader: 8B30, 445EFEDC9BE03D50
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((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;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) < alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 2584B8EB2B073EDB, 445EFEDC9BE03D50
|
|
// program: 0000000000000000, 0000000000000000, 445EFEDC9BE03D50
|
|
// reference: 86FDD59439582CD7, ADBF317026A2C9BB
|
|
// reference: 584C8F8B4C4B57E0, 675610FC3029B6FB
|
|
// reference: 0E5F21B6988D215E, E53B0D2873A4D170
|
|
// reference: F69E5CFA192F72F7, 4D59557D137B9626
|
|
// reference: 66E1B725132D176F, F3FD6476D55BDFF6
|
|
// reference: 2837AC7A672BEDFA, 628803D3E68EE07A
|
|
// reference: 2837AC7A66E987CD, 628803D3E68EE07A
|
|
// reference: 2CF0F2C5F7203CF1, DB099577AD2DBFFF
|
|
// reference: 66E1B7258B9C06F9, F8B41DF09FA3FFC2
|
|
// shader: 8B30, C5E4265987407F4F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor0.rgb) * (const_color[0].rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = byteround(clamp((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 = (last_tex_env_out.rgb);
|
|
float alpha_output_1 = byteround(clamp((last_tex_env_out.a) * (const_color[1].a), 0.0, 1.0));
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 5D26AA233A845CC1, C5E4265987407F4F
|
|
// program: 0000000000000000, 0000000000000000, C5E4265987407F4F
|
|
// reference: 5D26AA233B4636F6, C5E4265987407F4F
|
|
// reference: 748ADF862E5784CC, 4C4EC28F9AB434A9
|
|
// reference: 2584B8EB4D32C09A, 68CFCEC8317BD02C
|
|
// shader: 8B30, 846FD3446CF4E119
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor1 = textureLod(tex1, texcoord1, getLod(texcoord1 * vec2(textureSize(tex1, 0))));
|
|
vec4 texcolor2 = textureLod(tex2, texcoord2, getLod(texcoord2 * vec2(textureSize(tex2, 0))));
|
|
|
|
vec4 diffuse_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec4 specular_sum = vec4(0.0, 0.0, 0.0, 1.0);
|
|
vec3 light_vector = vec3(0.0);
|
|
vec3 refl_value = vec3(0.0);
|
|
vec3 spot_dir = vec3(0.0);
|
|
vec3 half_vector = vec3(0.0);
|
|
float dot_product = 0.0;
|
|
float clamp_highlights = 1.0;
|
|
float geo_factor = 1.0;
|
|
vec3 surface_normal = 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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[0].specular_1)) * clamp_highlights * 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);
|
|
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)));
|
|
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) + ((lut_scale_d1 * LookupLightingLUTUnsigned(1, max(dot(normal, normalize(half_vector)), 0.0))) * light_src[1].specular_1)) * clamp_highlights * 1.0;
|
|
diffuse_sum.rgb += lighting_global_ambient;
|
|
primary_fragment_color = clamp(diffuse_sum, vec4(0.0), vec4(1.0));
|
|
secondary_fragment_color = clamp(specular_sum, vec4(0.0), vec4(1.0));
|
|
vec4 combiner_buffer = vec4(0.0);
|
|
vec4 next_combiner_buffer = tev_combiner_buffer_color;
|
|
vec4 last_tex_env_out = vec4(0.0);
|
|
vec3 color_output_0 = byteround(clamp((texcolor1.rgb) * (const_color[0].rgb) + (texcolor2.rgb) * (vec3(1.0) - (const_color[0].rgb)), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_0 = (texcolor1.a);
|
|
last_tex_env_out = vec4(color_output_0, alpha_output_0);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
vec3 color_output_1 = byteround(clamp((vec3(1.0) - texcolor2.aaa) * (vec3(1.0) - secondary_fragment_color.aaa) + (last_tex_env_out.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
next_combiner_buffer.rgb = last_tex_env_out.rgb;
|
|
|
|
vec3 color_output_2 = byteround(clamp((primary_fragment_color.aaa) * (texture(tex_cube, vec3(texcoord0, texcoord0_w)).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((secondary_fragment_color.rgb) * (texcolor2.aaa) + (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((last_tex_env_out.rgb) + (combiner_buffer.rgb), vec3(1.0)) * (primary_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;
|
|
|
|
vec3 color_output_5 = byteround(clamp((last_tex_env_out.rgb) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_5 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_5, alpha_output_5);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
if (int(last_tex_env_out.a * 255.0) <= alphatest_ref) discard;
|
|
gl_FragDepth = depth;
|
|
color = byteround(last_tex_env_out);
|
|
}
|
|
// reference: 3A5CC4D9D69593C9, 846FD3446CF4E119
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 846FD3446CF4E119
|
|
// shader: 8B30, 03AEE4712884976F
|
|
in vec4 primary_color;
|
|
in vec2 texcoord0;
|
|
in vec2 texcoord1;
|
|
in vec2 texcoord2;
|
|
in float texcoord0_w;
|
|
in vec4 normquat;
|
|
in vec3 view;
|
|
|
|
#ifndef CITRA_GLES
|
|
in vec4 gl_FragCoord;
|
|
#endif // CITRA_GLES
|
|
out vec4 color;
|
|
|
|
uniform sampler2D tex0;
|
|
uniform sampler2D tex1;
|
|
uniform sampler2D tex2;
|
|
uniform samplerCube tex_cube;
|
|
uniform samplerBuffer texture_buffer_lut_lf;
|
|
uniform samplerBuffer texture_buffer_lut_rg;
|
|
uniform samplerBuffer texture_buffer_lut_rgba;
|
|
|
|
#define NUM_TEV_STAGES 6
|
|
layout (std140) uniform shader_data {
|
|
int alphatest_ref;
|
|
float depth_scale;
|
|
float depth_offset;
|
|
float shadow_bias_constant;
|
|
float shadow_bias_linear;
|
|
int scissor_x1;
|
|
int scissor_y1;
|
|
int scissor_x2;
|
|
int scissor_y2;
|
|
int fog_lut_offset;
|
|
int proctex_noise_lut_offset;
|
|
int proctex_color_map_offset;
|
|
int proctex_alpha_map_offset;
|
|
int proctex_lut_offset;
|
|
int proctex_diff_lut_offset;
|
|
float proctex_bias;
|
|
vec3 fog_color;
|
|
vec2 proctex_noise_f;
|
|
vec2 proctex_noise_a;
|
|
vec2 proctex_noise_p;
|
|
vec4 const_color[NUM_TEV_STAGES];
|
|
vec4 tev_combiner_buffer_color;
|
|
vec4 clip_coef;
|
|
};
|
|
|
|
#define NUM_LIGHTS 8
|
|
#define NUM_LIGHTING_SAMPLERS 24
|
|
struct LightSrc {
|
|
vec3 specular_0;
|
|
vec3 specular_1;
|
|
vec3 diffuse;
|
|
vec3 ambient;
|
|
vec3 position;
|
|
vec3 spot_direction;
|
|
float dist_atten_bias;
|
|
float dist_atten_scale;
|
|
};
|
|
layout (std140) uniform shader_light_data {
|
|
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
|
|
vec3 lighting_global_ambient;
|
|
LightSrc light_src[NUM_LIGHTS];
|
|
float lut_scale_d0;
|
|
float lut_scale_d1;
|
|
float lut_scale_sp;
|
|
float lut_scale_fr;
|
|
float lut_scale_rb;
|
|
float lut_scale_rg;
|
|
float lut_scale_rr;
|
|
int shadow_texture_bias;
|
|
};
|
|
|
|
// Rotate the vector v by the quaternion q
|
|
vec3 quaternion_rotate(vec4 q, vec3 v) {
|
|
return v + 2.0 * cross(q.xyz, cross(q.xyz, v) + q.w * v);
|
|
}
|
|
|
|
float LookupLightingLUT(int lut_index, int index, float delta) {
|
|
vec2 entry = texelFetch(texture_buffer_lut_lf, lighting_lut_offset[lut_index >> 2][lut_index & 3] + index).rg;
|
|
return entry.r + entry.g * delta;
|
|
}
|
|
|
|
float LookupLightingLUTUnsigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 256.0), 0, 255);
|
|
float delta = pos * 256.0 - float(index);
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float LookupLightingLUTSigned(int lut_index, float pos) {
|
|
int index = clamp(int(pos * 128.0), -128, 127);
|
|
float delta = pos * 128.0 - float(index);
|
|
if (index < 0) index += 256;
|
|
return LookupLightingLUT(lut_index, index, delta);
|
|
}
|
|
|
|
float byteround(float x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec2 byteround(vec2 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec3 byteround(vec3 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
vec4 byteround(vec4 x) {
|
|
return round(x * 255.0) * (1.0 / 255.0);
|
|
}
|
|
|
|
float getLod(vec2 coord) {
|
|
vec2 d = max(abs(dFdx(coord)), abs(dFdy(coord)));
|
|
return log2(max(d.x, d.y));
|
|
}
|
|
|
|
vec4 shadowTexture(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
vec4 shadowTextureCube(vec2 uv, float w) {
|
|
return vec4(1.0);
|
|
}
|
|
|
|
void main() {
|
|
vec4 rounded_primary_color = byteround(primary_color);
|
|
vec4 primary_fragment_color = vec4(0.0);
|
|
vec4 secondary_fragment_color = vec4(0.0);
|
|
float z_over_w = 2.0 * gl_FragCoord.z - 1.0;
|
|
float depth = z_over_w * depth_scale + depth_offset;
|
|
vec4 texcolor0 = textureLod(tex0, texcoord0, getLod(texcoord0 * vec2(textureSize(tex0, 0))));
|
|
|
|
vec4 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;
|
|
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);
|
|
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)));
|
|
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) + (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((const_color[0].rgb) * (primary_fragment_color.rgb) + (secondary_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;
|
|
|
|
vec3 color_output_1 = byteround(clamp(min((last_tex_env_out.rgb) + (primary_fragment_color.aaa), vec3(1.0)) * (rounded_primary_color.rgb), vec3(0.0), vec3(1.0)));
|
|
float alpha_output_1 = (last_tex_env_out.a);
|
|
last_tex_env_out = vec4(color_output_1, alpha_output_1);
|
|
last_tex_env_out = clamp(last_tex_env_out, vec4(0.0), vec4(1.0));
|
|
combiner_buffer = next_combiner_buffer;
|
|
|
|
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: 7D5A6DE47C922F5A, 03AEE4712884976F
|
|
// program: 3A54D4180A96F052, 0D30074279C2FEED, 03AEE4712884976F
|