import msp_interface; import shadow; layout(constant_id=auto) const bool use_normal_map = false; #pragma MSP stage(vertex) vec4 get_vertex_position() { return vertex; } vec3 get_vertex_normal() { return normal; } vec4 transform_position(vec4 pos) { return eye_obj_matrix*pos; } vec3 transform_normal(vec3 nor) { return eye_obj_normal_matrix*nor; } void standard_transform() { out vec4 eye_vertex = transform_position(get_vertex_position()); gl_Position = projection_matrix*eye_vertex; out vec3 eye_normal = transform_normal(get_vertex_normal()); vec3 eye_tangent = transform_normal(tangent); vec3 eye_binormal = transform_normal(binormal); out mat3 eye_tbn_matrix = mat3(eye_tangent, eye_binormal, eye_normal); out vec3 eye_look_dir = normalize(eye_vertex.xyz); out vec3 tbn_look_dir = eye_look_dir*eye_tbn_matrix; out vec3 eye_light_dir = normalize(light_sources[0].position.xyz-eye_vertex.xyz*light_sources[0].position.w); out vec3 tbn_light_dir = eye_light_dir*eye_tbn_matrix; out vec3 eye_halfway_dir = normalize(eye_light_dir-eye_look_dir); out vec3 tbn_halfway_dir = eye_halfway_dir*eye_tbn_matrix; out vec3 tbn_zenith_dir = eye_zenith_dir*eye_tbn_matrix; out float fog_coord = eye_vertex.z; for(int i=0; i