poprawka słońca

This commit is contained in:
sasankasa 2024-02-07 20:19:25 +01:00
parent fda254b25e
commit ab39c86f0a
3 changed files with 9 additions and 9 deletions

View File

@ -112,7 +112,7 @@ vec3 toneMapping(vec3 color)
float random (in vec2 st)
{
return fract(sin(dot(st.xy,
vec2(12.9898,78.233)))*
vec2(32.9898,128.233)))*
43758.5453123);
}

View File

@ -60,7 +60,7 @@ float fbm ( in vec2 _st) {
for (int i = 0; i < NUM_OCTAVES; ++i) {
v += a * noise(_st);
_st = rot * _st * 2.0 + shift;
a *= 0.9;
a *= 0.75;
}
return v;
}
@ -84,11 +84,11 @@ vec4 noiseTexture(float time) {
clamp((f*f)*4.640,0.712,0.056));
color = mix(color,
vec3(0.165,0.006,0.023),
vec3(0.165,0.111,0.036),
clamp(length(q),0.072,0.408));
color = mix(color,
vec3(1.000,0.069,0.060),
vec3(1.000,0.306,0.143),
clamp(length(r.x),0.0,1.0));
noiseColor = vec4((f*f*f+1.384*f*f+1.044*f)*color,1.);
@ -107,15 +107,15 @@ void main()
{
float atmosphereDot = dot(normal, viewDir);
vec3 atmosphereColor = vec3(1.0, 0.08, 0.02);
textureColor = mix(textureColor, atmosphereColor, pow(1 - atmosphereDot, 3));
textureColor = mix(textureColor, atmosphereColor, pow(1 - atmosphereDot, 2));
}
vec3 distance = lightColor / pow(length(lightPos - worldPos), 2.0) * 15;
vec4 textureNoise = noiseTexture(time);
//vec3 mixedTexture = mix(textureColor, textureNoise, textureNoise.r);
//vec3 toneMappedColor = toneMapping(mixedTexture * distance);
vec3 toneMappedColor = toneMapping(textureNoise.rgb * distance);
vec3 mixedTexture = mix(textureColor, textureNoise.rgb, 0.45f);
vec3 toneMappedColor = toneMapping(mixedTexture * distance);
//gamma correction
toneMappedColor = pow(toneMappedColor, vec3(1.0/2.2));

View File

@ -24,7 +24,7 @@ Core::Shader_Loader shaderLoader;
Core::RenderContext sphereContext;
Core::RenderContext cubeContext;
const char* const planetTexPaths[] = { "./textures/planets/earth.jpg", "./textures/planets/mercury.png", "./textures/planets/venus.jpg", "./textures/planets/mars.jpg",
const char* const planetTexPaths[] = { "./textures/planets/mercury.png", "./textures/planets/venus.jpg", "./textures/planets/earth.jpg", "./textures/planets/mars.jpg",
"./textures/planets/jupiter.jpg", "./textures/planets/saturn.jpg", "./textures/planets/uranus.jpg", "./textures/planets/neptune.jpg", "./textures/planets/icy.png",
"./textures/planets/volcanic.png", "./textures/planets/desert.png", "./textures/planets/tropical.png", "./textures/planets/toxic.jpg", "./textures/planets/swamp.png",
"./textures/planets/savannah.png", "./textures/planets/alpine.png", "./textures/planets/ceres.jpg", "./textures/planets/eris.jpg", "./textures/planets/haumea.jpg",