Some water rendering help..
Posted: Tue Dec 12, 2006 10:40 pm
I got this code from another code(the water shading class)
s32 dmat = irr::video::EMT_SOLID;
dmat = gpu->addHighLevelShaderMaterial(WATER_VERTEX_GLSL, "main", video::EVST_VS_1_1,
WATER_FRAGMENT_GLSL, "main", video::EPST_PS_1_1, this , video::EMT_TRANSPARENT_ALPHA_CHANNEL, 0);
waterNode->setMaterialType((video::E_MATERIAL_TYPE)dmat);
I am trying to get it to work with...
// Add some water >.>
IAnimatedMesh * WaterMesh = smgr->getMesh( "media/water.obj" );
ISceneNode * waterNode = smgr->addWaterSurfaceSceneNode( WaterMesh->getMesh(0),2.0f, 150.0f, 10.0f);
waterNode->setMaterialTexture(0, driver->getTexture("media/water.jpg"));
//waterNode->setMaterialType(EMT_TRANSPARENT_REFLECTION_2_LAYER );
waterNode->setPosition(core::vector3df(0,100,0));
waterNode->setScale(core::vector3df(25.0f, 2.5f, 25.0f));
but the param 'this' wich is stating the class its in, well, my script isnt in a class, its just in main() so, what would I replace the 'this' param with in
s32 dmat = irr::video::EMT_SOLID;
dmat = gpu->addHighLevelShaderMaterial(WATER_VERTEX_GLSL, "main", video::EVST_VS_1_1,
WATER_FRAGMENT_GLSL, "main", video::EPST_PS_1_1, this , video::EMT_TRANSPARENT_ALPHA_CHANNEL, 0);
waterNode->setMaterialType((video::E_MATERIAL_TYPE)dmat);
to make it work?
s32 dmat = irr::video::EMT_SOLID;
dmat = gpu->addHighLevelShaderMaterial(WATER_VERTEX_GLSL, "main", video::EVST_VS_1_1,
WATER_FRAGMENT_GLSL, "main", video::EPST_PS_1_1, this , video::EMT_TRANSPARENT_ALPHA_CHANNEL, 0);
waterNode->setMaterialType((video::E_MATERIAL_TYPE)dmat);
I am trying to get it to work with...
// Add some water >.>
IAnimatedMesh * WaterMesh = smgr->getMesh( "media/water.obj" );
ISceneNode * waterNode = smgr->addWaterSurfaceSceneNode( WaterMesh->getMesh(0),2.0f, 150.0f, 10.0f);
waterNode->setMaterialTexture(0, driver->getTexture("media/water.jpg"));
//waterNode->setMaterialType(EMT_TRANSPARENT_REFLECTION_2_LAYER );
waterNode->setPosition(core::vector3df(0,100,0));
waterNode->setScale(core::vector3df(25.0f, 2.5f, 25.0f));
but the param 'this' wich is stating the class its in, well, my script isnt in a class, its just in main() so, what would I replace the 'this' param with in
s32 dmat = irr::video::EMT_SOLID;
dmat = gpu->addHighLevelShaderMaterial(WATER_VERTEX_GLSL, "main", video::EVST_VS_1_1,
WATER_FRAGMENT_GLSL, "main", video::EPST_PS_1_1, this , video::EMT_TRANSPARENT_ALPHA_CHANNEL, 0);
waterNode->setMaterialType((video::E_MATERIAL_TYPE)dmat);
to make it work?