1
0
forked from mirrors/0ad

* clean up CLightEnv a bit

* add CLightEnv::m_TerrainShadowTransparency
* shadows will let a fraction of diffuse light through
* added JS LightEnv objects, so the lighting environment can be changed
  from the console
* new element TerrainShadowTransparency supported in the scenario .xml
format,
  changed cantabrian_generated with an example

This was SVN commit r3513.
This commit is contained in:
prefect
2006-02-15 00:45:16 +00:00
parent 1560a17dfb
commit 36fa5ec2bf
18 changed files with 649 additions and 191 deletions
+3 -6
View File
@@ -62,6 +62,7 @@
#include "scripting/JSInterface_Camera.h"
#include "scripting/JSInterface_Selection.h"
#include "scripting/JSInterface_Console.h"
#include "graphics/scripting/JSInterface_LightEnv.h"
#include "scripting/JSCollection.h"
#include "scripting/DOMEvent.h"
#ifndef NO_GUI
@@ -522,6 +523,7 @@ static void InitScripting()
JSI_Camera::init();
JSI_Console::init();
JSI_LightEnv::init();
new CGameEvents;
}
@@ -660,14 +662,9 @@ static void InitRenderer()
MICROLOG(L"init renderer");
g_Renderer.Open(g_xres,g_yres,g_bpp);
// Setup default lighting environment. Since the Renderer accesses the
// Setup lighting environment. Since the Renderer accesses the
// lighting environment through a pointer, this has to be done before
// the first Frame.
g_LightEnv.m_SunColor=RGBColor(1,1,1);
g_LightEnv.SetRotation(DEGTORAD(270));
g_LightEnv.SetElevation(DEGTORAD(45));
g_LightEnv.m_TerrainAmbientColor=RGBColor(0.4f,0.4f,0.4f);
g_LightEnv.m_UnitsAmbientColor=RGBColor(0.4f,0.4f,0.4f);
g_Renderer.SetLightEnv(&g_LightEnv);
// I haven't seen the camera affecting GUI rendering and such, but the