summaryrefslogtreecommitdiffhomepage
path: root/examples/shaders/resources
diff options
context:
space:
mode:
authorRay <[email protected]>2023-05-04 20:35:20 +0200
committerRay <[email protected]>2023-05-04 20:35:20 +0200
commit5573f0f1c7b29bfe46d0b70487e4adb4d01cba62 (patch)
tree2efc30e6f3b278d98b2db2a58bfd45684ec77a04 /examples/shaders/resources
parentabcbd9817e9163bd10008b42848dfa2d72ebb6c5 (diff)
downloadraylib-5573f0f1c7b29bfe46d0b70487e4adb4d01cba62.tar.gz
raylib-5573f0f1c7b29bfe46d0b70487e4adb4d01cba62.zip
REVIEWED: Ligthmap example
Diffstat (limited to 'examples/shaders/resources')
-rw-r--r--examples/shaders/resources/shaders/glsl330/lightmap.fs13
-rw-r--r--examples/shaders/resources/shaders/glsl330/lightmap.vs8
2 files changed, 13 insertions, 8 deletions
diff --git a/examples/shaders/resources/shaders/glsl330/lightmap.fs b/examples/shaders/resources/shaders/glsl330/lightmap.fs
index 95558610..827473d2 100644
--- a/examples/shaders/resources/shaders/glsl330/lightmap.fs
+++ b/examples/shaders/resources/shaders/glsl330/lightmap.fs
@@ -1,4 +1,5 @@
#version 330
+
// Input vertex attributes (from vertex shader)
in vec2 fragTexCoord;
in vec2 fragTexCoord2;
@@ -12,9 +13,11 @@ uniform sampler2D texture1;
// Output fragment color
out vec4 finalColor;
-void main() {
- // Texel color fetching from texture sampler
- vec4 texelColor = texture( texture0, fragTexCoord );
- vec4 texelColor2 = texture( texture1, fragTexCoord2 );
- finalColor = texelColor * texelColor2;
+void main()
+{
+ // Texel color fetching from texture sampler
+ vec4 texelColor = texture(texture0, fragTexCoord);
+ vec4 texelColor2 = texture(texture1, fragTexCoord2);
+
+ finalColor = texelColor * texelColor2;
}
diff --git a/examples/shaders/resources/shaders/glsl330/lightmap.vs b/examples/shaders/resources/shaders/glsl330/lightmap.vs
index 00278eaa..d92c2f09 100644
--- a/examples/shaders/resources/shaders/glsl330/lightmap.vs
+++ b/examples/shaders/resources/shaders/glsl330/lightmap.vs
@@ -1,4 +1,5 @@
#version 330
+
// Input vertex attributes
in vec3 vertexPosition;
in vec2 vertexTexCoord;
@@ -15,13 +16,14 @@ out vec2 fragTexCoord;
out vec2 fragTexCoord2;
out vec4 fragColor;
-void main() {
+void main()
+{
// Send vertex attributes to fragment shader
- fragPosition = vec3( matModel * vec4( vertexPosition, 1.0 ) );
+ fragPosition = vec3(matModel*vec4(vertexPosition, 1.0));
fragTexCoord = vertexTexCoord;
fragTexCoord2 = vertexTexCoord2;
fragColor = vertexColor;
// Calculate final vertex position
- gl_Position = mvp * vec4( vertexPosition, 1.0 );
+ gl_Position = mvp*vec4(vertexPosition, 1.0);
}