Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consistent naming pattern for shader variables.
- Loading branch information
Showing
3 changed files
with
25 additions
and
22 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,13 @@ | ||
#version 120 | ||
|
||
varying vec4 color_mod; | ||
varying vec4 color_draw; | ||
varying vec2 pos; | ||
varying float submerge_amount; | ||
varying vec4 frag_color_mod; | ||
varying vec4 frag_draw_color; | ||
varying vec2 frag_texture_pos; | ||
varying float frag_submerge; | ||
uniform sampler2D tex; | ||
|
||
void main() | ||
{ | ||
gl_FragColor = texture2D(tex, pos) + color_draw + color_mod; | ||
gl_FragColor = texture2D(tex, frag_texture_pos) | ||
+ frag_draw_color + frag_color_mod; | ||
} |
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,24 +1,24 @@ | ||
#version 120 | ||
|
||
// Required by SDL_gpu | ||
attribute vec4 draw_color; | ||
attribute vec3 vertex; | ||
attribute vec2 texture_pos; | ||
attribute vec4 color; | ||
attribute float submerge; | ||
attribute vec4 vert_draw_color; | ||
attribute vec3 vert_vertex; | ||
attribute vec2 vert_texture_pos; | ||
attribute vec4 vert_color_mod; | ||
attribute float vert_submerge; | ||
|
||
uniform mat4 model_view_proj; | ||
|
||
varying vec4 color_mod; | ||
varying vec2 pos; | ||
varying float submerge_amount; | ||
varying vec4 color_draw; | ||
varying vec4 frag_color_mod; | ||
varying vec2 frag_texture_pos; | ||
varying float frag_submerge; | ||
varying vec4 frag_draw_color; | ||
|
||
void main() | ||
{ | ||
pos = vec2(texture_pos); | ||
color_mod = color; | ||
color_draw = draw_color; | ||
submerge_amount = submerge; | ||
gl_Position = model_view_proj * vec4(vertex, 1.0); | ||
frag_texture_pos = vert_texture_pos; | ||
frag_color_mod = vert_color_mod; | ||
frag_draw_color = vert_draw_color; | ||
frag_submerge = vert_submerge; | ||
gl_Position = model_view_proj * vec4(vert_vertex, 1.0); | ||
} |
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