Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
ddbc2299b7
@ -7,7 +7,6 @@ uniform float endH;
|
||||
uniform float start;
|
||||
uniform float end;
|
||||
uniform vec3 col;
|
||||
uniform vec3 campos;
|
||||
uniform mat4 ipvmat;
|
||||
|
||||
in vec2 uv;
|
||||
@ -24,9 +23,8 @@ void main()
|
||||
xpos = ipvmat * xpos;
|
||||
xpos.xyz /= xpos.w;
|
||||
|
||||
float dist = distance(campos, xpos.xyz);
|
||||
float dist = length(xpos.xyz);
|
||||
float fog = smoothstep(start, end, dist);
|
||||
fog *= 1.0 - smoothstep(startH, endH, xpos.y);
|
||||
|
||||
fog = min(fog, fogmax);
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
#version 130
|
||||
uniform sampler2D diffuse;
|
||||
uniform sampler2D specular;
|
||||
uniform sampler2D ambient_occlusion;
|
||||
uniform sampler2D specular_map;
|
||||
uniform vec3 ambient;
|
||||
|
||||
in vec2 uv;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 texc = uv;
|
||||
|
||||
vec3 diffuse = texture(diffuse, texc).xyz;
|
||||
vec3 spec = texture(specular, texc).xyz;
|
||||
float specmap = texture(specular_map, texc).x;
|
||||
float ao = texture(ambient_occlusion, texc).x;
|
||||
|
||||
FragColor = vec4(diffuse + spec * specmap + ao * ambient, 1.0);
|
||||
}
|
32
data/shaders/transparentfog.frag
Normal file
32
data/shaders/transparentfog.frag
Normal file
@ -0,0 +1,32 @@
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
|
||||
uniform float fogmax;
|
||||
uniform float startH;
|
||||
uniform float endH;
|
||||
uniform float start;
|
||||
uniform float end;
|
||||
uniform vec3 col;
|
||||
uniform mat4 ipvmat;
|
||||
uniform vec2 screen;
|
||||
|
||||
in vec2 uv;
|
||||
out vec4 FragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = texture(tex, uv);
|
||||
vec3 tmp = vec3(gl_FragCoord.xy / screen, gl_FragCoord.z);
|
||||
tmp = 2. * tmp - 1.;
|
||||
|
||||
vec4 xpos = vec4(tmp, 1.0);
|
||||
xpos = ipvmat * xpos;
|
||||
xpos.xyz /= xpos.w;
|
||||
|
||||
float dist = length(xpos.xyz);
|
||||
float fog = smoothstep(start, end, dist);
|
||||
|
||||
fog = min(fog, fogmax);
|
||||
|
||||
FragColor = vec4(vec4(col, 1.) * fog + color *(1. - fog));
|
||||
}
|
@ -360,6 +360,7 @@ src/graphics/CBatchingMesh.hpp
|
||||
src/graphics/explosion.hpp
|
||||
src/graphics/glow.hpp
|
||||
src/graphics/glwrap.hpp
|
||||
src/graphics/gpuparticles.hpp
|
||||
src/graphics/hardware_skinning.hpp
|
||||
src/graphics/hit_effect.hpp
|
||||
src/graphics/hit_sfx.hpp
|
||||
|
@ -254,13 +254,6 @@ void ColorizeProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
|
||||
//-------------------------------------
|
||||
|
||||
void GlowProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
{
|
||||
srv->setVertexShaderConstant("res", m_res, 2);
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
|
||||
void ObjectPassProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
{
|
||||
core::matrix4 ModelViewProjectionMatrix = srv->getVideoDriver()->getTransform(ETS_PROJECTION);
|
||||
|
@ -328,23 +328,6 @@ private:
|
||||
|
||||
//
|
||||
|
||||
class GlowProvider: public CallBase
|
||||
{
|
||||
public:
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices *srv, int);
|
||||
|
||||
void setResolution(int x, int y)
|
||||
{
|
||||
m_res[0] = (float)x;
|
||||
m_res[1] = (float)y;
|
||||
}
|
||||
|
||||
private:
|
||||
float m_res[2];
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
class ObjectPassProvider: public CallBase
|
||||
{
|
||||
public:
|
||||
|
@ -39,15 +39,6 @@ GlowNode::GlowNode(scene::ISceneManager* mgr, float radius): ISceneNode(mgr->get
|
||||
{
|
||||
if (!sphere)
|
||||
{
|
||||
mat.Lighting = false;
|
||||
mat.MaterialType = irr_driver->getShader(ES_GLOW);
|
||||
|
||||
mat.setTexture(0, irr_driver->getRTT(RTT_QUARTER1));
|
||||
mat.TextureLayer[0].TextureWrapU =
|
||||
mat.TextureLayer[0].TextureWrapV = ETC_CLAMP_TO_EDGE;
|
||||
mat.setFlag(EMF_TRILINEAR_FILTER, true);
|
||||
mat.BlendOperation = EBO_ADD;
|
||||
|
||||
sphere = mgr->getGeometryCreator()->createSphereMesh(1, 4, 4);
|
||||
box = sphere->getBoundingBox();
|
||||
}
|
||||
@ -65,10 +56,5 @@ void GlowNode::render()
|
||||
|
||||
void GlowNode::OnRegisterSceneNode()
|
||||
{
|
||||
if (IsVisible)
|
||||
{
|
||||
SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT);
|
||||
}
|
||||
|
||||
ISceneNode::OnRegisterSceneNode();
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "irr_driver.hpp"
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include "config/user_config.hpp"
|
||||
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
#define IRR_OGL_LOAD_EXTENSION(X) wglGetProcAddress(reinterpret_cast<const char*>(X))
|
||||
@ -273,7 +274,7 @@ void bindUniformToTextureUnit(GLuint location, GLuint texid, unsigned textureUni
|
||||
glUniform1i(location, textureUnit);
|
||||
}
|
||||
|
||||
void setTexture(unsigned TextureUnit, GLuint TextureId, GLenum MagFilter, GLenum MinFilter)
|
||||
void setTexture(unsigned TextureUnit, GLuint TextureId, GLenum MagFilter, GLenum MinFilter, bool allowAF)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE0 + TextureUnit);
|
||||
glBindTexture(GL_TEXTURE_2D, TextureId);
|
||||
@ -281,6 +282,8 @@ void setTexture(unsigned TextureUnit, GLuint TextureId, GLenum MagFilter, GLenum
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, MinFilter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
if (allowAF)
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, UserConfigParams::m_anisotropic);
|
||||
}
|
||||
|
||||
static void drawTexColoredQuad(const video::ITexture *texture, const video::SColor *col, float width, float height,
|
||||
|
@ -22,7 +22,7 @@ void initGL();
|
||||
GLuint LoadProgram(const char * vertex_file_path, const char * fragment_file_path);
|
||||
GLuint LoadTFBProgram(const char * vertex_file_path, const char **varyings, unsigned varyingscount);
|
||||
void bindUniformToTextureUnit(GLuint location, GLuint texid, unsigned textureUnit);
|
||||
void setTexture(unsigned TextureUnit, GLuint TextureId, GLenum MagFilter, GLenum MinFilter);
|
||||
void setTexture(unsigned TextureUnit, GLuint TextureId, GLenum MagFilter, GLenum MinFilter, bool allowAF = false);
|
||||
|
||||
// already includes glext.h, which defines useful GL constants.
|
||||
// COpenGLDriver has already loaded the extension GL functions we use (e.g glBeginQuery)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,98 +0,0 @@
|
||||
#ifndef GPUPARTICLES_H
|
||||
#define GPUPARTICLES_H
|
||||
|
||||
#include "graphics/glwrap.hpp"
|
||||
|
||||
#include "../lib/irrlicht/source/Irrlicht/CParticleSystemSceneNode.h"
|
||||
#include <ISceneManager.h>
|
||||
#include <IParticleSystemSceneNode.h>
|
||||
|
||||
namespace irr { namespace video{ class ITexture; } }
|
||||
|
||||
GLuint getTextureGLuint(irr::video::ITexture *tex);
|
||||
|
||||
class GPUParticle : public scene::ISceneNode
|
||||
{
|
||||
protected:
|
||||
video::SMaterial fakemat;
|
||||
virtual void simulate() = 0;
|
||||
virtual void draw() = 0;
|
||||
public:
|
||||
GPUParticle(scene::ISceneNode *parent, scene::ISceneManager* mgr,
|
||||
video::ITexture *tex);
|
||||
virtual void render();
|
||||
virtual void OnRegisterSceneNode();
|
||||
};
|
||||
|
||||
class ParticleSystemProxy : public scene::CParticleSystemSceneNode {
|
||||
protected:
|
||||
video::SMaterial fakemat;
|
||||
GLuint tfb_buffers[2], initial_values_buffer, heighmapbuffer, heightmaptexture, quaternionsbuffer;
|
||||
GLuint current_simulation_vao, non_current_simulation_vao;
|
||||
GLuint current_hm_simulation_vao, non_currenthm__simulation_vao;
|
||||
GLuint current_rendering_vao, non_current_rendering_vao;
|
||||
GLuint current_rendering_flip_vao, non_current_rendering_flip_vao;
|
||||
bool m_alpha_additive, has_height_map, flip;
|
||||
float size_increase_factor, track_x, track_z, track_x_len, track_z_len;
|
||||
|
||||
static GLuint quad_vertex_buffer;
|
||||
|
||||
GLuint texture;
|
||||
unsigned count;
|
||||
static void SimpleParticleVAOBind(GLuint PositionBuffer);
|
||||
static void FlipParticleVAOBind(GLuint PositionBuffer, GLuint QuaternionBuffer);
|
||||
static void SimpleSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
|
||||
static void HeightmapSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
|
||||
|
||||
void simulateHeightmap();
|
||||
void simulateNoHeightmap();
|
||||
void drawFlip();
|
||||
void drawNotFlip();
|
||||
virtual void simulate();
|
||||
virtual void draw();
|
||||
void generateParticlesFromPointEmitter(scene::IParticlePointEmitter *);
|
||||
void generateParticlesFromBoxEmitter(scene::IParticleBoxEmitter *);
|
||||
void generateParticlesFromSphereEmitter(scene::IParticleSphereEmitter *);
|
||||
public:
|
||||
static IParticleSystemSceneNode *addParticleNode(
|
||||
bool withDefaultEmitter = true, ISceneNode* parent = 0, s32 id = -1,
|
||||
const core::vector3df& position = core::vector3df(0, 0, 0),
|
||||
const core::vector3df& rotation = core::vector3df(0, 0, 0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
|
||||
ParticleSystemProxy(bool createDefaultEmitter,
|
||||
ISceneNode* parent, scene::ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position,
|
||||
const core::vector3df& rotation,
|
||||
const core::vector3df& scale);
|
||||
~ParticleSystemProxy();
|
||||
|
||||
virtual void setEmitter(scene::IParticleEmitter* emitter);
|
||||
virtual void render();
|
||||
virtual void OnRegisterSceneNode();
|
||||
void setAlphaAdditive(bool);
|
||||
void setIncreaseFactor(float);
|
||||
void setHeightmap(const std::vector<std::vector<float> >&, float, float, float, float);
|
||||
void setFlip();
|
||||
};
|
||||
|
||||
class RainNode : public GPUParticle
|
||||
{
|
||||
protected:
|
||||
GLuint SimulationProgram, RenderProgram, tfb_vertex_buffer[2];
|
||||
unsigned count;
|
||||
GLuint texture, normal_and_depth;
|
||||
GLuint loc_campos, loc_viewm, loc_time;
|
||||
GLuint loc_screenw, loc_screen, loc_invproj, texloc_tex, texloc_normal_and_depths;
|
||||
s32 area;
|
||||
core::aabbox3d<f32> box;
|
||||
|
||||
virtual void simulate();
|
||||
virtual void draw();
|
||||
public:
|
||||
RainNode(scene::ISceneManager* mgr, video::ITexture *tex);
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const;
|
||||
virtual u32 getMaterialCount() const { return 1; }
|
||||
};
|
||||
|
||||
#endif // GPUPARTICLES_H
|
98
src/graphics/gpuparticles.hpp
Normal file
98
src/graphics/gpuparticles.hpp
Normal file
@ -0,0 +1,98 @@
|
||||
#ifndef GPUPARTICLES_H
|
||||
#define GPUPARTICLES_H
|
||||
|
||||
#include "graphics/glwrap.hpp"
|
||||
|
||||
#include "../lib/irrlicht/source/Irrlicht/CParticleSystemSceneNode.h"
|
||||
#include <ISceneManager.h>
|
||||
#include <IParticleSystemSceneNode.h>
|
||||
|
||||
namespace irr { namespace video{ class ITexture; } }
|
||||
|
||||
GLuint getTextureGLuint(irr::video::ITexture *tex);
|
||||
|
||||
class GPUParticle : public scene::ISceneNode
|
||||
{
|
||||
protected:
|
||||
video::SMaterial fakemat;
|
||||
virtual void simulate() = 0;
|
||||
virtual void draw() = 0;
|
||||
public:
|
||||
GPUParticle(scene::ISceneNode *parent, scene::ISceneManager* mgr,
|
||||
video::ITexture *tex);
|
||||
virtual void render();
|
||||
virtual void OnRegisterSceneNode();
|
||||
};
|
||||
|
||||
class ParticleSystemProxy : public scene::CParticleSystemSceneNode {
|
||||
protected:
|
||||
video::SMaterial fakemat;
|
||||
GLuint tfb_buffers[2], initial_values_buffer, heighmapbuffer, heightmaptexture, quaternionsbuffer;
|
||||
GLuint current_simulation_vao, non_current_simulation_vao;
|
||||
GLuint current_hm_simulation_vao, non_currenthm__simulation_vao;
|
||||
GLuint current_rendering_vao, non_current_rendering_vao;
|
||||
GLuint current_rendering_flip_vao, non_current_rendering_flip_vao;
|
||||
bool m_alpha_additive, has_height_map, flip;
|
||||
float size_increase_factor, track_x, track_z, track_x_len, track_z_len;
|
||||
|
||||
static GLuint quad_vertex_buffer;
|
||||
|
||||
GLuint texture;
|
||||
unsigned count;
|
||||
static void SimpleParticleVAOBind(GLuint PositionBuffer);
|
||||
static void FlipParticleVAOBind(GLuint PositionBuffer, GLuint QuaternionBuffer);
|
||||
static void SimpleSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
|
||||
static void HeightmapSimulationBind(GLuint PositionBuffer, GLuint InitialValuesBuffer);
|
||||
|
||||
void simulateHeightmap();
|
||||
void simulateNoHeightmap();
|
||||
void drawFlip();
|
||||
void drawNotFlip();
|
||||
virtual void simulate();
|
||||
virtual void draw();
|
||||
void generateParticlesFromPointEmitter(scene::IParticlePointEmitter *);
|
||||
void generateParticlesFromBoxEmitter(scene::IParticleBoxEmitter *);
|
||||
void generateParticlesFromSphereEmitter(scene::IParticleSphereEmitter *);
|
||||
public:
|
||||
static IParticleSystemSceneNode *addParticleNode(
|
||||
bool withDefaultEmitter = true, ISceneNode* parent = 0, s32 id = -1,
|
||||
const core::vector3df& position = core::vector3df(0, 0, 0),
|
||||
const core::vector3df& rotation = core::vector3df(0, 0, 0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f));
|
||||
|
||||
ParticleSystemProxy(bool createDefaultEmitter,
|
||||
ISceneNode* parent, scene::ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position,
|
||||
const core::vector3df& rotation,
|
||||
const core::vector3df& scale);
|
||||
~ParticleSystemProxy();
|
||||
|
||||
virtual void setEmitter(scene::IParticleEmitter* emitter);
|
||||
virtual void render();
|
||||
virtual void OnRegisterSceneNode();
|
||||
void setAlphaAdditive(bool);
|
||||
void setIncreaseFactor(float);
|
||||
void setHeightmap(const std::vector<std::vector<float> >&, float, float, float, float);
|
||||
void setFlip();
|
||||
};
|
||||
|
||||
class RainNode : public GPUParticle
|
||||
{
|
||||
protected:
|
||||
GLuint SimulationProgram, RenderProgram, tfb_vertex_buffer[2];
|
||||
unsigned count;
|
||||
GLuint texture, normal_and_depth;
|
||||
GLuint loc_campos, loc_viewm, loc_time;
|
||||
GLuint loc_screenw, loc_screen, loc_invproj, texloc_tex, texloc_normal_and_depths;
|
||||
s32 area;
|
||||
core::aabbox3d<f32> box;
|
||||
|
||||
virtual void simulate();
|
||||
virtual void draw();
|
||||
public:
|
||||
RainNode(scene::ISceneManager* mgr, video::ITexture *tex);
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const;
|
||||
virtual u32 getMaterialCount() const { return 1; }
|
||||
};
|
||||
|
||||
#endif // GPUPARTICLES_H
|
@ -1509,7 +1509,9 @@ void IrrDriver::displayFPS()
|
||||
{
|
||||
sprintf(buffer, "FPS: %i/%i/%i - Objects (P1:%d P2:%d T:%d) KTris - LightDst : ~%d",
|
||||
min, fps, max, object_count[SOLID_NORMAL_AND_DEPTH_PASS], object_count[SOLID_NORMAL_AND_DEPTH_PASS], object_count[TRANSPARENT_PASS], m_last_light_bucket_distance);
|
||||
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = object_count[SOLID_NORMAL_AND_DEPTH_PASS] = object_count[TRANSPARENT_PASS] = 0;
|
||||
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
|
||||
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = 0;
|
||||
object_count[TRANSPARENT_PASS] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -66,8 +66,6 @@ public:
|
||||
protected:
|
||||
static core::aabbox3df box;
|
||||
|
||||
class ScreenQuad *sq;
|
||||
|
||||
//float m_radius;
|
||||
float m_color[3];
|
||||
float m_energy;
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
#include "utils/helpers.hpp"
|
||||
#include "graphics/gpuparticles.h"
|
||||
#include "graphics/gpuparticles.hpp"
|
||||
|
||||
#include <SParticle.h>
|
||||
#include <IParticleAffector.h>
|
||||
|
@ -57,7 +57,11 @@ PostProcessing::PostProcessing(IVideoDriver* video_driver)
|
||||
io::IReadFile *areamap = irr_driver->getDevice()->getFileSystem()->
|
||||
createMemoryReadFile((void *) AreaMap33, sizeof(AreaMap33),
|
||||
"AreaMap33", false);
|
||||
if (!areamap) Log::fatal("postprocessing", "Failed to load the areamap");
|
||||
if (!areamap)
|
||||
{
|
||||
Log::fatal("postprocessing", "Failed to load the areamap");
|
||||
return;
|
||||
}
|
||||
m_areamap = irr_driver->getVideoDriver()->getTexture(areamap);
|
||||
areamap->drop();
|
||||
|
||||
@ -342,57 +346,6 @@ void PostProcessing::renderSunlight()
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
||||
void PostProcessing::renderLightbBlend(ITexture *diffuse, ITexture *specular, ITexture *ao, ITexture *specmap, bool debug)
|
||||
{
|
||||
const SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glStencilFunc(GL_EQUAL, 1, ~0);
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
if (debug)
|
||||
glBlendFunc(GL_ONE, GL_ZERO);
|
||||
else
|
||||
glBlendFunc(GL_DST_COLOR, GL_ZERO);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glUseProgram(FullScreenShader::LightBlendShader::Program);
|
||||
glBindVertexArray(FullScreenShader::LightBlendShader::vao);
|
||||
|
||||
glUniform3f(FullScreenShader::LightBlendShader::uniform_ambient, s.r, s.g, s.b);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D, static_cast<irr::video::COpenGLTexture*>(diffuse)->getOpenGLTextureName());
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glUniform1i(FullScreenShader::LightBlendShader::uniform_diffuse, 0);
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, static_cast<irr::video::COpenGLTexture*>(specular)->getOpenGLTextureName());
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glUniform1i(FullScreenShader::LightBlendShader::uniform_specular, 1);
|
||||
glActiveTexture(GL_TEXTURE2);
|
||||
glBindTexture(GL_TEXTURE_2D, static_cast<irr::video::COpenGLTexture*>(ao)->getOpenGLTextureName());
|
||||
glUniform1i(FullScreenShader::LightBlendShader::uniform_ambient_occlusion, 2);
|
||||
glActiveTexture(GL_TEXTURE3);
|
||||
if (!UserConfigParams::m_ssao)
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ONE};
|
||||
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
||||
}
|
||||
glBindTexture(GL_TEXTURE_2D, static_cast<irr::video::COpenGLTexture*>(specmap)->getOpenGLTextureName());
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glUniform1i(FullScreenShader::LightBlendShader::uniform_specular_map, 3);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
glBindVertexArray(0);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
}
|
||||
|
||||
|
||||
void PostProcessing::renderGaussian3Blur(video::ITexture *in, video::ITexture *temprtt, float inv_width, float inv_height)
|
||||
{
|
||||
@ -542,7 +495,7 @@ void PostProcessing::renderSSAO(const core::matrix4 &invprojm, const core::matri
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
void PostProcessing::renderFog(const core::vector3df &campos, const core::matrix4 &ipvmat)
|
||||
void PostProcessing::renderFog(const core::matrix4 &ipvmat)
|
||||
{
|
||||
irr_driver->getVideoDriver()->setRenderTarget(irr_driver->getRTT(RTT_COLOR), false, false);
|
||||
const Track * const track = World::getWorld()->getTrack();
|
||||
@ -568,7 +521,7 @@ void PostProcessing::renderFog(const core::vector3df &campos, const core::matrix
|
||||
glBindVertexArray(FullScreenShader::FogShader::vao);
|
||||
|
||||
setTexture(0, static_cast<irr::video::COpenGLFBOTexture*>(irr_driver->getRTT(RTT_NORMAL_AND_DEPTH))->DepthBufferTexture, GL_NEAREST, GL_NEAREST);
|
||||
FullScreenShader::FogShader::setUniforms(ipvmat, fogmax, startH, endH, start, end, col, campos, 0);
|
||||
FullScreenShader::FogShader::setUniforms(ipvmat, fogmax, startH, endH, start, end, col, 0);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
glBindVertexArray(0);
|
||||
|
@ -75,10 +75,8 @@ public:
|
||||
/** Generate diffuse and specular map */
|
||||
void renderPointlight(const std::vector<float> &positions, const std::vector<float> &colors, const std::vector<float> &energy);
|
||||
void renderSunlight();
|
||||
/** Blend all light related map */
|
||||
void renderLightbBlend(video::ITexture *diffuse, video::ITexture *specular, video::ITexture *ao, video::ITexture *specmap, bool debug);
|
||||
|
||||
void renderFog(const core::vector3df &campos, const core::matrix4 &ipvmat);
|
||||
void renderFog(const core::matrix4 &ipvmat);
|
||||
void renderSSAO(const core::matrix4 &invprojm, const core::matrix4 &projm);
|
||||
|
||||
/** Blur the in texture */
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "graphics/camera.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/gpuparticles.h"
|
||||
#include "graphics/gpuparticles.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "graphics/material.hpp"
|
||||
@ -42,7 +42,7 @@ using namespace core;
|
||||
|
||||
// The rain manager
|
||||
|
||||
Rain::Rain(Camera *camera, irr::scene::ISceneNode* parent)
|
||||
Rain::Rain(Camera *camera, irr::scene::ISceneNode* parent) : m_thunder_sound(0)
|
||||
{
|
||||
m_lightning = camera->getIndex()==0;
|
||||
|
||||
|
@ -242,7 +242,7 @@ void IrrDriver::renderGLSL(float dt)
|
||||
if (World::getWorld()->getTrack()->isFogEnabled())
|
||||
{
|
||||
PROFILER_PUSH_CPU_MARKER("- Fog", 0xFF, 0x00, 0x00);
|
||||
m_post_processing->renderFog(camnode->getAbsolutePosition(), irr_driver->getInvProjViewMatrix());
|
||||
m_post_processing->renderFog(irr_driver->getInvProjMatrix());
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
}
|
||||
|
||||
@ -640,10 +640,6 @@ void IrrDriver::renderGlow(video::SOverrideMaterial &overridemat,
|
||||
const u32 glowcount = glows.size();
|
||||
ColorizeProvider * const cb = (ColorizeProvider *) m_shaders->m_callbacks[ES_COLORIZE];
|
||||
|
||||
GlowProvider * const glowcb = (GlowProvider *) m_shaders->m_callbacks[ES_GLOW];
|
||||
glowcb->setResolution(UserConfigParams::m_width,
|
||||
UserConfigParams::m_height);
|
||||
|
||||
/* overridemat.Material.MaterialType = m_shaders->getShader(ES_COLORIZE);
|
||||
overridemat.EnableFlags = video::EMF_MATERIAL_TYPE;
|
||||
overridemat.EnablePasses = scene::ESNRP_SOLID;
|
||||
|
@ -40,8 +40,6 @@ Shaders::Shaders()
|
||||
m_callbacks[ES_GAUSSIAN3V] = m_callbacks[ES_GAUSSIAN3H] = new GaussianBlurProvider();
|
||||
m_callbacks[ES_MIPVIZ] = new MipVizProvider();
|
||||
m_callbacks[ES_COLORIZE] = new ColorizeProvider();
|
||||
m_callbacks[ES_GLOW] = new GlowProvider();
|
||||
m_callbacks[ES_OBJECTPASS] = new ObjectPassProvider();
|
||||
m_callbacks[ES_SUNLIGHT] = new SunLightProvider();
|
||||
m_callbacks[ES_MLAA_COLOR1] = new MLAAColor1Provider();
|
||||
m_callbacks[ES_MLAA_BLEND2] = new MLAABlend2Provider();
|
||||
@ -108,25 +106,20 @@ void Shaders::loadShaders()
|
||||
memcpy(saved_shaders, m_shaders, sizeof(m_shaders));
|
||||
|
||||
// Ok, go
|
||||
m_shaders[ES_NORMAL_MAP] = glslmat(dir + "normalmap.vert", dir + "normalmap.frag",
|
||||
m_callbacks[ES_NORMAL_MAP], EMT_SOLID_2_LAYER);
|
||||
|
||||
m_shaders[ES_NORMAL_MAP_LIGHTMAP] = glslmat(dir + "normalmap.vert", dir + "normalmap.frag",
|
||||
m_callbacks[ES_NORMAL_MAP_LIGHTMAP], EMT_SOLID_2_LAYER);
|
||||
m_shaders[ES_NORMAL_MAP] = glsl_noinput(dir + "normalmap.vert", dir + "normalmap.frag");
|
||||
m_shaders[ES_NORMAL_MAP_LIGHTMAP] = glsl_noinput(dir + "normalmap.vert", dir + "normalmap.frag");
|
||||
|
||||
m_shaders[ES_SKYBOX] = glslmat(dir + "skybox.vert", dir + "skybox.frag",
|
||||
m_callbacks[ES_SKYBOX], EMT_TRANSPARENT_ALPHA_CHANNEL);
|
||||
|
||||
m_shaders[ES_SPLATTING] = glslmat(dir + "splatting.vert", dir + "splatting.frag",
|
||||
m_callbacks[ES_SPLATTING], EMT_SOLID);
|
||||
m_shaders[ES_SPLATTING] = glsl_noinput(dir + "splatting.vert", dir + "splatting.frag");
|
||||
|
||||
m_shaders[ES_WATER] = glslmat(dir + "water.vert", dir + "water.frag",
|
||||
m_callbacks[ES_WATER], EMT_TRANSPARENT_ALPHA_CHANNEL);
|
||||
m_shaders[ES_WATER_SURFACE] = glsl(dir + "water.vert", dir + "pass.frag",
|
||||
m_callbacks[ES_WATER]);
|
||||
|
||||
m_shaders[ES_SPHERE_MAP] = glslmat(dir + "objectpass.vert", dir + "objectpass_spheremap.frag",
|
||||
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
|
||||
m_shaders[ES_SPHERE_MAP] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass_spheremap.frag");
|
||||
|
||||
m_shaders[ES_GRASS] = glslmat(dir + "grass.vert", dir + "grass.frag",
|
||||
m_callbacks[ES_GRASS], EMT_TRANSPARENT_ALPHA_CHANNEL);
|
||||
@ -155,22 +148,13 @@ void Shaders::loadShaders()
|
||||
m_shaders[ES_COLORIZE_REF] = glslmat(std::string(""), dir + "colorize_ref.frag",
|
||||
m_callbacks[ES_COLORIZE], EMT_SOLID);
|
||||
|
||||
m_shaders[ES_GLOW] = glslmat(std::string(""), dir + "glow.frag",
|
||||
m_callbacks[ES_GLOW], EMT_TRANSPARENT_ALPHA_CHANNEL);
|
||||
m_shaders[ES_OBJECTPASS] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass.frag");
|
||||
m_shaders[ES_OBJECT_UNLIT] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass.frag");
|
||||
m_shaders[ES_OBJECTPASS_REF] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass_ref.frag");
|
||||
m_shaders[ES_OBJECTPASS_RIMLIT] = glsl_noinput(dir + "objectpass_rimlit.vert", dir + "objectpass_rimlit.frag");
|
||||
|
||||
m_shaders[ES_OBJECTPASS] = glslmat(dir + "objectpass.vert", dir + "objectpass.frag",
|
||||
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
|
||||
m_shaders[ES_OBJECT_UNLIT] = glslmat(dir + "objectpass.vert", dir + "objectpass.frag",
|
||||
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
|
||||
m_shaders[ES_OBJECTPASS_REF] = glslmat(dir + "objectpass.vert", dir + "objectpass_ref.frag",
|
||||
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
|
||||
m_shaders[ES_OBJECTPASS_RIMLIT] = glslmat(dir + "objectpass_rimlit.vert", dir + "objectpass_rimlit.frag",
|
||||
m_callbacks[ES_OBJECTPASS], EMT_SOLID);
|
||||
|
||||
m_shaders[ES_SUNLIGHT] = glslmat(std::string(""), dir + "sunlight.frag",
|
||||
m_callbacks[ES_SUNLIGHT], EMT_SOLID);
|
||||
m_shaders[ES_SUNLIGHT_SHADOW] = glslmat(dir + "pass.vert", dir + "sunlightshadow.frag",
|
||||
m_callbacks[ES_SUNLIGHT], EMT_SOLID);
|
||||
m_shaders[ES_SUNLIGHT] = glsl_noinput(std::string(""), dir + "sunlight.frag");
|
||||
m_shaders[ES_SUNLIGHT_SHADOW] = glsl_noinput(dir + "pass.vert", dir + "sunlightshadow.frag");
|
||||
|
||||
m_shaders[ES_MLAA_COLOR1] = glsl(dir + "mlaa_offset.vert", dir + "mlaa_color1.frag",
|
||||
m_callbacks[ES_MLAA_COLOR1]);
|
||||
@ -249,7 +233,6 @@ void Shaders::loadShaders()
|
||||
FullScreenShader::Gaussian6HBlurShader::init();
|
||||
FullScreenShader::Gaussian6VBlurShader::init();
|
||||
FullScreenShader::GlowShader::init();
|
||||
FullScreenShader::LightBlendShader::init();
|
||||
FullScreenShader::PassThroughShader::init();
|
||||
FullScreenShader::PointLightShader::init();
|
||||
FullScreenShader::PPDisplaceShader::init();
|
||||
@ -271,6 +254,7 @@ void Shaders::loadShaders()
|
||||
MeshShader::GrassPass2Shader::init();
|
||||
MeshShader::BubbleShader::init();
|
||||
MeshShader::TransparentShader::init();
|
||||
MeshShader::TransparentFogShader::init();
|
||||
MeshShader::BillboardShader::init();
|
||||
MeshShader::DisplaceShader::init();
|
||||
ParticleShader::FlipParticleRender::init();
|
||||
@ -794,6 +778,51 @@ namespace MeshShader
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniform1i(uniform_tex, TU_tex);
|
||||
}
|
||||
|
||||
GLuint TransparentFogShader::Program;
|
||||
GLuint TransparentFogShader::attrib_position;
|
||||
GLuint TransparentFogShader::attrib_texcoord;
|
||||
GLuint TransparentFogShader::uniform_MVP;
|
||||
GLuint TransparentFogShader::uniform_tex;
|
||||
GLuint TransparentFogShader::uniform_fogmax;
|
||||
GLuint TransparentFogShader::uniform_startH;
|
||||
GLuint TransparentFogShader::uniform_endH;
|
||||
GLuint TransparentFogShader::uniform_start;
|
||||
GLuint TransparentFogShader::uniform_end;
|
||||
GLuint TransparentFogShader::uniform_col;
|
||||
GLuint TransparentFogShader::uniform_screen;
|
||||
GLuint TransparentFogShader::uniform_ipvmat;
|
||||
|
||||
void TransparentFogShader::init()
|
||||
{
|
||||
Program = LoadProgram(file_manager->getAsset("shaders/transparent.vert").c_str(), file_manager->getAsset("shaders/transparentfog.frag").c_str());
|
||||
attrib_position = glGetAttribLocation(Program, "Position");
|
||||
attrib_texcoord = glGetAttribLocation(Program, "Texcoord");
|
||||
uniform_MVP = glGetUniformLocation(Program, "ModelViewProjectionMatrix");
|
||||
uniform_tex = glGetUniformLocation(Program, "tex");
|
||||
uniform_fogmax = glGetUniformLocation(Program, "fogmax");
|
||||
uniform_startH = glGetUniformLocation(Program, "startH");
|
||||
uniform_endH = glGetUniformLocation(Program, "endH");
|
||||
uniform_start = glGetUniformLocation(Program, "start");
|
||||
uniform_end = glGetUniformLocation(Program, "end");
|
||||
uniform_col = glGetUniformLocation(Program, "col");
|
||||
uniform_screen = glGetUniformLocation(Program, "screen");
|
||||
uniform_ipvmat = glGetUniformLocation(Program, "ipvmat");
|
||||
}
|
||||
|
||||
void TransparentFogShader::setUniforms(const core::matrix4 &ModelViewProjectionMatrix, const core::matrix4 &ipvmat, float fogmax, float startH, float endH, float start, float end, const core::vector3df &col, const core::vector3df &campos, unsigned TU_tex)
|
||||
{
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniform1f(uniform_fogmax, fogmax);
|
||||
glUniform1f(uniform_startH, startH);
|
||||
glUniform1f(uniform_endH, endH);
|
||||
glUniform1f(uniform_start, start);
|
||||
glUniform1f(uniform_end, end);
|
||||
glUniform3f(uniform_col, col.X, col.Y, col.Z);
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniformMatrix4fv(uniform_ipvmat, 1, GL_FALSE, ipvmat.pointer());
|
||||
glUniform1i(uniform_tex, TU_tex);
|
||||
}
|
||||
|
||||
GLuint BillboardShader::Program;
|
||||
GLuint BillboardShader::attrib_corner;
|
||||
@ -814,7 +843,6 @@ namespace MeshShader
|
||||
uniform_Position = glGetUniformLocation(Program, "Position");
|
||||
uniform_Size = glGetUniformLocation(Program, "Size");
|
||||
uniform_tex = glGetUniformLocation(Program, "tex");
|
||||
printf("TUTex is %d, Texcoord is %d\n", uniform_tex, attrib_texcoord);
|
||||
}
|
||||
|
||||
void BillboardShader::setUniforms(const core::matrix4 &ModelViewMatrix, const core::matrix4 &ProjectionMatrix, const core::vector3df &Position, const core::dimension2d<float> &size, unsigned TU_tex)
|
||||
@ -1180,7 +1208,6 @@ namespace FullScreenShader
|
||||
uniform_col = glGetUniformLocation(Program, "col");
|
||||
uniform_invproj = glGetUniformLocation(Program, "invproj");
|
||||
vao = createVAO(Program);
|
||||
printf("uniform %d\n", uniform_ntex);
|
||||
}
|
||||
|
||||
void SunLightShader::setUniforms(const core::vector3df &direction, const core::matrix4 &InvProjMatrix, float r, float g, float b, unsigned TU_ntex, unsigned TU_dtex)
|
||||
@ -1192,24 +1219,6 @@ namespace FullScreenShader
|
||||
glUniform1i(uniform_dtex, TU_dtex);
|
||||
}
|
||||
|
||||
GLuint LightBlendShader::Program;
|
||||
GLuint LightBlendShader::uniform_diffuse;
|
||||
GLuint LightBlendShader::uniform_specular;
|
||||
GLuint LightBlendShader::uniform_ambient_occlusion;
|
||||
GLuint LightBlendShader::uniform_specular_map;
|
||||
GLuint LightBlendShader::uniform_ambient;
|
||||
GLuint LightBlendShader::vao;
|
||||
void LightBlendShader::init()
|
||||
{
|
||||
Program = LoadProgram(file_manager->getAsset("shaders/screenquad.vert").c_str(), file_manager->getAsset("shaders/lightblend.frag").c_str());
|
||||
uniform_diffuse = glGetUniformLocation(Program, "diffuse");
|
||||
uniform_specular = glGetUniformLocation(Program, "specular");
|
||||
uniform_ambient_occlusion = glGetUniformLocation(Program, "ambient_occlusion");
|
||||
uniform_specular_map = glGetUniformLocation(Program, "specular_map");
|
||||
uniform_ambient = glGetUniformLocation(Program, "ambient");
|
||||
vao = createVAO(Program);
|
||||
}
|
||||
|
||||
GLuint Gaussian6HBlurShader::Program;
|
||||
GLuint Gaussian6HBlurShader::uniform_tex;
|
||||
GLuint Gaussian6HBlurShader::uniform_pixel;
|
||||
@ -1432,7 +1441,6 @@ namespace FullScreenShader
|
||||
GLuint FogShader::uniform_start;
|
||||
GLuint FogShader::uniform_end;
|
||||
GLuint FogShader::uniform_col;
|
||||
GLuint FogShader::uniform_campos;
|
||||
GLuint FogShader::uniform_ipvmat;
|
||||
GLuint FogShader::vao;
|
||||
|
||||
@ -1446,22 +1454,20 @@ namespace FullScreenShader
|
||||
uniform_start = glGetUniformLocation(Program, "start");
|
||||
uniform_end = glGetUniformLocation(Program, "end");
|
||||
uniform_col = glGetUniformLocation(Program, "col");
|
||||
uniform_campos = glGetUniformLocation(Program, "campos");
|
||||
uniform_ipvmat = glGetUniformLocation(Program, "ipvmat");
|
||||
vao = createVAO(Program);
|
||||
}
|
||||
|
||||
void FogShader::setUniforms(const core::matrix4 &ipvmat, float fogmax, float startH, float endH, float start, float end, const core::vector3df &col, const core::vector3df &campos, unsigned TU_ntex)
|
||||
void FogShader::setUniforms(const core::matrix4 &ipvmat, float fogmax, float startH, float endH, float start, float end, const core::vector3df &col, unsigned TU_ntex)
|
||||
{
|
||||
glUniform1f(FullScreenShader::FogShader::uniform_fogmax, fogmax);
|
||||
glUniform1f(FullScreenShader::FogShader::uniform_startH, startH);
|
||||
glUniform1f(FullScreenShader::FogShader::uniform_endH, endH);
|
||||
glUniform1f(FullScreenShader::FogShader::uniform_start, start);
|
||||
glUniform1f(FullScreenShader::FogShader::uniform_end, end);
|
||||
glUniform3f(FullScreenShader::FogShader::uniform_col, col.X, col.Y, col.Z);
|
||||
glUniform3f(FullScreenShader::FogShader::uniform_campos, campos.X, campos.Y, campos.Z);
|
||||
glUniformMatrix4fv(FullScreenShader::FogShader::uniform_ipvmat, 1, GL_FALSE, ipvmat.pointer());
|
||||
glUniform1i(FullScreenShader::FogShader::uniform_tex, TU_ntex);
|
||||
glUniform1f(uniform_fogmax, fogmax);
|
||||
glUniform1f(uniform_startH, startH);
|
||||
glUniform1f(uniform_endH, endH);
|
||||
glUniform1f(uniform_start, start);
|
||||
glUniform1f(uniform_end, end);
|
||||
glUniform3f(uniform_col, col.X, col.Y, col.Z);
|
||||
glUniformMatrix4fv(uniform_ipvmat, 1, GL_FALSE, ipvmat.pointer());
|
||||
glUniform1i(uniform_tex, TU_ntex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,6 +191,17 @@ public:
|
||||
static void setUniforms(const core::matrix4 &ModelViewProjectionMatrix, unsigned TU_tex);
|
||||
};
|
||||
|
||||
class TransparentFogShader
|
||||
{
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint attrib_position, attrib_texcoord;
|
||||
static GLuint uniform_MVP, uniform_tex, uniform_fogmax, uniform_startH, uniform_endH, uniform_start, uniform_end, uniform_col, uniform_screen, uniform_ipvmat;
|
||||
|
||||
static void init();
|
||||
static void setUniforms(const core::matrix4 &ModelViewProjectionMatrix, const core::matrix4 &ipvmat, float fogmax, float startH, float endH, float start, float end, const core::vector3df &col, const core::vector3df &campos, unsigned TU_tex);
|
||||
};
|
||||
|
||||
class BillboardShader
|
||||
{
|
||||
public:
|
||||
@ -341,16 +352,6 @@ public:
|
||||
static void setUniforms(const core::vector3df &direction, const core::matrix4 &InvProjMatrix, float r, float g, float b, unsigned TU_ntex, unsigned TU_dtex);
|
||||
};
|
||||
|
||||
class LightBlendShader
|
||||
{
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint uniform_diffuse, uniform_specular, uniform_ambient_occlusion, uniform_specular_map, uniform_ambient;
|
||||
static GLuint vao;
|
||||
|
||||
static void init();
|
||||
};
|
||||
|
||||
class Gaussian6HBlurShader
|
||||
{
|
||||
public:
|
||||
@ -427,11 +428,11 @@ class FogShader
|
||||
{
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint uniform_tex, uniform_fogmax, uniform_startH, uniform_endH, uniform_start, uniform_end, uniform_col, uniform_campos, uniform_ipvmat;
|
||||
static GLuint uniform_tex, uniform_fogmax, uniform_startH, uniform_endH, uniform_start, uniform_end, uniform_col, uniform_ipvmat;
|
||||
static GLuint vao;
|
||||
|
||||
static void init();
|
||||
static void setUniforms(const core::matrix4 &ipvmat, float fogmax, float startH, float endH, float start, float end, const core::vector3df &col, const core::vector3df &campos, unsigned TU_ntex);
|
||||
static void setUniforms(const core::matrix4 &ipvmat, float fogmax, float startH, float endH, float start, float end, const core::vector3df &col, unsigned TU_ntex);
|
||||
};
|
||||
|
||||
}
|
||||
@ -494,7 +495,6 @@ public:
|
||||
ACT(ES_MIPVIZ) \
|
||||
ACT(ES_COLORIZE) \
|
||||
ACT(ES_COLORIZE_REF) \
|
||||
ACT(ES_GLOW) \
|
||||
ACT(ES_OBJECT_UNLIT) \
|
||||
ACT(ES_OBJECTPASS) \
|
||||
ACT(ES_OBJECTPASS_REF) \
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <ISkinnedMesh.h>
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
|
||||
using namespace irr;
|
||||
|
||||
@ -30,7 +32,10 @@ void STKAnimatedMesh::drawTransparent(const GLMesh &mesh, video::E_MATERIAL_TYPE
|
||||
|
||||
computeMVP(ModelViewProjectionMatrix);
|
||||
|
||||
drawTransparentObject(mesh, ModelViewProjectionMatrix);
|
||||
if (World::getWorld()->getTrack()->isFogEnabled())
|
||||
drawTransparentFogObject(mesh, ModelViewProjectionMatrix);
|
||||
else
|
||||
drawTransparentObject(mesh, ModelViewProjectionMatrix);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -106,9 +111,8 @@ void STKAnimatedMesh::render()
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
os::Printer::log("Animated Mesh returned no mesh to render.", Mesh->getDebugName(), ELL_WARNING);
|
||||
#endif
|
||||
Log::error("animated mesh", "Animated Mesh returned no mesh to render.");
|
||||
return;
|
||||
}
|
||||
|
||||
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
|
||||
|
@ -1,10 +1,13 @@
|
||||
#include "stkmesh.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include <ISceneManager.h>
|
||||
#include <IMaterialRenderer.h>
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "utils/helpers.hpp"
|
||||
#include "graphics/camera.hpp"
|
||||
#include "modes/world.hpp"
|
||||
|
||||
|
||||
GLuint createVAO(GLuint vbo, GLuint idx, GLuint attrib_position, GLuint attrib_texcoord, GLuint attrib_second_texcoord, GLuint attrib_normal, GLuint attrib_tangent, GLuint attrib_bitangent, GLuint attrib_color, size_t stride)
|
||||
@ -222,18 +225,20 @@ void drawObjectPass1(const GLMesh &mesh, const core::matrix4 & ModelViewProjecti
|
||||
|
||||
void drawObjectRefPass1(const GLMesh &mesh, const core::matrix4 & ModelViewProjectionMatrix, const core::matrix4 &TransposeInverseModelView)
|
||||
{
|
||||
glDisable(GL_CULL_FACE);
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
glUseProgram(MeshShader::ObjectRefPass1Shader::Program);
|
||||
MeshShader::ObjectRefPass1Shader::setUniforms(ModelViewProjectionMatrix, TransposeInverseModelView, 0);
|
||||
|
||||
glBindVertexArray(mesh.vao_first_pass);
|
||||
glDrawElements(ptype, count, itype, 0);
|
||||
glEnable(GL_CULL_FACE);
|
||||
}
|
||||
|
||||
static
|
||||
@ -258,7 +263,7 @@ void drawGrassPass1(const GLMesh &mesh, const core::matrix4 & ModelViewProjectio
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
glUseProgram(MeshShader::GrassPass1Shader::Program);
|
||||
MeshShader::GrassPass1Shader::setUniforms(ModelViewProjectionMatrix, TransposeInverseModelView, windDir, 0);
|
||||
@ -274,7 +279,7 @@ void drawNormalPass(const GLMesh &mesh, const core::matrix4 & ModelViewProjectio
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
assert(mesh.textures[1]);
|
||||
setTexture(0, mesh.textures[1], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[1], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
glUseProgram(MeshShader::NormalMapShader::Program);
|
||||
MeshShader::NormalMapShader::setUniforms(ModelViewProjectionMatrix, TransposeInverseModelView, 0);
|
||||
@ -289,7 +294,7 @@ void drawSphereMap(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
glUseProgram(MeshShader::SphereMapShader::Program);
|
||||
MeshShader::SphereMapShader::setUniforms(ModelViewProjectionMatrix, TransposeInverseModelView, 0);
|
||||
@ -305,7 +310,7 @@ void drawSplatting(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
// Texlayout
|
||||
setTexture(0, mesh.textures[1], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[1], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -317,7 +322,7 @@ void drawSplatting(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
||||
}
|
||||
//Tex detail0
|
||||
setTexture(1, mesh.textures[2], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(1, mesh.textures[2], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -329,7 +334,7 @@ void drawSplatting(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
||||
}
|
||||
//Tex detail1
|
||||
setTexture(2, mesh.textures[3], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(2, mesh.textures[3], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -341,7 +346,7 @@ void drawSplatting(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
||||
}
|
||||
//Tex detail2
|
||||
setTexture(3, mesh.textures[4], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(3, mesh.textures[4], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -353,7 +358,7 @@ void drawSplatting(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
||||
}
|
||||
//Tex detail3
|
||||
setTexture(4, mesh.textures[5], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(4, mesh.textures[5], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -387,11 +392,12 @@ void drawSplatting(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
|
||||
void drawObjectRefPass2(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix)
|
||||
{
|
||||
glDisable(GL_CULL_FACE);
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -416,6 +422,7 @@ void drawObjectRefPass2(const GLMesh &mesh, const core::matrix4 &ModelViewProjec
|
||||
|
||||
glBindVertexArray(mesh.vao_second_pass);
|
||||
glDrawElements(ptype, count, itype, 0);
|
||||
glEnable(GL_CULL_FACE);
|
||||
}
|
||||
|
||||
void drawGrassPass2(const GLMesh &mesh, const core::matrix4 & ModelViewProjectionMatrix, core::vector3df windDir)
|
||||
@ -424,7 +431,7 @@ void drawGrassPass2(const GLMesh &mesh, const core::matrix4 & ModelViewProjectio
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -480,7 +487,7 @@ void drawObjectRimLimit(const GLMesh &mesh, const core::matrix4 &ModelViewProjec
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = { GL_ONE, GL_ONE, GL_ONE, GL_ALPHA };
|
||||
@ -514,7 +521,7 @@ void drawObjectUnlit(const GLMesh &mesh, const core::matrix4 &ModelViewProjectio
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = { GL_ONE, GL_ONE, GL_ONE, GL_ALPHA };
|
||||
@ -540,7 +547,7 @@ void drawDetailledObjectPass2(const GLMesh &mesh, const core::matrix4 &ModelView
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = {GL_ONE, GL_ONE, GL_ONE, GL_ALPHA};
|
||||
@ -552,7 +559,7 @@ void drawDetailledObjectPass2(const GLMesh &mesh, const core::matrix4 &ModelView
|
||||
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
||||
}
|
||||
|
||||
setTexture(1, mesh.textures[1], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(1, mesh.textures[1], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
setTexture(2, static_cast<irr::video::COpenGLTexture*>(irr_driver->getRTT(RTT_TMP1))->getOpenGLTextureName(), GL_NEAREST, GL_NEAREST);
|
||||
setTexture(3, static_cast<irr::video::COpenGLTexture*>(irr_driver->getRTT(RTT_TMP2))->getOpenGLTextureName(), GL_NEAREST, GL_NEAREST);
|
||||
@ -576,7 +583,7 @@ void drawObjectPass2(const GLMesh &mesh, const core::matrix4 &ModelViewProjectio
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
if (irr_driver->getLightViz())
|
||||
{
|
||||
GLint swizzleMask[] = { GL_ONE, GL_ONE, GL_ONE, GL_ALPHA };
|
||||
@ -610,7 +617,7 @@ void drawTransparentObject(const GLMesh &mesh, const core::matrix4 &ModelViewPro
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
glUseProgram(MeshShader::TransparentShader::Program);
|
||||
MeshShader::TransparentShader::setUniforms(ModelViewProjectionMatrix, 0);
|
||||
@ -619,6 +626,35 @@ void drawTransparentObject(const GLMesh &mesh, const core::matrix4 &ModelViewPro
|
||||
glDrawElements(ptype, count, itype, 0);
|
||||
}
|
||||
|
||||
void drawTransparentFogObject(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix)
|
||||
{
|
||||
GLenum ptype = mesh.PrimitiveType;
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
const Track * const track = World::getWorld()->getTrack();
|
||||
|
||||
// This function is only called once per frame - thus no need for setters.
|
||||
const float fogmax = track->getFogMax();
|
||||
const float startH = track->getFogStartHeight();
|
||||
const float endH = track->getFogEndHeight();
|
||||
const float start = track->getFogStart();
|
||||
const float end = track->getFogEnd();
|
||||
const video::SColor tmpcol = track->getFogColor();
|
||||
|
||||
core::vector3df col(tmpcol.getRed() / 255.0f,
|
||||
tmpcol.getGreen() / 255.0f,
|
||||
tmpcol.getBlue() / 255.0f);
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
glUseProgram(MeshShader::TransparentFogShader::Program);
|
||||
MeshShader::TransparentFogShader::setUniforms(ModelViewProjectionMatrix, irr_driver->getInvProjMatrix(), fogmax, startH, endH, start, end, col, Camera::getCamera(0)->getCameraSceneNode()->getAbsolutePosition(), 0);
|
||||
|
||||
glBindVertexArray(mesh.vao_first_pass);
|
||||
glDrawElements(ptype, count, itype, 0);
|
||||
}
|
||||
|
||||
void drawBubble(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix)
|
||||
{
|
||||
const float time = irr_driver->getDevice()->getTimer()->getTime() / 1000.0f;
|
||||
@ -628,7 +664,7 @@ void drawBubble(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatr
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR);
|
||||
setTexture(0, mesh.textures[0], GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
glUseProgram(MeshShader::BubbleShader::Program);
|
||||
MeshShader::BubbleShader::setUniforms(ModelViewProjectionMatrix, 0, time, transparency);
|
||||
@ -664,7 +700,7 @@ void STKMesh::drawDisplace(const GLMesh &mesh)
|
||||
computeMVP(ModelViewProjectionMatrix);
|
||||
core::matrix4 ModelViewMatrix = irr_driver->getVideoDriver()->getTransform(video::ETS_VIEW);
|
||||
ModelViewMatrix *= irr_driver->getVideoDriver()->getTransform(video::ETS_WORLD);
|
||||
setTexture(0, static_cast<irr::video::COpenGLTexture*>(irr_driver->getTexture(FileManager::TEXTURE, "displace.png"))->getOpenGLTextureName(), GL_LINEAR, GL_LINEAR);
|
||||
setTexture(0, static_cast<irr::video::COpenGLTexture*>(irr_driver->getTexture(FileManager::TEXTURE, "displace.png"))->getOpenGLTextureName(), GL_LINEAR, GL_LINEAR, true);
|
||||
glUseProgram(MeshShader::DisplaceShader::Program);
|
||||
MeshShader::DisplaceShader::setUniforms(ModelViewProjectionMatrix, ModelViewMatrix, cb->getDirX(), cb->getDirY(), cb->getDir2X(), cb->getDir2Y(), 0);
|
||||
|
||||
@ -678,8 +714,10 @@ void STKMesh::drawTransparent(const GLMesh &mesh, video::E_MATERIAL_TYPE type)
|
||||
|
||||
computeMVP(ModelViewProjectionMatrix);
|
||||
|
||||
if (type == irr_driver->getShader(ES_BUBBLES))
|
||||
drawBubble(mesh, ModelViewProjectionMatrix);
|
||||
if (type == irr_driver->getShader(ES_BUBBLES))
|
||||
drawBubble(mesh, ModelViewProjectionMatrix);
|
||||
else if (World::getWorld()->getTrack()->isFogEnabled())
|
||||
drawTransparentFogObject(mesh, ModelViewProjectionMatrix);
|
||||
else
|
||||
drawTransparentObject(mesh, ModelViewProjectionMatrix);
|
||||
return;
|
||||
@ -856,6 +894,11 @@ void initvaostate(GLMesh &mesh, video::E_MATERIAL_TYPE type)
|
||||
mesh.vao_first_pass = createVAO(mesh.vertex_buffer, mesh.index_buffer,
|
||||
MeshShader::BubbleShader::attrib_position, MeshShader::BubbleShader::attrib_texcoord, -1, -1, -1, -1, -1, mesh.Stride);
|
||||
}
|
||||
else if (World::getWorld()->getTrack()->isFogEnabled())
|
||||
{
|
||||
mesh.vao_first_pass = createVAO(mesh.vertex_buffer, mesh.index_buffer,
|
||||
MeshShader::TransparentFogShader::attrib_position, MeshShader::TransparentFogShader::attrib_texcoord, -1, -1, -1, -1, -1, mesh.Stride);
|
||||
}
|
||||
else
|
||||
{
|
||||
mesh.vao_first_pass = createVAO(mesh.vertex_buffer, mesh.index_buffer,
|
||||
|
@ -47,6 +47,7 @@ void drawObjectUnlit(const GLMesh &mesh, const core::matrix4 &ModelViewProjectio
|
||||
|
||||
// Forward pass (for transparents meshes)
|
||||
void drawTransparentObject(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix);
|
||||
void drawTransparentFogObject(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix);
|
||||
void drawBubble(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionMatrix);
|
||||
|
||||
class STKMesh : public irr::scene::CMeshSceneNode
|
||||
|
@ -105,7 +105,7 @@ void ArenasScreen::beforeAddingWidget()
|
||||
|
||||
DynamicRibbonWidget* tracks_widget = this->getWidget<DynamicRibbonWidget>("tracks");
|
||||
assert( tracks_widget != NULL );
|
||||
tracks_widget->setItemCountHint(num_of_arenas); //set the item hint to that number to prevent weird formatting
|
||||
tracks_widget->setItemCountHint(num_of_arenas+1); //set the item hint to that number to prevent weird formatting
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -174,7 +174,7 @@ void EasterEggScreen::beforeAddingWidget()
|
||||
|
||||
DynamicRibbonWidget* tracks_widget = this->getWidget<DynamicRibbonWidget>("tracks");
|
||||
assert( tracks_widget != NULL );
|
||||
tracks_widget->setItemCountHint(num_of_arenas); //set the item hint to that number to prevent weird formatting
|
||||
tracks_widget->setItemCountHint(num_of_arenas+1); //set the item hint to that number to prevent weird formatting
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -484,6 +484,15 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
||||
gui::ScalableFont* font = GUIEngine::getTitleFont();
|
||||
font->draw(gp->getName(), pos, video::SColor(255,255,255,255),
|
||||
false, true /* vcenter */, NULL);
|
||||
|
||||
core::rect<s32> pos(15,
|
||||
20 + GUIEngine::getTitleFontHeight(),
|
||||
15 + UserConfigParams::m_width/2,
|
||||
20 + 2*GUIEngine::getTitleFontHeight());
|
||||
|
||||
//just below GP name
|
||||
font->draw(_("Type: Grand Prix"), pos, video::SColor(255,255,255,255),
|
||||
false, true /* vcenter */, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -190,7 +190,7 @@ void TracksScreen::beforeAddingWidget()
|
||||
|
||||
DynamicRibbonWidget* tracks_widget = this->getWidget<DynamicRibbonWidget>("tracks");
|
||||
assert( tracks_widget != NULL );
|
||||
tracks_widget->setItemCountHint( track_manager->getNumberOfTracks() );
|
||||
tracks_widget->setItemCountHint( track_manager->getNumberOfTracks()+1 );
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user