diff --git a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp index 074f360f3..151d28d30 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.cpp @@ -164,6 +164,7 @@ namespace NL3D case CMaterial::Normal: case CMaterial::UserColor: case CMaterial::LightMap: + case CMaterial::Cloud: generateNormalVS(); break; @@ -227,6 +228,10 @@ namespace NL3D case CMaterial::Water: generateWaterPS(); break; + + case CMaterial::Cloud: + generateCloudPS(); + break; } ps.assign( ss.str() ); @@ -988,6 +993,31 @@ namespace NL3D ss << std::endl; } + + void CGLSLShaderGenerator::generateCloudPS() + { + ss << "smooth in vec4 texCoord0;" << std::endl; + ss << "smooth in vec4 texCoord1;" << std::endl; + ss << std::endl; + + ss << "uniform sampler2D sampler0;" << std::endl; + ss << "uniform sampler2D sampler1;" << std::endl; + ss << std::endl; + + ss << "void main( void )" << std::endl; + ss << "{" << std::endl; + + addDiffuse(); + + ss << "vec4 tex0 = texture2D( sampler0, texCoord0 );" << std::endl; + ss << "vec4 tex1 = texture2D( sampler1, texCoord1 );" << std::endl; + ss << "vec4 tex = mix( tex0, tex1, diffuse.a );" << std::endl; + ss << "tex.a = 0;" << std::endl; + ss << "fragColor = tex;" << std::endl; + ss << "}" << std::endl; + ss << std::endl; + + } } diff --git a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.h b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.h index 0366b91c7..da9046dd2 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_glsl_shader_generator.h @@ -64,6 +64,8 @@ namespace NL3D void generateWaterPS(); + void generateCloudPS(); + std::stringstream ss; uint16 vbFormat; CMaterial const *material;