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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue