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?
Some water rendering help..
I am not using that class though, cause the water shader they made, compiles fine, but I see no animation, its just a polygon, and the shader I dont think is showing correctly either when I use it.. so I just made a ater node, and planned on adding the shader to it, im not using the class in my project so this cannot be that class, it would have to be something else right?
Sorry for the double post, but I got it, it was 0 although the shader still dont look right.. but ill figure it out ;_;
[ Edit ]
What do I need to do, to have the water reflect everything in the world? Sky, Hegihtmap, Models, Shadows perhaps... does anyone know? o.o the c++ shader code looks really nice, but when I place nito my prohect, doesnt look the same as in the screenshot o_o problems?
[ Edit ]
What do I need to do, to have the water reflect everything in the world? Sky, Hegihtmap, Models, Shadows perhaps... does anyone know? o.o the c++ shader code looks really nice, but when I place nito my prohect, doesnt look the same as in the screenshot o_o problems?
Last edited by pinkman on Tue Dec 12, 2006 10:54 pm, edited 1 time in total.
There is a magical file included to Irrlicht called "Irrlicht.chm" !!!
Look for "addHighLevelShaderMaterial" and you'll see what this is for and what to set it to...
Well, for lazy people:
Look for "addHighLevelShaderMaterial" and you'll see what this is for and what to set it to...
Well, for lazy people:
Code: Select all
callback,: Pointer to an implementation of IShaderConstantSetCallBack in which you can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Well, take it as a hint for the next time you have such a problem...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java