Page 2 of 8

Posted: Thu Mar 25, 2010 2:10 am
by Kalango
You mix that with a fancy normal/parallax map and some glowing and you got an almost next gen graphics....
BTW, does that support irr normal and parallax? Or will you have to implement another shader and stuff?

Posted: Thu Mar 25, 2010 2:52 pm
by ent1ty
He already said that twice or so.
Read, and you shall know.

Edit: maybe I am blind, but where is some example code how to use shadows?

Posted: Thu Mar 25, 2010 3:44 pm
by sudi
ent1ty wrote: Edit: maybe I am blind, but where is some example code how to use shadows?
yeah thats the cool part :D only thing you have to do is call

Code: Select all

irr::deferred::initDeferredRendering(smgr);
once.
Kalango wrote:You mix that with a fancy normal/parallax map and some glowing and you got an almost next gen graphics....
BTW, does that support irr normal and parallax? Or will you have to implement another shader and stuff?
this is deferred rendering so it doesn't work with the normal irrlicht shaders but something like normal mapping is real easy to implement. and i will do it next.

in the meantime i played a little bit with the transparent material. :D
Image

Posted: Thu Mar 25, 2010 4:10 pm
by Dorth
You are doing an amazing job! I think the poll at the top agrees ;)

Posted: Thu Mar 25, 2010 4:36 pm
by ent1ty
Just tested it, it's so cool :shock:
Just one question, i have terrain and a cube. The terrain casts shadows on itself, but the cube does not cast shadows on the terrain. Why?

Posted: Thu Mar 25, 2010 5:58 pm
by sudi
ent1ty wrote:Just tested it, it's so cool :shock:
Just one question, i have terrain and a cube. The terrain casts shadows on itself, but the cube does not cast shadows on the terrain. Why?
uhh? good question. is the cube transparent? is the cube between the light and the terrain? sry no clue maybe post the code for scene setup so i can what might be wrong.

EDIT: ok just tried a terrain with a cube. you are right when i am behind the cube the shadow is not visible but when i am behind the shadow location (away from light and cube) the shadow shows. dunno why this happens. maybe someone knows? i gotta investigate there.
EDIT[2]: ok now i know how to fix it. its bc when the light radius is bigger than the actual view distance the lightvolume is not completly drawn. which results in either no lightning when lightradius is way to big or missing shadows in that case. btw at the moment only EMT_SOLID/TRANSPARENT_ADD_COLOR/TRANSPARENT_ALPHA_CHANNEL are actually casting shadows. these are also the only materials which have the correct shaders attached.
oh to fix the problem just set your view distance to be bigger than the light radius.


Ok update now also transparent objects cast shadows. and i added VisualStudio support.
Download
PS: download link also changed in first post

Posted: Thu Mar 25, 2010 6:32 pm
by ent1ty
The cube is not transparent, it is between the terrain and light

Code: Select all

ITerrainSceneNode* terrain= smgr->addTerrainSceneNode("level.bmp");
terrain->setScale(vector3df(1,0.2,1));
terrain->setMaterialTexture(0, video->getTexture("texture.jpg"));

ILightSceneNode* light= smgr->addLightSceneNode(0, vector3df(50,60,50), SColorf(1.0,1.0, 1.0), 2000);
//light->addAnimator(smgr->createFlyCircleAnimator(vector3df(0,50,0), 100, 0.0005, vector3df(0, 1, 0)));

IBillboardSceneNode* billlight= smgr->addBillboardSceneNode(light);
billlight->setMaterialTexture(0, video->getTexture("texture.jpg"));
billlight->setMaterialFlag(EMF_LIGHTING, false);

IMeshSceneNode* kubo= smgr->addCubeSceneNode(5, 0, -1, vector3df(50,10,50));
kubo->setMaterialTexture(0, video->getTexture("detailmap.jpg"));

Posted: Thu Mar 25, 2010 6:34 pm
by sudi
ok now i know how to fix it. its bc when the light radius is bigger than the actual view distance the lightvolume is not completly drawn. which results in either no lightning when lightradius is way to big or missing shadows in that case. btw at the moment only EMT_SOLID/TRANSPARENT_ADD_COLOR/TRANSPARENT_ALPHA_CHANNEL are actually casting shadows. these are also the only materials which have the correct shaders attached.
oh to fix the problem just set your view distance to be 2times bigger than the light radius.

lightradius = 2000
viewdistance = 4000
Image

Posted: Thu Mar 25, 2010 6:37 pm
by etal2009
Sudi wrote:i added VisualStudio support.
Sweet! Thank you.

Posted: Thu Mar 25, 2010 7:06 pm
by ent1ty
Strange, it does not work for me.

Code: Select all

ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(0, 40, 0.1, -1);
camera->setNearValue(0.1);
camera->setFarValue(1000);

device->getCursorControl()->setVisible(false);


ITerrainSceneNode* terrain= smgr->addTerrainSceneNode("level.bmp");
terrain->setScale(vector3df(1,0.2,1));
terrain->setMaterialTexture(0, video->getTexture("texture.jpg"));

ILightSceneNode* light= smgr->addLightSceneNode(0, vector3df(50,40,50), SColorf(0.5,0.5, 1.0), 500);

IMeshSceneNode* cube= smgr->addCubeSceneNode(5, 0, -1, vector3df(50,20,50));
cube->setMaterialTexture(0, video->getTexture("texture.jpg"));
I tried playing with a few things, but nothing seemed to help. No idea why :cry:

Posted: Thu Mar 25, 2010 11:56 pm
by sudi
hey ent1ty would you mind uploading your files somewhere so i can try with the same data?. btw are there any glsl errors shown in the console?

added softparticles. but they are not perfect yet.
Image

Posted: Fri Mar 26, 2010 1:01 pm
by ent1ty
Here you go http://www.megaupload.com/?d=ETW23LCA
There is no GLSL error in console, just 'Unsupported texture format'

Posted: Fri Mar 26, 2010 1:24 pm
by sudi
ent1ty wrote:Here you go http://www.megaupload.com/?d=ETW23LCA
There is no GLSL error in console, just 'Unsupported texture format'
Found the error...why didn't i see this upfront...well

You are using a pointlight. those don't cast shadows(yet)

Posted: Fri Mar 26, 2010 1:51 pm
by ent1ty
Ah :)
There is another problem though. Every time i try to set the light's type to spot, the program crashes with an seg fault.
none of these works:

Code: Select all

ILightSceneNode* light= smgr->addLightSceneNode(0, vector3df(50,40,50), SColorf(1,0.8, .6), 500);
SLight lightdata= light->getLightData();
lightdata.Direction= vector3df(50,0,50);
lightdata.OuterCone= 40;
lightdata.Type= ELT_SPOT;
light->setLightData(lightdata);
or

Code: Select all

ILightSceneNode* light= smgr->addLightSceneNode(0, vector3df(50,40,50), SColorf(1,0.8, .6), 500);
light->setLightType(ELT_SPOT);

Posted: Fri Mar 26, 2010 2:37 pm
by sudi
well what does your debugger say?thats the reason i am shipping also debug builds.