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
85
91%
No
0
No votes
I really don't care
8
9%
 
Total votes : 93

Postby Kalango » Thu Mar 25, 2010 2:10 am

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?
Kalango
 
Posts: 157
Joined: Thu Apr 26, 2007 12:46 am

Postby ent1ty » Thu Mar 25, 2010 2:52 pm

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?
Height2Normal - convert height maps to normal maps

Code with brain, not heart.
- entity, a proud member of the Heartless Coders society
ent1ty
 
Posts: 925
Joined: Sun Nov 08, 2009 11:09 am

Postby Sudi » Thu Mar 25, 2010 3:44 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Postby Dorth » Thu Mar 25, 2010 4:10 pm

You are doing an amazing job! I think the poll at the top agrees ;)
Dorth
 
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Postby ent1ty » Thu Mar 25, 2010 4:36 pm

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?
Height2Normal - convert height maps to normal maps

Code with brain, not heart.
- entity, a proud member of the Heartless Coders society
ent1ty
 
Posts: 925
Joined: Sun Nov 08, 2009 11:09 am

Postby Sudi » Thu Mar 25, 2010 5:58 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Postby ent1ty » Thu Mar 25, 2010 6:32 pm

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"));
Height2Normal - convert height maps to normal maps

Code with brain, not heart.
- entity, a proud member of the Heartless Coders society
ent1ty
 
Posts: 925
Joined: Sun Nov 08, 2009 11:09 am

Postby Sudi » Thu Mar 25, 2010 6:34 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Postby etal2009 » Thu Mar 25, 2010 6:37 pm

Sudi wrote:i added VisualStudio support.

Sweet! Thank you.
etal2009
 
Posts: 16
Joined: Wed Mar 10, 2010 2:26 pm

Postby ent1ty » Thu Mar 25, 2010 7:06 pm

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:
Height2Normal - convert height maps to normal maps

Code with brain, not heart.
- entity, a proud member of the Heartless Coders society
ent1ty
 
Posts: 925
Joined: Sun Nov 08, 2009 11:09 am

Postby Sudi » Thu Mar 25, 2010 11:56 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Postby ent1ty » Fri Mar 26, 2010 1:01 pm

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

Code with brain, not heart.
- entity, a proud member of the Heartless Coders society
ent1ty
 
Posts: 925
Joined: Sun Nov 08, 2009 11:09 am

Postby Sudi » Fri Mar 26, 2010 1:24 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

Postby ent1ty » Fri Mar 26, 2010 1:51 pm

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);
Height2Normal - convert height maps to normal maps

Code with brain, not heart.
- entity, a proud member of the Heartless Coders society
ent1ty
 
Posts: 925
Joined: Sun Nov 08, 2009 11:09 am

Postby Sudi » Fri Mar 26, 2010 2:37 pm

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.
User avatar
Sudi
 
Posts: 1600
Joined: Fri Aug 26, 2005 8:38 pm

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron