diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 663388e94..962f19a57 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -231,7 +231,7 @@ void LocalMap::render(const float x, const float y, // use fallback techniques without shadows and without mrt vp->setMaterialScheme("local_map"); - //rtt->update(); + rtt->update(); // create "fog of war" texture TexturePtr tex2 = TextureManager::getSingleton().createManual( diff --git a/apps/openmw/mwrender/shadows.cpp b/apps/openmw/mwrender/shadows.cpp index 93152244b..2e09f4c31 100644 --- a/apps/openmw/mwrender/shadows.cpp +++ b/apps/openmw/mwrender/shadows.cpp @@ -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/sky.cpp b/apps/openmw/mwrender/sky.cpp index 0a866ac7c..f32883fdd 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -453,7 +453,6 @@ void SkyManager::create() HighLevelGpuProgramManager& mgr = HighLevelGpuProgramManager::getSingleton(); // Stars - /// \todo sky_night_02.nif (available in Bloodmoon) MeshPtr mesh = NifOgre::NIFLoader::load("meshes\\sky_night_01.nif"); Entity* night1_ent = mSceneMgr->createEntity("meshes\\sky_night_01.nif"); night1_ent->setRenderQueueGroup(RQG_SkiesEarly+1); @@ -548,60 +547,9 @@ void SkyManager::create() atmosphere_ent->getSubEntity (0)->setMaterialName ("openmw_atmosphere"); //mAtmosphereMaterial = atmosphere_ent->getSubEntity(0)->getMaterial(); //mAtmosphereMaterial->getTechnique(0)->getPass(0)->setPolygonModeOverrideable(false); - // Atmosphere shader - HighLevelGpuProgramPtr vshader = mgr.createProgram("Atmosphere_VP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - "cg", GPT_VERTEX_PROGRAM); - - vshader->setParameter("profiles", "vs_2_x arbvp1"); - vshader->setParameter("entry_point", "main_vp"); - - StringUtil::StrStreamType outStream; - outStream << - "void main_vp( \n" - " float4 position : POSITION, \n" - " in float4 color : COLOR, \n" - " out float4 oPosition : POSITION, \n" - " out float4 oVertexColor : TEXCOORD0, \n" - " uniform float4x4 worldViewProj \n" - ") \n" - "{ \n" - " oPosition = mul( worldViewProj, position ); \n" - " oVertexColor = color; \n" - "}"; - vshader->setSource(outStream.str()); - vshader->load(); - - vshader->getDefaultParameters()->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX); - //mAtmosphereMaterial->getTechnique(0)->getPass(0)->setVertexProgram(vshader->getName()); - - HighLevelGpuProgramPtr fshader = mgr.createProgram("Atmosphere_FP", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - "cg", GPT_FRAGMENT_PROGRAM); - - fshader->setParameter("profiles", "ps_2_x arbfp1"); - fshader->setParameter("entry_point", "main_fp"); - - StringUtil::StrStreamType _outStream; - _outStream << - "void main_fp( \n" - " in float4 iVertexColor : TEXCOORD0, \n" - " out float4 oColor : COLOR, \n"; - if (RenderingManager::useMRT()) _outStream << - " out float4 oColor1 : COLOR1, \n"; - _outStream << - " uniform float4 emissive \n" - ") \n" - "{ \n" - " oColor = iVertexColor * emissive; \n"; - if (RenderingManager::useMRT()) _outStream << - " oColor1 = float4(1, 0, 0, 1); \n"; - _outStream << - "}"; - fshader->setSource(_outStream.str()); - fshader->load(); - - fshader->getDefaultParameters()->setNamedAutoConstant("emissive", GpuProgramParameters::ACT_SURFACE_EMISSIVE_COLOUR); // mAtmosphereMaterial->getTechnique(0)->getPass(0)->setFragmentProgram(fshader->getName()); + atmosphere_ent->getSubEntity (0)->setMaterialName("openmw_atmosphere"); // Clouds NifOgre::NIFLoader::load("meshes\\sky_clouds_01.nif"); @@ -838,15 +786,14 @@ void SkyManager::setWeather(const MWWorld::WeatherResult& weather) mCloudMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(clr); mCloudColour = weather.mSunColor; } - +*/ if (mSkyColour != weather.mSkyColor) { - mAtmosphereMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(weather.mSkyColor); - mMasser->setSkyColour(weather.mSkyColor); - mSecunda->setSkyColour(weather.mSkyColor); mSkyColour = weather.mSkyColor; + sh::Factory::getInstance().setSharedParameter ("atmosphereColour", sh::makeProperty(new sh::Vector4( + weather.mSkyColor.r, weather.mSkyColor.g, weather.mSkyColor.b, 1.0))); } - +/* if (mCloudSpeed != weather.mCloudSpeed) { mCloudMaterial->getTechnique(0)->getPass(0)->getFragmentProgramParameters()->setNamedConstant("speed", Real(weather.mCloudSpeed)); diff --git a/apps/openmw/mwrender/sky.hpp b/apps/openmw/mwrender/sky.hpp index e11745e82..6bb055824 100644 --- a/apps/openmw/mwrender/sky.hpp +++ b/apps/openmw/mwrender/sky.hpp @@ -7,6 +7,8 @@ #include #include +#include + #include "sky.hpp" #include "../mwworld/weather.hpp" diff --git a/extern/shiny b/extern/shiny index a0b3020bd..3e7e02a84 160000 --- a/extern/shiny +++ b/extern/shiny @@ -1 +1 @@ -Subproject commit a0b3020bdba4433c1e3f45a1d5188eab0172bd88 +Subproject commit 3e7e02a846ce6c3de7e2344a82d346293115eb7d diff --git a/files/materials/atmosphere.shader b/files/materials/atmosphere.shader index a772e3c5e..484381a1f 100644 --- a/files/materials/atmosphere.shader +++ b/files/materials/atmosphere.shader @@ -6,29 +6,28 @@ SH_BEGIN_PROGRAM shUniform(float4x4 wvp) @shAutoConstant(wvp, worldviewproj_matrix) - shInput(float2, uv0) - shOutput(float2, UV) + + shColourInput(float4) + shOutput(float4, colourPassthrough) SH_START_PROGRAM { shOutputPosition = shMatrixMult(wvp, shInputPosition); - UV = uv0; + colourPassthrough = colour; } #else SH_BEGIN_PROGRAM - shSampler2D(diffuseMap) - shInput(float2, UV) + shInput(float4, colourPassthrough) #if MRT shDeclareMrtOutput(1) #endif - shUniform(float4 materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour) - shUniform(float4 materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour) + shUniform(float4 atmosphereColour) @shSharedParameter(atmosphereColour) SH_START_PROGRAM { - shOutputColor(0) = float4(1,1,1,materialDiffuse.a) * float4(materialEmissive.xyz, 1) * shSample(diffuseMap, UV); + shOutputColor(0) = colourPassthrough * atmosphereColour; #if MRT shOutputColor(1) = float4(1,1,1,1); diff --git a/files/materials/shadowcaster.mat b/files/materials/shadowcaster.mat index 25b791f1f..7c11fddf6 100644 --- a/files/materials/shadowcaster.mat +++ b/files/materials/shadowcaster.mat @@ -1,5 +1,3 @@ - - material openmw_shadowcaster_default { create_configuration Default diff --git a/files/materials/sky.mat b/files/materials/sky.mat index 25c9185b7..c78570f7f 100644 --- a/files/materials/sky.mat +++ b/files/materials/sky.mat @@ -1,5 +1,6 @@ material openmw_moon { + allow_fixed_function false mrt_output true pass { @@ -23,6 +24,7 @@ material openmw_moon material openmw_clouds { + allow_fixed_function false mrt_output true pass { @@ -55,6 +57,7 @@ material openmw_clouds material openmw_atmosphere { + allow_fixed_function false mrt_output true pass { @@ -75,6 +78,7 @@ material openmw_atmosphere material openmw_stars { + allow_fixed_function false mrt_output true pass { @@ -98,6 +102,7 @@ material openmw_stars // used for both sun and sun glare material openmw_sun { + allow_fixed_function false mrt_output true pass {