paysages : Fixed atmosphere changing clouds alpha (causing ghosting when clouds where over ground).
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@352 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
parent
1fecbf414e
commit
40a0d576bc
4 changed files with 15 additions and 5 deletions
1
TODO
1
TODO
|
@ -1,6 +1,5 @@
|
||||||
Technology Preview 2 :
|
Technology Preview 2 :
|
||||||
- InputInt doesn't honor small_step.
|
- InputInt doesn't honor small_step.
|
||||||
- Fix the fog impression when cloud layer overlaps with ground range.
|
|
||||||
- Remove color gradations (replace with automatic boolean and simple colors).
|
- Remove color gradations (replace with automatic boolean and simple colors).
|
||||||
- Replace zone ranges with curves (with curve input and curve dialog).
|
- Replace zone ranges with curves (with curve input and curve dialog).
|
||||||
- Interface for textures thickness, slope_range and thickness_transparency (and correct slider ranges).
|
- Interface for textures thickness, slope_range and thickness_transparency (and correct slider ranges).
|
||||||
|
|
|
@ -87,6 +87,7 @@ Color atmosphereApply(AtmosphereDefinition* definition, Renderer* renderer, Vect
|
||||||
Color mask = definition->color;
|
Color mask = definition->color;
|
||||||
double distance = v3Norm(v3Sub(renderer->camera_location, location));
|
double distance = v3Norm(v3Sub(renderer->camera_location, location));
|
||||||
double value;
|
double value;
|
||||||
|
double alpha;
|
||||||
|
|
||||||
if (distance < definition->distance_near)
|
if (distance < definition->distance_near)
|
||||||
{
|
{
|
||||||
|
@ -97,10 +98,15 @@ Color atmosphereApply(AtmosphereDefinition* definition, Renderer* renderer, Vect
|
||||||
distance = definition->distance_far;
|
distance = definition->distance_far;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alpha = base.a;
|
||||||
|
base.a = 1.0;
|
||||||
|
|
||||||
value = definition->full_mask * (distance - definition->distance_near) / (definition->distance_far - definition->distance_near);
|
value = definition->full_mask * (distance - definition->distance_near) / (definition->distance_far - definition->distance_near);
|
||||||
|
|
||||||
mask.a = value;
|
mask.a = value;
|
||||||
|
|
||||||
colorMask(&base, &mask);
|
colorMask(&base, &mask);
|
||||||
|
|
||||||
|
base.a = alpha;
|
||||||
|
|
||||||
return base;
|
return base;
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,7 +169,7 @@ CloudsLayerDefinition cloudsLayerCreateDefinition()
|
||||||
result.base_coverage = 0.35;
|
result.base_coverage = 0.35;
|
||||||
result.shape_noise = noiseCreateGenerator();
|
result.shape_noise = noiseCreateGenerator();
|
||||||
noiseGenerateBaseNoise(result.shape_noise, 200000);
|
noiseGenerateBaseNoise(result.shape_noise, 200000);
|
||||||
noiseAddLevelsSimple(result.shape_noise, 4, 1.0, 1.0);
|
noiseAddLevelsSimple(result.shape_noise, 5, 1.0, 1.0);
|
||||||
result.edge_noise = noiseCreateGenerator();
|
result.edge_noise = noiseCreateGenerator();
|
||||||
noiseGenerateBaseNoise(result.edge_noise, 800000);
|
noiseGenerateBaseNoise(result.edge_noise, 800000);
|
||||||
noiseAddLevelsSimple(result.edge_noise, 8, 1.0, 1.0);
|
noiseAddLevelsSimple(result.edge_noise, 8, 1.0, 1.0);
|
||||||
|
@ -575,7 +575,10 @@ Color cloudsGetLayerColor(CloudsLayerDefinition* definition, Renderer* renderer,
|
||||||
col.a = 1.0;
|
col.a = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = renderer->applyAtmosphere(renderer, start, result);
|
if (result.a > 0.000001)
|
||||||
|
{
|
||||||
|
result = renderer->applyAtmosphere(renderer, start, result);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -602,7 +605,7 @@ Color cloudsGetColor(CloudsDefinition* definition, Renderer* renderer, Vector3 s
|
||||||
for (i = 0; i < definition->nblayers; i++)
|
for (i = 0; i < definition->nblayers; i++)
|
||||||
{
|
{
|
||||||
layer_color = cloudsGetLayerColor(layers + i, renderer, start, end);
|
layer_color = cloudsGetLayerColor(layers + i, renderer, start, end);
|
||||||
if (layer_color.a > 0.0)
|
if (layer_color.a > 0.000001)
|
||||||
{
|
{
|
||||||
colorMask(&result, &layer_color);
|
colorMask(&result, &layer_color);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
/*#define DEBUG_ONETHREAD 1*/
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue