Deferred Rendering
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?
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!
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!
yeah thats the cool part only thing you have to do is callent1ty wrote: Edit: maybe I am blind, but where is some example code how to use shadows?
Code: Select all
irr::deferred::initDeferredRendering(smgr);
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.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?
in the meantime i played a little bit with the transparent material.
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.
Just tested it, it's so cool
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?
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!
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!
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.ent1ty wrote:Just tested it, it's so cool
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?
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.
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!
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!
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
oh to fix the problem just set your view distance to be 2times bigger than the light radius.
lightradius = 2000
viewdistance = 4000
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.
Strange, it does not work for me.
I tried playing with a few things, but nothing seemed to help. No idea why
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"));
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!
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!
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.
added softparticles. but they are not perfect 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.
Here you go http://www.megaupload.com/?d=ETW23LCA
There is no GLSL error in console, just 'Unsupported texture format'
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!
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!
Found the error...why didn't i see this upfront...wellent1ty wrote:Here you go http://www.megaupload.com/?d=ETW23LCA
There is no GLSL error in console, just 'Unsupported texture format'
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.
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:
or
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);
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!
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!
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.