-
Notifications
You must be signed in to change notification settings - Fork 1
/
mesh.glfs
31 lines (25 loc) · 1.17 KB
/
mesh.glfs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#version 150
in vec3 normal_eye;
in vec3 position_eye;
in vec4 color_fs;
in vec2 texcoord_fs;
//***** begin interface of fragment.glfs ***********************************
uniform float gamma = 2.2;
void finish_fragment(vec4 color);
//***** end interface of fragment.glfs ***********************************
//***** begin interface of surface.glsl ***********************************
vec4 compute_reflected_appearance_texture(vec3 position_eye, vec3 normal_eye, vec2 texcoords, vec4 color, int side);
//***** end interface of surface.glsl ***********************************
//***** begin interface of side.glsl ***********************************
bool keep_this_side(in vec3 position, in vec3 normal, out int side);
void update_material_color_and_transparency(inout vec3 mat_color, inout float transparency, in int side, in vec4 color);
void update_normal(inout vec3 normal, in int side);
//***** end interface of side.glsl ***********************************
void main()
{
vec3 normal = normalize(normal_eye);
int side;
if (!keep_this_side(position_eye, normal, side))
discard;
finish_fragment(compute_reflected_appearance_texture(position_eye, normal, texcoord_fs, color_fs, side));
}