Merge branch 'master' of https://github.com/supertuxkart/stk-code into devel
This commit is contained in:
commit
1e1633b88f
@ -16,7 +16,7 @@
|
||||
<spacer height="4" width="10" />
|
||||
-->
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<checkbox id="dynamiclight"/>
|
||||
<spacer width="10" height="10"/>
|
||||
<label text="Advanced pipeline (lights, etc.)" I18N="Video settings"/>
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<spacer width="70" height="10" />
|
||||
<label text="Shadows" I18N="Video settings"/>
|
||||
<spacer width="10" height="10"/>
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<spacer width="70" height="10"/>
|
||||
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<spacer width="70" height="10"/>
|
||||
<checkbox id="ssao"/>
|
||||
<spacer width="10" height="10"/>
|
||||
@ -62,7 +62,7 @@
|
||||
|
||||
<spacer height="20" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
<checkbox id="motionblur"/>
|
||||
<spacer width="10" height="10"/>
|
||||
@ -80,7 +80,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
<checkbox id="glow"/>
|
||||
<spacer width="10" height="10"/>
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
<checkbox id="weather_gfx"/>
|
||||
<spacer width="10" height="10"/>
|
||||
@ -116,7 +116,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
<checkbox id="ubo"/>
|
||||
<spacer width="10" height="10"/>
|
||||
@ -134,7 +134,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<div layout="horizontal-row" proportion="1" height="fit">
|
||||
<checkbox id="hd-textures"/>
|
||||
<spacer width="10" height="10"/>
|
||||
@ -153,7 +153,7 @@
|
||||
|
||||
<spacer height="20" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<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%" />
|
||||
@ -161,7 +161,7 @@
|
||||
|
||||
<spacer height="4" width="10" />
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit">
|
||||
<div layout="horizontal-row" width="100%" proportion="1">
|
||||
<label text="Texture filtering" I18N="Video settings" width="40%"/>
|
||||
<spacer width="10" height="10"/>
|
||||
<gauge id="filtering" min_value="0" max_value="5" width="50%" />
|
||||
|
@ -21,62 +21,58 @@ void main()
|
||||
|
||||
vec2 offset = 10. / screen;
|
||||
|
||||
vec4 col = texture2D(tex, uv);
|
||||
vec4 col = texture(tex, uv);
|
||||
vec4 colOriginal = col;
|
||||
// Weight from here http://artmartinsh.blogspot.fr/2010/02/glsl-lens-blur-filter-with-bokeh.html
|
||||
|
||||
col += texture2D(tex, uv + (vec2(0.0, 0.4) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.15, 0.37) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.29,0.29) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(-0.37,0.15) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.4, 0.0) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.37, -0.15) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.29, -0.29) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(-0.15, -0.37) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.0, -0.4) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(-0.15, 0.37) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(-0.29, 0.29) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.37, 0.15) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(-0.4, 0.0) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(-0.37, -0.15) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(-0.29, -0.29) * offset) * blur);
|
||||
col += texture2D(tex, uv + (vec2(0.15, -0.37) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.0, 0.4) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.15, 0.37) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.29,0.29) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(-0.37,0.15) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.4, 0.0) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.37, -0.15) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.29, -0.29) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(-0.15, -0.37) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.0, -0.4) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(-0.15, 0.37) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(-0.29, 0.29) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.37, 0.15) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(-0.4, 0.0) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(-0.37, -0.15) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(-0.29, -0.29) * offset) * blur);
|
||||
col += texture(tex, uv + (vec2(0.15, -0.37) * offset) * blur);
|
||||
|
||||
col += texture2D(tex, uv + (vec2(0.15, 0.37) * offset) * blur * 0.9);
|
||||
col += texture2D(tex, uv + (vec2(-0.37, 0.15) * offset) * blur * 0.9);
|
||||
col += texture2D(tex, uv + (vec2(0.37, -0.15) * offset) * blur * 0.9);
|
||||
col += texture2D(tex, uv + (vec2(-0.15, -0.37) * offset) * blur * 0.9);
|
||||
col += texture2D(tex, uv + (vec2(-0.15, 0.37) * offset) * blur * 0.9);
|
||||
col += texture2D(tex, uv + (vec2(0.37, 0.15) * offset) * blur * 0.9);
|
||||
col += texture2D(tex, uv + (vec2(-0.37, -0.15) * offset) * blur * 0.9);
|
||||
col += texture2D(tex, uv + (vec2(0.15, -0.37) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(0.15, 0.37) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(-0.37, 0.15) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(0.37, -0.15) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(-0.15, -0.37) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(-0.15, 0.37) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(0.37, 0.15) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(-0.37, -0.15) * offset) * blur * 0.9);
|
||||
col += texture(tex, uv + (vec2(0.15, -0.37) * offset) * blur * 0.9);
|
||||
|
||||
col += texture2D(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.7);
|
||||
col += texture2D(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.7);
|
||||
col += texture2D(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.7);
|
||||
col += texture2D(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.7);
|
||||
col += texture2D(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.7);
|
||||
col += texture2D(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.7);
|
||||
col += texture2D(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.7);
|
||||
col += texture2D(tex, uv + (vec2(0.0, 0.4) * offset) * blur *0.7);
|
||||
col += texture(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.7);
|
||||
col += texture(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.7);
|
||||
col += texture(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.7);
|
||||
col += texture(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.7);
|
||||
col += texture(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.7);
|
||||
col += texture(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.7);
|
||||
col += texture(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.7);
|
||||
col += texture(tex, uv + (vec2(0.0, 0.4) * offset) * blur *0.7);
|
||||
|
||||
col += texture2D(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.4);
|
||||
col += texture2D(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.4);
|
||||
col += texture2D(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.4);
|
||||
col += texture2D(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.4);
|
||||
col += texture2D(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.4);
|
||||
col += texture2D(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.4);
|
||||
col += texture2D(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.4);
|
||||
col += texture2D(tex, uv + (vec2(0.0, 0.4) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(0.29, 0.29) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(0.4, 0.0) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(0.29, -0.29) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(0.0, -0.4) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(-0.29, 0.29) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(-0.4, 0.0) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(-0.29, -0.29) * offset) * blur * 0.4);
|
||||
col += texture(tex, uv + (vec2(0.0, 0.4) * offset) * blur * 0.4);
|
||||
|
||||
col = vec4(col.rgb / 41.0, col.a);
|
||||
depth = clamp((FragPos.z/280), 0., 1.);
|
||||
depth = (1 - depth);
|
||||
vec3 final = colOriginal.rgb * depth + col.rgb * (1 - depth);
|
||||
|
||||
/*
|
||||
FragColor.xyz = vec3(depth);
|
||||
FragColor.a = 1.0;
|
||||
*/
|
||||
FragColor = vec4(final, 1.);
|
||||
}
|
||||
|
@ -26,10 +26,10 @@ out float AO;
|
||||
|
||||
const float sigma = 1.;
|
||||
const float tau = 7.;
|
||||
const float beta = 0.0001;
|
||||
const float beta = 0.001;
|
||||
const float epsilon = .00001;
|
||||
const float radius = 1.5;
|
||||
const float k = 1.;
|
||||
const float radius = 1.;
|
||||
const float k = 1.5;
|
||||
|
||||
#define SAMPLES 16
|
||||
|
||||
@ -64,9 +64,8 @@ void main(void)
|
||||
float h = r * alpha;
|
||||
vec2 offset = h * vec2(cos(theta), sin(theta)) * screen;
|
||||
|
||||
float m = round(log2(h) + 7);
|
||||
float m = round(log2(h) + 6);
|
||||
ivec2 ioccluder_uv = ivec2(x, y) + ivec2(offset);
|
||||
ioccluder_uv = (ioccluder_uv << int(m)) >> int(m);
|
||||
|
||||
if (ioccluder_uv.x < 0 || ioccluder_uv.x > screen.x || ioccluder_uv.y < 0 || ioccluder_uv.y > screen.y) continue;
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video { class ITexture; }
|
||||
namespace gui
|
||||
{
|
||||
class IGUIFont;
|
||||
@ -564,6 +565,10 @@ namespace gui
|
||||
|
||||
//! get the type of this skin
|
||||
virtual EGUI_SKIN_TYPE getType() const { return EGST_UNKNOWN; }
|
||||
|
||||
virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
|
||||
const video::SColor* const colors, bool useAlphaChannelOfTexture) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -249,11 +249,16 @@ void CGUIButton::draw()
|
||||
pos.X -= ImageRect.getWidth() / 2;
|
||||
pos.Y -= ImageRect.getHeight() / 2;
|
||||
|
||||
driver->draw2DImage(Image,
|
||||
ScaleImage? AbsoluteRect :
|
||||
core::recti(pos, ImageRect.getSize()),
|
||||
ImageRect, &AbsoluteClippingRect,
|
||||
0, UseAlphaChannel);
|
||||
skin->draw2DImage(Image,
|
||||
ScaleImage ? AbsoluteRect :
|
||||
core::recti(pos, ImageRect.getSize()),
|
||||
ImageRect, &AbsoluteClippingRect,
|
||||
0, UseAlphaChannel);
|
||||
//driver->draw2DImage(Image,
|
||||
// ScaleImage? AbsoluteRect :
|
||||
// core::recti(pos, ImageRect.getSize()),
|
||||
// ImageRect, &AbsoluteClippingRect,
|
||||
// 0, UseAlphaChannel);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -179,6 +179,13 @@ CGUISkin::~CGUISkin()
|
||||
}
|
||||
|
||||
|
||||
void CGUISkin::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
|
||||
const video::SColor* const colors, bool useAlphaChannelOfTexture)
|
||||
{
|
||||
Driver->draw2DImage(texture, destRect, sourceRect, clipRect, colors, useAlphaChannelOfTexture);
|
||||
}
|
||||
|
||||
//! returns default color
|
||||
video::SColor CGUISkin::getColor(EGUI_DEFAULT_COLOR color) const
|
||||
{
|
||||
|
@ -224,6 +224,10 @@ namespace gui
|
||||
//! scripting languages, editors, debuggers or xml deserialization purposes.
|
||||
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0);
|
||||
|
||||
virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
|
||||
const video::SColor* const colors, bool useAlphaChannelOfTexture);
|
||||
|
||||
private:
|
||||
|
||||
video::SColor Colors[EGDC_COUNT];
|
||||
|
@ -490,6 +490,7 @@ ScopedGPUTimer::ScopedGPUTimer(GPUTimer &timer)
|
||||
if (!UserConfigParams::m_profiler_enabled) return;
|
||||
if (profiler.isFrozen()) return;
|
||||
|
||||
#ifdef GL_TIME_ELAPSED
|
||||
irr::video::COpenGLDriver *gl_driver = (irr::video::COpenGLDriver *)irr_driver->getDevice()->getVideoDriver();
|
||||
if (!timer.initialised)
|
||||
{
|
||||
@ -497,14 +498,17 @@ ScopedGPUTimer::ScopedGPUTimer(GPUTimer &timer)
|
||||
timer.initialised = true;
|
||||
}
|
||||
gl_driver->extGlBeginQuery(GL_TIME_ELAPSED, timer.query);
|
||||
#endif
|
||||
}
|
||||
ScopedGPUTimer::~ScopedGPUTimer()
|
||||
{
|
||||
if (!UserConfigParams::m_profiler_enabled) return;
|
||||
if (profiler.isFrozen()) return;
|
||||
|
||||
#ifdef GL_TIME_ELAPSED
|
||||
irr::video::COpenGLDriver *gl_driver = (irr::video::COpenGLDriver *)irr_driver->getDevice()->getVideoDriver();
|
||||
gl_driver->extGlEndQuery(GL_TIME_ELAPSED);
|
||||
#endif
|
||||
}
|
||||
|
||||
GPUTimer::GPUTimer() : initialised(false)
|
||||
|
@ -5,6 +5,12 @@
|
||||
# include <OpenGL/gl.h>
|
||||
# include <OpenGL/gl3.h>
|
||||
# define OGL32CTX
|
||||
# ifdef GL_ARB_instanced_arrays
|
||||
# define glVertexAttribDivisor glVertexAttribDivisorARB
|
||||
# endif
|
||||
# ifndef GL_TEXTURE_SWIZZLE_RGBA
|
||||
# define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
|
||||
# endif
|
||||
#elif defined(ANDROID)
|
||||
# include <GLES/gl.h>
|
||||
#elif defined(WIN32)
|
||||
|
@ -195,7 +195,7 @@ void ParticleSystemProxy::generateParticlesFromBoxEmitter(scene::IParticleBoxEmi
|
||||
memcpy(&(initialvalue[i].PositionX), &(particles[i].PositionX), 3 * sizeof(float));
|
||||
generateLifetimeSizeDirection(emitter, initialvalue[i].Lifetime, initialvalue[i].Size,
|
||||
initialvalue[i].DirectionX, initialvalue[i].DirectionY, initialvalue[i].DirectionZ);
|
||||
memcpy(&(particles[i].DirectionX), &(initialvalue[i].DirectionZ), 4 * sizeof(float));
|
||||
memcpy(&(particles[i].DirectionX), &(initialvalue[i].DirectionX), 4 * sizeof(float));
|
||||
}
|
||||
glBindBuffer(GL_ARRAY_BUFFER, initial_values_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, count * sizeof(ParticleData), initialvalue, GL_STREAM_DRAW);
|
||||
|
@ -112,6 +112,7 @@ IrrDriver::IrrDriver()
|
||||
m_wind = new Wind();
|
||||
m_mipviz = m_wireframe = m_normals = m_ssaoviz = \
|
||||
m_lightviz = m_shadowviz = m_distortviz = 0;
|
||||
SkyboxCubeMap = 0;
|
||||
} // IrrDriver
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -436,16 +437,24 @@ void IrrDriver::initDevice()
|
||||
|
||||
GLMajorVersion = 2;
|
||||
GLMinorVersion = 1;
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &GLMajorVersion);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &GLMinorVersion);
|
||||
// Call to glGetIntegerv should not be made if --no-graphics is used
|
||||
if(!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &GLMajorVersion);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &GLMinorVersion);
|
||||
}
|
||||
Log::info("IrrDriver", "OPENGL VERSION IS %d.%d", GLMajorVersion, GLMinorVersion);
|
||||
m_glsl = (GLMajorVersion > 3 || (GLMajorVersion == 3 && GLMinorVersion >= 1));
|
||||
|
||||
// Parse extensions
|
||||
hasVSLayer = false;
|
||||
const GLubyte *extensions = glGetString(GL_EXTENSIONS);
|
||||
if (extensions && strstr((const char*)extensions, "GL_AMD_vertex_shader_layer") != NULL)
|
||||
// Default false value for hasVSLayer if --no-graphics argument is used
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
const GLubyte *extensions = glGetString(GL_EXTENSIONS);
|
||||
if (extensions && strstr((const char*)extensions, "GL_AMD_vertex_shader_layer") != NULL)
|
||||
hasVSLayer = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1201,7 +1210,7 @@ void IrrDriver::suppressSkyBox()
|
||||
{
|
||||
SkyboxTextures.clear();
|
||||
SphericalHarmonicsTextures.clear();
|
||||
if (SkyboxCubeMap)
|
||||
if ((SkyboxCubeMap) && (!ProfileWorld::isNoGraphics()))
|
||||
glDeleteTextures(1, &SkyboxCubeMap);
|
||||
SkyboxCubeMap = 0;
|
||||
}
|
||||
@ -2305,7 +2314,7 @@ void IrrDriver::applyObjectPassShader()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
|
||||
scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy, float radius,
|
||||
float r, float g, float b, bool sun, scene::ISceneNode* parent)
|
||||
{
|
||||
if (m_glsl)
|
||||
@ -2314,7 +2323,7 @@ scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy,
|
||||
LightNode *light = NULL;
|
||||
|
||||
if (!sun)
|
||||
light = new LightNode(m_scene_manager, parent, energy, r, g, b);
|
||||
light = new LightNode(m_scene_manager, parent, energy, radius, r, g, b);
|
||||
else
|
||||
light = new SunNode(m_scene_manager, parent, r, g, b);
|
||||
|
||||
|
@ -563,8 +563,8 @@ public:
|
||||
void applyObjectPassShader();
|
||||
void applyObjectPassShader(scene::ISceneNode * const node, bool rimlit = false);
|
||||
// ------------------------------------------------------------------------
|
||||
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);
|
||||
scene::ISceneNode *addLight(const core::vector3df &pos, float energy, float radius, float r,
|
||||
float g, float b, bool sun = false, scene::ISceneNode* parent = NULL);
|
||||
// ------------------------------------------------------------------------
|
||||
void clearLights();
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -34,10 +34,11 @@ using namespace core;
|
||||
aabbox3df LightNode::box;
|
||||
|
||||
|
||||
LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float e, float r, float g, float b):
|
||||
LightNode::LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float e, float d, float r, float g, float b):
|
||||
ISceneNode(parent == NULL ? mgr->getRootSceneNode() : parent, mgr, -1)
|
||||
{
|
||||
m_energy = e;
|
||||
m_radius = d;
|
||||
m_energy_multiplier = 1.0f;
|
||||
m_color[0] = r;
|
||||
m_color[1] = g;
|
||||
|
@ -40,7 +40,7 @@ class LightNode: public scene::ISceneNode
|
||||
#endif
|
||||
|
||||
public:
|
||||
LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float energy, float r, float g, float b);
|
||||
LightNode(scene::ISceneManager* mgr, scene::ISceneNode* parent, float energy, float d, float r, float g, float b);
|
||||
virtual ~LightNode();
|
||||
|
||||
virtual void render() OVERRIDE;
|
||||
@ -55,7 +55,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]); }
|
||||
@ -66,7 +66,7 @@ public:
|
||||
protected:
|
||||
static core::aabbox3df box;
|
||||
|
||||
//float m_radius;
|
||||
float m_radius;
|
||||
float m_color[3];
|
||||
float m_energy;
|
||||
|
||||
|
@ -341,6 +341,8 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, std::vector
|
||||
renderDisplacement();
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
}
|
||||
// Ensure that no object will be drawn after that by using invalid pass
|
||||
irr_driver->setPhase(PASS_COUNT);
|
||||
}
|
||||
|
||||
// --------------------------------------------
|
||||
@ -684,7 +686,7 @@ void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode)
|
||||
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, SharedObject::ViewProjectionMatrixesUBO);
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, 0, 16 * 8 * sizeof(float), tmp);
|
||||
delete tmp;
|
||||
delete []tmp;
|
||||
}
|
||||
|
||||
void IrrDriver::renderShadows()
|
||||
@ -874,7 +876,7 @@ void IrrDriver::renderLights(scene::ICameraSceneNode * const camnode, float dt)
|
||||
PointLightsInfo[lightnum].blue = col.Z;
|
||||
|
||||
// Light radius
|
||||
PointLightsInfo[lightnum].radius = 20 * light_node->getEffectiveEnergy();
|
||||
PointLightsInfo[lightnum].radius = light_node->getRadius();
|
||||
}
|
||||
}
|
||||
if (lightnum > MAXLIGHT)
|
||||
|
@ -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, 0., r, g, b)
|
||||
LightNode(mgr, parent, 0., 0., r, g, b)
|
||||
{
|
||||
m_color[0] = r;
|
||||
m_color[1] = g;
|
||||
|
@ -2267,6 +2267,15 @@ void Skin::drawIcon (IGUIElement *element, EGUI_DEFAULT_ICON icon,
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void Skin::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
|
||||
const video::SColor* const colors, bool useAlphaChannelOfTexture)
|
||||
{
|
||||
::draw2DImage(texture, destRect, sourceRect, clipRect, colors, useAlphaChannelOfTexture);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
video::SColor Skin::getColor (EGUI_DEFAULT_COLOR color) const
|
||||
{
|
||||
/*
|
||||
|
@ -381,6 +381,11 @@ namespace GUIEngine
|
||||
const core::rect< s32 > &rect,
|
||||
const core::rect< s32 > *clip,
|
||||
core::rect<s32>* checkClientArea=0);
|
||||
|
||||
virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
|
||||
const video::SColor* const colors, bool useAlphaChannelOfTexture);
|
||||
|
||||
virtual void drawIcon (gui::IGUIElement *element,
|
||||
gui::EGUI_DEFAULT_ICON icon,
|
||||
const core::position2di position,
|
||||
|
@ -1276,8 +1276,8 @@ void SkiddingAI::handleItems(const float dt)
|
||||
break;
|
||||
|
||||
// Don't fire if the kart we are aiming at is invulnerable.
|
||||
if (fire_backwards && m_kart_behind->isInvulnerable() ||
|
||||
!fire_backwards && m_kart_ahead->isInvulnerable() )
|
||||
if ((fire_backwards && m_kart_behind && m_kart_behind->isInvulnerable()) ||
|
||||
(!fire_backwards && m_kart_ahead && m_kart_ahead->isInvulnerable()) )
|
||||
return;
|
||||
|
||||
float distance = fire_backwards ? m_distance_behind
|
||||
|
@ -856,7 +856,7 @@ int handleCmdLine()
|
||||
}
|
||||
} // --laps
|
||||
|
||||
if(CommandLine::has("--profile-laps=", &n))
|
||||
if(CommandLine::has("--profile-laps", &n))
|
||||
{
|
||||
if (n < 0)
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ void ConnectToServer::asynchronousUpdate()
|
||||
if (m_server_address.ip == 0 || m_server_address.port == 0)
|
||||
{ // server data not correct, hide address and stop
|
||||
m_state = HIDING_ADDRESS;
|
||||
Log::error("ConnectToServer", "Server address is "ADDRESS_FORMAT, ADDRESS_ARGS(m_server_address.ip, m_server_address.port));
|
||||
Log::error("ConnectToServer", "Server address is " ADDRESS_FORMAT, ADDRESS_ARGS(m_server_address.ip, m_server_address.port));
|
||||
m_current_protocol_id = m_listener->requestStart(new HidePublicAddress());
|
||||
return;
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ void FeatureUnlockedCutScene::init()
|
||||
120, 120));
|
||||
|
||||
const core::vector3df &sun_pos = core::vector3df( 0, 200, 100.0f );
|
||||
m_light = irr_driver->addLight(sun_pos, 10000.0f, 1, 1, 1);
|
||||
m_light = irr_driver->addLight(sun_pos, 10000.0f, 1., 1, 1, 1, true);
|
||||
#ifdef DEBUG
|
||||
m_light->setName("light");
|
||||
#endif
|
||||
|
@ -1719,7 +1719,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, 0., tmpf.r, tmpf.g, tmpf.b, true);
|
||||
m_sun = irr_driver->addLight(m_sun_position, 0., 0., tmpf.r, tmpf.g, tmpf.b, true);
|
||||
|
||||
if (!irr_driver->isGLSL())
|
||||
{
|
||||
|
@ -675,15 +675,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_energy = 1.0f;
|
||||
xml_node.get("energy", &m_energy);
|
||||
|
||||
m_distance = 20. * m_energy;
|
||||
xml_node.get("distance", &m_distance);
|
||||
|
||||
if (irr_driver->isGLSL())
|
||||
{
|
||||
m_node = irr_driver->addLight(m_init_xyz, m_energy, colorf.r, colorf.g, colorf.b, false, parent);
|
||||
m_node = irr_driver->addLight(m_init_xyz, m_energy, m_distance, colorf.r, colorf.g, colorf.b, false, parent);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -307,7 +307,7 @@ class TrackObjectPresentationLight : public TrackObjectPresentationSceneNode
|
||||
{
|
||||
private:
|
||||
video::SColor m_color;
|
||||
//float m_distance;
|
||||
float m_distance;
|
||||
float m_energy;
|
||||
|
||||
public:
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "log.hpp"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(WIN32) && !defined(DEBUG)
|
||||
// --------------------- Windows version -----------------
|
||||
#include <Windows.h>
|
||||
#include <DbgHelp.h>
|
||||
|
Loading…
Reference in New Issue
Block a user