-
Notifications
You must be signed in to change notification settings - Fork 34
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
10 changed files
with
73 additions
and
25 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#version 120 | ||
|
||
varying vec4 v_color; | ||
varying vec4 v_coord3d; | ||
varying vec2 v_texCoord; | ||
|
||
uniform sampler2D u_tex; | ||
|
||
void main() { | ||
vec4 color = v_color; | ||
|
||
if (v_texCoord.x != -1 && v_texCoord.y != -1) { | ||
color = texture2D(u_tex, v_texCoord); | ||
|
||
if (color.r == color.g && color.g == color.b) { | ||
color *= v_color; | ||
} | ||
} | ||
|
||
if (color.a < 0.3) discard; | ||
|
||
gl_FragColor = color; | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#version 120 | ||
|
||
attribute vec4 color; | ||
attribute vec4 coord3d; | ||
attribute vec2 texCoord; | ||
|
||
varying vec4 v_color; | ||
varying vec4 v_coord3d; | ||
varying vec2 v_texCoord; | ||
|
||
uniform mat4 u_modelMatrix; | ||
uniform mat4 u_projectionMatrix; | ||
uniform mat4 u_viewMatrix; | ||
|
||
void main() { | ||
v_coord3d = u_modelMatrix * vec4(coord3d.xyz, 1.0); | ||
v_color = color; | ||
v_texCoord = texCoord; | ||
|
||
gl_Position = u_projectionMatrix * u_viewMatrix * v_coord3d; | ||
} | ||
|
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
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
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