|
@@ -404,7 +404,6 @@ const standard_vertex_source = `//
|
|
|
uniform mat4 ModelViewMatrix;
|
|
uniform mat4 ModelViewMatrix;
|
|
|
uniform mat3 NormalMatrix;
|
|
uniform mat3 NormalMatrix;
|
|
|
uniform mat4 MVP;
|
|
uniform mat4 MVP;
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
|
|
|
|
|
#include <lights>
|
|
#include <lights>
|
|
|
#include <material>
|
|
#include <material>
|
|
@@ -464,39 +463,9 @@ out vec4 Position;
|
|
|
out vec3 Normal;
|
|
out vec3 Normal;
|
|
|
out vec3 CamDir;
|
|
out vec3 CamDir;
|
|
|
out vec2 FragTexcoord;
|
|
out vec2 FragTexcoord;
|
|
|
-=======
|
|
|
|
|
-
|
|
|
|
|
-#include <lights>
|
|
|
|
|
-#include <material>
|
|
|
|
|
-#include <phong_model>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-// Outputs for the fragment shader.
|
|
|
|
|
-out vec3 ColorFrontAmbdiff;
|
|
|
|
|
-out vec3 ColorFrontSpec;
|
|
|
|
|
-out vec3 ColorBackAmbdiff;
|
|
|
|
|
-out vec3 ColorBackSpec;
|
|
|
|
|
-out vec2 FragTexcoord;
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
void main() {
|
|
|
|
|
|
|
|
- // Transform this vertex normal to camera coordinates.
|
|
|
|
|
- vec3 normal = normalize(NormalMatrix * VertexNormal);
|
|
|
|
|
-
|
|
|
|
|
- // Calculate this vertex position in camera coordinates
|
|
|
|
|
- vec4 position = ModelViewMatrix * vec4(VertexPosition, 1.0);
|
|
|
|
|
-
|
|
|
|
|
- // Calculate the direction vector from the vertex to the camera
|
|
|
|
|
- // The camera is at 0,0,0
|
|
|
|
|
- vec3 camDir = normalize(-position.xyz);
|
|
|
|
|
->>>>>>> master
|
|
|
|
|
-
|
|
|
|
|
- // Calculates the vertex Ambient+Diffuse and Specular colors using the Phong model
|
|
|
|
|
- // for the front and back
|
|
|
|
|
- phongModel(position, normal, camDir, MatAmbientColor, MatDiffuseColor, ColorFrontAmbdiff, ColorFrontSpec);
|
|
|
|
|
- phongModel(position, -normal, camDir, MatAmbientColor, MatDiffuseColor, ColorBackAmbdiff, ColorBackSpec);
|
|
|
|
|
-
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
// Transform this vertex position to camera coordinates.
|
|
// Transform this vertex position to camera coordinates.
|
|
|
Position = ModelViewMatrix * vec4(VertexPosition, 1.0);
|
|
Position = ModelViewMatrix * vec4(VertexPosition, 1.0);
|
|
|
|
|
|
|
@@ -516,17 +485,6 @@ void main() {
|
|
|
//#endif
|
|
//#endif
|
|
|
FragTexcoord = texcoord;
|
|
FragTexcoord = texcoord;
|
|
|
|
|
|
|
|
-=======
|
|
|
|
|
- vec2 texcoord = VertexTexcoord;
|
|
|
|
|
-#if MAT_TEXTURES > 0
|
|
|
|
|
- // Flips texture coordinate Y if requested.
|
|
|
|
|
- if (MatTexFlipY(0)) {
|
|
|
|
|
- texcoord.y = 1 - texcoord.y;
|
|
|
|
|
- }
|
|
|
|
|
-#endif
|
|
|
|
|
- FragTexcoord = texcoord;
|
|
|
|
|
-
|
|
|
|
|
->>>>>>> master
|
|
|
|
|
gl_Position = MVP * vec4(VertexPosition, 1.0);
|
|
gl_Position = MVP * vec4(VertexPosition, 1.0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -811,7 +769,6 @@ void main() {
|
|
|
|
|
|
|
|
Color = VertexColor;
|
|
Color = VertexColor;
|
|
|
gl_Position = MVP * vec4(VertexPosition, 1.0);
|
|
gl_Position = MVP * vec4(VertexPosition, 1.0);
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -852,8 +809,6 @@ void main() {
|
|
|
|
|
|
|
|
// Final fragment color
|
|
// Final fragment color
|
|
|
FragColor = uBaseColor;
|
|
FragColor = uBaseColor;
|
|
|
-=======
|
|
|
|
|
->>>>>>> master
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -877,10 +832,7 @@ var shaderMap = map[string]string{
|
|
|
"panel_vertex": panel_vertex_source,
|
|
"panel_vertex": panel_vertex_source,
|
|
|
"standard_fragment": standard_fragment_source,
|
|
"standard_fragment": standard_fragment_source,
|
|
|
"standard_vertex": standard_vertex_source,
|
|
"standard_vertex": standard_vertex_source,
|
|
|
-<<<<<<< HEAD
|
|
|
|
|
"physical_vertex": physical_vertex_source,
|
|
"physical_vertex": physical_vertex_source,
|
|
|
-=======
|
|
|
|
|
->>>>>>> master
|
|
|
|
|
"point_fragment": point_fragment_source,
|
|
"point_fragment": point_fragment_source,
|
|
|
"basic_fragment": basic_fragment_source,
|
|
"basic_fragment": basic_fragment_source,
|
|
|
"phong_vertex": phong_vertex_source,
|
|
"phong_vertex": phong_vertex_source,
|