skybox
This commit is contained in:
parent
17ba5bfe64
commit
57685ed075
20 changed files with 282 additions and 13 deletions
|
|
@ -3,6 +3,7 @@
|
|||
varying vec4 vPos;
|
||||
varying vec3 vNrm;
|
||||
varying vec4 vShadowCoord;
|
||||
varying vec4 vColor;
|
||||
|
||||
uniform sampler2D depth_texture;
|
||||
uniform sampler2D current_texture;
|
||||
|
|
@ -62,11 +63,11 @@ float ShadowCoef(void){
|
|||
}
|
||||
|
||||
void main(void){
|
||||
vec4 c = enable_lighting > 0.5 ? PhongShading() : gl_Color;
|
||||
vec4 c = enable_lighting > 0.5 ? PhongShading() : vColor;
|
||||
vec4 ambient = gl_LightSource[0].ambient;
|
||||
float shadow_coef = ShadowCoef();
|
||||
|
||||
//c = c * texture2D(current_texture, gl_TexCoord[0].st);
|
||||
c = c * texture2D(current_texture, gl_TexCoord[0].st);
|
||||
|
||||
gl_FragColor = ambient * shadow_coef * c + (1.0 - ambient) * c;
|
||||
gl_FragColor.a = 1.0;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,15 @@
|
|||
varying vec4 vPos;
|
||||
varying vec3 vNrm;
|
||||
varying vec4 vShadowCoord;
|
||||
varying vec4 vColor;
|
||||
|
||||
void main(void){
|
||||
vPos = gl_ModelViewMatrix * gl_Vertex;
|
||||
vNrm = normalize(gl_NormalMatrix * gl_Normal);
|
||||
vShadowCoord = gl_TextureMatrix[7] * gl_ModelViewMatrix * gl_Vertex;
|
||||
|
||||
vColor = gl_Color;
|
||||
|
||||
gl_Position = gl_ProjectionMatrix * vPos;
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
|
|
|||
BIN
engine/resource/skybox/back.png
Normal file
BIN
engine/resource/skybox/back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 222 KiB |
BIN
engine/resource/skybox/down.png
Normal file
BIN
engine/resource/skybox/down.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 306 KiB |
BIN
engine/resource/skybox/front.png
Normal file
BIN
engine/resource/skybox/front.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
BIN
engine/resource/skybox/left.png
Normal file
BIN
engine/resource/skybox/left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 231 KiB |
BIN
engine/resource/skybox/right.png
Normal file
BIN
engine/resource/skybox/right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 249 KiB |
BIN
engine/resource/skybox/up.png
Normal file
BIN
engine/resource/skybox/up.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
Loading…
Add table
Add a link
Reference in a new issue