src/gl/compiler.cpp

changeset 119
24275a4064f4
parent 115
ed884a2fb009
child 139
72098474d362
equal deleted inserted replaced
118:8e1c9f18ae15 119:24275a4064f4
46 const int FRAGSTYLE_Normal = 0; 46 const int FRAGSTYLE_Normal = 0;
47 const int FRAGSTYLE_BfcGreen = 1; 47 const int FRAGSTYLE_BfcGreen = 1;
48 const int FRAGSTYLE_BfcRed = 2; 48 const int FRAGSTYLE_BfcRed = 2;
49 const int FRAGSTYLE_Random = 3; 49 const int FRAGSTYLE_Random = 3;
50 const int FRAGSTYLE_Id = 4; 50 const int FRAGSTYLE_Id = 4;
51 const int FRAGSTYLE_Black = 5;
51 52
52 void main() 53 void main()
53 { 54 {
54 mat3 normalMatrix = transpose(inverse(mat3(modelMatrix))); 55 mat3 normalMatrix = transpose(inverse(mat3(modelMatrix)));
55 vNormal = normalize(normalMatrix * normal); 56 vNormal = normalize(normalMatrix * normal);
74 vColor = vec4(0.2, 0.9, 0.2, 1.0); 75 vColor = vec4(0.2, 0.9, 0.2, 1.0);
75 } 76 }
76 else if (fragmentStyle == FRAGSTYLE_BfcRed) 77 else if (fragmentStyle == FRAGSTYLE_BfcRed)
77 { 78 {
78 vColor = vec4(0.9, 0.2, 0.2, 1.0); 79 vColor = vec4(0.9, 0.2, 0.2, 1.0);
80 }
81 else if (fragmentStyle == FRAGSTYLE_Black)
82 {
83 vColor = vec4(0.0, 0.0, 0.0, 1.0);
79 } 84 }
80 else 85 else
81 { 86 {
82 vColor = color; 87 vColor = color;
83 } 88 }

mercurial