diff options
author | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-06-14 21:13:36 +0200 |
---|---|---|
committer | RealBadAngel <maciej.kasatkin@o2.pl> | 2015-06-14 21:13:36 +0200 |
commit | 43fcfbfe05578d7471d40c8c087fd04e24b264b5 (patch) | |
tree | 7b26cc3c87f3255d36bfdee21f1f65785d274bef /client/shaders/water_surface_shader/opengl_vertex.glsl | |
parent | d105bf27dd9f570754f470c3bb6a46369c4aaaad (diff) | |
download | minetest-43fcfbfe05578d7471d40c8c087fd04e24b264b5.tar.gz minetest-43fcfbfe05578d7471d40c8c087fd04e24b264b5.tar.bz2 minetest-43fcfbfe05578d7471d40c8c087fd04e24b264b5.zip |
Improved parallax mapping. Generate heightmaps on the fly.
Diffstat (limited to 'client/shaders/water_surface_shader/opengl_vertex.glsl')
-rw-r--r-- | client/shaders/water_surface_shader/opengl_vertex.glsl | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/client/shaders/water_surface_shader/opengl_vertex.glsl b/client/shaders/water_surface_shader/opengl_vertex.glsl index 6e70bbc36..53678800d 100644 --- a/client/shaders/water_surface_shader/opengl_vertex.glsl +++ b/client/shaders/water_surface_shader/opengl_vertex.glsl @@ -18,20 +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;
|