Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/TerrainRenderer.cpp
/* Copyright (C) 2013 Wildfire Games. | /* Copyright (C) 2013 Wildfire Games. | ||||
elexis: 9 | |||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 757 Lines • ▼ Show 20 Lines | bool TerrainRenderer::RenderFancyWater(const CShaderDefines& context, int cullGroup, ShadowMap* shadow) | ||||
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_WaterReflection) | ||||
{ | { | ||||
// 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 - 0.3f + 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); | ||||
m->fancyWaterShader->Uniform(str_color, WaterMgr->m_WaterColor); | m->fancyWaterShader->Uniform(str_color, WaterMgr->m_WaterColor); | ||||
m->fancyWaterShader->Uniform(str_tint, WaterMgr->m_WaterTint); | m->fancyWaterShader->Uniform(str_tint, WaterMgr->m_WaterTint); | ||||
m->fancyWaterShader->Uniform(str_waviness, WaterMgr->m_Waviness); | m->fancyWaterShader->Uniform(str_waviness, WaterMgr->m_Waviness); | ||||
m->fancyWaterShader->Uniform(str_murkiness, WaterMgr->m_Murkiness); | m->fancyWaterShader->Uniform(str_murkiness, WaterMgr->m_Murkiness); | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
9