diff --git a/data/shader/skydome.fsh b/data/shader/skydome.fsh index 68f52d2..9d4ff71 100644 --- a/data/shader/skydome.fsh +++ b/data/shader/skydome.fsh @@ -7,22 +7,44 @@ in vec4 sunPosition; out vec4 oColor; uniform sampler2D uTexture; -uniform sampler2D nightTexture; uniform float farPlane; uniform vec4 fogColor; uniform vec3 cameraCenter; uniform vec3 sunColor; uniform vec3 directionalVector; +uniform float skydomeSize; const float sunSize = 20.0; +const float starSize = 1.0; +const vec4 starColor = vec4(1.0, 1.0, 0.9, 1.0); + +const int starCount = 2; +vec3 starPositions[starCount] = vec3[]( + vec3(-0.3102524288591748, 0.9505037096381865, -0.016915328877346533), + vec3(-0.14085574439428544, 0.9519584459035886, -0.27190950065041153) +); + +float starSizes[starCount] = float[] ( + float(0.5), + float(1.2) +); void main() { vec4 textureColor = vec4(0.0, 0.0, 0.0, 1.0); float sunAngle = -dot(normalize(directionalVector), vec3(0.0, 1.0, 0.0)); vec4 dayColor = texture(uTexture, vTexCoord); if (sunAngle >= 0.0) { - textureColor = mix(dayColor, texture(nightTexture, vTexCoord), sunAngle); - textureColor = mix(vec4(0.0, 0.0, 0.0, 1.0), textureColor, 1.0 - sunAngle); + vec4 nightColor = vec4(0.0, 0.0, 0.0, 1.0); + for(int i = 0; isetUniform("windowSizeX", int(windowSize.x)); flamePostShader->setUniform("windowSizeY", int(windowSize.y)); - skydomeShader->use(); - skydomeShader->setTexture("nightTexture", level->getSkydome()->getNightTexture()->getReference(), 15); - flame_fbo_color_texture = SharedTexture2D(new Texture2D(windowSize, GL_RGBA8)); flame_fbo_color_texture->setMinFilter(GL_NEAREST); flame_fbo_color_texture->setMagFilter(GL_NEAREST); @@ -188,11 +185,11 @@ void Graphics::init(Level* level) { framebuffer_flame->validate(); mergeShader->use(); - mergeShader->setTexture("flame_fbo", flame_fbo_color_texture, 16); - mergeShader->setTexture("light_fbo", light_fbo_color_texture, 17); + mergeShader->setTexture("flame_fbo", flame_fbo_color_texture, 15); + mergeShader->setTexture("light_fbo", light_fbo_color_texture, 16); flameColorShader->use(); - flameColorShader->setTexture("flame_fbo", flame_fbo_color_texture, 18); + flameColorShader->setTexture("flame_fbo", flame_fbo_color_texture, 17); updateClosestLights(); }