Navigation Menu

Skip to content

Commit

Permalink
Automated whitespace error fix for last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Jun 14, 2015
1 parent 43fcfbf commit ee38bcd
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 54 deletions.
80 changes: 40 additions & 40 deletions client/shaders/nodes_shader/opengl_vertex.glsl
Expand Up @@ -14,36 +14,36 @@ varying vec3 eyeVec;
varying vec3 lightVec;
varying vec3 tsEyeVec;
varying vec3 tsLightVec;
varying float generate_heightmaps;
varying float generate_heightmaps;

const float e = 2.718281828459;
const float BS = 10.0;

float smoothCurve(float x)
{
return x * x * (3.0 - 2.0 * x);
float smoothCurve(float x)
{
return x * x * (3.0 - 2.0 * x);
}
float triangleWave(float x)
{
return abs(fract(x + 0.5) * 2.0 - 1.0);
float triangleWave(float x)
{
return abs(fract(x + 0.5) * 2.0 - 1.0);
}
float smoothTriangleWave(float x)
{
return smoothCurve(triangleWave(x)) * 2.0 - 1.0;
float smoothTriangleWave(float x)
{
return smoothCurve(triangleWave(x)) * 2.0 - 1.0;
}

void main(void)
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[0].y += 0.008;

#if ((DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) && GENERATE_NORMALMAPS)
generate_heightmaps = 1.0;
#else
generate_heightmaps = 0.0;
#endif

#if ((MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER)
gl_TexCoord[0].y += 0.008;

#if ((DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) && GENERATE_NORMALMAPS)
generate_heightmaps = 1.0;
#else
generate_heightmaps = 0.0;
#endif

#if ((MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER)
vec4 pos = gl_Vertex;
pos.y -= 2.0;

Expand Down Expand Up @@ -87,33 +87,33 @@ void main(void)

vPosition = gl_Position.xyz;
worldPosition = (mWorld * gl_Vertex).xyz;

// Don't generate heightmaps when too far from the eye
float dist = distance (worldPosition, eyePosition);
if (dist > 100.00) {
generate_heightmaps = 0.0;
}


// Don't generate heightmaps when too far from the eye
float dist = distance (worldPosition, eyePosition);
if (dist > 100.00) {
generate_heightmaps = 0.0;
}

vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0);

vec3 normal, tangent, binormal;
normal = normalize(gl_NormalMatrix * gl_Normal);
tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
binormal = normalize(gl_NormalMatrix * -gl_MultiTexCoord2.xyz);

vec3 v;
tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
binormal = normalize(gl_NormalMatrix * -gl_MultiTexCoord2.xyz);

vec3 v;

lightVec = sunPosition - worldPosition;
v.x = dot(lightVec, tangent);
v.y = dot(lightVec, binormal);
v.z = dot(lightVec, normal);
tsLightVec = v;

eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
v.x = dot(eyeVec, tangent);
v.y = dot(eyeVec, binormal);
v.z = dot(eyeVec, normal);
tsEyeVec = v;
v.x = dot(lightVec, tangent);
v.y = dot(lightVec, binormal);
v.z = dot(lightVec, normal);
tsLightVec = v;

eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
v.x = dot(eyeVec, tangent);
v.y = dot(eyeVec, binormal);
v.z = dot(eyeVec, normal);
tsEyeVec = v;

vec4 color;
float day = gl_Color.r;
Expand Down
20 changes: 10 additions & 10 deletions client/shaders/water_surface_shader/opengl_vertex.glsl
Expand Up @@ -18,23 +18,23 @@ varying vec3 tsLightVec;
const float e = 2.718281828459;
const float BS = 10.0;

float smoothCurve(float x)
{
return x * x * (3.0 - 2.0 * x);
float smoothCurve(float x)
{
return x * x * (3.0 - 2.0 * x);
}
float triangleWave(float x)
{
return abs(fract( x + 0.5 ) * 2.0 - 1.0);
float triangleWave(float x)
{
return abs(fract( x + 0.5 ) * 2.0 - 1.0);
}
float smoothTriangleWave(float x)
{
return smoothCurve(triangleWave( x )) * 2.0 - 1.0;
float smoothTriangleWave(float x)
{
return smoothCurve(triangleWave( x )) * 2.0 - 1.0;
}

void main(void)
{
gl_TexCoord[0] = gl_MultiTexCoord0;


#if (MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER
vec4 pos = gl_Vertex;
pos.y -= 2.0;
Expand Down
2 changes: 1 addition & 1 deletion src/mapblock_mesh.cpp
Expand Up @@ -1213,7 +1213,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
p.tile.applyMaterialOptions(material);
}
}

// Create meshbuffer
scene::SMeshBufferTangents *buf = new scene::SMeshBufferTangents();
// Set material
Expand Down
6 changes: 3 additions & 3 deletions src/mesh.cpp
Expand Up @@ -106,7 +106,7 @@ void scaleMesh(scene::IMesh *mesh, v3f scale)
const u32 stride = getVertexPitchFromType(buf->getVertexType());
u32 vertex_count = buf->getVertexCount();
u8 *vertices = (u8 *)buf->getVertices();
for (u32 i = 0; i < vertex_count; i++)
for (u32 i = 0; i < vertex_count; i++)
((video::S3DVertex *)(vertices + i * stride))->Pos *= scale;

buf->recalculateBoundingBox();
Expand Down Expand Up @@ -134,7 +134,7 @@ void translateMesh(scene::IMesh *mesh, v3f vec)
const u32 stride = getVertexPitchFromType(buf->getVertexType());
u32 vertex_count = buf->getVertexCount();
u8 *vertices = (u8 *)buf->getVertices();
for (u32 i = 0; i < vertex_count; i++)
for (u32 i = 0; i < vertex_count; i++)
((video::S3DVertex *)(vertices + i * stride))->Pos += vec;

buf->recalculateBoundingBox();
Expand All @@ -160,7 +160,7 @@ void setMeshColor(scene::IMesh *mesh, const video::SColor &color)
const u32 stride = getVertexPitchFromType(buf->getVertexType());
u32 vertex_count = buf->getVertexCount();
u8 *vertices = (u8 *)buf->getVertices();
for (u32 i = 0; i < vertex_count; i++)
for (u32 i = 0; i < vertex_count; i++)
((video::S3DVertex *)(vertices + i * stride))->Color = color;
}
}
Expand Down

0 comments on commit ee38bcd

Please sign in to comment.