Adjust graphics presets for SP

This commit is contained in:
Benau 2018-01-12 12:03:31 +08:00
parent 7f3722d90b
commit 9ccb34c2a1
25 changed files with 142 additions and 313 deletions

View File

@ -23,7 +23,7 @@
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" proportion="1">
<div layout="horizontal-row" width="50%" proportion="1">
<spacer width="70" height="10" />
<div layout="horizontal-row" proportion="1" height="fit">
@ -31,14 +31,6 @@
<spacer width="10" height="10"/>
<gauge id="shadows" min_value="0" max_value="2" proportion="1"/>
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" proportion="1" height="fit">
<checkbox id="ibl"/>
<spacer width="10" height="10"/>
<label text="Image-based lighting" I18N="Video settings"/>
</div>
</div>
<spacer height="4" width="10" />
@ -75,9 +67,9 @@
<spacer height="4" width="10" />
<div layout="horizontal-row" proportion="1" height="fit">
<checkbox id="global_illumination"/>
<checkbox id="dof"/>
<spacer width="10" height="10"/>
<label text="Global illumination" I18N="Video settings"/>
<label text="Depth of field" I18N="Video settings"/>
</div>
</div>
@ -115,9 +107,9 @@
<spacer height="4" width="10" />
<div layout="horizontal-row" proportion="1" height="fit">
<checkbox id="dof"/>
<checkbox id="ibl"/>
<spacer width="10" height="10"/>
<label text="Depth of field" I18N="Video settings"/>
<label text="Image-based lighting" I18N="Video settings"/>
</div>
</div>
@ -125,9 +117,9 @@
<div layout="horizontal-row" width="100%" proportion="1">
<div layout="horizontal-row" proportion="1" height="fit">
<checkbox id="weather_gfx"/>
<checkbox id="animated_characters"/>
<spacer width="10" height="10"/>
<label text="Weather Effects" I18N="Video settings"/>
<label text="Animated Characters" I18N="Video settings"/>
</div>
<spacer height="4" width="10" />
@ -142,17 +134,9 @@
<spacer height="20" width="10" />
<div layout="horizontal-row" width="100%" proportion="1">
<label text="Animated Scenery" I18N="Video settings" width="40%"/>
<label text="Particles Effects" I18N="Video settings" width="40%"/>
<spacer width="10" height="10"/>
<gauge id="anim_gfx" min_value="0" max_value="2" width="50%" />
</div>
<spacer height="4" width="10" />
<div layout="horizontal-row" width="100%" proportion="1">
<label text="Animated Characters" I18N="Video settings" width="40%"/>
<spacer width="10" height="10"/>
<gauge id="steering_animations" min_value="0" max_value="2" width="50%" />
<gauge id="particles_effects" min_value="0" max_value="2" width="50%" />
</div>
<spacer height="4" width="10" />
@ -160,7 +144,7 @@
<div layout="horizontal-row" width="100%" proportion="1">
<label text="Rendered image quality" I18N="Video settings" width="40%"/>
<spacer width="10" height="10"/>
<gauge id="image_quality" min_value="0" max_value="3" width="50%" />
<gauge id="image_quality" min_value="0" max_value="2" width="50%" />
</div>
<spacer height="4" width="10" />

View File

@ -73,43 +73,39 @@ ThreeDAnimation::~ThreeDAnimation()
*/
void ThreeDAnimation::update(float dt)
{
//if (UserConfigParams::m_graphical_effects > 1 ||
// (UserConfigParams::m_graphical_effects > 0 && m_important_animation))
Vec3 xyz = m_object->getPosition();
Vec3 scale = m_object->getScale();
//make the object think no time has passed to pause it's animation
if (m_is_paused)dt = 0;
AnimationBase::update(dt, &xyz, &m_hpr, &scale); //updates all IPOs
//m_node->setPosition(xyz.toIrrVector());
//m_node->setScale(scale.toIrrVector());
if (!m_playing) return;
// Note that the rotation order of irrlicht is different from the one
// in blender. So in order to reproduce the blender IPO rotations
// correctly, we have to get the rotations around each axis and combine
// them in the right order for irrlicht
core::matrix4 m;
m.makeIdentity();
core::matrix4 mx;
assert(!std::isnan(m_hpr.getX()));
assert(!std::isnan(m_hpr.getY()));
assert(!std::isnan(m_hpr.getZ()));
mx.setRotationDegrees(core::vector3df(m_hpr.getX(), 0, 0));
core::matrix4 my;
my.setRotationDegrees(core::vector3df(0, m_hpr.getY(), 0));
core::matrix4 mz;
mz.setRotationDegrees(core::vector3df(0, 0, m_hpr.getZ()));
m = my*mz*mx;
core::vector3df hpr = m.getRotationDegrees();
//m_node->setRotation(hpr);
if (m_object)
{
Vec3 xyz = m_object->getPosition();
Vec3 scale = m_object->getScale();
//make the object think no time has passed to pause it's animation
if (m_is_paused)dt = 0;
AnimationBase::update(dt, &xyz, &m_hpr, &scale); //updates all IPOs
//m_node->setPosition(xyz.toIrrVector());
//m_node->setScale(scale.toIrrVector());
if (!m_playing) return;
// Note that the rotation order of irrlicht is different from the one
// in blender. So in order to reproduce the blender IPO rotations
// correctly, we have to get the rotations around each axis and combine
// them in the right order for irrlicht
core::matrix4 m;
m.makeIdentity();
core::matrix4 mx;
assert(!std::isnan(m_hpr.getX()));
assert(!std::isnan(m_hpr.getY()));
assert(!std::isnan(m_hpr.getZ()));
mx.setRotationDegrees(core::vector3df(m_hpr.getX(), 0, 0));
core::matrix4 my;
my.setRotationDegrees(core::vector3df(0, m_hpr.getY(), 0));
core::matrix4 mz;
mz.setRotationDegrees(core::vector3df(0, 0, m_hpr.getZ()));
m = my*mz*mx;
core::vector3df hpr = m.getRotationDegrees();
//m_node->setRotation(hpr);
if (m_object)
{
m_object->move(xyz.toIrrVector(), hpr, scale.toIrrVector(), true, false);
}
m_object->move(xyz.toIrrVector(), hpr, scale.toIrrVector(), true, false);
}
} // update

View File

@ -784,9 +784,9 @@ namespace UserConfigParams
#define FBO_DEFAULT true
#endif
PARAM_PREFIX IntUserConfigParam m_graphical_effects
PARAM_DEFAULT( IntUserConfigParam(2, "animate_graphics",
&m_graphics_quality, "Scenery animations: 0 disabled, 1 only important, 2 enabled") );
PARAM_PREFIX IntUserConfigParam m_particles_effects
PARAM_DEFAULT( IntUserConfigParam(2, "particles-effecs",
&m_graphics_quality, "Particles effects: 0 disabled, 1 only important, 2 enabled") );
// This saves the actual user preference.
PARAM_PREFIX IntUserConfigParam m_xmas_mode
@ -798,14 +798,10 @@ namespace UserConfigParams
PARAM_DEFAULT(IntUserConfigParam(0, "easter-ear-mode",
&m_graphics_quality, "Easter Bunny Ears: 0 use current date, 1 always on, 2 always off"));
PARAM_PREFIX BoolUserConfigParam m_weather_effects
PARAM_DEFAULT( BoolUserConfigParam(true, "weather_gfx",
&m_graphics_quality, "Weather effects") );
PARAM_PREFIX IntUserConfigParam m_show_steering_animations
PARAM_DEFAULT( IntUserConfigParam(ANIMS_PLAYERS_ONLY,
"steering_animations", &m_graphics_quality,
"Whether to display kart animations (0=disabled for all; "
"1=enabled for humans, disabled for AIs; 2=enabled for all") );
PARAM_PREFIX BoolUserConfigParam m_animated_characters
PARAM_DEFAULT( BoolUserConfigParam(true,
"animated-characters", &m_graphics_quality,
"Whether to display animated characters") );
PARAM_PREFIX IntUserConfigParam m_geometry_level
PARAM_DEFAULT( IntUserConfigParam(GEOLEVEL_0,
@ -817,17 +813,7 @@ namespace UserConfigParams
PARAM_DEFAULT( IntUserConfigParam(4, "anisotropic",
&m_graphics_quality,
"Quality of anisotropic filtering (usual values include 2-4-8-16; 0 to disable)") );
PARAM_PREFIX BoolUserConfigParam m_trilinear
PARAM_DEFAULT( BoolUserConfigParam(true, "trilinear",
&m_graphics_quality,
"Whether trilinear filtering is allowed to be "
"used (true or false)") );
/*
PARAM_PREFIX IntUserConfigParam m_antialiasing
PARAM_DEFAULT( IntUserConfigParam(0,
"antialiasing", &m_graphics_quality,
"Whether antialiasing is enabled (0 = disabled, 1 = 2x, 2 = 4x, 3 = 8x") );
*/
PARAM_PREFIX BoolUserConfigParam m_vsync
PARAM_DEFAULT( BoolUserConfigParam(false, "vsync",
&m_graphics_quality,

View File

@ -80,7 +80,7 @@ void CentralVideoSettings::init()
}
#if !defined(USE_GLES2)
m_glsl = (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version >= 1))
&& !UserConfigParams::m_force_legacy_device;
&& !UserConfigParams::m_force_legacy_device && m_supports_sp;
#else
m_glsl = m_gl_major_version >= 3 && !UserConfigParams::m_force_legacy_device;
#endif
@ -152,12 +152,10 @@ void CentralVideoSettings::init()
Log::info("GLDriver", "ARB Shader Storage Buffer Object Present");
}
if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_EXT_TEXTURE_COMPRESSION_S3TC) &&
hasGLExtension("GL_EXT_texture_compression_s3tc") &&
hasGLExtension("GL_ARB_texture_compression_rgtc"))
hasGLExtension("GL_EXT_texture_compression_s3tc"))
{
hasTextureCompression = true;
Log::info("GLDriver", "EXT Texture Compression S3TC Present");
Log::info("GLDriver", "ARB Texture Compression RGTC Present");
}
if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_UNIFORM_BUFFER_OBJECT) &&
hasGLExtension("GL_ARB_uniform_buffer_object")) {
@ -412,11 +410,6 @@ bool CentralVideoSettings::isEXTColorBufferFloatUsable() const
}
#endif
bool CentralVideoSettings::supportsShadows() const
{
return isARBExplicitAttribLocationUsable();
}
bool CentralVideoSettings::supportsGlobalIllumination() const
{
return false;
@ -434,7 +427,7 @@ bool CentralVideoSettings::supportsTextureCompression() const
bool CentralVideoSettings::isShadowEnabled() const
{
return supportsShadows() && (UserConfigParams::m_shadows_resolution > 0);
return UserConfigParams::m_shadows_resolution > 0;
}
bool CentralVideoSettings::isGlobalIlluminationEnabled() const

View File

@ -100,7 +100,6 @@ public:
// Are all required extensions available for feature support
bool supportsShadows() const;
bool supportsGlobalIllumination() const;
bool supportsComputeShadersFiltering() const;
bool supportsHardwareSkinning() const;

View File

@ -58,7 +58,7 @@ Explosion::Explosion(const Vec3& coord, const char* explosion_sound, const char
ParticleKind* particles = pkm->getParticles(filename);
m_emitter = NULL;
if (UserConfigParams::m_graphical_effects > 1)
if (UserConfigParams::m_particles_effects > 1)
{
m_emitter = new ParticleEmitter(particles, coord, NULL);
m_emitter->getNode()->setPreGenerating(false);

View File

@ -482,7 +482,6 @@ void IrrDriver::initDevice()
params.ForceLegacyDevice = true;
recreate_device = true;
UserConfigParams::m_force_legacy_device = true;
}
#endif
@ -596,14 +595,6 @@ void IrrDriver::initDevice()
Log::info("irr_driver", "GLSL supported.");
}
/* if (!supportGeometryShader())
{
// these options require geometry shaders
UserConfigParams::m_shadows = 0;
UserConfigParams::m_gi = false;
}*/
// m_glsl might be reset in rtt if an error occurs.
if (CVS->isGLSL())
{

View File

@ -1002,10 +1002,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
UserConfigParams::m_anisotropic;
}
}
else if (UserConfigParams::m_trilinear)
{
m->setFlag(video::EMF_TRILINEAR_FILTER, true);
}
m->setFlag(video::EMF_TRILINEAR_FILTER, true);
// UV clamping
if ( (m_clamp_tex & UCLAMP) != 0)

View File

@ -25,7 +25,7 @@
#include "graphics/material.hpp"
#include "graphics/render_info.hpp"
#include "../../lib/irrlicht/source/Irrlicht/CBoneSceneNode.h"
#include "../../../lib/irrlicht/source/Irrlicht/CBoneSceneNode.h"
#include <algorithm>
namespace SP

View File

@ -190,7 +190,7 @@ void ModelViewWidget::update(float delta)
m_rtt_main_node->setVisible(true);
#ifndef SERVER_ONLY
if (UserConfigParams::m_show_steering_animations != 0)
if (UserConfigParams::m_animated_characters)
m_rtt_main_node->OnAnimate(os::Timer::getTime());
#endif

View File

@ -197,7 +197,7 @@ PlayerKartWidget::PlayerKartWidget(KartSelectionScreen* parent,
core::matrix4 model_location;
model_location.setScale(core::vector3df(scale, scale, scale));
const bool has_win_anime =
UserConfigParams::m_show_steering_animations != 0 &&
UserConfigParams::m_animated_characters &&
(((kart_model.getFrame(KartModel::AF_WIN_LOOP_START) > -1 ||
kart_model.getFrame(KartModel::AF_WIN_START) > -1) &&
kart_model.getFrame(KartModel::AF_WIN_END) > -1) ||

View File

@ -153,7 +153,7 @@ void Attachment::set(AttachmentType type, float time,
break;
} // switch(type)
if (UserConfigParams::m_graphical_effects < 2)
if (UserConfigParams::m_particles_effects < 2)
{
m_node->setAnimationSpeed(0);
m_node->setCurrentFrame(0);
@ -190,7 +190,7 @@ void Attachment::set(AttachmentType type, float time,
m_time_left = m_time_left * speed_mult;
if (UserConfigParams::m_graphical_effects > 1)
if (UserConfigParams::m_particles_effects > 1)
{
// .blend was created @25 (<10 real, slow computer), make it faster
m_node->setAnimationSpeed(50);

View File

@ -74,7 +74,7 @@ LocalPlayerController::LocalPlayerController(AbstractKart *kart,
// Attach Particle System
Track *track = Track::getCurrentTrack();
#ifndef SERVER_ONLY
if (UserConfigParams::m_weather_effects &&
if (UserConfigParams::m_particles_effects > 1 &&
track->getSkyParticles() != NULL)
{
track->getSkyParticles()->setBoxSizeXZ(150.0f, 150.0f);

View File

@ -223,17 +223,8 @@ void Kart::init(RaceManager::KartType type)
#ifdef SERVER_ONLY
bool animations = false; // server never animates
#else
bool animations = true;
bool animations = UserConfigParams::m_animated_characters;
#endif
const int anims = UserConfigParams::m_show_steering_animations;
if (anims == ANIMS_NONE)
{
animations = false;
}
else if (anims == ANIMS_PLAYERS_ONLY && type != RaceManager::KT_PLAYER)
{
animations = false;
}
loadData(type, animations);
m_kart_gfx = new KartGFX(this, Track::getCurrentTrack()->getIsDuringDay());
@ -1795,7 +1786,7 @@ void Kart::handleMaterialGFX(float dt)
// something with the wheels, and the material has not the
// below surface property set.
if (material && isOnGround() && !material->isBelowSurface() &&
!getKartAnimation() && UserConfigParams::m_graphical_effects > 1)
!getKartAnimation() && UserConfigParams::m_particles_effects > 1)
{
// Get the appropriate particle data depending on
@ -1847,7 +1838,7 @@ void Kart::handleMaterialGFX(float dt)
} // for i in all cameras for this kart
} // camera != final camera
if (UserConfigParams::m_graphical_effects < 2)
if (UserConfigParams::m_particles_effects < 2)
return;
// Use the middle of the contact points of the two rear wheels
@ -2130,7 +2121,7 @@ void Kart::crashed(const Material *m, const Vec3 &normal)
{
#ifndef SERVER_ONLY
std::string particles = m->getCrashResetParticles();
if (particles.size() > 0 && UserConfigParams::m_graphical_effects > 0)
if (particles.size() > 0 && UserConfigParams::m_particles_effects > 0)
{
ParticleKind* kind =
ParticleKindManager::get()->getParticles(particles);

View File

@ -164,10 +164,10 @@ void KartGFX::addEffect(KartGFXType type, const std::string &file_name,
const Vec3 &position, bool important)
{
#ifndef SERVER_ONLY
if (((UserConfigParams::m_graphical_effects < 2 || !CVS->isGLSL()) &&
if (((UserConfigParams::m_particles_effects < 2 || !CVS->isGLSL()) &&
(!important || m_kart->getType() == RaceManager::KT_AI ||
m_kart->getType() == RaceManager::KT_SPARE_TIRE)) ||
UserConfigParams::m_graphical_effects < 1)
UserConfigParams::m_particles_effects < 1)
{
m_all_emitters.push_back(NULL);
return;

View File

@ -803,16 +803,16 @@ int handleCmdLinePreliminary()
UserConfigParams::m_dof = true;
else if (CommandLine::has("--disable-dof"))
UserConfigParams::m_dof = false;
// global illumination
if (CommandLine::has("--enable-gi"))
UserConfigParams::m_gi = true;
else if (CommandLine::has("--disable-gi"))
UserConfigParams::m_gi = false;
// animated scenery
if (CommandLine::has("--enable-gfx"))
UserConfigParams::m_graphical_effects = 2;
else if (CommandLine::has("--disable-gfx"))
UserConfigParams::m_graphical_effects = 0;
// particles effects
if (CommandLine::has("--enable-particles"))
UserConfigParams::m_particles_effects = 2;
else if (CommandLine::has("--disable-particles"))
UserConfigParams::m_particles_effects = 0;
// animated characters
if (CommandLine::has("--enable-animated-characters"))
UserConfigParams::m_animated_characters = true;
else if (CommandLine::has("--disable-animated-characters"))
UserConfigParams::m_animated_characters = false;
if (CommandLine::has("--enable-motion-blur"))
UserConfigParams::m_motionblur = true;
else if (CommandLine::has("--disable-motion-blur"))
@ -841,11 +841,6 @@ int handleCmdLinePreliminary()
UserConfigParams::m_high_definition_textures = 2 | 1;
else if (CommandLine::has("--disable-hd-textures"))
UserConfigParams::m_high_definition_textures = 2;
if (CommandLine::has("--enable-trilinear"))
UserConfigParams::m_trilinear = true;
else if (CommandLine::has("--disable-trilinear"))
UserConfigParams::m_trilinear = false;
// Enable loading grand prix from local directory
if(CommandLine::has("--add-gp-dir", &s))

View File

@ -227,7 +227,7 @@ void World::init()
powerup_manager->updateWeightsForRace(race_manager->getNumberOfKarts());
if (UserConfigParams::m_weather_effects)
if (UserConfigParams::m_particles_effects > 1)
{
Weather::getInstance<Weather>(); // create Weather instance
}
@ -1003,7 +1003,7 @@ void World::update(float dt)
}
PROFILER_PUSH_CPU_MARKER("World::update (weather)", 0x80, 0x7F, 0x00);
if (UserConfigParams::m_graphical_effects > 1 && Weather::getInstance())
if (UserConfigParams::m_particles_effects > 1 && Weather::getInstance())
{
Weather::getInstance()->update(dt);
}

View File

@ -17,7 +17,6 @@
#include "states_screens/dialogs/custom_video_settings.hpp"
#include "config/stk_config.hpp"
#include "config/user_config.hpp"
#include "guiengine/widgets/check_box_widget.hpp"
#include "guiengine/widgets/spinner_widget.hpp"
@ -37,12 +36,8 @@ using namespace irr::gui;
// -----------------------------------------------------------------------------
CustomVideoSettingsDialog::CustomVideoSettingsDialog(const float w, const float h) :
ModalDialog(w, h), m_all_kart_animated(true)
ModalDialog(w, h)
{
#ifndef SERVER_ONLY
m_all_kart_animated = stk_config->m_max_skinning_bones > 512 ||
!CVS->supportsHardwareSkinning();
#endif
loadFromFile("custom_video_settings.stkgui");
updateActivation();
}
@ -58,26 +53,16 @@ CustomVideoSettingsDialog::~CustomVideoSettingsDialog()
void CustomVideoSettingsDialog::beforeAddingWidgets()
{
#ifndef SERVER_ONLY
getWidget<CheckBoxWidget>("weather_gfx")->setState(UserConfigParams::m_weather_effects);
getWidget<CheckBoxWidget>("animated_characters")
->setState(UserConfigParams::m_animated_characters);
getWidget<CheckBoxWidget>("dof")->setState(UserConfigParams::m_dof);
SpinnerWidget* anim_gfx = getWidget<SpinnerWidget>("anim_gfx");
assert(anim_gfx != NULL);
anim_gfx->addLabel(_("Disabled"));
anim_gfx->addLabel(_("Important only"));
anim_gfx->addLabel(_("Enabled"));
anim_gfx->setValue(UserConfigParams::m_graphical_effects);
SpinnerWidget* kart_anim = getWidget<SpinnerWidget>("steering_animations");
kart_anim->addLabel(_("Disabled")); // 0
//I18N: animations setting (only karts with human players are animated)
kart_anim->addLabel(_("Human players only")); // 1
//I18N: animations setting (all karts are animated)
if (m_all_kart_animated)
kart_anim->addLabel(_("Enabled for all")); // 2
kart_anim->setValue(!m_all_kart_animated &&
UserConfigParams::m_show_steering_animations == 2 ?
1 : UserConfigParams::m_show_steering_animations);
SpinnerWidget* particles_effects = getWidget<SpinnerWidget>("particles_effects");
assert(particles_effects != NULL);
particles_effects->addLabel(_("Disabled"));
particles_effects->addLabel(_("Important only"));
particles_effects->addLabel(_("Enabled"));
particles_effects->setValue(UserConfigParams::m_particles_effects);
SpinnerWidget* geometry_level = getWidget<SpinnerWidget>("geometry_detail");
//I18N: Geometry level disabled : lowest level, no details
@ -94,21 +79,17 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
filtering->addLabel(_("Very Low"));
filtering->addLabel(_("Low"));
filtering->addLabel(_("High"));
filtering->addLabel(_("Very High"));
filtering->setValue(OptionsScreenVideo::getImageQuality());
SpinnerWidget* shadows = getWidget<SpinnerWidget>("shadows");
shadows->addLabel(_("Disabled")); // 0
shadows->addLabel(_("Low")); // 1
shadows->addLabel(_("High")); // 2
if (CVS->supportsShadows())
shadows->setValue(UserConfigParams::m_shadows_resolution / 512);
else
shadows->setValue(0);
shadows->setValue(UserConfigParams::m_shadows_resolution / 512);
getWidget<CheckBoxWidget>("dynamiclight")->setState(UserConfigParams::m_dynamic_lights);
getWidget<CheckBoxWidget>("lightshaft")->setState(UserConfigParams::m_light_shaft);
getWidget<CheckBoxWidget>("ibl")->setState(!UserConfigParams::m_degraded_IBL);
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);
@ -124,12 +105,6 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
cb_tex_cmp->setState(false);
cb_tex_cmp->setActive(false);
}
if (!CVS->supportsGlobalIllumination())
{
shadows->setActive(false);
getWidget<CheckBoxWidget>("global_illumination")->setActive(false);
}
#endif
}
@ -149,7 +124,7 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
UserConfigParams::m_motionblur =
advanced_pipeline && getWidget<CheckBoxWidget>("motionblur")->getState();
if (advanced_pipeline && CVS->supportsShadows())
if (advanced_pipeline)
{
UserConfigParams::m_shadows_resolution =
getWidget<SpinnerWidget>("shadows")->getValue() * 512;
@ -171,10 +146,6 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
UserConfigParams::m_degraded_IBL =
!advanced_pipeline || !getWidget<CheckBoxWidget>("ibl")->getState();
UserConfigParams::m_gi =
advanced_pipeline && CVS->supportsGlobalIllumination() &&
getWidget<CheckBoxWidget>("global_illumination")->getState();
UserConfigParams::m_glow =
advanced_pipeline && getWidget<CheckBoxWidget>("glow")->getState();
@ -184,14 +155,11 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
UserConfigParams::m_texture_compression =
getWidget<CheckBoxWidget>("texture_compression")->getState();
UserConfigParams::m_graphical_effects =
getWidget<SpinnerWidget>("anim_gfx")->getValue();
UserConfigParams::m_particles_effects =
getWidget<SpinnerWidget>("particles_effects")->getValue();
UserConfigParams::m_weather_effects =
getWidget<CheckBoxWidget>("weather_gfx")->getState();
UserConfigParams::m_show_steering_animations =
getWidget<SpinnerWidget>("steering_animations")->getValue();
UserConfigParams::m_animated_characters =
getWidget<CheckBoxWidget>("animated_characters")->getState();
const int val =
getWidget<SpinnerWidget>("geometry_detail")->getValue();
@ -227,17 +195,8 @@ void CustomVideoSettingsDialog::updateActivation()
getWidget<CheckBoxWidget>("ssao")->setActive(light);
getWidget<CheckBoxWidget>("lightshaft")->setActive(light);
getWidget<CheckBoxWidget>("ibl")->setActive(light);
getWidget<CheckBoxWidget>("global_illumination")->setActive(light);
getWidget<CheckBoxWidget>("glow")->setActive(light);
getWidget<CheckBoxWidget>("bloom")->setActive(light);
getWidget<SpinnerWidget>("steering_animations")
->setMax(m_all_kart_animated ? 2 : 1);
if (!CVS->supportsShadows() && !CVS->supportsGlobalIllumination())
{
getWidget<SpinnerWidget>("shadows")->setActive(false);
getWidget<CheckBoxWidget>("global_illumination")->setActive(false);
}
#endif
} // updateActivation

View File

@ -27,8 +27,6 @@
*/
class CustomVideoSettingsDialog : public GUIEngine::ModalDialog
{
private:
bool m_all_kart_animated;
public:
/**
* Creates a modal dialog with given percentage of screen width and height

View File

@ -886,7 +886,7 @@ void KartSelectionScreen::updateKartWidgetModel(int widget_id,
model_location.setScale(core::vector3df(scale, scale, scale));
w3->clearModels();
const bool has_win_anime =
UserConfigParams::m_show_steering_animations != 0 &&
UserConfigParams::m_animated_characters &&
(((kart_model.getFrame(KartModel::AF_WIN_LOOP_START) > -1 ||
kart_model.getFrame(KartModel::AF_WIN_START) > -1) &&
kart_model.getFrame(KartModel::AF_WIN_END) > -1) ||

View File

@ -19,7 +19,6 @@
#include "audio/sfx_manager.hpp"
#include "audio/sfx_base.hpp"
#include "config/stk_config.hpp"
#include "config/user_config.hpp"
#include "graphics/central_settings.hpp"
#include "graphics/irr_driver.hpp"
@ -52,61 +51,49 @@ void OptionsScreenVideo::initPresets()
m_presets.push_back
({
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
1 /* animatedScenery */, 0 /* animatedCharacters */, 0 /* image_quality */,
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */,
false /* animatedCharacters */, 0 /* particles */, 0 /* image_quality */,
false /* depth of field */, true /* degraded IBL */
});
m_presets.push_back
({
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
2 /* animatedScenery */, 1 /* animatedCharacters */, 1 /* image_quality */,
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */,
true /* animatedCharacters */, 0 /* particles */, 0 /* image_quality */,
false /* depth of field */, true /* degraded IBL */
});
m_presets.push_back
({
true /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, true /* weather */,
2 /* animatedScenery */, 1 /* animatedCharacters */, 2 /* image_quality */,
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */,
true /* animatedCharacters */, 1 /* particles */, 1 /* image_quality */,
false /* depth of field */, true /* degraded IBL */
});
m_presets.push_back
({
true /* light */, 0 /* shadow */, false /* bloom */, true /* motionblur */,
true /* lightshaft */, true /* glow */, true /* mlaa */, false /* ssao */, true /* weather */,
2 /* animatedScenery */, 1 /* animatedCharacters */, 2 /* image_quality */,
false /* depth of field */, false /* global illumination */, false /* degraded IBL */
true /* lightshaft */, true /* glow */, true /* mlaa */, false /* ssao */,
true /* animatedCharacters */, 1 /* particles */, 1 /* image_quality */,
false /* depth of field */, false /* degraded IBL */
});
m_presets.push_back
({
true /* light */, 512 /* shadow */, true /* bloom */, true /* motionblur */,
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */, true /* weather */,
2 /* animatedScenery */,
#ifndef SERVER_ONLY
(stk_config->m_max_skinning_bones > 512 || !CVS->supportsHardwareSkinning() ? 2 : 1),
#else
2 /* animatedCharacters */,
#endif
3 /* image_quality */,
true /* depth of field */, false /* global illumination */, false /* degraded IBL */
true /* lightshaft */, true /* glow */, true /* mlaa */, false /* ssao */,
true /* animatedCharacters */, 2 /* particles */, 2 /* image_quality */,
true /* depth of field */, false /* degraded IBL */
});
m_presets.push_back
({
true /* light */, 1024 /* shadow */, true /* bloom */, true /* motionblur */,
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */, true /* weather */,
2 /* animatedScenery */,
#ifndef SERVER_ONLY
(stk_config->m_max_skinning_bones > 512 || !CVS->supportsHardwareSkinning() ? 2 : 1),
#else
2 /* animatedCharacters */,
#endif
3 /* image_quality */,
true /* depth of field */, true /* global illumination */, false /* degraded IBL */
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */,
true /* animatedCharacters */, 2 /* particles */, 2 /* image_quality */,
true /* depth of field */, false /* degraded IBL */
});
} // initPresets
@ -142,27 +129,19 @@ struct Resolution
// ----------------------------------------------------------------------------
int OptionsScreenVideo::getImageQuality()
{
if (UserConfigParams::m_trilinear == false &&
UserConfigParams::m_anisotropic == 0 &&
if (UserConfigParams::m_anisotropic == 2 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x00 &&
UserConfigParams::m_hq_mipmap == false)
return 0;
if (UserConfigParams::m_trilinear == true &&
UserConfigParams::m_anisotropic == 2 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x00 &&
if (UserConfigParams::m_anisotropic == 4 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x01 &&
UserConfigParams::m_hq_mipmap == false)
return 1;
if (UserConfigParams::m_trilinear == true &&
UserConfigParams::m_anisotropic == 4 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x01 &&
UserConfigParams::m_hq_mipmap == false)
return 2;
if (UserConfigParams::m_trilinear == true &&
UserConfigParams::m_anisotropic == 16 &&
if (UserConfigParams::m_anisotropic == 16 &&
(UserConfigParams::m_high_definition_textures & 0x01) == 0x01 &&
UserConfigParams::m_hq_mipmap == true)
return 3;
return 2;
return 2;
return 1;
} // getImageQuality
// ----------------------------------------------------------------------------
@ -171,25 +150,16 @@ void OptionsScreenVideo::setImageQuality(int quality)
switch (quality)
{
case 0:
UserConfigParams::m_trilinear = false;
UserConfigParams::m_anisotropic = 0;
UserConfigParams::m_high_definition_textures = 0x02;
UserConfigParams::m_hq_mipmap = false;
break;
case 1:
UserConfigParams::m_trilinear = true;
UserConfigParams::m_anisotropic = 2;
UserConfigParams::m_high_definition_textures = 0x02;
UserConfigParams::m_hq_mipmap = false;
break;
case 2:
UserConfigParams::m_trilinear = true;
case 1:
UserConfigParams::m_anisotropic = 4;
UserConfigParams::m_high_definition_textures = 0x03;
UserConfigParams::m_hq_mipmap = false;
break;
case 3:
UserConfigParams::m_trilinear = true;
case 2:
UserConfigParams::m_anisotropic = 16;
UserConfigParams::m_high_definition_textures = 0x03;
UserConfigParams::m_hq_mipmap = true;
@ -403,8 +373,8 @@ void OptionsScreenVideo::updateGfxSlider()
bool found = false;
for (unsigned int l = 0; l < m_presets.size(); l++)
{
if (m_presets[l].animatedCharacters == UserConfigParams::m_show_steering_animations &&
m_presets[l].animatedScenery == UserConfigParams::m_graphical_effects &&
if (m_presets[l].animatedCharacters == UserConfigParams::m_animated_characters &&
m_presets[l].particles == UserConfigParams::m_particles_effects &&
m_presets[l].image_quality == getImageQuality() &&
m_presets[l].bloom == UserConfigParams::m_bloom &&
m_presets[l].glow == UserConfigParams::m_glow &&
@ -412,12 +382,9 @@ void OptionsScreenVideo::updateGfxSlider()
m_presets[l].lightshaft == UserConfigParams::m_light_shaft &&
m_presets[l].mlaa == UserConfigParams::m_mlaa &&
m_presets[l].motionblur == UserConfigParams::m_motionblur &&
//m_presets[l].shaders == UserConfigParams::m_pixel_shaders
m_presets[l].shadows == UserConfigParams::m_shadows_resolution &&
m_presets[l].ssao == UserConfigParams::m_ssao &&
m_presets[l].weather == UserConfigParams::m_weather_effects &&
m_presets[l].dof == UserConfigParams::m_dof &&
m_presets[l].global_illumination == UserConfigParams::m_gi &&
m_presets[l].degraded_ibl == UserConfigParams::m_degraded_IBL)
{
gfx->setValue(l + 1);
@ -451,13 +418,7 @@ void OptionsScreenVideo::updateTooltip()
//I18N: in the graphical options tooltip;
// indicates a graphical feature is disabled
const core::stringw disabled = _LTR("Disabled");
//I18N: if all kart animations are enabled
const core::stringw all = _LTR("All");
//I18N: if some kart animations are enabled
const core::stringw me = _LTR("Me Only");
//I18N: if no kart animations are enabled
const core::stringw none = _LTR("None");
//I18N: if only important animated scenery is enabled
//I18N: if only important particles effects is enabled
const core::stringw important_only = _LTR("Important only");
//I18N: in the graphical options tooltip;
@ -469,27 +430,16 @@ void OptionsScreenVideo::updateTooltip()
//I18N: in the graphical options tooltip;
// indicates the rendered image quality is high
const core::stringw high = _LTR("High");
//I18N: in the graphical options tooltip;
// indicates the rendered image quality is very high
const core::stringw very_high = _LTR("Very High");
//I18N: in graphical options
// tooltip = tooltip + L"\n" + _("Pixel shaders: %s",
// UserConfigParams::m_pixel_shaders ? enabled : disabled);
//I18N: in graphical options
tooltip = _("Animated Scenery: %s",
UserConfigParams::m_graphical_effects == 2 ? enabled :
UserConfigParams::m_graphical_effects == 1 ? important_only :
tooltip = _("Particles Effects: %s",
UserConfigParams::m_particles_effects == 2 ? enabled :
UserConfigParams::m_particles_effects == 1 ? important_only :
disabled);
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("Weather Effects: %s",
UserConfigParams::m_weather_effects ? enabled : disabled);
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("Animated Characters: %s",
UserConfigParams::m_show_steering_animations == 2
? all
: (UserConfigParams::m_show_steering_animations == 1 ? me : none));
UserConfigParams::m_animated_characters ? enabled : disabled);
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("Dynamic lights: %s",
UserConfigParams::m_dynamic_lights ? enabled : disabled);
@ -524,15 +474,10 @@ void OptionsScreenVideo::updateTooltip()
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);
//I18N: in graphical options
int quality = getImageQuality();
tooltip = tooltip + L"\n" + _("Rendered image quality: %s",
quality == 0 ? very_low : quality == 1 ? low : quality == 2 ?
high : very_high);
quality == 0 ? very_low : quality == 1 ? low : high);
gfx->setTooltip(tooltip);
} // updateTooltip
@ -599,8 +544,8 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
const int level = gfx_level->getValue() - 1;
UserConfigParams::m_show_steering_animations = m_presets[level].animatedCharacters;
UserConfigParams::m_graphical_effects = m_presets[level].animatedScenery;
UserConfigParams::m_animated_characters = m_presets[level].animatedCharacters;
UserConfigParams::m_particles_effects = m_presets[level].particles;
setImageQuality(m_presets[level].image_quality);
UserConfigParams::m_bloom = m_presets[level].bloom;
UserConfigParams::m_glow = m_presets[level].glow;
@ -608,12 +553,9 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
UserConfigParams::m_light_shaft = m_presets[level].lightshaft;
UserConfigParams::m_mlaa = m_presets[level].mlaa;
UserConfigParams::m_motionblur = m_presets[level].motionblur;
//UserConfigParams::m_pixel_shaders = m_presets[level].shaders;
UserConfigParams::m_shadows_resolution = m_presets[level].shadows;
UserConfigParams::m_ssao = m_presets[level].ssao;
UserConfigParams::m_weather_effects = m_presets[level].weather;
UserConfigParams::m_dof = m_presets[level].dof;
UserConfigParams::m_gi = m_presets[level].global_illumination;
UserConfigParams::m_degraded_IBL = m_presets[level].degraded_ibl;
updateGfxSlider();

View File

@ -35,13 +35,11 @@ struct GFXPreset
bool glow;
bool mlaa;
bool ssao;
bool weather;
int animatedScenery;
int animatedCharacters;
bool animatedCharacters;
int particles;
int image_quality;
/** Depth of field */
bool dof;
bool global_illumination;
bool degraded_ibl;
};

View File

@ -75,7 +75,7 @@ LODNode* ModelDefinitionLoader::instanciateAsLOD(const XMLNode* node, scene::ISc
for (unsigned int m=0; m<group.size(); m++)
{
if (group[m].m_skeletal_animation &&
(UserConfigParams::m_graphical_effects > 1 ||
(UserConfigParams::m_animated_characters ||
World::getWorld()->getIdent() == IDENT_CUTSCENE))
{
scene::IAnimatedMesh* a_mesh = irr_driver->getAnimatedMesh(group[m].m_model_file);

View File

@ -1602,7 +1602,7 @@ void Track::createWater(const XMLNode &node)
*/
scene::ISceneNode* scene_node = NULL;
/*
if (UserConfigParams::m_graphical_effects > 1)
if (UserConfigParams::m_particles_effects > 1)
{
scene::IMesh *welded;
scene_node = irr_driver->addWaterNode(mesh, &welded,
@ -2157,7 +2157,7 @@ void Track::loadObjects(const XMLNode* root, const std::string& path, ModelDefin
}
else if (name == "particle-emitter")
{
if (UserConfigParams::m_graphical_effects > 1)
if (UserConfigParams::m_particles_effects > 1)
{
m_track_object_manager->add(*node, parent, model_def_loader, parent_library);
}

View File

@ -416,7 +416,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
m_is_in_skybox = true;
}
bool animated = skeletal_animation && (UserConfigParams::m_graphical_effects > 1 ||
bool animated = skeletal_animation && (UserConfigParams::m_animated_characters ||
World::getWorld()->getIdent() == IDENT_CUTSCENE);
bool displacing = false;
xml_node.get("displacing", &displacing);
@ -465,7 +465,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
m_node = NULL;
m_is_in_skybox = false;
m_render_info = NULL;
bool animated = (UserConfigParams::m_graphical_effects > 1 ||
bool animated = (UserConfigParams::m_particles_effects > 1 ||
World::getWorld()->getIdent() == IDENT_CUTSCENE);
m_model_file = model_file;
@ -502,7 +502,7 @@ void TrackObjectPresentationMesh::init(const XMLNode* xml_node,
if(xml_node)
xml_node->get("skeletal-animation", &skeletal_animation);
bool animated = skeletal_animation && (UserConfigParams::m_graphical_effects > 1 ||
bool animated = skeletal_animation && (UserConfigParams::m_particles_effects > 1 ||
World::getWorld()->getIdent() == IDENT_CUTSCENE);
bool displacing = false;
std::string interaction;