-
Notifications
You must be signed in to change notification settings - Fork 28
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
8 changed files
with
145 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#version 140 | ||
|
||
// Inputs should match the vertex shader's outputs. | ||
in vec2 var_texcoord0; | ||
|
||
// The texture to sample. | ||
uniform lowp sampler2D texture0; | ||
|
||
// The final color of the fragment. | ||
out lowp vec4 final_color; | ||
|
||
void main() | ||
{ | ||
// Sample the texture at the fragment's texture coordinates. | ||
vec4 color = texture(texture0, var_texcoord0.xy); | ||
|
||
// Output the sampled color. | ||
final_color = 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,25 @@ | ||
name: "unlit" | ||
tags: "model" | ||
vertex_program: "/example/unlit.vp" | ||
fragment_program: "/example/unlit.fp" | ||
vertex_space: VERTEX_SPACE_LOCAL | ||
vertex_constants { | ||
name: "mtx_world" | ||
type: CONSTANT_TYPE_WORLD | ||
} | ||
vertex_constants { | ||
name: "mtx_view" | ||
type: CONSTANT_TYPE_VIEW | ||
} | ||
vertex_constants { | ||
name: "mtx_proj" | ||
type: CONSTANT_TYPE_PROJECTION | ||
} | ||
samplers { | ||
name: "texture0" | ||
wrap_u: WRAP_MODE_CLAMP_TO_EDGE | ||
wrap_v: WRAP_MODE_CLAMP_TO_EDGE | ||
filter_min: FILTER_MODE_MIN_LINEAR | ||
filter_mag: FILTER_MODE_MAG_LINEAR | ||
max_anisotropy: 0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#version 140 | ||
|
||
// The model's vertex position and texture coordinates. | ||
in vec4 position; | ||
in vec2 texcoord0; | ||
|
||
// The projection, view and world matrices. | ||
uniform general_vp | ||
{ | ||
mat4 mtx_world; | ||
mat4 mtx_view; | ||
mat4 mtx_proj; | ||
}; | ||
|
||
// The output of a vertex shader are passed to the fragment shader. | ||
// The texture coordinates of the vertex. | ||
out vec2 var_texcoord0; | ||
|
||
void main() | ||
{ | ||
// Pass the texture coordinates to the fragment shader. | ||
var_texcoord0 = texcoord0; | ||
|
||
// Transform the vertex position to clip space. | ||
gl_Position = mtx_proj * mtx_view * mtx_world * vec4(position.xyz, 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
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,19 @@ | ||
#version 140 | ||
|
||
// Inputs should match the vertex shader's outputs. | ||
in vec2 var_texcoord0; | ||
|
||
// The texture to sample. | ||
uniform lowp sampler2D texture0; | ||
|
||
// The final color of the fragment. | ||
out lowp vec4 final_color; | ||
|
||
void main() | ||
{ | ||
// Sample the texture at the fragment's texture coordinates. | ||
vec4 color = texture(texture0, var_texcoord0.xy); | ||
|
||
// Output the sampled color. | ||
final_color = 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,25 @@ | ||
name: "unlit" | ||
tags: "model" | ||
vertex_program: "/example/unlit.vp" | ||
fragment_program: "/example/unlit.fp" | ||
vertex_space: VERTEX_SPACE_LOCAL | ||
vertex_constants { | ||
name: "mtx_world" | ||
type: CONSTANT_TYPE_WORLD | ||
} | ||
vertex_constants { | ||
name: "mtx_view" | ||
type: CONSTANT_TYPE_VIEW | ||
} | ||
vertex_constants { | ||
name: "mtx_proj" | ||
type: CONSTANT_TYPE_PROJECTION | ||
} | ||
samplers { | ||
name: "texture0" | ||
wrap_u: WRAP_MODE_CLAMP_TO_EDGE | ||
wrap_v: WRAP_MODE_CLAMP_TO_EDGE | ||
filter_min: FILTER_MODE_MIN_LINEAR | ||
filter_mag: FILTER_MODE_MAG_LINEAR | ||
max_anisotropy: 0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#version 140 | ||
|
||
// The model's vertex position and texture coordinates. | ||
in vec4 position; | ||
in vec2 texcoord0; | ||
|
||
// The projection, view and world matrices. | ||
uniform general_vp | ||
{ | ||
mat4 mtx_world; | ||
mat4 mtx_view; | ||
mat4 mtx_proj; | ||
}; | ||
|
||
// The output of a vertex shader are passed to the fragment shader. | ||
// The texture coordinates of the vertex. | ||
out vec2 var_texcoord0; | ||
|
||
void main() | ||
{ | ||
// Pass the texture coordinates to the fragment shader. | ||
var_texcoord0 = texcoord0; | ||
|
||
// Transform the vertex position to clip space. | ||
gl_Position = mtx_proj * mtx_view * mtx_world * vec4(position.xyz, 1.0); | ||
} |