Fixed compiler warnings.
This commit is contained in:
parent
5182cdb18b
commit
481b5f22bb
@ -427,26 +427,26 @@ float &tex_center_pos_x, float &tex_center_pos_y
|
||||
irr_driver->getVideoDriver()->getCurrentRenderTargetSize();
|
||||
const int screen_w = frame_size.Width;
|
||||
const int screen_h = frame_size.Height;
|
||||
center_pos_x = destRect.UpperLeftCorner.X + destRect.LowerRightCorner.X;
|
||||
center_pos_x = float(destRect.UpperLeftCorner.X + destRect.LowerRightCorner.X);
|
||||
center_pos_x /= screen_w;
|
||||
center_pos_x -= 1.;
|
||||
center_pos_y = destRect.UpperLeftCorner.Y + destRect.LowerRightCorner.Y;
|
||||
center_pos_y = float(destRect.UpperLeftCorner.Y + destRect.LowerRightCorner.Y);
|
||||
center_pos_y /= screen_h;
|
||||
center_pos_y = 1. - center_pos_y;
|
||||
width = destRect.LowerRightCorner.X - destRect.UpperLeftCorner.X;
|
||||
center_pos_y = float(1.f - center_pos_y);
|
||||
width = float(destRect.LowerRightCorner.X - destRect.UpperLeftCorner.X);
|
||||
width /= screen_w;
|
||||
height = destRect.LowerRightCorner.Y - destRect.UpperLeftCorner.Y;
|
||||
height = float(destRect.LowerRightCorner.Y - destRect.UpperLeftCorner.Y);
|
||||
height /= screen_h;
|
||||
|
||||
const core::dimension2d<u32>& ss = texture->getOriginalSize();
|
||||
tex_center_pos_x = sourceRect.UpperLeftCorner.X + sourceRect.LowerRightCorner.X;
|
||||
tex_center_pos_x /= ss.Width * 2.;
|
||||
tex_center_pos_y = sourceRect.UpperLeftCorner.Y + sourceRect.LowerRightCorner.Y;
|
||||
tex_center_pos_y /= ss.Height * 2.;
|
||||
tex_width = sourceRect.LowerRightCorner.X - sourceRect.UpperLeftCorner.X;
|
||||
tex_width /= ss.Width * 2.;
|
||||
tex_height = sourceRect.LowerRightCorner.Y - sourceRect.UpperLeftCorner.Y;
|
||||
tex_height /= ss.Height * 2.;
|
||||
tex_center_pos_x = float(sourceRect.UpperLeftCorner.X + sourceRect.LowerRightCorner.X);
|
||||
tex_center_pos_x /= ss.Width * 2.f;
|
||||
tex_center_pos_y = float(sourceRect.UpperLeftCorner.Y + sourceRect.LowerRightCorner.Y);
|
||||
tex_center_pos_y /= ss.Height * 2.f;
|
||||
tex_width = float(sourceRect.LowerRightCorner.X - sourceRect.UpperLeftCorner.X);
|
||||
tex_width /= ss.Width * 2.f;
|
||||
tex_height = float(sourceRect.LowerRightCorner.Y - sourceRect.UpperLeftCorner.Y);
|
||||
tex_height /= ss.Height * 2.f;
|
||||
|
||||
if (texture->isRenderTarget())
|
||||
{
|
||||
@ -590,15 +590,15 @@ void GL32_draw2DRectangle(video::SColor color, const core::rect<s32>& position,
|
||||
irr_driver->getVideoDriver()->getCurrentRenderTargetSize();
|
||||
const int screen_w = frame_size.Width;
|
||||
const int screen_h = frame_size.Height;
|
||||
float center_pos_x = position.UpperLeftCorner.X + position.LowerRightCorner.X;
|
||||
float center_pos_x = float(position.UpperLeftCorner.X + position.LowerRightCorner.X);
|
||||
center_pos_x /= screen_w;
|
||||
center_pos_x -= 1;
|
||||
float center_pos_y = position.UpperLeftCorner.Y + position.LowerRightCorner.Y;
|
||||
float center_pos_y = float(position.UpperLeftCorner.Y + position.LowerRightCorner.Y);
|
||||
center_pos_y /= screen_h;
|
||||
center_pos_y = 1 - center_pos_y;
|
||||
float width = position.LowerRightCorner.X - position.UpperLeftCorner.X;
|
||||
float width = float(position.LowerRightCorner.X - position.UpperLeftCorner.X);
|
||||
width /= screen_w;
|
||||
float height = position.LowerRightCorner.Y - position.UpperLeftCorner.Y;
|
||||
float height = float(position.LowerRightCorner.Y - position.UpperLeftCorner.Y);
|
||||
height /= screen_h;
|
||||
|
||||
if (color.getAlpha() < 255)
|
||||
|
@ -651,14 +651,15 @@ void ParticleEmitter::setParticleType(const ParticleKind* type)
|
||||
else
|
||||
{
|
||||
video::SColor color_from = type->getMinColor();
|
||||
core::vector3df color_from_v = core::vector3df(color_from.getRed(),
|
||||
color_from.getGreen(),
|
||||
color_from.getBlue());
|
||||
core::vector3df color_from_v =
|
||||
core::vector3df(float(color_from.getRed()),
|
||||
float(color_from.getGreen()),
|
||||
float(color_from.getBlue()));
|
||||
|
||||
video::SColor color_to = type->getMaxColor();
|
||||
core::vector3df color_to_v = core::vector3df(color_to.getRed(),
|
||||
color_to.getGreen(),
|
||||
color_to.getBlue());
|
||||
core::vector3df color_to_v = core::vector3df(float(color_to.getRed()),
|
||||
float(color_to.getGreen()),
|
||||
float(color_to.getBlue()));
|
||||
|
||||
ColorAffector* affector = new ColorAffector(color_from_v, color_to_v);
|
||||
m_node->addAffector(affector);
|
||||
|
@ -309,7 +309,7 @@ void PostProcessing::renderShadowedSunlight(const std::vector<core::matrix4> &su
|
||||
|
||||
void PostProcessing::renderGaussian3Blur(GLuint in_fbo, GLuint in_tex, GLuint tmp_fbo, GLuint tmp_tex, size_t width, size_t height)
|
||||
{
|
||||
float inv_width = 1. / width, inv_height = 1. / height;
|
||||
float inv_width = 1.0f / width, inv_height = 1.0f / height;
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, tmp_fbo);
|
||||
glUseProgram(FullScreenShader::Gaussian3VBlurShader::Program);
|
||||
@ -342,7 +342,7 @@ void PostProcessing::renderGaussian3Blur(GLuint in_fbo, GLuint in_tex, GLuint tm
|
||||
|
||||
void PostProcessing::renderGaussian6Blur(GLuint in_fbo, GLuint in_tex, GLuint tmp_fbo, GLuint tmp_tex, size_t width, size_t height)
|
||||
{
|
||||
float inv_width = 1. / width, inv_height = 1. / height;
|
||||
float inv_width = 1.f / width, inv_height = 1.f / height;
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, tmp_fbo);
|
||||
glUseProgram(FullScreenShader::Gaussian6VBlurShader::Program);
|
||||
@ -489,7 +489,10 @@ void PostProcessing::renderMotionBlur(unsigned cam, GLuint in_rtt, GLuint out_fb
|
||||
setTexture(0, in_rtt, GL_NEAREST, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
FullScreenShader::MotionBlurShader::setUniforms(cb->getBoostTime(cam), cb->getCenter(cam), cb->getDirection(cam), 0.15, cb->getMaxHeight(cam) * 0.7, 0);
|
||||
FullScreenShader::MotionBlurShader
|
||||
::setUniforms(cb->getBoostTime(cam), cb->getCenter(cam),
|
||||
cb->getDirection(cam), 0.15f,
|
||||
cb->getMaxHeight(cam) * 0.7f, 0);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
}
|
||||
|
@ -432,7 +432,8 @@ void IrrDriver::renderSolidSecondPass()
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_rtts->getFBO(FBO_COLORS));
|
||||
SColor clearColor = World::getWorld()->getClearColor();
|
||||
glClearColor(clearColor.getRed() / 255., clearColor.getGreen() / 255., clearColor.getBlue() / 255., clearColor.getAlpha() / 255.);
|
||||
glClearColor(clearColor.getRed() / 255.f, clearColor.getGreen() / 255.f,
|
||||
clearColor.getBlue() / 255.f, clearColor.getAlpha() / 255.f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glDepthMask(GL_FALSE);
|
||||
|
||||
@ -763,7 +764,12 @@ static void renderPointLights(unsigned count)
|
||||
|
||||
setTexture(0, irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH), GL_NEAREST, GL_NEAREST);
|
||||
setTexture(1, irr_driver->getDepthStencilTexture(), GL_NEAREST, GL_NEAREST);
|
||||
LightShader::PointLightShader::setUniforms(irr_driver->getViewMatrix(), irr_driver->getProjMatrix(), irr_driver->getInvProjMatrix(), core::vector2df(UserConfigParams::m_width, UserConfigParams::m_height), 200, 0, 1);
|
||||
LightShader::PointLightShader
|
||||
::setUniforms(irr_driver->getViewMatrix(), irr_driver->getProjMatrix(),
|
||||
irr_driver->getInvProjMatrix(),
|
||||
core::vector2df(float(UserConfigParams::m_width),
|
||||
float(UserConfigParams::m_height) ),
|
||||
200, 0, 1);
|
||||
|
||||
glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, count);
|
||||
}
|
||||
@ -916,21 +922,21 @@ static void getYml(GLenum face, size_t width, size_t height,
|
||||
for (unsigned j = 0; j < height; j++)
|
||||
{
|
||||
float x, y, z;
|
||||
float fi = i, fj = j;
|
||||
float fi = float(i), fj = float(j);
|
||||
fi /= width, fj /= height;
|
||||
fi = 2 * fi - 1, fj = 2 * fj - 1;
|
||||
getXYZ(face, fi, fj, x, y, z);
|
||||
|
||||
// constant part of Ylm
|
||||
float c00 = 0.282095;
|
||||
float c1minus1 = 0.488603;
|
||||
float c10 = 0.488603;
|
||||
float c11 = 0.488603;
|
||||
float c2minus2 = 1.092548;
|
||||
float c2minus1 = 1.092548;
|
||||
float c21 = 1.092548;
|
||||
float c20 = 0.315392;
|
||||
float c22 = 0.546274;
|
||||
float c00 = 0.282095f;
|
||||
float c1minus1 = 0.488603f;
|
||||
float c10 = 0.488603f;
|
||||
float c11 = 0.488603f;
|
||||
float c2minus2 = 1.092548f;
|
||||
float c2minus1 = 1.092548f;
|
||||
float c21 = 1.092548f;
|
||||
float c20 = 0.315392f;
|
||||
float c22 = 0.546274f;
|
||||
|
||||
size_t idx = i * height + j;
|
||||
|
||||
@ -957,7 +963,7 @@ static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height,
|
||||
reconstructedVal += Y1minus1[i * height + j] * Coeff[1] + Y10[i * height + j] * Coeff[2] + Y11[i * height + j] * Coeff[3];
|
||||
reconstructedVal += Y2minus2[idx] * Coeff[4] + Y2minus1[idx] * Coeff[5] + Y20[idx] * Coeff[6] + Y21[idx] * Coeff[7] + Y22[idx] * Coeff[8];
|
||||
reconstructedVal /= solidangle;
|
||||
return MAX2(255 * reconstructedVal, 0.);
|
||||
return MAX2(255.0f * reconstructedVal, 0.f);
|
||||
}
|
||||
|
||||
static void unprojectSH(float *output[], size_t width, size_t height,
|
||||
@ -972,7 +978,7 @@ static void unprojectSH(float *output[], size_t width, size_t height,
|
||||
{
|
||||
for (unsigned j = 0; j < height; j++)
|
||||
{
|
||||
float fi = i, fj = j;
|
||||
float fi = float(i), fj = float(j);
|
||||
fi /= width, fj /= height;
|
||||
fi = 2 * fi - 1, fj = 2 * fj - 1;
|
||||
|
||||
@ -1003,7 +1009,7 @@ static void projectSH(float *color[], size_t width, size_t height,
|
||||
greenSHCoeff[i] = 0;
|
||||
redSHCoeff[i] = 0;
|
||||
}
|
||||
float wh = width * height;
|
||||
float wh = float(width * height);
|
||||
for (unsigned face = 0; face < 6; face++)
|
||||
{
|
||||
for (unsigned i = 0; i < width; i++)
|
||||
@ -1011,7 +1017,7 @@ static void projectSH(float *color[], size_t width, size_t height,
|
||||
for (unsigned j = 0; j < height; j++)
|
||||
{
|
||||
size_t idx = i * height + j;
|
||||
float fi = i, fj = j;
|
||||
float fi = float(i), fj = float(j);
|
||||
fi /= width, fj /= height;
|
||||
fi = 2 * fi - 1, fj = 2 * fj - 1;
|
||||
|
||||
@ -1019,11 +1025,11 @@ static void projectSH(float *color[], size_t width, size_t height,
|
||||
float d = sqrt(fi * fi + fj * fj + 1);
|
||||
|
||||
// Constant obtained by projecting unprojected ref values
|
||||
float solidangle = 2.75 / (wh * pow(d, 1.5f));
|
||||
float solidangle = 2.75f / (wh * pow(d, 1.5f));
|
||||
// pow(., 2.2) to convert from srgb
|
||||
float b = pow(color[face][4 * height * i + 4 * j] / 255., 2.2);
|
||||
float g = pow(color[face][4 * height * i + 4 * j + 1] / 255., 2.2);
|
||||
float r = pow(color[face][4 * height * i + 4 * j + 2] / 255., 2.2);
|
||||
float b = pow(color[face][4 * height * i + 4 * j ] / 255.f, 2.2f);
|
||||
float g = pow(color[face][4 * height * i + 4 * j + 1] / 255.f, 2.2f);
|
||||
float r = pow(color[face][4 * height * i + 4 * j + 2] / 255.f, 2.2f);
|
||||
|
||||
assert(b >= 0.);
|
||||
|
||||
@ -1089,9 +1095,9 @@ static void testSH(char *color[6], size_t width, size_t height,
|
||||
testoutput[i] = new float[width * height * 4];
|
||||
for (unsigned j = 0; j < width * height; j++)
|
||||
{
|
||||
testoutput[i][4 * j] = 0xFF & color[i][4 * j];
|
||||
testoutput[i][4 * j + 1] = 0xFF & color[i][4 * j + 1];
|
||||
testoutput[i][4 * j + 2] = 0xFF & color[i][4 * j + 2];
|
||||
testoutput[i][4 * j ] = float(0xFF & color[i][4 * j]);
|
||||
testoutput[i][4 * j + 1] = float(0xFF & color[i][4 * j + 1]);
|
||||
testoutput[i][4 * j + 2] = float(0xFF & color[i][4 * j + 2]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1187,9 +1193,9 @@ static void testSH(char *color[6], size_t width, size_t height,
|
||||
{
|
||||
for (unsigned j = 0; j < width * height; j++)
|
||||
{
|
||||
color[i][4 * j] = MIN2(testoutput[i][4 * j], 255);
|
||||
color[i][4 * j + 1] = MIN2(testoutput[i][4 * j + 1], 255);
|
||||
color[i][4 * j + 2] = MIN2(testoutput[i][4 * j + 2], 255);
|
||||
color[i][4 * j ] = char(MIN2(testoutput[i][4 * j], 255));
|
||||
color[i][4 * j + 1] = char(MIN2(testoutput[i][4 * j + 1], 255));
|
||||
color[i][4 * j + 2] = char(MIN2(testoutput[i][4 * j + 2], 255));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1212,8 +1218,8 @@ void IrrDriver::generateSkyboxCubemap()
|
||||
GLint w = 0, h = 0;
|
||||
for (unsigned i = 0; i < 6; i++)
|
||||
{
|
||||
w = MAX2(w, SkyboxTextures[i]->getOriginalSize().Width);
|
||||
h = MAX2(h, SkyboxTextures[i]->getOriginalSize().Height);
|
||||
w = MAX2(unsigned int(w), SkyboxTextures[i]->getOriginalSize().Width);
|
||||
h = MAX2(unsigned int(h), SkyboxTextures[i]->getOriginalSize().Height);
|
||||
}
|
||||
|
||||
const unsigned texture_permutation[] = { 2, 3, 0, 1, 5, 4 };
|
||||
@ -1279,7 +1285,9 @@ void IrrDriver::renderSkybox()
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glUseProgram(MeshShader::SkyboxShader::Program);
|
||||
MeshShader::SkyboxShader::setUniforms(transform, invtransform, core::vector2df(UserConfigParams::m_width, UserConfigParams::m_height), 0);
|
||||
MeshShader::SkyboxShader::setUniforms(transform, invtransform,
|
||||
core::vector2df(float(UserConfigParams::m_width),
|
||||
float(UserConfigParams::m_height)), 0);
|
||||
glDrawElements(GL_TRIANGLES, 6 * 6, GL_UNSIGNED_INT, 0);
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ namespace MeshShader
|
||||
{
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniformMatrix4fv(uniform_TM, 1, GL_FALSE, TextureMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -722,7 +722,7 @@ namespace MeshShader
|
||||
{
|
||||
glUniformMatrix4fv(uniform_VP, 1, GL_FALSE, ViewProjectionMatrix.pointer());
|
||||
glUniformMatrix4fv(uniform_TM, 1, GL_FALSE, TextureMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -773,7 +773,7 @@ namespace MeshShader
|
||||
{
|
||||
glUniformMatrix4fv(uniform_VP, 1, GL_FALSE, ViewProjectionMatrix.pointer());
|
||||
glUniformMatrix4fv(uniform_TM, 1, GL_FALSE, TextureMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -820,7 +820,7 @@ namespace MeshShader
|
||||
void DetailledObjectPass2Shader::setUniforms(const core::matrix4 &ModelViewProjectionMatrix)
|
||||
{
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -895,7 +895,7 @@ namespace MeshShader
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniformMatrix4fv(uniform_TIMV, 1, GL_FALSE, TransposeInverseModelView.pointer());
|
||||
glUniformMatrix4fv(uniform_TM, 1, GL_FALSE, TextureMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -932,7 +932,7 @@ namespace MeshShader
|
||||
void UntexturedObjectShader::setUniforms(const core::matrix4 &ModelViewProjectionMatrix)
|
||||
{
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -978,7 +978,7 @@ namespace MeshShader
|
||||
{
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniformMatrix4fv(uniform_TM, 1, GL_FALSE, TextureMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -1023,7 +1023,7 @@ namespace MeshShader
|
||||
void GrassPass2Shader::setUniforms(const core::matrix4 &ModelViewProjectionMatrix, const core::vector3df &windDirection)
|
||||
{
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
glUniform3f(uniform_windDir, windDirection.X, windDirection.Y, windDirection.Z);
|
||||
@ -1090,7 +1090,7 @@ namespace MeshShader
|
||||
glUniformMatrix4fv(uniform_VP, 1, GL_FALSE, ViewProjectionMatrix.pointer());
|
||||
glUniformMatrix4fv(uniform_invproj, 1, GL_FALSE, invproj.pointer());
|
||||
glUniformMatrix4fv(uniform_IVM, 1, GL_FALSE, InverseViewMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
glUniform3f(uniform_SunDir, SunDir.X, SunDir.Y, SunDir.Z);
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
@ -1189,7 +1189,7 @@ namespace MeshShader
|
||||
void SplattingShader::setUniforms(const core::matrix4 &ModelViewProjectionMatrix)
|
||||
{
|
||||
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
|
||||
glUniform2f(uniform_screen, UserConfigParams::m_width, UserConfigParams::m_height);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
const video::SColorf s = irr_driver->getSceneManager()->getAmbientLight();
|
||||
glUniform3f(uniform_ambient, s.r, s.g, s.b);
|
||||
}
|
||||
@ -1348,7 +1348,7 @@ namespace MeshShader
|
||||
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);
|
||||
glUniform2f(uniform_screen, float(UserConfigParams::m_width), float(UserConfigParams::m_height));
|
||||
glUniformMatrix4fv(uniform_ipvmat, 1, GL_FALSE, ipvmat.pointer());
|
||||
glUniform1i(uniform_tex, TU_tex);
|
||||
}
|
||||
@ -2496,7 +2496,7 @@ namespace FullScreenShader
|
||||
|
||||
void GodFadeShader::setUniforms(const SColor &col, unsigned TU_tex)
|
||||
{
|
||||
glUniform3f(uniform_col, col.getRed() / 255., col.getGreen() / 255., col.getBlue() / 255.);
|
||||
glUniform3f(uniform_col, col.getRed() / 255.f, col.getGreen() / 255.f, col.getBlue() / 255.f);
|
||||
glUniform1i(uniform_tex, TU_tex);
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,10 @@ void drawSphereMap(const GLMesh &mesh, const core::matrix4 &ModelViewProjectionM
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
}
|
||||
|
||||
MeshShader::SphereMapShader::setUniforms(ModelViewProjectionMatrix, irr_driver->getViewMatrix().getTransposed(), TransposeInverseModelView, irr_driver->getInvProjMatrix(), core::vector2df(UserConfigParams::m_width, UserConfigParams::m_height));
|
||||
MeshShader::SphereMapShader
|
||||
::setUniforms(ModelViewProjectionMatrix, irr_driver->getViewMatrix().getTransposed(),
|
||||
TransposeInverseModelView, irr_driver->getInvProjMatrix(),
|
||||
core::vector2df(float(UserConfigParams::m_width), float(UserConfigParams::m_height)));
|
||||
|
||||
assert(mesh.vao_second_pass);
|
||||
glBindVertexArray(mesh.vao_second_pass);
|
||||
@ -441,7 +444,9 @@ void drawCaustics(const GLMesh &mesh, const core::matrix4 & ModelViewProjectionM
|
||||
CausticTex = irr_driver->getTexture(file_manager->getAsset("textures/caustics.png").c_str());
|
||||
setTexture(MeshShader::CausticsShader::TU_caustictex, getTextureGLuint(CausticTex), GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
MeshShader::CausticsShader::setUniforms(ModelViewProjectionMatrix, dir, dir2, core::vector2df(UserConfigParams::m_width, UserConfigParams::m_height));
|
||||
MeshShader::CausticsShader::setUniforms(ModelViewProjectionMatrix, dir, dir2,
|
||||
core::vector2df(float(UserConfigParams::m_width),
|
||||
float(UserConfigParams::m_height)));
|
||||
|
||||
assert(mesh.vao_second_pass);
|
||||
glBindVertexArray(mesh.vao_second_pass);
|
||||
|
@ -164,7 +164,12 @@ void STKMeshSceneNode::drawDisplace(const GLMesh &mesh)
|
||||
setTexture(1, irr_driver->getRenderTargetTexture(RTT_TMP4), GL_LINEAR, GL_LINEAR, true);
|
||||
setTexture(2, irr_driver->getRenderTargetTexture(RTT_COLOR), GL_LINEAR, GL_LINEAR, true);
|
||||
glUseProgram(MeshShader::DisplaceShader::Program);
|
||||
MeshShader::DisplaceShader::setUniforms(ModelViewProjectionMatrix, ModelViewMatrix, core::vector2df(cb->getDirX(), cb->getDirY()), core::vector2df(cb->getDir2X(), cb->getDir2Y()), core::vector2df(UserConfigParams::m_width, UserConfigParams::m_height), 0, 1, 2);
|
||||
MeshShader::DisplaceShader::setUniforms(ModelViewProjectionMatrix, ModelViewMatrix,
|
||||
core::vector2df(cb->getDirX(), cb->getDirY()),
|
||||
core::vector2df(cb->getDir2X(), cb->getDir2Y()),
|
||||
core::vector2df(float(UserConfigParams::m_width),
|
||||
float(UserConfigParams::m_height)),
|
||||
0, 1, 2);
|
||||
|
||||
assert(mesh.vao_displace_pass);
|
||||
glBindVertexArray(mesh.vao_displace_pass);
|
||||
|
Loading…
Reference in New Issue
Block a user