gl_Position = clip_eye_matrix*eye_vertex;
out vec3 world_normal = normal_tf*get_vertex_normal();
- vec3 world_tangent = normal_tf*tangent;
- vec3 world_binormal = cross(world_normal, world_tangent);
- out mat3 world_tbn_matrix = mat3(world_tangent, world_binormal, world_normal);
+ if(use_normal_map)
+ {
+ vec3 world_tangent = normal_tf*tangent;
+ vec3 world_binormal = cross(world_normal, world_tangent);
+ out mat3 world_tbn_matrix = mat3(world_tangent, world_binormal, world_normal);
+ }
- vec3 eye_pos = (inverse(eye_world_matrix)*vec4(0.0, 0.0, 0.0, 1.0)).xyz;
+ vec3 eye_pos = world_eye_matrix[3].xyz;
out vec3 world_look_dir = normalize(world_vertex.xyz-eye_pos);
out float fog_coord = eye_vertex.z;
-
- if(use_clipping)
- {
- for(int i=0; i<max_clip_planes; ++i)
- gl_ClipDistance[i] = dot(world_vertex, clip_planes[i].equation);
- }
}
virtual void custom_transform()