Added Cubemap
This commit is contained in:
1 parent
f749b29c31
commit
9158de2f39
22 files changed
+325
-16
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#version 330 core
|
||||
|
||||
in vec3 texCoord;
|
||||
|
||||
uniform samplerCube cm;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
vec3 tc;
|
||||
tc = vec3(-texCoord.x, texCoord.y, texCoord.z);
|
||||
if (texCoord.y > 0.99 || texCoord.y < -0.99) {
|
||||
tc = vec3(texCoord.x, texCoord.y, texCoord.z);
|
||||
}
|
||||
color = texture(cm, tc);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#version 330 core
|
||||
|
||||
layout(location = 0) in vec3 pos;
|
||||
|
||||
uniform mat4 view;
|
||||
uniform mat4 proj;
|
||||
|
||||
out vec3 texCoord;
|
||||
|
||||
void main() {
|
||||
texCoord = pos;
|
||||
|
||||
vec4 vertexPos = proj * view * vec4(pos, 1.0);
|
||||
gl_Position = vertexPos.xyww;
|
||||
}
|
||||
Reference in new issue
Block a user