Working
This commit is contained in:
1 parent
05bf63d447
commit
2b19a3eaba
21 files changed
+309
No files matched your search
@@ -0,0 +1,13 @@
|
||||
uniform samplerCube Texture;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = textureCube(Texture, normalize(dir));
|
||||
//if (dir.z < 0)
|
||||
//{
|
||||
// gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
//}
|
||||
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
attribute vec3 vPosition;
|
||||
|
||||
uniform mat4 ProjectionModelViewMatrix;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
vec4 realVertexPos = vec4(vPosition.xyz, 1.0);
|
||||
gl_Position = ProjectionModelViewMatrix * realVertexPos;
|
||||
|
||||
dir = vPosition;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
uniform samplerCube Env;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = textureCube(Env, normalize(dir));
|
||||
|
||||
vec4 fogColor = vec4(0.25, 0.55, 1.0, 1.0);
|
||||
|
||||
float coef = dir.y+1.0;
|
||||
coef = clamp(coef, 0.0, 1.0);
|
||||
|
||||
gl_FragColor = mix(gl_FragColor,fogColor, coef);
|
||||
|
||||
//if (dir.z < 0)
|
||||
//{
|
||||
// gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
//}
|
||||
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
attribute vec3 vPosition;
|
||||
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat3 ModelRotateMatrix;
|
||||
uniform vec3 ModelTranslateVector;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
|
||||
gl_Position = ProjectionMatrix * realVertexPos;
|
||||
|
||||
dir = -vPosition;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
uniform samplerCube Env;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
gl_FragColor = textureCube(Env, normalize(dir));
|
||||
|
||||
vec4 fogColor = vec4(0.05, 0.05, 0.1, 1.0);
|
||||
|
||||
float coef = dir.y+1.0;
|
||||
coef = clamp(coef, 0.0, 1.0);
|
||||
|
||||
gl_FragColor = mix(gl_FragColor,fogColor, coef);
|
||||
|
||||
//if (dir.z < 0)
|
||||
//{
|
||||
// gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
//}
|
||||
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
attribute vec3 vPosition;
|
||||
|
||||
uniform mat4 ProjectionMatrix;
|
||||
uniform mat3 ModelRotateMatrix;
|
||||
uniform vec3 ModelTranslateVector;
|
||||
|
||||
varying vec3 dir;
|
||||
|
||||
void main(){
|
||||
vec4 realVertexPos = vec4(ModelRotateMatrix * vPosition.xyz + ModelTranslateVector, 1.0);
|
||||
gl_Position = ProjectionMatrix * realVertexPos;
|
||||
|
||||
dir = -vPosition;
|
||||
}
|
||||
Reference in new issue
Block a user