mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
fixed the sun rendering (rendered without depth check)
This commit is contained in:
parent
3b3218d907
commit
ad0f9f4bcf
1 changed files with 3 additions and 2 deletions
|
@ -164,7 +164,7 @@ namespace MWRender
|
||||||
// Clouds
|
// Clouds
|
||||||
NifOgre::NIFLoader::load("meshes\\sky_clouds_01.nif");
|
NifOgre::NIFLoader::load("meshes\\sky_clouds_01.nif");
|
||||||
Entity* clouds_ent = mSceneMgr->createEntity("meshes\\sky_clouds_01.nif");
|
Entity* clouds_ent = mSceneMgr->createEntity("meshes\\sky_clouds_01.nif");
|
||||||
clouds_ent->setRenderQueueGroup(RENDER_QUEUE_SKIES_EARLY);
|
clouds_ent->setRenderQueueGroup(RENDER_QUEUE_SKIES_LATE);
|
||||||
SceneNode* clouds_node = mRootNode->createChildSceneNode();
|
SceneNode* clouds_node = mRootNode->createChildSceneNode();
|
||||||
clouds_node->attachObject(clouds_ent);
|
clouds_node->attachObject(clouds_ent);
|
||||||
mCloudMaterial = clouds_ent->getSubEntity(0)->getMaterial();
|
mCloudMaterial = clouds_ent->getSubEntity(0)->getMaterial();
|
||||||
|
@ -225,7 +225,7 @@ namespace MWRender
|
||||||
|
|
||||||
// Sun
|
// Sun
|
||||||
/// \todo calculate the sun position based on time of day
|
/// \todo calculate the sun position based on time of day
|
||||||
Vector3 sunPosition(0, 0, 1.f);
|
Vector3 sunPosition(0.4, 0.4, 1.f);
|
||||||
|
|
||||||
// this distance has to be set accordingly so that the sun is
|
// this distance has to be set accordingly so that the sun is
|
||||||
// behind the clouds, but still in front of the atmosphere
|
// behind the clouds, but still in front of the atmosphere
|
||||||
|
@ -248,6 +248,7 @@ namespace MWRender
|
||||||
sunMaterial->removeAllTechniques();
|
sunMaterial->removeAllTechniques();
|
||||||
Pass* p = sunMaterial->createTechnique()->createPass();
|
Pass* p = sunMaterial->createTechnique()->createPass();
|
||||||
p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
|
p->setSceneBlending(SBT_TRANSPARENT_ALPHA);
|
||||||
|
p->setDepthCheckEnabled(false);
|
||||||
p->setDepthWriteEnabled(false);
|
p->setDepthWriteEnabled(false);
|
||||||
p->createTextureUnitState("textures\\tx_sun_05.dds");
|
p->createTextureUnitState("textures\\tx_sun_05.dds");
|
||||||
bbSet->setMaterialName("SunMaterial");
|
bbSet->setMaterialName("SunMaterial");
|
||||||
|
|
Loading…
Reference in a new issue