| @@ -27,17 +27,17 @@ import { | |||
| const SkyBoxFS = ` | |||
| uniform samplerCube u_cubeMap; | |||
| varying vec3 v_texCoord; | |||
| in vec3 v_texCoord; | |||
| void main() | |||
| { | |||
| vec4 color = textureCube(u_cubeMap, normalize(v_texCoord)); | |||
| gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); | |||
| vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); | |||
| out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); | |||
| } | |||
| ` | |||
| const SkyBoxVS = ` | |||
| attribute vec3 position; | |||
| varying vec3 v_texCoord; | |||
| in vec3 position; | |||
| out vec3 v_texCoord; | |||
| uniform mat3 u_rotateMatrix; | |||
| void main() | |||
| { | |||
| @@ -1,8 +1,9 @@ | |||
| in vec2 v_textureCoordinates; | |||
| uniform sampler2D colorTexture; | |||
| uniform sampler2D depthTexture; | |||
| uniform vec4 fogByDistance; | |||
| uniform vec4 fogColor; | |||
| varying vec2 v_textureCoordinates; | |||
| float getDistance(sampler2D depthTexture, vec2 texCoords){ | |||
| float depth = czm_unpackDepth(texture(depthTexture, texCoords)); | |||
| @@ -32,5 +33,5 @@ void main(void){ | |||
| vec4 sceneColor = texture(colorTexture, v_textureCoordinates); | |||
| float blendAmount = interpolateByDistance(fogByDistance, distance); | |||
| vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); | |||
| gl_FragColor = alphaBlend(finalFogColor, sceneColor); | |||
| out_FragColor = alphaBlend(finalFogColor, sceneColor); | |||
| } | |||
| @@ -1,5 +1,5 @@ | |||
| in vec2 v_textureCoordinates; | |||
| uniform sampler2D colorTexture; | |||
| varying vec2 v_textureCoordinates; | |||
| uniform float speed; | |||
| uniform float mixNum; | |||
| @@ -19,5 +19,5 @@ void main(){ | |||
| float v=1.-sin(hash(floor(uv.x*100.))*2.); | |||
| float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*10.; | |||
| c*=v*b; | |||
| gl_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), mixNum); | |||
| out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), mixNum); | |||
| } | |||
| @@ -1,5 +1,5 @@ | |||
| in vec2 v_textureCoordinates; | |||
| uniform sampler2D colorTexture; | |||
| varying vec2 v_textureCoordinates; | |||
| uniform float speed; | |||
| float snow(vec2 uv,float scale){ | |||
| @@ -29,5 +29,5 @@ void main(){ | |||
| c+=snow(uv,6.); | |||
| c+=snow(uv,5.); | |||
| finalColor=(vec3(c)); | |||
| gl_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3); | |||
| out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3); | |||
| } | |||