Deferred Rendering

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Do you think this is usefull and needs further improvements

Yes
99
93%
No
0
No votes
I really don't care
8
7%
 
Total votes: 107

Kalango
Posts: 157
Joined: Thu Apr 26, 2007 12:46 am

Post 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?
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post 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?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

You are doing an amazing job! I think the poll at the top agrees ;)
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post 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?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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
Last edited by sudi on Thu Mar 25, 2010 6:33 pm, edited 1 time in total.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post 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"));
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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
Last edited by sudi on Thu Mar 25, 2010 6:41 pm, edited 1 time in total.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
etal2009
Posts: 16
Joined: Wed Mar 10, 2010 2:26 pm

Post by etal2009 »

Sudi wrote:i added VisualStudio support.
Sweet! Thank you.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post 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:
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

Here you go http://www.megaupload.com/?d=ETW23LCA
There is no GLSL error in console, just 'Unsupported texture format'
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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)
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post 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);
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

well what does your debugger say?thats the reason i am shipping also debug builds.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Post Reply