Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/renderer/TerrainRenderer.cpp
Show First 20 Lines • Show All 750 Lines • ▼ Show 20 Lines | if (WaterMgr->m_WaterFancyEffects) | ||||
m->fancyWaterShader->BindTexture(str_waterEffectsTexOther, WaterMgr->m_FancyTextureOther); | m->fancyWaterShader->BindTexture(str_waterEffectsTexOther, WaterMgr->m_FancyTextureOther); | ||||
} | } | ||||
if (WaterMgr->m_WaterRealDepth) | if (WaterMgr->m_WaterRealDepth) | ||||
m->fancyWaterShader->BindTexture(str_depthTex, WaterMgr->m_depthTT); | m->fancyWaterShader->BindTexture(str_depthTex, WaterMgr->m_depthTT); | ||||
if (WaterMgr->m_WaterRefraction) | if (WaterMgr->m_WaterRefraction) | ||||
m->fancyWaterShader->BindTexture(str_refractionMap, WaterMgr->m_RefractionTexture); | m->fancyWaterShader->BindTexture(str_refractionMap, WaterMgr->m_RefractionTexture); | ||||
if (WaterMgr->m_WaterReflection) | |||||
m->fancyWaterShader->BindTexture(str_skyCube, g_Renderer.GetSkyManager()->GetSkyCube()); | |||||
m->fancyWaterShader->BindTexture(str_reflectionMap, WaterMgr->m_ReflectionTexture); | m->fancyWaterShader->BindTexture(str_reflectionMap, WaterMgr->m_ReflectionTexture); | ||||
m->fancyWaterShader->BindTexture(str_losMap, losTexture.GetTextureSmooth()); | m->fancyWaterShader->BindTexture(str_losMap, losTexture.GetTextureSmooth()); | ||||
const CLightEnv& lightEnv = g_Renderer.GetLightEnv(); | const CLightEnv& lightEnv = g_Renderer.GetLightEnv(); | ||||
m->fancyWaterShader->Uniform(str_transform, g_Renderer.GetViewCamera().GetViewProjection()); | m->fancyWaterShader->Uniform(str_transform, g_Renderer.GetViewCamera().GetViewProjection()); | ||||
//TODO: bind only what's needed | //TODO: bind only what's needed | ||||
if (WaterMgr->m_WaterReflection) | if (WaterMgr->m_WaterRefraction || WaterMgr->m_WaterReflection) | ||||
{ | { | ||||
m->fancyWaterShader->BindTexture(str_skyCube, g_Renderer.GetSkyManager()->GetSkyCube()); | |||||
// TODO: check that this rotates in the right direction. | // TODO: check that this rotates in the right direction. | ||||
CMatrix3D skyBoxRotation; | CMatrix3D skyBoxRotation; | ||||
skyBoxRotation.SetIdentity(); | skyBoxRotation.SetIdentity(); | ||||
skyBoxRotation.RotateY(M_PI + lightEnv.GetRotation()); | skyBoxRotation.RotateY(M_PI + lightEnv.GetRotation()); | ||||
m->fancyWaterShader->Uniform(str_skyBoxRot, skyBoxRotation); | m->fancyWaterShader->Uniform(str_skyBoxRot, skyBoxRotation); | ||||
} | } | ||||
m->fancyWaterShader->Uniform(str_sunDir, lightEnv.GetSunDir()); | m->fancyWaterShader->Uniform(str_sunDir, lightEnv.GetSunDir()); | ||||
m->fancyWaterShader->Uniform(str_sunColor, lightEnv.m_SunColor); | m->fancyWaterShader->Uniform(str_sunColor, lightEnv.m_SunColor); | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator