-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
148 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,37 @@ | ||
#version 450 | ||
|
||
uniform sampler2D tex; | ||
uniform sampler2D tex0; | ||
uniform sampler2D tex1; | ||
uniform sampler2D tex2; | ||
uniform sampler2D tex3; | ||
uniform sampler2D tex4; | ||
uniform sampler2D tex5; | ||
uniform sampler2D tex6; | ||
uniform sampler2D tex7; | ||
in float texIndex; | ||
in vec2 texCoord; | ||
in vec4 color; | ||
out vec4 FragColor; | ||
|
||
void main() { | ||
vec4 texcolor = texture(tex, texCoord) * color; | ||
vec4 texcolor; | ||
if (texIndex < 0.5) { | ||
texcolor = texture(tex0, texCoord) * color; | ||
} else if (texIndex < 1.5) { | ||
texcolor = texture(tex1, texCoord) * color; | ||
} else if (texIndex < 2.5) { | ||
texcolor = texture(tex2, texCoord) * color; | ||
} else if (texIndex < 3.5) { | ||
texcolor = texture(tex3, texCoord) * color; | ||
} else if (texIndex < 4.5) { | ||
texcolor = texture(tex4, texCoord) * color; | ||
} else if (texIndex < 5.5) { | ||
texcolor = texture(tex5, texCoord) * color; | ||
} else if (texIndex < 6.5) { | ||
texcolor = texture(tex6, texCoord) * color; | ||
} else { | ||
texcolor = texture(tex7, texCoord) * color; | ||
} | ||
texcolor.rgb *= color.a; | ||
FragColor = texcolor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters