diff options
author | rom <romangraef@gmail.com> | 2021-04-23 23:29:43 +0200 |
---|---|---|
committer | rom <romangraef@gmail.com> | 2021-04-23 23:59:12 +0200 |
commit | e5b6ba623aeb28ad9408358c58a3da12b1126396 (patch) | |
tree | 70b3474196f28e4a2059c245888a6a4ac91a677b /txtgameengine/builtin_shaders | |
parent | 99ab218d9a0964a9de10cf621ff82d4fbaaf50b9 (diff) | |
download | txtgameengine-e5b6ba623aeb28ad9408358c58a3da12b1126396.tar.gz txtgameengine-e5b6ba623aeb28ad9408358c58a3da12b1126396.tar.bz2 txtgameengine-e5b6ba623aeb28ad9408358c58a3da12b1126396.zip |
textures
Diffstat (limited to 'txtgameengine/builtin_shaders')
-rw-r--r-- | txtgameengine/builtin_shaders/basic/fragment.glsl | 6 | ||||
-rw-r--r-- | txtgameengine/builtin_shaders/basic/vertex.glsl | 7 | ||||
-rw-r--r-- | txtgameengine/builtin_shaders/texture/fragment.glsl | 12 | ||||
-rw-r--r-- | txtgameengine/builtin_shaders/texture/vertex.glsl | 12 |
4 files changed, 37 insertions, 0 deletions
diff --git a/txtgameengine/builtin_shaders/basic/fragment.glsl b/txtgameengine/builtin_shaders/basic/fragment.glsl new file mode 100644 index 0000000..a9dfa6f --- /dev/null +++ b/txtgameengine/builtin_shaders/basic/fragment.glsl @@ -0,0 +1,6 @@ +#version 330 core + +out vec4 fragColor; +void main() { + fragColor = vec4(0, 0, 1, 1); +}
\ No newline at end of file diff --git a/txtgameengine/builtin_shaders/basic/vertex.glsl b/txtgameengine/builtin_shaders/basic/vertex.glsl new file mode 100644 index 0000000..92f7c97 --- /dev/null +++ b/txtgameengine/builtin_shaders/basic/vertex.glsl @@ -0,0 +1,7 @@ +#version 330 core + +layout(location = 0) in vec2 vertexPosition_modelspace; + +void main() { + gl_Position = vec4(vertexPosition_modelspace, 0, 1); +} diff --git a/txtgameengine/builtin_shaders/texture/fragment.glsl b/txtgameengine/builtin_shaders/texture/fragment.glsl new file mode 100644 index 0000000..d9d36fd --- /dev/null +++ b/txtgameengine/builtin_shaders/texture/fragment.glsl @@ -0,0 +1,12 @@ +#version 330 core + +in vec2 UV; + +out vec3 color; + +uniform sampler2D textureSampler; + +void main() { + color = texture(textureSampler, UV).rgb; +} + diff --git a/txtgameengine/builtin_shaders/texture/vertex.glsl b/txtgameengine/builtin_shaders/texture/vertex.glsl new file mode 100644 index 0000000..dd93afb --- /dev/null +++ b/txtgameengine/builtin_shaders/texture/vertex.glsl @@ -0,0 +1,12 @@ +#version 330 core + +layout(location=0) in vec3 vertexPosition_modelspace; +layout(location=1) in vec2 vertexUV; + +out vec2 UV; + +void main() { + gl_Position = vec4(vertexPosition_modelspace, 1); + UV = vertexUV; +} + |