

It's just bumpmapped specular lighting, you can google for the shader code.blackMasoon wrote:I was woundering how should be the shader modified to add this tipe of light reflection to water:
Code: Select all
#include "stdafx.h"
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#include "realisticwater.h"
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
//#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif
int main()
{
IrrlichtDevice *device =
createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 32, false, true, true, 0);
if (!device) return 1;
device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
ICameraSceneNode* camera = smgr->addCameraSceneNode();
camera->setPosition(vector3df(200,200,200));
RealisticWaterSceneNode* water = new RealisticWaterSceneNode(smgr,512,512,driver->getTexture("..\\media\\waterbump.png"),device->getTimer());
smgr->addLightSceneNode(0,vector3df(0,50,0));
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}