Hello!
I have got 2 questions about lightmaps in 3d graphics.
1.
How light maps are done for an object on a certain map?
The object cast shadows on more that 1 object (like, floor, walls, other objects). So if i understanding correctly -- we need to load floor, walls, .... into editor with our target object and render shadows (lightmaps). BUT then we will get static lightmap -- so if we need to reuse some object in other game levels -- we need calculate all possible shadows (lightmaps) for all objects.
So we have 1 object mesh, 1 texture, but 10 lightmaps for each instantiation of the object. Deeply i think this is wrong, but i want to know the answer and how this done in now days games?
2.
How it is possible to cast lightmaps on dynamic objects. There are a lot f games that implements this. I'm saying about using only lightmaps (pre calculated soft shadows) --- when the moving object gets into the shadow of some another object -- it receives completely proper shadow projection (not some highlighting of the full mesh, NO -- because there are also visible soft shadow's edges) -- and this looks like projective shadows ------ HOW this is done?
P.S.: Second question is more interesting, because if it solves -- we do not need to pre render 10 cases of shadow of the object for each game level.
Please, share the info if you know something about it.
Thank You.
About Lightmaps
1- Lightmaps are baked into the 2nd texture coordinates of mesh before exporting, which means objects must be duplicated. I don't think it's possible to split this data
2- I think a mixture of using pixel shader shadows on dynamic meshes, and also some kind of lighting regions (cube or sphere maps) to change the ambient lighting. I don't think it's read from the lightmaps, though I could be wrong.
2- I think a mixture of using pixel shader shadows on dynamic meshes, and also some kind of lighting regions (cube or sphere maps) to change the ambient lighting. I don't think it's read from the lightmaps, though I could be wrong.
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=25699
thats how light maps work,.
dynamic light maps,ill exapnd later.
thats how light maps work,.
dynamic light maps,ill exapnd later.
Re: About Lightmaps
Are you abosolutely sure it wasn't shadow mapping?greenya wrote: 2.
How it is possible to cast lightmaps on dynamic objects. There are a lot f games that implements this. I'm saying about using only lightmaps (pre calculated soft shadows) --- when the moving object gets into the shadow of some another object -- it receives completely proper shadow projection (not some highlighting of the full mesh, NO -- because there are also visible soft shadow's edges) -- and this looks like projective shadows ------ HOW this is done?
Here is a screenshot of my dynamic shadowmaps, the quality is very similar to lightmaps so its easy to get confused:
Cheers
(Maybe its possible to project lightmaps using a cubemap to have a dynamic lightmap effect? This is usually used for good ambient lighting.)
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Sorry for my English and my possible misunderstanding, but i just wanted to show certain what i mean. I have create 3min video of doom3 play -- this going to show what do i mean:
http://www.youtube.com/watch?v=ojuMr8l0JVA
little description:
0 - i load savepoint
1 - i turned on stencil shadows ( i showed it with the volumes casted from objects around )
2 - i turned off light ( from the second try -- sorry ) ( anyway, stencil shadows are gone )
3 - and then -- i started to move the box -- it receives lightmap shadow ( it is the shadow of the some metal net ( it is also clearly visible on the floor ) ). BUT floor is a static object (never get movement) , but not the box,
SO, my question is:
how the box receives correct lightmap shadow since it moving object (so the light map not pre-rendered)
Thank You!
http://www.youtube.com/watch?v=ojuMr8l0JVA
little description:
0 - i load savepoint
1 - i turned on stencil shadows ( i showed it with the volumes casted from objects around )
2 - i turned off light ( from the second try -- sorry ) ( anyway, stencil shadows are gone )
3 - and then -- i started to move the box -- it receives lightmap shadow ( it is the shadow of the some metal net ( it is also clearly visible on the floor ) ). BUT floor is a static object (never get movement) , but not the box,
SO, my question is:
how the box receives correct lightmap shadow since it moving object (so the light map not pre-rendered)
Thank You!
Its just a projected texture. Very similar to shadow maps (But without a depth test).
Read up on projective texturing to get an idea on how this technique is achieved.
This is me using projective texturing to simulate window light shining on a table:
See how the colour of the transparent windows is projected onto the floor and the table? Even if the floor or the table moves, it will still be projected correctly, its fully dynamic.
Here is the basic procedure:
In shaders:
Create a camera pointing at the object. Use the projection matrix of the camera as texcoords for the texture, by multiplying with the vertex position then dividing by the w coord.
Fixed function (OGL):
Create a new material renderer, use texgen to generate EYE_LINEAR coords using the projection matrix of the camera multiplied by a projection matrix:
f32 projMat[] = {0.5f, 0, 0, 0, 0, 0.5f, 0, 0, 0, 0, 0.5f, 0, 0.5f, 0.5f, 0.5f, 1};
Cheers, I hope I've shed some light on the issue.
Read up on projective texturing to get an idea on how this technique is achieved.
This is me using projective texturing to simulate window light shining on a table:
See how the colour of the transparent windows is projected onto the floor and the table? Even if the floor or the table moves, it will still be projected correctly, its fully dynamic.
Here is the basic procedure:
In shaders:
Create a camera pointing at the object. Use the projection matrix of the camera as texcoords for the texture, by multiplying with the vertex position then dividing by the w coord.
Fixed function (OGL):
Create a new material renderer, use texgen to generate EYE_LINEAR coords using the projection matrix of the camera multiplied by a projection matrix:
f32 projMat[] = {0.5f, 0, 0, 0, 0, 0.5f, 0, 0, 0, 0, 0.5f, 0, 0.5f, 0.5f, 0.5f, 1};
Cheers, I hope I've shed some light on the issue.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net