Add two per track parameter for color correction
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14633 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
7f214d4458
commit
5b5fd87a8b
@ -144,12 +144,12 @@ void GrassShaderProvider::OnSetConstants(IMaterialRendererServices *srv, int use
|
||||
|
||||
void ColorLevelsProvider::OnSetConstants(IMaterialRendererServices *srv, int userData)
|
||||
{
|
||||
m_inlevel = vector3df(0.0, 0.65, 137.0);
|
||||
m_outlevel = vector2df(0.0, 255.0);
|
||||
|
||||
m_inlevel = World::getWorld()->getTrack()->getColorLevelIn();
|
||||
m_outlevel = World::getWorld()->getTrack()->getColorLevelOut();
|
||||
|
||||
srv->setVertexShaderConstant("inlevel", &m_inlevel.X, 3);
|
||||
srv->setVertexShaderConstant("outlevel", &m_outlevel.X, 2);
|
||||
|
||||
|
||||
if (!firstdone)
|
||||
{
|
||||
|
@ -114,6 +114,8 @@ Track::Track(const std::string &filename)
|
||||
m_mini_map = NULL;
|
||||
m_bloom = true;
|
||||
m_bloom_threshold = 0.75f;
|
||||
m_color_inlevel = core::vector3df(0.0,1.0, 255.0);
|
||||
m_color_outlevel = core::vector2df(0.0, 255.0);
|
||||
m_clouds = false;
|
||||
m_lensflare = false;
|
||||
m_godrays = false;
|
||||
@ -371,6 +373,8 @@ void Track::loadTrackInfo()
|
||||
root->get("god-rays", &m_godrays);
|
||||
root->get("displacement-speed", &m_displacement_speed);
|
||||
root->get("caustics-speed", &m_caustics_speed);
|
||||
root->get("color-level-in", &m_color_inlevel);
|
||||
root->get("color-level-out", &m_color_outlevel);
|
||||
|
||||
// Make the default for auto-rescue in battle mode and soccer mode to be false
|
||||
if(m_is_arena || m_is_soccer)
|
||||
|
@ -380,6 +380,12 @@ private:
|
||||
|
||||
float m_displacement_speed;
|
||||
float m_caustics_speed;
|
||||
|
||||
/** The levels for color correction
|
||||
* m_color_inlevel(black, gamma, white)
|
||||
* m_color_outlevel(black, white)*/
|
||||
core::vector3df m_color_inlevel;
|
||||
core::vector2df m_color_outlevel;
|
||||
|
||||
/** List of all bezier curves in the track - for e.g. camera, ... */
|
||||
std::vector<BezierCurve*> m_all_curves;
|
||||
@ -583,10 +589,15 @@ public:
|
||||
|
||||
bool getBloom() const { return m_bloom; }
|
||||
float getBloomThreshold() const { return m_bloom_threshold; }
|
||||
|
||||
/** Return the color levels for color correction shader */
|
||||
core::vector3df getColorLevelIn() const { return m_color_inlevel; }
|
||||
core::vector2df getColorLevelOut() const { return m_color_outlevel; }
|
||||
|
||||
bool hasLensFlare() const { return m_lensflare; }
|
||||
bool hasGodRays() const { return m_godrays; }
|
||||
bool hasShadows() const { return m_shadows; }
|
||||
|
||||
|
||||
float getDisplacementSpeed() const { return m_displacement_speed; }
|
||||
float getCausticsSpeed() const { return m_caustics_speed; }
|
||||
|
Loading…
Reference in New Issue
Block a user