Generate cloud shader.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 11 years ago
parent 2c84b164ee
commit f77bcf6981

@ -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;
}
}

@ -64,6 +64,8 @@ namespace NL3D
void generateWaterPS();
void generateCloudPS();
std::stringstream ss;
uint16 vbFormat;
CMaterial const *material;

Loading…
Cancel
Save