From 81d30ff63a119f9d2251688699f1e713576837bf Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 9 Jul 2012 19:20:41 +0200 Subject: [PATCH] temp commit --- apps/openmw/mwrender/localmap.cpp | 4 ++-- apps/openmw/mwrender/renderingmanager.cpp | 11 ++++++----- apps/openmw/mwrender/shadows.cpp | 6 +++--- apps/openmw/mwrender/water.cpp | 2 +- components/nifogre/ogre_nif_loader.cpp | 2 ++ extern/shiny | 2 +- files/materials/objects.mat | 3 +++ files/materials/objects.shader | 2 +- 8 files changed, 19 insertions(+), 13 deletions(-) diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 4fa125c9b..1a4002b12 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -229,9 +229,9 @@ void LocalMap::render(const float x, const float y, vp->setVisibilityMask(RV_Map); // use fallback techniques without shadows and without mrt - vp->setMaterialScheme("simple"); + //vp->setMaterialScheme("local_map"); - rtt->update(); + //rtt->update(); // create "fog of war" texture TexturePtr tex2 = TextureManager::getSingleton().createManual( diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 174a9e4f8..ca26697b7 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -76,9 +76,8 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const // Load resources ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); - // Due to the huge world size of MW, we'll want camera-relative rendering. - // This prevents precision artifacts when moving very far from the origin. - mRendering.getScene()->setCameraRelativeRendering(true); + // causes light flicker in opengl when moving.. + //mRendering.getScene()->setCameraRelativeRendering(true); // disable unsupported effects const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities(); @@ -525,12 +524,14 @@ Shadows* RenderingManager::getShadows() void RenderingManager::switchToInterior() { - mRendering.getScene()->setCameraRelativeRendering(false); + // causes light flicker in opengl when moving.. + //mRendering.getScene()->setCameraRelativeRendering(false); } void RenderingManager::switchToExterior() { - mRendering.getScene()->setCameraRelativeRendering(true); + // causes light flicker in opengl when moving.. + //mRendering.getScene()->setCameraRelativeRendering(true); } Ogre::Vector4 RenderingManager::boundingBoxToScreen(Ogre::AxisAlignedBox bounds) diff --git a/apps/openmw/mwrender/shadows.cpp b/apps/openmw/mwrender/shadows.cpp index 9a4ae7243..1bea14530 100644 --- a/apps/openmw/mwrender/shadows.cpp +++ b/apps/openmw/mwrender/shadows.cpp @@ -53,7 +53,7 @@ void Shadows::recreate() mSceneMgr->setShadowTextureSelfShadow(true); mSceneMgr->setShadowCasterRenderBackFaces(true); - mSceneMgr->setShadowTextureCasterMaterial("depth_shadow_caster"); + // mSceneMgr->setShadowTextureCasterMaterial("openmw_shadowcaster_default"); mSceneMgr->setShadowTexturePixelFormat(PF_FLOAT32_R); mSceneMgr->setShadowDirectionalLightExtrusionDistance(1000000); @@ -111,7 +111,7 @@ void Shadows::recreate() // -------------------------------------------------------------------------------------------------------------------- // --------------------------- Debug overlays to display the content of shadow maps ----------------------------------- // -------------------------------------------------------------------------------------------------------------------- - /* + OverlayManager& mgr = OverlayManager::getSingleton(); Overlay* overlay; @@ -157,7 +157,7 @@ void Shadows::recreate() overlay->add2D(debugPanel); overlay->show(); } - */ + } PSSMShadowCameraSetup* Shadows::getPSSMSetup() diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 666161052..311df9169 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -336,7 +336,7 @@ void Water::applyRTT() vp->setBackgroundColour(ColourValue(0.8f, 0.9f, 1.0f)); vp->setShadowsEnabled(false); // use fallback techniques without shadows and without mrt (currently not implemented for sky and terrain) - vp->setMaterialScheme("simple"); + //vp->setMaterialScheme("water_reflection"); rtt->addListener(this); rtt->setActive(true); diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index d12a78114..f33ac2364 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -276,6 +276,8 @@ void NIFLoader::createMaterial(const String &name, else warn("Unhandled alpha setting for texture " + texName); } + //else + //instance->getMaterial ()->setShadowCasterMaterial ("openmw_shadowcaster_noalpha"); // As of yet UNTESTED code from Chris: /*pass->setTextureFiltering(Ogre::TFO_ANISOTROPIC); diff --git a/extern/shiny b/extern/shiny index 88a192a67..d25605ee3 160000 --- a/extern/shiny +++ b/extern/shiny @@ -1 +1 @@ -Subproject commit 88a192a67d7dff636be4540be4a8654ad33f106a +Subproject commit d25605ee3a2d67dc0b6367cd150cc6d0c6a3b661 diff --git a/files/materials/objects.mat b/files/materials/objects.mat index 58c9a17bc..324fe1b2a 100644 --- a/files/materials/objects.mat +++ b/files/materials/objects.mat @@ -14,6 +14,9 @@ material openmw_objects_base scene_blend default depth_write default alpha_rejection default + shadow_transparency true // use diffuse alpha as mask for shadow + + shadow_caster_material openmw_shadowcaster pass { diff --git a/files/materials/objects.shader b/files/materials/objects.shader index e066b43cc..831699364 100644 --- a/files/materials/objects.shader +++ b/files/materials/objects.shader @@ -72,7 +72,7 @@ shInput(float3, normalPassthrough) shInput(float3, objSpacePositionPassthrough) shUniform(float4 lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour) - shUniform(float passIteration) @shAutoConstant(passIteration, pass_iteration_number) + //shUniform(float passIteration) @shAutoConstant(passIteration, pass_iteration_number) shUniform(float4 materialAmbient) @shAutoConstant(materialAmbient, surface_ambient_colour) shUniform(float4 materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour) shUniform(float4 materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)