mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 04:40:26 +00:00
cleanup
This commit is contained in:
parent
791d16bbdb
commit
42883ec64b
20 changed files with 6 additions and 287 deletions
|
@ -319,7 +319,6 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
||||||
|
|
||||||
addResourcesDirectory(mResDir / "mygui");
|
addResourcesDirectory(mResDir / "mygui");
|
||||||
addResourcesDirectory(mResDir / "water");
|
addResourcesDirectory(mResDir / "water");
|
||||||
addResourcesDirectory(mResDir / "gbuffer");
|
|
||||||
addResourcesDirectory(mResDir / "shadows");
|
addResourcesDirectory(mResDir / "shadows");
|
||||||
addZipResource(mResDir / "mygui" / "Obliviontt.zip");
|
addZipResource(mResDir / "mygui" / "Obliviontt.zip");
|
||||||
|
|
||||||
|
|
|
@ -236,8 +236,6 @@ void LocalMap::render(const float x, const float y,
|
||||||
vp->setShadowsEnabled(false);
|
vp->setShadowsEnabled(false);
|
||||||
vp->setBackgroundColour(ColourValue(0, 0, 0));
|
vp->setBackgroundColour(ColourValue(0, 0, 0));
|
||||||
vp->setVisibilityMask(RV_Map);
|
vp->setVisibilityMask(RV_Map);
|
||||||
|
|
||||||
// use fallback techniques without shadows and without mrt
|
|
||||||
vp->setMaterialScheme("local_map");
|
vp->setMaterialScheme("local_map");
|
||||||
|
|
||||||
rtt->update();
|
rtt->update();
|
||||||
|
|
|
@ -126,7 +126,6 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
||||||
|
|
||||||
sh::Factory::getInstance ().setShadersEnabled (Settings::Manager::getBool("shaders", "Objects"));
|
sh::Factory::getInstance ().setShadersEnabled (Settings::Manager::getBool("shaders", "Objects"));
|
||||||
|
|
||||||
sh::Factory::getInstance ().setGlobalSetting ("mrt_output", useMRT() ? "true" : "false");
|
|
||||||
sh::Factory::getInstance ().setGlobalSetting ("fog", "true");
|
sh::Factory::getInstance ().setGlobalSetting ("fog", "true");
|
||||||
sh::Factory::getInstance ().setGlobalSetting ("lighting", "true");
|
sh::Factory::getInstance ().setGlobalSetting ("lighting", "true");
|
||||||
sh::Factory::getInstance ().setGlobalSetting ("num_lights", Settings::Manager::getString ("num lights", "Objects"));
|
sh::Factory::getInstance ().setGlobalSetting ("num_lights", Settings::Manager::getString ("num lights", "Objects"));
|
||||||
|
@ -690,11 +689,6 @@ void RenderingManager::enableLights(bool sun)
|
||||||
sunEnable(sun);
|
sunEnable(sun);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool RenderingManager::useMRT()
|
|
||||||
{
|
|
||||||
return Settings::Manager::getBool("shader", "Water");
|
|
||||||
}
|
|
||||||
|
|
||||||
Shadows* RenderingManager::getShadows()
|
Shadows* RenderingManager::getShadows()
|
||||||
{
|
{
|
||||||
return mShadows;
|
return mShadows;
|
||||||
|
@ -795,7 +789,6 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|
||||||
else if (it->second == "shader" && it->first == "Water")
|
else if (it->second == "shader" && it->first == "Water")
|
||||||
{
|
{
|
||||||
applyCompositors();
|
applyCompositors();
|
||||||
sh::Factory::getInstance ().setGlobalSetting ("mrt_output", useMRT() ? "true" : "false");
|
|
||||||
sh::Factory::getInstance ().setGlobalSetting ("simple_water", Settings::Manager::getBool("shader", "Water") ? "false" : "true");
|
sh::Factory::getInstance ().setGlobalSetting ("simple_water", Settings::Manager::getBool("shader", "Water") ? "false" : "true");
|
||||||
rebuild = true;
|
rebuild = true;
|
||||||
mRendering.getViewport ()->setClearEveryFrame (true);
|
mRendering.getViewport ()->setClearEveryFrame (true);
|
||||||
|
@ -873,7 +866,6 @@ void RenderingManager::windowResized(Ogre::RenderWindow* rw)
|
||||||
|
|
||||||
mRendering.adjustViewport();
|
mRendering.adjustViewport();
|
||||||
mCompositors->recreate();
|
mCompositors->recreate();
|
||||||
mWater->assignTextures();
|
|
||||||
|
|
||||||
mVideoPlayer->setResolution (rw->getWidth(), rw->getHeight());
|
mVideoPlayer->setResolution (rw->getWidth(), rw->getHeight());
|
||||||
|
|
||||||
|
@ -897,19 +889,6 @@ bool RenderingManager::waterShaderSupported()
|
||||||
|
|
||||||
void RenderingManager::applyCompositors()
|
void RenderingManager::applyCompositors()
|
||||||
{
|
{
|
||||||
mCompositors->removeAll();
|
|
||||||
if (useMRT())
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
mCompositors->addCompositor("gbuffer", 0);
|
|
||||||
mCompositors->setCompositorEnabled("gbuffer", true);
|
|
||||||
mCompositors->addCompositor("gbufferFinalizer", 2);
|
|
||||||
mCompositors->setCompositorEnabled("gbufferFinalizer", true);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
//if (mWater)
|
|
||||||
//mWater->assignTextures();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderingManager::getTriangleBatchCount(unsigned int &triangles, unsigned int &batches)
|
void RenderingManager::getTriangleBatchCount(unsigned int &triangles, unsigned int &batches)
|
||||||
|
|
|
@ -104,8 +104,6 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList
|
||||||
|
|
||||||
void removeWater();
|
void removeWater();
|
||||||
|
|
||||||
static const bool useMRT();
|
|
||||||
|
|
||||||
void preCellChange (MWWorld::CellStore* store);
|
void preCellChange (MWWorld::CellStore* store);
|
||||||
///< this event is fired immediately before changing cell
|
///< this event is fired immediately before changing cell
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,6 @@ PlaneReflection::PlaneReflection(Ogre::SceneManager* sceneManager, SkyManager* s
|
||||||
vp->setOverlaysEnabled(false);
|
vp->setOverlaysEnabled(false);
|
||||||
vp->setBackgroundColour(ColourValue(0.8f, 0.9f, 1.0f));
|
vp->setBackgroundColour(ColourValue(0.8f, 0.9f, 1.0f));
|
||||||
vp->setShadowsEnabled(false);
|
vp->setShadowsEnabled(false);
|
||||||
// use fallback techniques without shadows and without mrt
|
|
||||||
vp->setMaterialScheme("water_reflection");
|
vp->setMaterialScheme("water_reflection");
|
||||||
mRenderTarget->addListener(this);
|
mRenderTarget->addListener(this);
|
||||||
mRenderTarget->setActive(true);
|
mRenderTarget->setActive(true);
|
||||||
|
@ -232,8 +231,6 @@ Water::Water (Ogre::Camera *camera, RenderingManager* rend, const ESM::Cell* cel
|
||||||
underwaterDome->setMaterialName("Underwater_Dome");
|
underwaterDome->setMaterialName("Underwater_Dome");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
assignTextures();
|
|
||||||
|
|
||||||
setHeight(mTop);
|
setHeight(mTop);
|
||||||
|
|
||||||
sh::MaterialInstance* m = sh::Factory::getInstance ().getMaterialInstance ("Water");
|
sh::MaterialInstance* m = sh::Factory::getInstance ().getMaterialInstance ("Water");
|
||||||
|
@ -362,22 +359,6 @@ Vector3 Water::getSceneNodeCoordinates(int gridX, int gridY)
|
||||||
return Vector3(gridX * CELL_SIZE + (CELL_SIZE / 2), mTop, -gridY * CELL_SIZE - (CELL_SIZE / 2));
|
return Vector3(gridX * CELL_SIZE + (CELL_SIZE / 2), mTop, -gridY * CELL_SIZE - (CELL_SIZE / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Water::assignTextures()
|
|
||||||
{
|
|
||||||
if (Settings::Manager::getBool("shader", "Water"))
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
CompositorInstance* compositor = CompositorManager::getSingleton().getCompositorChain(mRendering->getViewport())->getCompositor("gbuffer");
|
|
||||||
|
|
||||||
TexturePtr colorTexture = compositor->getTextureInstance("mrt_output", 0);
|
|
||||||
sh::Factory::getInstance ().setTextureAlias ("WaterRefraction", colorTexture->getName());
|
|
||||||
|
|
||||||
TexturePtr depthTexture = compositor->getTextureInstance("mrt_output", 1);
|
|
||||||
sh::Factory::getInstance ().setTextureAlias ("SceneDepth", depthTexture->getName());
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Water::setViewportBackground(const ColourValue& bg)
|
void Water::setViewportBackground(const ColourValue& bg)
|
||||||
{
|
{
|
||||||
if (mReflection)
|
if (mReflection)
|
||||||
|
@ -483,7 +464,6 @@ void Water::processChangedSettings(const Settings::CategorySettingVector& settin
|
||||||
applyRTT();
|
applyRTT();
|
||||||
applyVisibilityMask();
|
applyVisibilityMask();
|
||||||
mWater->setMaterial(mMaterial);
|
mWater->setMaterial(mMaterial);
|
||||||
assignTextures();
|
|
||||||
}
|
}
|
||||||
if (applyVisMask)
|
if (applyVisMask)
|
||||||
applyVisibilityMask();
|
applyVisibilityMask();
|
||||||
|
|
|
@ -146,8 +146,6 @@ namespace MWRender {
|
||||||
void toggle();
|
void toggle();
|
||||||
void update(float dt, Ogre::Vector3 player);
|
void update(float dt, Ogre::Vector3 player);
|
||||||
|
|
||||||
void assignTextures();
|
|
||||||
|
|
||||||
void setViewportBackground(const Ogre::ColourValue& bg);
|
void setViewportBackground(const Ogre::ColourValue& bg);
|
||||||
|
|
||||||
void processChangedSettings(const Settings::CategorySettingVector& settings);
|
void processChangedSettings(const Settings::CategorySettingVector& settings);
|
||||||
|
|
|
@ -6,10 +6,6 @@ set(WATER_FILES
|
||||||
circle.png
|
circle.png
|
||||||
)
|
)
|
||||||
|
|
||||||
set(GBUFFER_FILES
|
|
||||||
gbuffer.compositor
|
|
||||||
)
|
|
||||||
|
|
||||||
set(MATERIAL_FILES
|
set(MATERIAL_FILES
|
||||||
atmosphere.shader
|
atmosphere.shader
|
||||||
atmosphere.shaderset
|
atmosphere.shaderset
|
||||||
|
@ -22,7 +18,6 @@ set(MATERIAL_FILES
|
||||||
objects.shader
|
objects.shader
|
||||||
objects.shaderset
|
objects.shaderset
|
||||||
openmw.configuration
|
openmw.configuration
|
||||||
quad2.shader
|
|
||||||
quad.mat
|
quad.mat
|
||||||
quad.shader
|
quad.shader
|
||||||
quad.shaderset
|
quad.shaderset
|
||||||
|
@ -54,6 +49,4 @@ set(MATERIAL_FILES
|
||||||
|
|
||||||
copy_all_files(${CMAKE_CURRENT_SOURCE_DIR}/water "${OpenMW_BINARY_DIR}/resources/water/" "${WATER_FILES}")
|
copy_all_files(${CMAKE_CURRENT_SOURCE_DIR}/water "${OpenMW_BINARY_DIR}/resources/water/" "${WATER_FILES}")
|
||||||
|
|
||||||
copy_all_files(${CMAKE_CURRENT_SOURCE_DIR}/gbuffer "${OpenMW_BINARY_DIR}/resources/gbuffer/" "${GBUFFER_FILES}")
|
|
||||||
|
|
||||||
copy_all_files(${CMAKE_CURRENT_SOURCE_DIR}/materials "${OpenMW_BINARY_DIR}/resources/materials/" "${MATERIAL_FILES}")
|
copy_all_files(${CMAKE_CURRENT_SOURCE_DIR}/materials "${OpenMW_BINARY_DIR}/resources/materials/" "${MATERIAL_FILES}")
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
// Compositor that just controls output to the MRT textures
|
|
||||||
compositor gbuffer
|
|
||||||
{
|
|
||||||
technique
|
|
||||||
{
|
|
||||||
// MRT output. Currently this is a color texture plus a depth texture
|
|
||||||
texture mrt_output target_width target_height PF_FLOAT16_RGBA PF_FLOAT16_RGBA chain_scope depth_pool 2
|
|
||||||
|
|
||||||
target mrt_output
|
|
||||||
{
|
|
||||||
input none
|
|
||||||
|
|
||||||
pass clear
|
|
||||||
{
|
|
||||||
colour_value 0 0 0 1
|
|
||||||
}
|
|
||||||
pass render_quad
|
|
||||||
{
|
|
||||||
// this makes sure the depth for background is set to 1
|
|
||||||
material openmw_viewport_init
|
|
||||||
}
|
|
||||||
pass render_scene
|
|
||||||
{
|
|
||||||
// Renders everything except water
|
|
||||||
first_render_queue 0
|
|
||||||
last_render_queue 50
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
target_output
|
|
||||||
{
|
|
||||||
input none
|
|
||||||
|
|
||||||
pass render_quad
|
|
||||||
{
|
|
||||||
material quad
|
|
||||||
input 0 mrt_output 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finalizer compositor to render objects that we don't want in the MRT textures (ex. water)
|
|
||||||
// NB the water has to be rendered in a seperate compositor anyway, because it
|
|
||||||
// accesses the MRT textures which can't be done while they are still being rendered to.
|
|
||||||
compositor gbufferFinalizer
|
|
||||||
{
|
|
||||||
technique
|
|
||||||
{
|
|
||||||
texture no_mrt_output target_width target_height PF_R8G8B8A8 depth_pool 2 no_fsaa
|
|
||||||
texture previousscene target_width target_height PF_R8G8B8A8
|
|
||||||
|
|
||||||
target previousscene
|
|
||||||
{
|
|
||||||
input previous
|
|
||||||
}
|
|
||||||
target no_mrt_output
|
|
||||||
{
|
|
||||||
input none
|
|
||||||
shadows off
|
|
||||||
pass clear
|
|
||||||
{
|
|
||||||
buffers colour
|
|
||||||
colour_value 0 0 0 0
|
|
||||||
}
|
|
||||||
pass render_quad
|
|
||||||
{
|
|
||||||
material quad_noDepthWrite
|
|
||||||
input 0 previousscene
|
|
||||||
}
|
|
||||||
pass render_scene
|
|
||||||
{
|
|
||||||
first_render_queue 51
|
|
||||||
last_render_queue 105
|
|
||||||
}
|
|
||||||
}
|
|
||||||
target_output
|
|
||||||
{
|
|
||||||
input none
|
|
||||||
pass clear
|
|
||||||
{
|
|
||||||
}
|
|
||||||
pass render_quad
|
|
||||||
{
|
|
||||||
material quad_noDepthWrite
|
|
||||||
input 0 no_mrt_output
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,5 @@
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
#define MRT @shGlobalSettingBool(mrt_output)
|
|
||||||
|
|
||||||
#ifdef SH_VERTEX_SHADER
|
#ifdef SH_VERTEX_SHADER
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
|
@ -19,18 +17,11 @@
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
shInput(float, alphaFade)
|
shInput(float, alphaFade)
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
#endif
|
|
||||||
shUniform(float4, atmosphereColour) @shSharedParameter(atmosphereColour)
|
shUniform(float4, atmosphereColour) @shSharedParameter(atmosphereColour)
|
||||||
|
|
||||||
SH_START_PROGRAM
|
SH_START_PROGRAM
|
||||||
{
|
{
|
||||||
shOutputColour(0) = atmosphereColour * float4(1,1,1,alphaFade);
|
shOutputColour(0) = atmosphereColour * float4(1,1,1,alphaFade);
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
#define MRT @shGlobalSettingBool(mrt_output)
|
|
||||||
|
|
||||||
#ifdef SH_VERTEX_SHADER
|
#ifdef SH_VERTEX_SHADER
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
|
@ -22,9 +20,6 @@
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
shInput(float2, UV)
|
shInput(float2, UV)
|
||||||
shInput(float, alphaFade)
|
shInput(float, alphaFade)
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
shSampler2D(diffuseMap1)
|
shSampler2D(diffuseMap1)
|
||||||
shSampler2D(diffuseMap2)
|
shSampler2D(diffuseMap2)
|
||||||
|
@ -42,10 +37,6 @@
|
||||||
float4 albedo = shSample(diffuseMap1, scrolledUV) * (1-cloudBlendFactor) + shSample(diffuseMap2, scrolledUV) * cloudBlendFactor;
|
float4 albedo = shSample(diffuseMap1, scrolledUV) * (1-cloudBlendFactor) + shSample(diffuseMap2, scrolledUV) * cloudBlendFactor;
|
||||||
|
|
||||||
shOutputColour(0) = float4(cloudColour, 1) * albedo * float4(1,1,1, cloudOpacity * alphaFade);
|
shOutputColour(0) = float4(cloudColour, 1) * albedo * float4(1,1,1, cloudOpacity * alphaFade);
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
#define MRT @shGlobalSettingBool(mrt_output)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SH_VERTEX_SHADER
|
#ifdef SH_VERTEX_SHADER
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
|
@ -22,9 +19,6 @@
|
||||||
shSampler2D(diffuseMap)
|
shSampler2D(diffuseMap)
|
||||||
shSampler2D(alphaMap)
|
shSampler2D(alphaMap)
|
||||||
shInput(float2, UV)
|
shInput(float2, UV)
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
#endif
|
|
||||||
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
|
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
|
||||||
shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
|
shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
|
||||||
|
|
||||||
|
@ -42,10 +36,6 @@
|
||||||
shOutputColour(0).rgb += (1-tex.a) * shOutputColour(0).a * atmosphereColour.rgb; //fill dark side of moon with atmosphereColour
|
shOutputColour(0).rgb += (1-tex.a) * shOutputColour(0).a * atmosphereColour.rgb; //fill dark side of moon with atmosphereColour
|
||||||
shOutputColour(0).rgb += (1-materialDiffuse.a) * atmosphereColour.rgb; //fade bump
|
shOutputColour(0).rgb += (1-materialDiffuse.a) * atmosphereColour.rgb; //fade bump
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
|
|
||||||
#define FOG @shGlobalSettingBool(fog)
|
#define FOG @shGlobalSettingBool(fog)
|
||||||
#define MRT @shPropertyNotBool(is_transparent) && @shGlobalSettingBool(mrt_output)
|
|
||||||
#define LIGHTING @shGlobalSettingBool(lighting)
|
#define LIGHTING @shGlobalSettingBool(lighting)
|
||||||
|
|
||||||
#define SHADOWS_PSSM LIGHTING && @shGlobalSettingBool(shadows_pssm)
|
#define SHADOWS_PSSM LIGHTING && @shGlobalSettingBool(shadows_pssm)
|
||||||
|
@ -12,7 +11,7 @@
|
||||||
#include "shadows.h"
|
#include "shadows.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if FOG || MRT || SHADOWS_PSSM
|
#if FOG || SHADOWS_PSSM
|
||||||
#define NEED_DEPTH
|
#define NEED_DEPTH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -51,9 +50,9 @@
|
||||||
|
|
||||||
#if VERTEX_LIGHTING
|
#if VERTEX_LIGHTING
|
||||||
shUniform(float, lightCount) @shAutoConstant(lightCount, light_count)
|
shUniform(float, lightCount) @shAutoConstant(lightCount, light_count)
|
||||||
shUniform(float4, lightPosition[8]) @shAutoConstant(lightPosition, light_position_object_space_array, 8)
|
shUniform(float4, lightPosition[@shGlobalSettingString(num_lights)]) @shAutoConstant(lightPosition, light_position_object_space_array, @shGlobalSettingString(num_lights))
|
||||||
shUniform(float4, lightDiffuse[8]) @shAutoConstant(lightDiffuse, light_diffuse_colour_array, 8)
|
shUniform(float4, lightDiffuse[@shGlobalSettingString(num_lights)]) @shAutoConstant(lightDiffuse, light_diffuse_colour_array, @shGlobalSettingString(num_lights))
|
||||||
shUniform(float4, lightAttenuation[8]) @shAutoConstant(lightAttenuation, light_attenuation_array, 8)
|
shUniform(float4, lightAttenuation[@shGlobalSettingString(num_lights)]) @shAutoConstant(lightAttenuation, light_attenuation_array, @shGlobalSettingString(num_lights))
|
||||||
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
|
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
|
||||||
#if !HAS_VERTEXCOLOUR
|
#if !HAS_VERTEXCOLOUR
|
||||||
shUniform(float4, materialAmbient) @shAutoConstant(materialAmbient, surface_ambient_colour)
|
shUniform(float4, materialAmbient) @shAutoConstant(materialAmbient, surface_ambient_colour)
|
||||||
|
@ -153,18 +152,11 @@
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
shSampler2D(diffuseMap)
|
shSampler2D(diffuseMap)
|
||||||
shInput(float2, UV)
|
shInput(float2, UV)
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NEED_DEPTH
|
#ifdef NEED_DEPTH
|
||||||
shInput(float, depthPassthrough)
|
shInput(float, depthPassthrough)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shUniform(float, far) @shAutoConstant(far, far_clip_distance)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LIGHTING
|
#if LIGHTING
|
||||||
shInput(float3, normalPassthrough)
|
shInput(float3, normalPassthrough)
|
||||||
shInput(float3, objSpacePositionPassthrough)
|
shInput(float3, objSpacePositionPassthrough)
|
||||||
|
@ -369,10 +361,6 @@
|
||||||
float isUnderwater = (worldPos.y < waterLevel) ? 1.0 : 0.0;
|
float isUnderwater = (worldPos.y < waterLevel) ? 1.0 : 0.0;
|
||||||
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, watercolour, fogAmount * isUnderwater * waterEnabled);
|
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, watercolour, fogAmount * isUnderwater * waterEnabled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(depthPassthrough / far,1,1,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,13 +3,11 @@ configuration water_reflection
|
||||||
fog false
|
fog false
|
||||||
shadows false
|
shadows false
|
||||||
shadows_pssm false
|
shadows_pssm false
|
||||||
mrt_output false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration local_map
|
configuration local_map
|
||||||
{
|
{
|
||||||
fog false
|
fog false
|
||||||
mrt_output false
|
|
||||||
shadows false
|
shadows false
|
||||||
shadows_pssm false
|
shadows_pssm false
|
||||||
simple_water true
|
simple_water true
|
||||||
|
|
|
@ -20,16 +20,3 @@ material quad_noDepthWrite
|
||||||
parent quad
|
parent quad
|
||||||
depth_write off
|
depth_write off
|
||||||
}
|
}
|
||||||
|
|
||||||
material openmw_viewport_init
|
|
||||||
{
|
|
||||||
pass
|
|
||||||
{
|
|
||||||
vertex_program viewport_init_vertex
|
|
||||||
fragment_program viewport_init_fragment
|
|
||||||
|
|
||||||
depth_write off
|
|
||||||
depth_check off
|
|
||||||
scene_blend add
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -13,19 +13,3 @@ shader_set quad_fragment
|
||||||
profiles_cg ps_2_x ps_2_0 ps fp40 arbfp1
|
profiles_cg ps_2_x ps_2_0 ps fp40 arbfp1
|
||||||
profiles_hlsl ps_2_0
|
profiles_hlsl ps_2_0
|
||||||
}
|
}
|
||||||
|
|
||||||
shader_set viewport_init_vertex
|
|
||||||
{
|
|
||||||
source quad2.shader
|
|
||||||
type vertex
|
|
||||||
profiles_cg vs_2_0 vp40 arbvp1
|
|
||||||
profiles_hlsl vs_2_0
|
|
||||||
}
|
|
||||||
|
|
||||||
shader_set viewport_init_fragment
|
|
||||||
{
|
|
||||||
source quad2.shader
|
|
||||||
type fragment
|
|
||||||
profiles_cg ps_2_x ps_2_0 ps fp40 arbfp1
|
|
||||||
profiles_hlsl ps_2_0
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
#include "core.h"
|
|
||||||
|
|
||||||
#ifdef SH_VERTEX_SHADER
|
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
|
||||||
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
|
|
||||||
SH_START_PROGRAM
|
|
||||||
{
|
|
||||||
shOutputPosition = shMatrixMult(wvp, shInputPosition);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
|
||||||
shUniform(float3, viewportBackground) @shSharedParameter(viewportBackground)
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
SH_START_PROGRAM
|
|
||||||
{
|
|
||||||
shOutputColour(0) = float4(viewportBackground, 1);
|
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,7 +1,5 @@
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
#define MRT @shGlobalSettingBool(mrt_output)
|
|
||||||
|
|
||||||
#ifdef SH_VERTEX_SHADER
|
#ifdef SH_VERTEX_SHADER
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
|
@ -22,9 +20,6 @@
|
||||||
#else
|
#else
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
shInput(float2, UV)
|
shInput(float2, UV)
|
||||||
shInput(float, fade)
|
shInput(float, fade)
|
||||||
|
@ -36,11 +31,6 @@
|
||||||
SH_START_PROGRAM
|
SH_START_PROGRAM
|
||||||
{
|
{
|
||||||
shOutputColour(0) = shSample(diffuseMap, UV) * float4(1,1,1, nightFade * fade);
|
shOutputColour(0) = shSample(diffuseMap, UV) * float4(1,1,1, nightFade * fade);
|
||||||
|
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
#define MRT @shGlobalSettingBool(mrt_output)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SH_VERTEX_SHADER
|
#ifdef SH_VERTEX_SHADER
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
|
@ -21,19 +18,12 @@
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
shSampler2D(diffuseMap)
|
shSampler2D(diffuseMap)
|
||||||
shInput(float2, UV)
|
shInput(float2, UV)
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
#endif
|
|
||||||
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
|
shUniform(float4, materialDiffuse) @shAutoConstant(materialDiffuse, surface_diffuse_colour)
|
||||||
//shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
|
//shUniform(float4, materialEmissive) @shAutoConstant(materialEmissive, surface_emissive_colour)
|
||||||
|
|
||||||
SH_START_PROGRAM
|
SH_START_PROGRAM
|
||||||
{
|
{
|
||||||
shOutputColour(0) = float4(1,1,1,materialDiffuse.a) * shSample(diffuseMap, UV);
|
shOutputColour(0) = float4(1,1,1,materialDiffuse.a) * shSample(diffuseMap, UV);
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#define IS_FIRST_PASS 1
|
#define IS_FIRST_PASS 1
|
||||||
|
|
||||||
#define FOG @shGlobalSettingBool(fog)
|
#define FOG @shGlobalSettingBool(fog)
|
||||||
#define MRT @shGlobalSettingBool(mrt_output)
|
|
||||||
|
|
||||||
#define LIGHTING @shGlobalSettingBool(lighting)
|
#define LIGHTING @shGlobalSettingBool(lighting)
|
||||||
|
|
||||||
|
@ -18,7 +17,7 @@
|
||||||
|
|
||||||
#define NUM_LAYERS @shPropertyString(num_layers)
|
#define NUM_LAYERS @shPropertyString(num_layers)
|
||||||
|
|
||||||
#if MRT || FOG || SHADOWS_PSSM
|
#if FOG || SHADOWS_PSSM
|
||||||
#define NEED_DEPTH 1
|
#define NEED_DEPTH 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -153,11 +152,6 @@
|
||||||
|
|
||||||
@shPassthroughFragmentInputs
|
@shPassthroughFragmentInputs
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
shUniform(float, far) @shAutoConstant(far, far_clip_distance)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if LIGHTING
|
#if LIGHTING
|
||||||
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
|
shUniform(float4, lightAmbient) @shAutoConstant(lightAmbient, ambient_light_colour)
|
||||||
|
@ -370,10 +364,6 @@
|
||||||
float isUnderwater = (worldPos.y < waterLevel) ? 1.0 : 0.0;
|
float isUnderwater = (worldPos.y < waterLevel) ? 1.0 : 0.0;
|
||||||
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, watercolour, fogAmount * isUnderwater);
|
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, watercolour, fogAmount * isUnderwater);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(depth / far,1,1,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -7,10 +7,6 @@
|
||||||
#if SIMPLE_WATER
|
#if SIMPLE_WATER
|
||||||
// --------------------------------------- SIMPLE WATER ---------------------------------------------------
|
// --------------------------------------- SIMPLE WATER ---------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#define MRT @shGlobalSettingBool(mrt_output)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef SH_VERTEX_SHADER
|
#ifdef SH_VERTEX_SHADER
|
||||||
|
|
||||||
SH_BEGIN_PROGRAM
|
SH_BEGIN_PROGRAM
|
||||||
|
@ -32,9 +28,6 @@
|
||||||
shSampler2D(animatedTexture)
|
shSampler2D(animatedTexture)
|
||||||
shInput(float2, UV)
|
shInput(float2, UV)
|
||||||
shInput(float, depth)
|
shInput(float, depth)
|
||||||
#if MRT
|
|
||||||
shDeclareMrtOutput(1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
shUniform(float3, fogColor) @shAutoConstant(fogColor, fog_colour)
|
shUniform(float3, fogColor) @shAutoConstant(fogColor, fog_colour)
|
||||||
shUniform(float4, fogParams) @shAutoConstant(fogParams, fog_params)
|
shUniform(float4, fogParams) @shAutoConstant(fogParams, fog_params)
|
||||||
|
@ -47,10 +40,6 @@
|
||||||
|
|
||||||
float fogValue = shSaturate((depth - fogParams.y) * fogParams.w);
|
float fogValue = shSaturate((depth - fogParams.y) * fogParams.w);
|
||||||
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, fogColor, fogValue);
|
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, fogColor, fogValue);
|
||||||
|
|
||||||
#if MRT
|
|
||||||
shOutputColour(1) = float4(1,1,1,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue