forked from mirror/openmw-tes3mp
sync mrt_output setting
This commit is contained in:
parent
3537af051d
commit
865bfc6f47
13 changed files with 49 additions and 32 deletions
|
@ -450,3 +450,18 @@ void Objects::update(const float dt)
|
|||
it = mLights.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
void Objects::rebuildStaticGeometry()
|
||||
{
|
||||
for (std::map<MWWorld::CellStore *, Ogre::StaticGeometry*>::iterator it = mStaticGeometry.begin(); it != mStaticGeometry.end(); ++it)
|
||||
{
|
||||
it->second->destroy();
|
||||
it->second->build();
|
||||
}
|
||||
|
||||
for (std::map<MWWorld::CellStore *, Ogre::StaticGeometry*>::iterator it = mStaticGeometrySmall.begin(); it != mStaticGeometrySmall.end(); ++it)
|
||||
{
|
||||
it->second->destroy();
|
||||
it->second->build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,6 +93,8 @@ public:
|
|||
void removeCell(MWWorld::CellStore* store);
|
||||
void buildStaticGeometry(MWWorld::CellStore &cell);
|
||||
void setMwRoot(Ogre::SceneNode* root);
|
||||
|
||||
void rebuildStaticGeometry();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -81,12 +81,14 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
|||
//mRendering.getScene()->setCameraRelativeRendering(true);
|
||||
|
||||
// disable unsupported effects
|
||||
const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
|
||||
//const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities();
|
||||
if (!waterShaderSupported())
|
||||
Settings::Manager::setBool("shader", "Water", false);
|
||||
if (!Settings::Manager::getBool("shaders", "Objects"))
|
||||
Settings::Manager::setBool("enabled", "Shadows", false);
|
||||
|
||||
sh::Factory::getInstance ().setGlobalSetting ("mrt_output", useMRT() ? "true" : "false");
|
||||
|
||||
applyCompositors();
|
||||
|
||||
// Turn the entire scene (represented by the 'root' node) -90
|
||||
|
@ -614,6 +616,8 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|
|||
else if (it->second == "shader" && it->first == "Water")
|
||||
{
|
||||
applyCompositors();
|
||||
sh::Factory::getInstance ().setGlobalSetting ("mrt_output", useMRT() ? "true" : "false");
|
||||
mObjects.rebuildStaticGeometry ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -631,18 +631,9 @@ void SkyManager::create()
|
|||
// Make a unique "modifiable" copy of the materials to be sure
|
||||
//mCloudMaterial = mCloudMaterial->clone("Clouds");
|
||||
//clouds_ent->getSubEntity(0)->setMaterial(mCloudMaterial);
|
||||
//mAtmosphereMaterial = mAtmosphereMaterial->clone("Atmosphere");
|
||||
//atmosphere_ent->getSubEntity(0)->setMaterial(mAtmosphereMaterial);
|
||||
|
||||
/*
|
||||
|
||||
mAtmosphereMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1.0, 1.0, 1.0);
|
||||
mAtmosphereMaterial->getTechnique(0)->getPass(0)->setDiffuse(0.0, 0.0, 0.0, 0.0);
|
||||
mAtmosphereMaterial->getTechnique(0)->getPass(0)->setAmbient(0.0, 0.0, 0.0);
|
||||
mCloudMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1.0, 1.0, 1.0);
|
||||
mCloudMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
|
||||
mAtmosphereMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
|
||||
mAtmosphereMaterial->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);
|
||||
mCloudMaterial->getTechnique(0)->getPass(0)->setSceneBlending(SBT_TRANSPARENT_ALPHA);
|
||||
|
||||
mCloudMaterial->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();
|
||||
|
|
2
extern/shiny
vendored
2
extern/shiny
vendored
|
@ -1 +1 @@
|
|||
Subproject commit b3cfd41dff2758e268ce16f366b7e7857eee80ea
|
||||
Subproject commit 27a128c414e2f92d6bcda379b9c9df04e69b7472
|
|
@ -27,10 +27,10 @@
|
|||
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputColor(0) = colourPassthrough * atmosphereColour;
|
||||
shOutputColour(0) = colourPassthrough * atmosphereColour;
|
||||
|
||||
#if MRT
|
||||
shOutputColor(1) = float4(1,1,1,1);
|
||||
shOutputColour(1) = float4(1,1,1,1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,12 @@
|
|||
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;
|
||||
}
|
||||
|
@ -28,10 +31,10 @@
|
|||
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputColor(0) = float4(1,1,1,materialDiffuse.a) * float4(materialEmissive.xyz, 1) * shSample(diffuseMap, UV);
|
||||
shOutputColour(0) = float4(1,1,1,materialDiffuse.a) * float4(materialEmissive.xyz, 1) * shSample(diffuseMap, UV);
|
||||
|
||||
#if MRT
|
||||
shOutputColor(1) = float4(1,1,1,1);
|
||||
shOutputColour(1) = float4(1,1,1,1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#ifdef SH_FRAGMENT_SHADER
|
||||
|
||||
#define shOutputColor(num) oColor##num
|
||||
#define shOutputColour(num) oColor##num
|
||||
|
||||
#define shDeclareMrtOutput(num) , out float4 oColor##num : COLOR##num
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
|||
#define shInputPosition vertex
|
||||
|
||||
#define shOutputPosition gl_Position
|
||||
#define shOutputColor(num) oColor##num
|
||||
#define shOutputColour(num) oColor##num
|
||||
|
||||
#define float4x4 mat4
|
||||
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
|
||||
|
||||
#define FOG @shPropertyBool(fog)
|
||||
#define MRT @shPropertyNotBool(is_transparent) && @shPropertyBool(mrt_output)
|
||||
#define MRT @shPropertyNotBool(is_transparent) && @shPropertyBool(mrt_output) && @shGlobalSettingBool(mrt_output)
|
||||
#define LIGHTING @shPropertyBool(lighting)
|
||||
|
||||
#define SHADOWS LIGHTING && 0
|
||||
#define SHADOWS_PSSM LIGHTING
|
||||
|
||||
#define SHADOWS 1 && LIGHTING
|
||||
#define SHADOWS 0 && LIGHTING
|
||||
#define SHADOWS_PSSM 0 && LIGHTING
|
||||
|
||||
#if FOG || MRT || SHADOWS_PSSM
|
||||
|
@ -132,13 +132,13 @@
|
|||
#if SHADOWS
|
||||
shInput(float4, lightSpacePos0)
|
||||
shSampler2D(shadowMap0)
|
||||
shUniform(float2 invShadowmapSize0) @shAutoConstant(invShadowmapSize0, inverse_texture_size, 0)
|
||||
shUniform(float2 invShadowmapSize0) @shAutoConstant(invShadowmapSize0, inverse_texture_size, 1)
|
||||
#endif
|
||||
#if SHADOWS_PSSM
|
||||
@shForeach(3)
|
||||
shInput(float4, lightSpacePos@shIterator)
|
||||
shSampler2D(shadowMap@shIterator)
|
||||
shUniform(float2 invShadowmapSize@shIterator) @shAutoConstant(invShadowmapSize@shIterator, inverse_texture_size, @shIterator)
|
||||
shUniform(float2 invShadowmapSize@shIterator) @shAutoConstant(invShadowmapSize@shIterator, inverse_texture_size, @shIterator(1))
|
||||
@shEndForeach
|
||||
shUniform(float4 pssmSplitPoints) @shSharedParameter(pssmSplitPoints)
|
||||
#endif
|
||||
|
@ -148,7 +148,7 @@
|
|||
#endif
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputColor(0) = shSample(diffuseMap, UV);
|
||||
shOutputColour(0) = shSample(diffuseMap, UV);
|
||||
|
||||
#if LIGHTING
|
||||
float3 normal = normalize(normalPassthrough);
|
||||
|
@ -194,24 +194,24 @@
|
|||
ambient *= colorPassthrough.xyz;
|
||||
#endif
|
||||
|
||||
shOutputColor(0).xyz *= (ambient + diffuse + materialEmissive.xyz);
|
||||
shOutputColour(0).xyz *= (ambient + diffuse + materialEmissive.xyz);
|
||||
#endif
|
||||
|
||||
|
||||
#if HAS_VERTEXCOLOR && !LIGHTING
|
||||
shOutputColor(0).xyz *= colorPassthrough.xyz;
|
||||
shOutputColour(0).xyz *= colorPassthrough.xyz;
|
||||
#endif
|
||||
|
||||
#if FOG
|
||||
float fogValue = shSaturate((depthPassthrough - fogParams.y) * fogParams.w);
|
||||
shOutputColor(0).xyz = shLerp (shOutputColor(0).xyz, fogColor, fogValue);
|
||||
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, fogColor, fogValue);
|
||||
#endif
|
||||
|
||||
// prevent negative color output (for example with negative lights)
|
||||
shOutputColor(0).xyz = max(shOutputColor(0).xyz, float3(0,0,0));
|
||||
shOutputColour(0).xyz = max(shOutputColour(0).xyz, float3(0,0,0));
|
||||
|
||||
#if MRT
|
||||
shOutputColor(1) = float4(depthPassthrough / far,1,1,1);
|
||||
shOutputColour(1) = float4(depthPassthrough / far,1,1,1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
material openmw_shadowcaster_default
|
||||
{
|
||||
create_configuration Default
|
||||
allow_fixed_function false
|
||||
pass
|
||||
{
|
||||
fog_override true
|
||||
|
@ -18,6 +19,7 @@ material openmw_shadowcaster_default
|
|||
material openmw_shadowcaster_noalpha
|
||||
{
|
||||
create_configuration Default
|
||||
allow_fixed_function false
|
||||
pass
|
||||
{
|
||||
fog_override true
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
discard;
|
||||
#endif
|
||||
|
||||
shOutputColor(0) = float4(finalDepth, finalDepth, finalDepth, 1);
|
||||
shOutputColour(0) = float4(finalDepth, finalDepth, finalDepth, 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -44,13 +44,13 @@ material openmw_clouds
|
|||
// second diffuse map is used for weather transitions
|
||||
texture_unit diffuseMap1
|
||||
{
|
||||
texture $diffuseMap1
|
||||
texture_alias cloud_texture_1
|
||||
create_in_ffp true
|
||||
}
|
||||
|
||||
texture_unit diffuseMap2
|
||||
{
|
||||
texture $diffuseMap2
|
||||
texture_alias cloud_texture_2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputColor(0) = float4(1,1,1,materialDiffuse.a) * float4(materialEmissive.xyz, 1) * shSample(diffuseMap, UV);
|
||||
shOutputColour(0) = float4(1,1,1,materialDiffuse.a) * float4(materialEmissive.xyz, 1) * shSample(diffuseMap, UV);
|
||||
|
||||
#if MRT
|
||||
shOutputColor(1) = float4(1,1,1,1);
|
||||
shOutputColour(1) = float4(1,1,1,1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue