Automated whitespace error fix for last commit

This commit is contained in:
est31 2015-06-14 23:09:20 +02:00
parent 43fcfbfe05
commit ee38bcd307
4 changed files with 54 additions and 54 deletions

View File

@ -14,36 +14,36 @@ varying vec3 eyeVec;
varying vec3 lightVec; varying vec3 lightVec;
varying vec3 tsEyeVec; varying vec3 tsEyeVec;
varying vec3 tsLightVec; varying vec3 tsLightVec;
varying float generate_heightmaps; varying float generate_heightmaps;
const float e = 2.718281828459; const float e = 2.718281828459;
const float BS = 10.0; const float BS = 10.0;
float smoothCurve(float x) float smoothCurve(float x)
{ {
return x * x * (3.0 - 2.0 * x); return x * x * (3.0 - 2.0 * x);
} }
float triangleWave(float x) float triangleWave(float x)
{ {
return abs(fract(x + 0.5) * 2.0 - 1.0); return abs(fract(x + 0.5) * 2.0 - 1.0);
} }
float smoothTriangleWave(float x) float smoothTriangleWave(float x)
{ {
return smoothCurve(triangleWave(x)) * 2.0 - 1.0; return smoothCurve(triangleWave(x)) * 2.0 - 1.0;
} }
void main(void) void main(void)
{ {
gl_TexCoord[0] = gl_MultiTexCoord0; gl_TexCoord[0] = gl_MultiTexCoord0;
gl_TexCoord[0].y += 0.008; gl_TexCoord[0].y += 0.008;
#if ((DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) && GENERATE_NORMALMAPS) #if ((DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) && GENERATE_NORMALMAPS)
generate_heightmaps = 1.0; generate_heightmaps = 1.0;
#else #else
generate_heightmaps = 0.0; generate_heightmaps = 0.0;
#endif #endif
#if ((MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER) #if ((MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER)
vec4 pos = gl_Vertex; vec4 pos = gl_Vertex;
pos.y -= 2.0; pos.y -= 2.0;
@ -87,33 +87,33 @@ void main(void)
vPosition = gl_Position.xyz; vPosition = gl_Position.xyz;
worldPosition = (mWorld * gl_Vertex).xyz; worldPosition = (mWorld * gl_Vertex).xyz;
// Don't generate heightmaps when too far from the eye // Don't generate heightmaps when too far from the eye
float dist = distance (worldPosition, eyePosition); float dist = distance (worldPosition, eyePosition);
if (dist > 100.00) { if (dist > 100.00) {
generate_heightmaps = 0.0; generate_heightmaps = 0.0;
} }
vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0); vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0);
vec3 normal, tangent, binormal; vec3 normal, tangent, binormal;
normal = normalize(gl_NormalMatrix * gl_Normal); normal = normalize(gl_NormalMatrix * gl_Normal);
tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz); tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
binormal = normalize(gl_NormalMatrix * -gl_MultiTexCoord2.xyz); binormal = normalize(gl_NormalMatrix * -gl_MultiTexCoord2.xyz);
vec3 v; vec3 v;
lightVec = sunPosition - worldPosition; lightVec = sunPosition - worldPosition;
v.x = dot(lightVec, tangent); v.x = dot(lightVec, tangent);
v.y = dot(lightVec, binormal); v.y = dot(lightVec, binormal);
v.z = dot(lightVec, normal); v.z = dot(lightVec, normal);
tsLightVec = v; tsLightVec = v;
eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz; eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
v.x = dot(eyeVec, tangent); v.x = dot(eyeVec, tangent);
v.y = dot(eyeVec, binormal); v.y = dot(eyeVec, binormal);
v.z = dot(eyeVec, normal); v.z = dot(eyeVec, normal);
tsEyeVec = v; tsEyeVec = v;
vec4 color; vec4 color;
float day = gl_Color.r; float day = gl_Color.r;

View File

@ -18,23 +18,23 @@ varying vec3 tsLightVec;
const float e = 2.718281828459; const float e = 2.718281828459;
const float BS = 10.0; const float BS = 10.0;
float smoothCurve(float x) float smoothCurve(float x)
{ {
return x * x * (3.0 - 2.0 * x); return x * x * (3.0 - 2.0 * x);
} }
float triangleWave(float x) float triangleWave(float x)
{ {
return abs(fract( x + 0.5 ) * 2.0 - 1.0); return abs(fract( x + 0.5 ) * 2.0 - 1.0);
} }
float smoothTriangleWave(float x) float smoothTriangleWave(float x)
{ {
return smoothCurve(triangleWave( x )) * 2.0 - 1.0; return smoothCurve(triangleWave( x )) * 2.0 - 1.0;
} }
void main(void) void main(void)
{ {
gl_TexCoord[0] = gl_MultiTexCoord0; gl_TexCoord[0] = gl_MultiTexCoord0;
#if (MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER #if (MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER
vec4 pos = gl_Vertex; vec4 pos = gl_Vertex;
pos.y -= 2.0; pos.y -= 2.0;

View File

@ -1213,7 +1213,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
p.tile.applyMaterialOptions(material); p.tile.applyMaterialOptions(material);
} }
} }
// Create meshbuffer // Create meshbuffer
scene::SMeshBufferTangents *buf = new scene::SMeshBufferTangents(); scene::SMeshBufferTangents *buf = new scene::SMeshBufferTangents();
// Set material // Set material

View File

@ -106,7 +106,7 @@ void scaleMesh(scene::IMesh *mesh, v3f scale)
const u32 stride = getVertexPitchFromType(buf->getVertexType()); const u32 stride = getVertexPitchFromType(buf->getVertexType());
u32 vertex_count = buf->getVertexCount(); u32 vertex_count = buf->getVertexCount();
u8 *vertices = (u8 *)buf->getVertices(); 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; ((video::S3DVertex *)(vertices + i * stride))->Pos *= scale;
buf->recalculateBoundingBox(); buf->recalculateBoundingBox();
@ -134,7 +134,7 @@ void translateMesh(scene::IMesh *mesh, v3f vec)
const u32 stride = getVertexPitchFromType(buf->getVertexType()); const u32 stride = getVertexPitchFromType(buf->getVertexType());
u32 vertex_count = buf->getVertexCount(); u32 vertex_count = buf->getVertexCount();
u8 *vertices = (u8 *)buf->getVertices(); 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; ((video::S3DVertex *)(vertices + i * stride))->Pos += vec;
buf->recalculateBoundingBox(); buf->recalculateBoundingBox();
@ -160,7 +160,7 @@ void setMeshColor(scene::IMesh *mesh, const video::SColor &color)
const u32 stride = getVertexPitchFromType(buf->getVertexType()); const u32 stride = getVertexPitchFromType(buf->getVertexType());
u32 vertex_count = buf->getVertexCount(); u32 vertex_count = buf->getVertexCount();
u8 *vertices = (u8 *)buf->getVertices(); 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; ((video::S3DVertex *)(vertices + i * stride))->Color = color;
} }
} }