poprawka słońca
This commit is contained in:
parent
fda254b25e
commit
ab39c86f0a
@ -112,7 +112,7 @@ vec3 toneMapping(vec3 color)
|
|||||||
float random (in vec2 st)
|
float random (in vec2 st)
|
||||||
{
|
{
|
||||||
return fract(sin(dot(st.xy,
|
return fract(sin(dot(st.xy,
|
||||||
vec2(12.9898,78.233)))*
|
vec2(32.9898,128.233)))*
|
||||||
43758.5453123);
|
43758.5453123);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ float fbm ( in vec2 _st) {
|
|||||||
for (int i = 0; i < NUM_OCTAVES; ++i) {
|
for (int i = 0; i < NUM_OCTAVES; ++i) {
|
||||||
v += a * noise(_st);
|
v += a * noise(_st);
|
||||||
_st = rot * _st * 2.0 + shift;
|
_st = rot * _st * 2.0 + shift;
|
||||||
a *= 0.9;
|
a *= 0.75;
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
@ -84,11 +84,11 @@ vec4 noiseTexture(float time) {
|
|||||||
clamp((f*f)*4.640,0.712,0.056));
|
clamp((f*f)*4.640,0.712,0.056));
|
||||||
|
|
||||||
color = mix(color,
|
color = mix(color,
|
||||||
vec3(0.165,0.006,0.023),
|
vec3(0.165,0.111,0.036),
|
||||||
clamp(length(q),0.072,0.408));
|
clamp(length(q),0.072,0.408));
|
||||||
|
|
||||||
color = mix(color,
|
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));
|
clamp(length(r.x),0.0,1.0));
|
||||||
|
|
||||||
noiseColor = vec4((f*f*f+1.384*f*f+1.044*f)*color,1.);
|
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);
|
float atmosphereDot = dot(normal, viewDir);
|
||||||
vec3 atmosphereColor = vec3(1.0, 0.08, 0.02);
|
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;
|
vec3 distance = lightColor / pow(length(lightPos - worldPos), 2.0) * 15;
|
||||||
|
|
||||||
vec4 textureNoise = noiseTexture(time);
|
vec4 textureNoise = noiseTexture(time);
|
||||||
//vec3 mixedTexture = mix(textureColor, textureNoise, textureNoise.r);
|
vec3 mixedTexture = mix(textureColor, textureNoise.rgb, 0.45f);
|
||||||
//vec3 toneMappedColor = toneMapping(mixedTexture * distance);
|
|
||||||
vec3 toneMappedColor = toneMapping(textureNoise.rgb * distance);
|
vec3 toneMappedColor = toneMapping(mixedTexture * distance);
|
||||||
//gamma correction
|
//gamma correction
|
||||||
toneMappedColor = pow(toneMappedColor, vec3(1.0/2.2));
|
toneMappedColor = pow(toneMappedColor, vec3(1.0/2.2));
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ Core::Shader_Loader shaderLoader;
|
|||||||
Core::RenderContext sphereContext;
|
Core::RenderContext sphereContext;
|
||||||
Core::RenderContext cubeContext;
|
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/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/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",
|
"./textures/planets/savannah.png", "./textures/planets/alpine.png", "./textures/planets/ceres.jpg", "./textures/planets/eris.jpg", "./textures/planets/haumea.jpg",
|
||||||
|
Loading…
Reference in New Issue
Block a user