|
|
@@ -1,4 +1,4 @@
|
|
|
-// File generated by G3NSHADERS. Do not edit.
|
|
|
+// Code generated by G3NSHADERS. DO NOT EDIT.
|
|
|
// To regenerate this file install 'g3nshaders' and execute:
|
|
|
// 'go generate' in this folder.
|
|
|
|
|
|
@@ -1110,77 +1110,6 @@ void main() {
|
|
|
|
|
|
`
|
|
|
|
|
|
-const sprite_fragment_source = `//
|
|
|
-// Fragment shader for sprite
|
|
|
-//
|
|
|
-
|
|
|
-precision highp float;
|
|
|
-
|
|
|
-#include <material>
|
|
|
-
|
|
|
-// Inputs from vertex shader
|
|
|
-in vec3 Color;
|
|
|
-in vec2 FragTexcoord;
|
|
|
-
|
|
|
-// Output
|
|
|
-out vec4 FragColor;
|
|
|
-
|
|
|
-void main() {
|
|
|
-
|
|
|
- // Combine all texture colors and opacity
|
|
|
- vec4 texCombined = vec4(1);
|
|
|
-#if MAT_TEXTURES>0
|
|
|
- for (int i = 0; i < {{.MatTexturesMax}}; i++) {
|
|
|
- vec4 texcolor = texture(MatTexture[i], FragTexcoord * MatTexRepeat(i) + MatTexOffset(i));
|
|
|
- if (i == 0) {
|
|
|
- texCombined = texcolor;
|
|
|
- } else {
|
|
|
- texCombined = mix(texCombined, texcolor, texcolor.a);
|
|
|
- }
|
|
|
- }
|
|
|
-#endif
|
|
|
-
|
|
|
- // Combine material color with texture
|
|
|
- FragColor = min(vec4(Color, MatOpacity) * texCombined, vec4(1));
|
|
|
-}
|
|
|
-
|
|
|
-`
|
|
|
-
|
|
|
-const sprite_vertex_source = `//
|
|
|
-// Vertex shader for sprites
|
|
|
-//
|
|
|
-
|
|
|
-#include <attributes>
|
|
|
-
|
|
|
-// Input uniforms
|
|
|
-uniform mat4 MVP;
|
|
|
-
|
|
|
-#include <material>
|
|
|
-
|
|
|
-// Outputs for fragment shader
|
|
|
-out vec3 Color;
|
|
|
-out vec2 FragTexcoord;
|
|
|
-
|
|
|
-void main() {
|
|
|
-
|
|
|
- // Applies transformation to vertex position
|
|
|
- gl_Position = MVP * vec4(VertexPosition, 1.0);
|
|
|
-
|
|
|
- // Outputs color
|
|
|
- Color = MatDiffuseColor;
|
|
|
-
|
|
|
- // Flips texture coordinate Y if requested.
|
|
|
- vec2 texcoord = VertexTexcoord;
|
|
|
-#if MAT_TEXTURES>0
|
|
|
- if (MatTexFlipY[0]) {
|
|
|
- texcoord.y = 1.0 - texcoord.y;
|
|
|
- }
|
|
|
-#endif
|
|
|
- FragTexcoord = texcoord;
|
|
|
-}
|
|
|
-
|
|
|
-`
|
|
|
-
|
|
|
const standard_fragment_source = `//
|
|
|
// Fragment Shader template
|
|
|
//
|
|
|
@@ -1315,8 +1244,6 @@ var shaderMap = map[string]string{
|
|
|
"physical_vertex": physical_vertex_source,
|
|
|
"point_fragment": point_fragment_source,
|
|
|
"point_vertex": point_vertex_source,
|
|
|
- "sprite_fragment": sprite_fragment_source,
|
|
|
- "sprite_vertex": sprite_vertex_source,
|
|
|
"standard_fragment": standard_fragment_source,
|
|
|
"standard_vertex": standard_vertex_source,
|
|
|
}
|
|
|
@@ -1329,6 +1256,5 @@ var programMap = map[string]ProgramInfo{
|
|
|
"phong": {"phong_vertex", "phong_fragment", ""},
|
|
|
"physical": {"physical_vertex", "physical_fragment", ""},
|
|
|
"point": {"point_vertex", "point_fragment", ""},
|
|
|
- "sprite": {"sprite_vertex", "sprite_fragment", ""},
|
|
|
"standard": {"standard_vertex", "standard_fragment", ""},
|
|
|
}
|