Fix up whitespace in shaders.cpp

This commit is contained in:
Stephen Just 2014-05-19 09:59:13 -06:00
parent f4992b80fc
commit 0167e6d95a

View File

@ -104,43 +104,43 @@ static void initCubeVBO()
{
// From CSkyBoxSceneNode
float corners[] =
{
// top side
1., 1., -1.,
1., 1., 1.,
-1., 1., 1.,
-1., 1., -1.,
{
// top side
1., 1., -1.,
1., 1., 1.,
-1., 1., 1.,
-1., 1., -1.,
// Bottom side
1., -1., 1.,
1., -1., -1.,
-1., -1., -1.,
-1., -1., 1.,
// Bottom side
1., -1., 1.,
1., -1., -1.,
-1., -1., -1.,
-1., -1., 1.,
// right side
1., -1, -1,
1., -1, 1,
1., 1., 1.,
1., 1., -1.,
// right side
1., -1, -1,
1., -1, 1,
1., 1., 1.,
1., 1., -1.,
// left side
-1., -1., 1.,
-1., -1., -1.,
-1., 1., -1.,
-1., 1., 1.,
// left side
-1., -1., 1.,
-1., -1., -1.,
-1., 1., -1.,
-1., 1., 1.,
// back side
-1., -1., -1.,
1., -1, -1.,
1, 1, -1.,
-1, 1, -1.,
// back side
-1., -1., -1.,
1., -1, -1.,
1, 1, -1.,
-1, 1, -1.,
// front side
1., -1., 1.,
-1., -1., 1.,
-1, 1., 1.,
1., 1., 1.,
};
// front side
1., -1., 1.,
-1., -1., 1.,
-1, 1., 1.,
1., 1., 1.,
};
int indices[] = {
0, 1, 2, 2, 3, 0,
4, 5, 6, 6, 7, 4,
@ -188,38 +188,38 @@ void Shaders::loadShaders()
m_shaders[ES_NORMAL_MAP_LIGHTMAP] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_SKYBOX] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_SKYBOX], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_callbacks[ES_SKYBOX], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_SPLATTING] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_WATER] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_WATER], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_callbacks[ES_WATER], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_WATER_SURFACE] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_WATER]);
m_callbacks[ES_WATER]);
m_shaders[ES_SPHERE_MAP] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_GRASS] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_GRASS], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_callbacks[ES_GRASS], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_GRASS_REF] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_GRASS], EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
m_callbacks[ES_GRASS], EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
m_shaders[ES_BUBBLES] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_BUBBLES], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_callbacks[ES_BUBBLES], EMT_TRANSPARENT_ALPHA_CHANNEL);
m_shaders[ES_MOTIONBLUR] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_MOTIONBLUR]);
m_callbacks[ES_MOTIONBLUR]);
m_shaders[ES_GAUSSIAN3H] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_GAUSSIAN3H], EMT_SOLID);
m_callbacks[ES_GAUSSIAN3H], EMT_SOLID);
m_shaders[ES_GAUSSIAN3V] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_GAUSSIAN3V], EMT_SOLID);
m_callbacks[ES_GAUSSIAN3V], EMT_SOLID);
m_shaders[ES_MIPVIZ] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_MIPVIZ], EMT_SOLID);
m_callbacks[ES_MIPVIZ], EMT_SOLID);
m_shaders[ES_COLORIZE] = glslmat(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_COLORIZE], EMT_SOLID);
m_callbacks[ES_COLORIZE], EMT_SOLID);
m_shaders[ES_OBJECTPASS] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_OBJECT_UNLIT] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
@ -229,10 +229,10 @@ void Shaders::loadShaders()
m_shaders[ES_SUNLIGHT] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_DISPLACE] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_DISPLACE]);
m_callbacks[ES_DISPLACE]);
m_shaders[ES_PASSFAR] = glsl(dir + "pass.vert", dir + "pass.frag",
m_callbacks[ES_COLORIZE]);
m_callbacks[ES_COLORIZE]);
// Check that all successfully loaded
for (s32 i = 0; i < ES_COUNT; i++) {
@ -355,7 +355,7 @@ void Shaders::check(const int num) const
if (m_shaders[num] == -1)
{
Log::error("shaders", "Shader %s failed to load. Update your drivers, if the issue "
"persists, report a bug to us.", shader_names[num] + 3);
"persists, report a bug to us.", shader_names[num] + 3);
}
}
@ -959,7 +959,7 @@ namespace MeshShader
glUseProgram(0);
}
void ObjectRimLimitShader::setUniforms(const core::matrix4 &ModelMatrix,
void ObjectRimLimitShader::setUniforms(const core::matrix4 &ModelMatrix,
const core::matrix4 &InverseModelMatrix,
const core::matrix4 &TextureMatrix)
{
@ -1053,7 +1053,7 @@ namespace MeshShader
glUseProgram(0);
}
void ObjectRefPass2Shader::setUniforms(const core::matrix4 &ModelMatrix,
void ObjectRefPass2Shader::setUniforms(const core::matrix4 &ModelMatrix,
const core::matrix4 &TextureMatrix)
{
if (UserConfigParams::m_ubo_disabled)
@ -1099,7 +1099,7 @@ namespace MeshShader
glUseProgram(0);
}
void GrassPass2Shader::setUniforms(const core::matrix4 &ModelViewProjectionMatrix,
void GrassPass2Shader::setUniforms(const core::matrix4 &ModelViewProjectionMatrix,
const core::vector3df &windDirection)
{
glUniformMatrix4fv(uniform_MVP, 1, GL_FALSE, ModelViewProjectionMatrix.pointer());
@ -1402,9 +1402,9 @@ namespace MeshShader
uniform_tex = glGetUniformLocation(Program, "tex");
}
void BillboardShader::setUniforms(const core::matrix4 &ModelViewMatrix,
const core::matrix4 &ProjectionMatrix,
const core::vector3df &Position,
void BillboardShader::setUniforms(const core::matrix4 &ModelViewMatrix,
const core::matrix4 &ProjectionMatrix,
const core::vector3df &Position,
const core::dimension2d<float> &size,
unsigned TU_tex)
{
@ -1933,8 +1933,8 @@ namespace ParticleShader
}
void SimpleParticleRender::setUniforms(const core::matrix4 &ViewMatrix, const core::matrix4 &ProjMatrix,
const core::matrix4 InvProjMatrix, float width, float height, unsigned TU_tex, unsigned TU_dtex,
const ParticleSystemProxy* particle_system)
const core::matrix4 InvProjMatrix, float width, float height, unsigned TU_tex, unsigned TU_dtex,
const ParticleSystemProxy* particle_system)
{
glUniformMatrix4fv(uniform_invproj, 1, GL_FALSE, InvProjMatrix.pointer());
glUniformMatrix4fv(uniform_matrix, 1, GL_FALSE, irr_driver->getProjMatrix().pointer());
@ -2529,35 +2529,35 @@ namespace FullScreenShader
SSAOSamples[63] = 0.772942f;
// Generate another random distribution, if needed
/* for (unsigned i = 0; i < 16; i++) {
// Use double to avoid denorm and get a true uniform distribution
// Generate z component between [0.1; 1] to avoid being too close from surface
double z = rand();
z /= RAND_MAX;
z = 0.1 + 0.9 * z;
/* for (unsigned i = 0; i < 16; i++) {
// Use double to avoid denorm and get a true uniform distribution
// Generate z component between [0.1; 1] to avoid being too close from surface
double z = rand();
z /= RAND_MAX;
z = 0.1 + 0.9 * z;
// Now generate x,y on the unit circle
double x = rand();
x /= RAND_MAX;
x = 2 * x - 1;
double y = rand();
y /= RAND_MAX;
y = 2 * y - 1;
double xynorm = sqrt(x * x + y * y);
x /= xynorm;
y /= xynorm;
// Now resize x,y so that norm(x,y,z) is one
x *= sqrt(1. - z * z);
y *= sqrt(1. - z * z);
// Now generate x,y on the unit circle
double x = rand();
x /= RAND_MAX;
x = 2 * x - 1;
double y = rand();
y /= RAND_MAX;
y = 2 * y - 1;
double xynorm = sqrt(x * x + y * y);
x /= xynorm;
y /= xynorm;
// Now resize x,y so that norm(x,y,z) is one
x *= sqrt(1. - z * z);
y *= sqrt(1. - z * z);
// Norm factor
double w = rand();
w /= RAND_MAX;
SSAOSamples[4 * i] = (float)x;
SSAOSamples[4 * i + 1] = (float)y;
SSAOSamples[4 * i + 2] = (float)z;
SSAOSamples[4 * i + 3] = (float)w;
}*/
// Norm factor
double w = rand();
w /= RAND_MAX;
SSAOSamples[4 * i] = (float)x;
SSAOSamples[4 * i + 1] = (float)y;
SSAOSamples[4 * i + 2] = (float)z;
SSAOSamples[4 * i + 3] = (float)w;
}*/
}
void SSAOShader::setUniforms(const core::vector2df &screen, unsigned TU_dtex, unsigned TU_noise)