-
Notifications
You must be signed in to change notification settings - Fork 0
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
5 changed files
with
52 additions
and
17 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,21 @@ | ||
#version 300 es | ||
precision mediump float; | ||
|
||
layout (location = 0) out vec4 fragColor; | ||
layout (location = 1) out vec4 brightColor; | ||
|
||
in vec3 TexCoords; | ||
|
||
uniform samplerCube skybox; | ||
|
||
void main() | ||
{ | ||
fragColor = texture(skybox, TexCoords); | ||
|
||
float brightness = dot(fragColor.rgb, vec3(0.2126, 0.7152, 0.0722)); | ||
if (brightness > 0.2) { | ||
brightColor = vec4(fragColor.rgb, 1.0); | ||
} else { | ||
brightColor = vec4(0.0, 0.0, 0.0, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#version 300 es | ||
precision mediump float; | ||
|
||
layout (location = 0) in vec3 aPos; | ||
|
||
out vec3 TexCoords; | ||
|
||
uniform mat4 matrix; | ||
|
||
void main() | ||
{ | ||
TexCoords = aPos; | ||
vec4 pos = matrix * vec4(aPos, 1.0); | ||
gl_Position = pos.xyww; | ||
} |
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