Merge branch 'master' into NewRTTWidget
This commit is contained in:
commit
588b4189ac
@ -55,9 +55,20 @@
|
||||
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<spacer width="70" height="10"/>
|
||||
<checkbox id="ssao"/>
|
||||
<spacer width="10" height="10"/>
|
||||
<label text="Ambient Occlusion" I18N="Video settings"/>
|
||||
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
<checkbox id="ssao"/>
|
||||
<spacer width="10" height="10"/>
|
||||
<label text="Ambient Occlusion" I18N="Video settings"/>
|
||||
</div>
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
<checkbox id="global_illumination"/>
|
||||
<spacer width="10" height="10"/>
|
||||
<label text="Global illumination" I18N="Video settings"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<spacer height="20" width="10" />
|
||||
|
@ -114,6 +114,7 @@ enum QueryPerf
|
||||
Q_TRANSPARENT,
|
||||
Q_PARTICLES,
|
||||
Q_DISPLACEMENT,
|
||||
Q_DOF,
|
||||
Q_GODRAYS,
|
||||
Q_BLOOM,
|
||||
Q_TONEMAP,
|
||||
|
@ -721,8 +721,11 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode)
|
||||
|
||||
if (UserConfigParams::m_dof)
|
||||
{
|
||||
PROFILER_PUSH_CPU_MARKER("- DoF", 0xFF, 0x00, 0x00);
|
||||
ScopedGPUTimer Timer(irr_driver->getGPUTimer(Q_DOF));
|
||||
renderDoF(*out_fbo, in_fbo->getRTT()[0]);
|
||||
std::swap(in_fbo, out_fbo);
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -55,6 +55,7 @@ RTT::RTT(size_t width, size_t height)
|
||||
{
|
||||
m_shadow_FBO = NULL;
|
||||
m_RSM = NULL;
|
||||
m_RH_FBO = NULL;
|
||||
using namespace video;
|
||||
using namespace core;
|
||||
|
||||
@ -237,9 +238,6 @@ RTT::RTT(size_t width, size_t height)
|
||||
|
||||
RTT::~RTT()
|
||||
{
|
||||
delete m_shadow_FBO;
|
||||
delete m_RH_FBO;
|
||||
delete m_RSM;
|
||||
glDeleteTextures(RTT_COUNT, RenderTargetTextures);
|
||||
glDeleteTextures(1, &DepthStencilTexture);
|
||||
if (irr_driver->getGLSLVersion() >= 150)
|
||||
@ -252,5 +250,9 @@ RTT::~RTT()
|
||||
glDeleteTextures(1, &RH_Red);
|
||||
glDeleteTextures(1, &RH_Green);
|
||||
glDeleteTextures(1, &RH_Blue);
|
||||
|
||||
delete m_shadow_FBO;
|
||||
delete m_RH_FBO;
|
||||
delete m_RSM;
|
||||
}
|
||||
}
|
||||
|
@ -1510,8 +1510,6 @@ namespace MeshShader
|
||||
attrib_normal = glGetAttribLocation(Program, "Normal");
|
||||
uniform_tex = glGetUniformLocation(Program, "tex");
|
||||
uniform_RSMMatrix = glGetUniformLocation(Program, "RSMMatrix");
|
||||
GLuint uniform_ViewProjectionMatrixesUBO = glGetUniformBlockIndex(Program, "MatrixesData");
|
||||
glUniformBlockBinding(Program, uniform_ViewProjectionMatrixesUBO, 0);
|
||||
}
|
||||
|
||||
void RSMShader::setUniforms(const core::matrix4 &RSMMatrix, const core::matrix4 &ModelMatrix, unsigned TU_tex)
|
||||
@ -2339,8 +2337,6 @@ namespace FullScreenShader
|
||||
uniform_RHMatrix = glGetUniformLocation(Program, "RHMatrix");
|
||||
uniform_RSMMatrix = glGetUniformLocation(Program, "RSMMatrix");
|
||||
vao = createVAO(Program);
|
||||
GLuint uniform_ViewProjectionMatrixesUBO = glGetUniformBlockIndex(Program, "MatrixesData");
|
||||
glUniformBlockBinding(Program, uniform_ViewProjectionMatrixesUBO, 0);
|
||||
}
|
||||
|
||||
void RadianceHintsConstructionShader::setUniforms(const core::matrix4 &RSMMatrix, const core::matrix4 &RHMatrix, const core::vector3df &extents, unsigned TU_ctex, unsigned TU_ntex, unsigned TU_dtex)
|
||||
@ -2507,29 +2503,6 @@ namespace FullScreenShader
|
||||
vao = createVAO(Program);
|
||||
}
|
||||
|
||||
GLuint ShadowGenShader::Program;
|
||||
GLuint ShadowGenShader::uniform_halft;
|
||||
GLuint ShadowGenShader::uniform_quarter;
|
||||
GLuint ShadowGenShader::uniform_height;
|
||||
GLuint ShadowGenShader::vao;
|
||||
void ShadowGenShader::init()
|
||||
{
|
||||
Program = LoadProgram(
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(),
|
||||
GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/shadowgen.frag").c_str());
|
||||
uniform_halft = glGetUniformLocation(Program, "halft");
|
||||
uniform_quarter = glGetUniformLocation(Program, "quarter");
|
||||
uniform_height = glGetUniformLocation(Program, "height");
|
||||
vao = createVAO(Program);
|
||||
}
|
||||
|
||||
void ShadowGenShader::setUniforms(GLuint TU_halft, GLuint TU_quarter, GLuint TU_height)
|
||||
{
|
||||
glUniform1i(uniform_halft, TU_halft);
|
||||
glUniform1i(uniform_quarter, TU_quarter);
|
||||
glUniform1i(uniform_height, TU_height);
|
||||
}
|
||||
|
||||
GLuint PassThroughShader::Program;
|
||||
GLuint PassThroughShader::uniform_texture;
|
||||
GLuint PassThroughShader::vao;
|
||||
|
@ -701,39 +701,6 @@ public:
|
||||
static void init();
|
||||
};
|
||||
|
||||
class PenumbraHShader
|
||||
{
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint uniform_tex, uniform_pixel;
|
||||
static GLuint vao;
|
||||
|
||||
static void init();
|
||||
static void setUniforms(const core::vector2df &pixels, GLuint TU_tex);
|
||||
};
|
||||
|
||||
class PenumbraVShader
|
||||
{
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint uniform_tex, uniform_pixel;
|
||||
static GLuint vao;
|
||||
|
||||
static void init();
|
||||
static void setUniforms(const core::vector2df &pixels, GLuint TU_tex);
|
||||
};
|
||||
|
||||
class ShadowGenShader
|
||||
{
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint uniform_halft, uniform_quarter, uniform_height;
|
||||
static GLuint vao;
|
||||
|
||||
static void init();
|
||||
static void setUniforms(GLuint TU_halft, GLuint TU_quarter, GLuint TU_height);
|
||||
};
|
||||
|
||||
class PassThroughShader
|
||||
{
|
||||
public:
|
||||
|
@ -150,8 +150,6 @@ void STKAnimatedMesh::render()
|
||||
core::matrix4 invmodel;
|
||||
AbsoluteTransformation.getInverse(invmodel);
|
||||
|
||||
PROFILER_PUSH_CPU_MARKER("GATHER SOLID MESHES", 0xFC, 0xFA, 0x68);
|
||||
|
||||
GLMesh* mesh;
|
||||
for_in(mesh, GeometricMesh[FPSM_DEFAULT])
|
||||
{
|
||||
@ -167,14 +165,11 @@ void STKAnimatedMesh::render()
|
||||
GroupedFPSM<FPSM_ALPHA_REF_TEXTURE>::TIMVSet.push_back(invmodel);
|
||||
}
|
||||
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
return;
|
||||
}
|
||||
|
||||
if (irr_driver->getPhase() == SOLID_LIT_PASS)
|
||||
{
|
||||
PROFILER_PUSH_CPU_MARKER("GATHER TRANSPARENT MESHES", 0xFC, 0xFA, 0x68);
|
||||
|
||||
core::matrix4 invmodel;
|
||||
AbsoluteTransformation.getInverse(invmodel);
|
||||
|
||||
@ -221,7 +216,6 @@ void STKAnimatedMesh::render()
|
||||
GroupedSM<SM_UNTEXTURED>::TIMVSet.push_back(invmodel);
|
||||
}
|
||||
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -195,11 +195,8 @@ FileManager::FileManager()
|
||||
checkAndCreateCachedTexturesDir();
|
||||
checkAndCreateGPDir();
|
||||
|
||||
#ifdef WIN32
|
||||
redirectOutput();
|
||||
|
||||
#endif
|
||||
|
||||
// We can't use _() here, since translations will only be initalised
|
||||
// after the filemanager (to get the path to the tranlsations from it)
|
||||
for(unsigned int i=0; i<m_root_dirs.size(); i++)
|
||||
@ -999,12 +996,36 @@ std::string FileManager::checkAndCreateLinuxDir(const char *env_name,
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Redirects output to go into files in the user's config directory
|
||||
* instead of to the console.
|
||||
* instead of to the console. It keeps backup copies of previous stdout files
|
||||
* (3 atm), which can help to diagnose problems caused by a previous crash.
|
||||
*/
|
||||
void FileManager::redirectOutput()
|
||||
{
|
||||
//Enable logging of stdout and stderr to logfile
|
||||
// Do a simple log rotate: stdout.log.2 becomes stdout.log.3 etc
|
||||
const int NUM_BACKUPS=3;
|
||||
std::string logoutfile = getUserConfigFile("stdout.log");
|
||||
for(int i=NUM_BACKUPS; i>1; i--)
|
||||
{
|
||||
std::ostringstream out_old;
|
||||
out_old << logoutfile << "." << i;
|
||||
removeFile(out_old.str());
|
||||
std::ostringstream out_new;
|
||||
out_new << logoutfile << "." << i-1;
|
||||
if(fileExists(out_new.str()))
|
||||
{
|
||||
rename(out_new.str().c_str(), out_old.str().c_str());
|
||||
}
|
||||
} // for i in NUM_BACKUPS
|
||||
|
||||
if(fileExists(logoutfile))
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << logoutfile<<".1";
|
||||
// No good place to log error messages when log is not yet initialised
|
||||
rename(logoutfile.c_str(), out.str().c_str());
|
||||
}
|
||||
|
||||
//Enable logging of stdout and stderr to logfile
|
||||
Log::verbose("main", "Error messages and other text output will "
|
||||
"be logged to %s.", logoutfile.c_str());
|
||||
Log::openOutputFiles(logoutfile);
|
||||
|
@ -1183,11 +1183,6 @@ int main(int argc, char *argv[] )
|
||||
|
||||
initRest();
|
||||
|
||||
// Windows 32 always redirects output
|
||||
#ifndef WIN32
|
||||
file_manager->redirectOutput();
|
||||
#endif
|
||||
|
||||
input_manager = new InputManager ();
|
||||
|
||||
#ifdef ENABLE_WIIUSE
|
||||
|
@ -87,6 +87,7 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
|
||||
|
||||
getWidget<CheckBoxWidget>("dynamiclight")->setState(UserConfigParams::m_dynamic_lights);
|
||||
getWidget<CheckBoxWidget>("lightshaft")->setState(UserConfigParams::m_light_shaft);
|
||||
getWidget<CheckBoxWidget>("global_illumination")->setState(UserConfigParams::m_gi);
|
||||
getWidget<CheckBoxWidget>("motionblur")->setState(UserConfigParams::m_motionblur);
|
||||
getWidget<CheckBoxWidget>("mlaa")->setState(UserConfigParams::m_mlaa);
|
||||
getWidget<CheckBoxWidget>("glow")->setState(UserConfigParams::m_glow);
|
||||
@ -139,6 +140,9 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
|
||||
UserConfigParams::m_light_shaft =
|
||||
getWidget<CheckBoxWidget>("lightshaft")->getState();
|
||||
|
||||
UserConfigParams::m_gi =
|
||||
getWidget<CheckBoxWidget>("global_illumination")->getState();
|
||||
|
||||
UserConfigParams::m_glow =
|
||||
getWidget<CheckBoxWidget>("glow")->getState();
|
||||
|
||||
|
@ -61,6 +61,7 @@ struct GFXPreset
|
||||
int anisotropy;
|
||||
/** Depth of field */
|
||||
bool dof;
|
||||
bool global_illumination;
|
||||
};
|
||||
|
||||
static GFXPreset GFX_PRESETS[] =
|
||||
@ -68,31 +69,36 @@ static GFXPreset GFX_PRESETS[] =
|
||||
{
|
||||
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
|
||||
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
|
||||
false /* animatedScenery */, 0 /* animatedCharacters */, 0 /* anisotropy */, false /* depth of field */
|
||||
false /* animatedScenery */, 0 /* animatedCharacters */, 0 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */
|
||||
},
|
||||
|
||||
{
|
||||
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
|
||||
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 4 /* anisotropy */, false /* depth of field */
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 4 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */
|
||||
},
|
||||
|
||||
{
|
||||
true /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
|
||||
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, true /* weather */,
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 4 /* anisotropy */, false /* depth of field */
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 4 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */
|
||||
},
|
||||
|
||||
{
|
||||
true /* light */, 0 /* shadow */, false /* bloom */, true /* motionblur */,
|
||||
true /* lightshaft */, true /* glow */, true /* mlaa */, false /* ssao */, true /* weather */,
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 8 /* anisotropy */, false /* depth of field */
|
||||
true /* animatedScenery */, 1 /* animatedCharacters */, 8 /* anisotropy */,
|
||||
false /* depth of field */, false /* global illumination */
|
||||
},
|
||||
|
||||
{
|
||||
true /* light */, 2 /* shadow */, true /* bloom */, true /* motionblur */,
|
||||
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */, true /* weather */,
|
||||
true /* animatedScenery */, 2 /* animatedCharacters */, 8 /* anisotropy */, true /* depth of field */
|
||||
true /* animatedScenery */, 2 /* animatedCharacters */, 8 /* anisotropy */,
|
||||
true /* depth of field */, true /* global illumination */
|
||||
}
|
||||
};
|
||||
|
||||
@ -362,7 +368,8 @@ void OptionsScreenVideo::updateGfxSlider()
|
||||
GFX_PRESETS[l].shadows == UserConfigParams::m_shadows &&
|
||||
GFX_PRESETS[l].ssao == UserConfigParams::m_ssao &&
|
||||
GFX_PRESETS[l].weather == UserConfigParams::m_weather_effects &&
|
||||
GFX_PRESETS[l].dof == UserConfigParams::m_dof)
|
||||
GFX_PRESETS[l].dof == UserConfigParams::m_dof &&
|
||||
GFX_PRESETS[l].global_illumination == UserConfigParams::m_gi)
|
||||
{
|
||||
gfx->setValue(l + 1);
|
||||
found = true;
|
||||
@ -444,6 +451,14 @@ void OptionsScreenVideo::updateTooltip()
|
||||
tooltip = tooltip + L"\n" + _("Light shaft (God rays) : %s",
|
||||
UserConfigParams::m_light_shaft ? enabled : disabled);
|
||||
|
||||
//I18N: in graphical options
|
||||
tooltip = tooltip + L"\n" + _("Depth of field : %s",
|
||||
UserConfigParams::m_dof ? enabled : disabled);
|
||||
|
||||
//I18N: in graphical options
|
||||
tooltip = tooltip + L"\n" + _("Global illumination : %s",
|
||||
UserConfigParams::m_gi ? enabled : disabled);
|
||||
|
||||
gfx->setTooltip(tooltip);
|
||||
} // updateTooltip
|
||||
|
||||
@ -526,6 +541,7 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
|
||||
UserConfigParams::m_ssao = GFX_PRESETS[level].ssao;
|
||||
UserConfigParams::m_weather_effects = GFX_PRESETS[level].weather;
|
||||
UserConfigParams::m_dof = GFX_PRESETS[level].dof;
|
||||
UserConfigParams::m_gi = GFX_PRESETS[level].global_illumination;
|
||||
|
||||
updateGfxSlider();
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ core::stringw Track::getName() const
|
||||
{
|
||||
translated = translated.subString(0, index);
|
||||
}
|
||||
return translated;
|
||||
return translated;
|
||||
} // getName
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -399,6 +399,7 @@ void Profiler::draw()
|
||||
"Transparent",
|
||||
"Particles",
|
||||
"Displacement",
|
||||
"Depth of Field",
|
||||
"Godrays",
|
||||
"Bloom",
|
||||
"Tonemap",
|
||||
|
Loading…
Reference in New Issue
Block a user