* 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
+10 -3
View File
@@ -366,8 +366,14 @@ void CRenderer::EnumCaps()
if (oglHaveExtension("GL_ARB_vertex_shader"))
m_Caps.m_VertexShader=true;
}
if (0 == oglHaveExtensions(0, "GL_ARB_shadow", "GL_ARB_depth_texture", 0)) {
m_Caps.m_DepthTextureShadows = true;
// According to Delphi3d.net, all relevant graphics chips that support depth textures
// (i.e. Geforce3+, Radeon9500+, even i915) also have >= 4 TMUs, so this restriction
// isn't actually a restriction, and it helps with integrating depth texture
// shadows into rendering paths.
if (ogl_max_tex_units >= 4)
m_Caps.m_DepthTextureShadows = true;
}
}
@@ -587,7 +593,7 @@ void CRenderer::BeginFrame()
m_Stats.Reset();
// init per frame stuff
m->shadow->SetupFrame(m_CullCamera, m_LightEnv->m_SunDir);
m->shadow->SetupFrame(m_CullCamera, m_LightEnv->GetSunDir());
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -606,7 +612,8 @@ void CRenderer::RenderShadowMap()
m->shadow->BeginRender();
glColor3ub(0, 0, 0);
float shadowTransp = m_LightEnv->GetTerrainShadowTransparency();
glColor3f(shadowTransp, shadowTransp, shadowTransp);
// Figure out transparent rendering strategy
RenderModifierPtr transparentShadows = m_Models.ModTransparentShadow;