0% found this document useful (0 votes)
14 views

Geometry 3

Uploaded by

vininunesbn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Geometry 3

Uploaded by

vininunesbn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

#version 320 es

#define CITRA_GLES

#if defined(GL_ANDROID_extension_pack_es31a)
#extension GL_ANDROID_extension_pack_es31a : enable
#endif // defined(GL_ANDROID_extension_pack_es31a)

#if defined(GL_EXT_clip_cull_distance)
#extension GL_EXT_clip_cull_distance : enable
#endif // defined(GL_EXT_clip_cull_distance)

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
#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_data {


int framebuffer_scale;
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;
int shadow_texture_bias;
ivec4 lighting_lut_offset[NUM_LIGHTING_SAMPLERS / 4];
vec3 fog_color;
vec2 proctex_noise_f;
vec2 proctex_noise_a;
vec2 proctex_noise_p;
vec3 lighting_global_ambient;
LightSrc light_src[NUM_LIGHTS];
vec4 const_color[NUM_TEV_STAGES];
vec4 tev_combiner_buffer_color;
vec4 clip_coef;
};

struct pica_uniforms {
bool b[16];
uvec4 i[4];
vec4 f[96];
};

bool exec_shader();

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]);
}

ERROR: 0:97: 'gl_ClipDistance' : undeclared identifier


ERROR: 0:97: 'expression' : left of '[' is not of type array, matrix, or vector
ERROR: 0:97: 'assign' : l-value required (can't modify a const)
ERROR: 0:98: 'gl_ClipDistance' : undeclared identifier
ERROR: 0:98: 'expression' : left of '[' is not of type array, matrix, or vector
ERROR: 0:98: 'assign' : l-value required (can't modify a const)
#

You might also like