forked from mirror/openmw-tes3mp
override nif transparency settings (part 1)
parent
2a4fcf42a3
commit
a727bcd4a4
@ -0,0 +1,37 @@
|
||||
#include "nifoverrides.hpp"
|
||||
|
||||
#include <OgreStringConverter.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
using namespace NifOverrides;
|
||||
|
||||
Ogre::ConfigFile Overrides::mTransparencyOverrides = Ogre::ConfigFile();
|
||||
|
||||
void Overrides::loadTransparencyOverrides (const std::string& file)
|
||||
{
|
||||
mTransparencyOverrides.load(file);
|
||||
}
|
||||
|
||||
TransparencyResult Overrides::getTransparencyOverride(const std::string& texture)
|
||||
{
|
||||
TransparencyResult result;
|
||||
result.first = false;
|
||||
|
||||
std::string tex = texture;
|
||||
boost::to_lower(tex);
|
||||
|
||||
Ogre::ConfigFile::SectionIterator seci = mTransparencyOverrides.getSectionIterator();
|
||||
while (seci.hasMoreElements())
|
||||
{
|
||||
Ogre::String sectionName = seci.peekNextKey();
|
||||
if (sectionName == tex)
|
||||
{
|
||||
result.first = true;
|
||||
result.second = Ogre::StringConverter::parseInt(mTransparencyOverrides.getSetting("alphaRejectValue", sectionName));
|
||||
break;
|
||||
}
|
||||
seci.getNext();
|
||||
}
|
||||
return result;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
#ifndef COMPONENTS_NIFOVERRIDES_H
|
||||
#define COMPONENTS_NIFOVERRIDES_H
|
||||
|
||||
#include <OgreConfigFile.h>
|
||||
|
||||
namespace NifOverrides
|
||||
{
|
||||
|
||||
typedef std::pair<bool, int> TransparencyResult;
|
||||
|
||||
/// \brief provide overrides for some model / texture properties that bethesda has chosen poorly
|
||||
class Overrides
|
||||
{
|
||||
public:
|
||||
static Ogre::ConfigFile mTransparencyOverrides;
|
||||
void loadTransparencyOverrides (const std::string& file);
|
||||
|
||||
static TransparencyResult getTransparencyOverride(const std::string& texture);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,86 @@
|
||||
# Bethesda has used wrong transparency settings for many textures
|
||||
# (who would have guessed)
|
||||
# This is very unfortunate because objects with real transparency:
|
||||
# - cannot cast shadows
|
||||
# - cannot receive advanced framebuffer effects like depth of field or ambient occlusion
|
||||
# - cannot cover lens flare effects (the lens flare will just shine through)
|
||||
|
||||
# This file lists textures that should be using alpha rejection instead of transparency
|
||||
# basically these are textures that are not translucent (i.e. at one spot on the texture, either transparent or opaque)
|
||||
|
||||
# Note: all the texture names here have to be lowercase
|
||||
|
||||
[textures\tx_flag_imp_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_ivy_02.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_ivy_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_sail.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_saltrice_04.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_black_lichen_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_leaves_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_leaves_02.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_leaves_03.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_ai_heather_01.dds]
|
||||
alphaRejectValue = 96
|
||||
|
||||
[textures\tx_goldkanet_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_goldkanet_02.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_plant_tails00.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_vine_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_comberry_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_willow_flower_02.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_cork_bulb_02.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_v_b_telvanni_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_green_lichen_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_roobrush_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_bittergreen_02.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_chokeweed_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_de_banner_book_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_bannerd_w_a_shop_01.dds]
|
||||
alphaRejectValue = 128
|
||||
|
||||
[textures\tx_banner_temple_02.dds]
|
||||
alphaRejectValue = 128
|
Loading…
Reference in New Issue