paysages : Small improvements.
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@532 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
parent
445d59a4be
commit
970c452d93
3 changed files with 5 additions and 9 deletions
|
@ -1227,19 +1227,13 @@ void brunetonGetLightingStatus(Renderer* renderer, LightStatus* status, Vector3
|
|||
|
||||
muS = v3Dot(up, s);
|
||||
sun.color = _transmittanceWithShadow(r0, muS);
|
||||
/*sun.color.r *= 100.0;
|
||||
sun.color.g *= 100.0;
|
||||
sun.color.b *= 100.0;*/
|
||||
sun.direction = v3Scale(s, -1.0);
|
||||
sun.reflection = 1.0;
|
||||
sun.reflection = ISun;
|
||||
sun.altered = 1;
|
||||
|
||||
lightingPushLight(status, &sun);
|
||||
|
||||
irradiance.color = _irradiance(_irradianceTexture, r0, muS);
|
||||
/*irradiance.color.r *= 100.0;
|
||||
irradiance.color.g *= 100.0;
|
||||
irradiance.color.b *= 100.0;*/
|
||||
irradiance.direction = VECTOR_DOWN;
|
||||
irradiance.reflection = 0.0;
|
||||
irradiance.altered = 0;
|
||||
|
|
|
@ -54,6 +54,7 @@ static int _alterLight(Renderer* renderer, LightDefinition* light, Vector3 locat
|
|||
for (i = 0; i < n; i++)
|
||||
{
|
||||
light->color = cloudsLayerFilterLight(layersGetLayer(definition->layers, i), renderer, light->color, location, v3Add(location, v3Scale(light->direction, -10000.0)), v3Scale(light->direction, -1.0));
|
||||
/* TODO Reduce light->reflection too */
|
||||
}
|
||||
return n > 0;
|
||||
}
|
||||
|
|
|
@ -161,18 +161,19 @@ static int _alterLight(Renderer* renderer, LightDefinition* light, Vector3 at)
|
|||
|
||||
if (at.y < definition->height)
|
||||
{
|
||||
if (light->direction.y < 0.00001)
|
||||
if (light->direction.y <= -0.00001)
|
||||
{
|
||||
factor = (definition->height - at.y) / (-light->direction.y * definition->lighting_depth);
|
||||
if (factor > 1.0)
|
||||
{
|
||||
factor = 1.0;
|
||||
}
|
||||
factor = 1.0 - 0.8 * factor;
|
||||
factor = 1.0 - factor;
|
||||
|
||||
light->color.r *= factor;
|
||||
light->color.g *= factor;
|
||||
light->color.b *= factor;
|
||||
light->reflection *= factor;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue