diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index b9b0a43d5..0a621677e 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -2036,6 +2036,8 @@ video::ITexture* IrrDriver::RTTProvider::renderToTexture(float angle, return m_render_target_texture; } +// ---------------------------------------------------------------------------- + void IrrDriver::applyObjectPassShader(scene::ISceneNode * const node, bool rimlit) { if (!m_glsl) @@ -2102,6 +2104,8 @@ void IrrDriver::applyObjectPassShader(scene::ISceneNode * const node, bool rimli } } +// ---------------------------------------------------------------------------- + void IrrDriver::applyObjectPassShader() { if (!m_glsl) @@ -2110,15 +2114,17 @@ void IrrDriver::applyObjectPassShader() applyObjectPassShader(m_scene_manager->getRootSceneNode()); } -scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float radius, - float energy, float r, float g, float b, bool sun, scene::ISceneNode* parent) +// ---------------------------------------------------------------------------- + +scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy, + float r, float g, float b, bool sun, scene::ISceneNode* parent) { if (m_glsl) { LightNode *light = NULL; if (!sun) - light = new LightNode(m_scene_manager, parent, radius, energy, r, g, b); + light = new LightNode(m_scene_manager, parent, energy, r, g, b); else light = new SunNode(m_scene_manager, parent, r, g, b); @@ -2148,10 +2154,12 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float radius, } else { - return m_scene_manager->addLightSceneNode(NULL, pos, video::SColorf(r, g, b), radius); + return NULL; } } +// ---------------------------------------------------------------------------- + void IrrDriver::clearLights() { u32 i; diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 88b7c4dc4..68fcfcfe9 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -456,7 +456,7 @@ public: void applyObjectPassShader(); void applyObjectPassShader(scene::ISceneNode * const node, bool rimlit = false); // ------------------------------------------------------------------------ - scene::ISceneNode *addLight(const core::vector3df &pos, float radius = 1.0f, float energy = 1., float r = 1.0f, + scene::ISceneNode *addLight(const core::vector3df &pos, float energy = 1., float r = 1.0f, float g = 1.0f, float b = 1.0f, bool sun = false, scene::ISceneNode* parent = NULL); // ------------------------------------------------------------------------ void clearLights(); diff --git a/src/graphics/light.cpp b/src/graphics/light.cpp index 46f8de22e..671fb0d99 100644 --- a/src/graphics/light.cpp +++ b/src/graphics/light.cpp @@ -34,7 +34,7 @@ using namespace core; aabbox3df LightNode::box; -LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float radius, float e, float r, float g, float b): +LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float e, float r, float g, float b): ISceneNode(parent == NULL ? mgr->getRootSceneNode() : parent, mgr, -1) { m_energy = e; diff --git a/src/graphics/light.hpp b/src/graphics/light.hpp index 29de481da..05e6ee210 100644 --- a/src/graphics/light.hpp +++ b/src/graphics/light.hpp @@ -34,7 +34,7 @@ namespace irr class LightNode: public scene::ISceneNode { public: - LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float radius, float energy, float r, float g, float b); + LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float energy, float r, float g, float b); virtual ~LightNode(); virtual void render() OVERRIDE; @@ -50,7 +50,7 @@ public: virtual u32 getMaterialCount() const OVERRIDE { return 1; } virtual bool isPointLight() { return true; } - float getRadius() const { return m_radius; } + //float getRadius() const { return m_radius; } float getEnergy() const { return m_energy; } float getEffectiveEnergy() const { return m_energy_multiplier * m_energy; } core::vector3df getColor() const { return core::vector3df(m_color[0], m_color[1], m_color[2]); } @@ -63,7 +63,7 @@ protected: class ScreenQuad *sq; - float m_radius; + //float m_radius; float m_color[3]; float m_energy; diff --git a/src/graphics/sun.cpp b/src/graphics/sun.cpp index 91ebb5ad4..399896f3d 100644 --- a/src/graphics/sun.cpp +++ b/src/graphics/sun.cpp @@ -35,7 +35,7 @@ using namespace scene; using namespace core; SunNode::SunNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float r, float g, float b): - LightNode(mgr, parent, 10000, 0., r, g, b) + LightNode(mgr, parent, 0., r, g, b) { sq = new ScreenQuad(irr_driver->getVideoDriver()); diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 895f9f7cd..a2ce45536 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -1628,7 +1628,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id) } const video::SColorf tmpf(m_sun_diffuse_color); - m_sun = irr_driver->addLight(m_sun_position, 10000.0f, 0., tmpf.r, tmpf.g, tmpf.b, true); + m_sun = irr_driver->addLight(m_sun_position, 0., tmpf.r, tmpf.g, tmpf.b, true); if (!irr_driver->isGLSL()) { diff --git a/src/tracks/track_object_presentation.cpp b/src/tracks/track_object_presentation.cpp index fc30f85ce..94c19b41e 100644 --- a/src/tracks/track_object_presentation.cpp +++ b/src/tracks/track_object_presentation.cpp @@ -587,15 +587,15 @@ TrackObjectPresentationLight::TrackObjectPresentationLight(const XMLNode& xml_no xml_node.get("color", &m_color); const video::SColorf colorf(m_color); - m_distance = 25.0f; - xml_node.get("distance", &m_distance); + //m_distance = 25.0f; + //xml_node.get("distance", &m_distance); m_energy = 1.0f; xml_node.get("energy", &m_energy); if (irr_driver->isGLSL()) { - m_node = irr_driver->addLight(m_init_xyz, m_distance, m_energy, colorf.r, colorf.g, colorf.b, false, parent); + m_node = irr_driver->addLight(m_init_xyz, m_energy, colorf.r, colorf.g, colorf.b, false, parent); } else { diff --git a/src/tracks/track_object_presentation.hpp b/src/tracks/track_object_presentation.hpp index e12c3fdd5..708880c64 100644 --- a/src/tracks/track_object_presentation.hpp +++ b/src/tracks/track_object_presentation.hpp @@ -274,7 +274,7 @@ class TrackObjectPresentationLight : public TrackObjectPresentationSceneNode { private: video::SColor m_color; - float m_distance; + //float m_distance; float m_energy; public: