|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic Page: 1 2 »» |
Last Thread Next Thread ![]() |
| LIGHT MAP GENERATION |
|
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| is want to use this underneather for a lightmap one lightmap is 32*32 which means i could pack 256 lightmaps into one object like this below now my question is would a lightmap with 32*32 bet big enough for a solid which is 256*256? or would i use a 64*64 there? because you d get this a step effect on your steps which is gay and should i use a normal luminance/luminance alpha or even a normal RGBA? thats all the help i need to get started thx
typedef struct dlightmap_s
{
unsigned char map[512][512];
}dlightmap_t;
[/CODE] |
||||
|
||||
![]() Drag0n Member since: 10/9/2001 From: Ulm, Germany |
||||
|
|
||||
| I'd say it depends on the size of your object rather than on the size of your texture... "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning..." -- Rich Cook |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| it depends on the size of you texture the smaller the texture the more visible the step effect |
||||
|
||||
![]() Raduprv Member since: 10/19/2002 From: Romania (now living in USA) |
||||
|
|
||||
| Actually, it depends on both... Height Map Editor | Eternal lands |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Also, it depends on your filtering... for a better filtering effect, filter all you lightmaps trilinearly... |
||||
|
||||
![]() CraZeE Member since: 2/28/2001 From: Malaysia |
||||
|
|
||||
| for lightmaps, a normal luminance image is usually sufficient. but if i'm not mistaken, arent luminance maps translated implicitly to RGB in memory? just a thought.. neva was sure of it |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| yes but what about colored lights and not only white light with different brightness? use openGL lights? and find out which polygons are affected by it? |
||||
|
||||
![]() ga Member since: 3/11/2000 |
||||
|
|
||||
quote: don't do opengl lights if you're doing lightmaps, you should be using lightmaps because opengl lights don't look good enough ... reading back data from opengl lighting to use in lightmaps is a really bad idea edit: use colored lightmaps for colored lights. [edited by - ga on January 7, 2003 5:48:58 PM] |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| lets say i have a 32*32*4 lightmap that consumes 4 kb assume you have 20000 polygons which need lightmaps then you will get 80 mb of lightmaps isn t that a bit too much? |
||||
|
||||
![]() ga Member since: 3/11/2000 |
||||
|
|
||||
| 80 MB is too much. you can vary the size of the lightmap depending on how big the polygon is. Also you shouldn't make a seperate lightmap for each polygon but rather some big lightmaps and each lightmap serves several polygons. |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| i want to use a 512*512*4(RGBA) lightmap i can make 256 tiles out of it and give all completely black polygons the same lightmap but that still needs a lot of memory |
||||
|
||||
![]() JuNC Member since: 2/5/2002 From: Plymouth, United Kingdom |
||||
|
|
||||
| Why do you want an alpha channel in the lightmap? You could try using 16bit colour if it really is too big. You must determine the lightmap size from the size of the polygon. Lightmaps only look good if they all have the same scale (ignoring 'detail' lightmaps), which means a large polygon needs a larger lightmap. |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
instead you could make a nice large enough image with the lightmaps packed tight and export the necessary texture coordinates to go with it. |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| thats what iam doing but this still needs a lot of memory for huge polygon counts |
||||
|
||||
![]() AljosaH Member since: 10/14/2002 |
||||
|
|
||||
| BTW - do all good 3D engines based on OpenGL use lightmaps or can good enough effects be achieved with OGL lighting? |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| well as far as í know there is no really fast method to do realtime shadows on environments with more than 50000 polys visible what i am doing now is i generate a 32*32*4 lightmap for every polygon and then i merge several lightmaps which like very similar eg: lightmap 1 has 244 245 237 lightmap 2 238 237 244 and merge it to 241 242 240 or i don t apply lightmaps when the enviroment light stands perpendicular to the surface of a polygon or when the angle is <5° that should reduce quite a few lightmaps another thing i thought about is using OGL lights with the light colorsettings and only apply a luminance texture |
||||
|
||||
![]() Yann L Moderator Member since: 2/6/2002 From: Breizh |
||||
|
|
||||
| Sorry for the shameless plug (again "[Basiror] well as far as í know there is no really fast method to do realtime shadows on environments with more than 50000 polys visible" Approx. 290000 polys visible, 67 fps on a GF4. Not a single lightmap used. 100% dynamic perpixel lighting with shadowmaps: ![]() Never underestimate the power of modern perpixel lighting. You should consider using PP lighting instead of lightmapping, it can be a real alternative on newer hardware. / Yann [edited by - Yann L on January 9, 2003 6:40:42 PM] |
||||
|
||||
![]() Karg Member since: 8/16/2002 |
||||
|
|
||||
| Yann, I hate you. karg ps. how's the game going? any expected release dates? |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Couldnt you store lightmaps as grayscale, 8 bit, and store a hue/saturaton value for color? It might not be completely accurate, but you would shve 75% off the data... |
||||
|
||||
![]() Anonymous Poster |
||||
|
||||
| Hi Yann, whats the difference between a lightmap and a shadowmap? Beside this, I plan do compute the lightning for my indoor racing game through radiosity. Will the result of the radiosity calculations then be more lightmap-like or shadowmap-like? |
||||
|
||||
![]() Yann L Moderator Member since: 2/6/2002 From: Breizh |
||||
|
|
||||
quote: A lightmap is a (typically pre-calculated) texture map that contains the intensity values produced by a specific lightsource on specific geometry. The intensity values encode any possible shadow-effects, or even colour bleeding, in the case of radiosity. Shadowmaps, OTOH, do not contain the actual light values. They contain a depth-buffer from the viewpoint of the light. The textures themselves do not store RGB values, but depth values. They are computed in realtime, for each lightsource, using render-textures (p-buffers). Directional lights and spot-lights need a 2D texture, while pointlights use a cubemap texture. When rendering your scene, a special kind of depth compare operation (supported on GF3+) is done on the shadowmap's depth value and an interpolated component. The result is a realtime per-pixel shadow information, that can be used in a subsequent pixelshader. More informations about shadowmaps can be found here. (and a few more papers on the nVidia developer site). quote: Radiosity is precomputed, and therefore its solution is stored in lightmaps. You cannot (yet) compute radiosity in realtime. But ofcourse, the visual results of radiosity are excellent, so it might be worth using lightmaps for this purpose. Although you can combine lightmaps for the overall lighting, and shadowmaps for the effect of local dynamic lightsources. quote: Not yet. The shot above is from a public demo level, that isn't yet public because of .. hmm.. incompetent management people... nuff' said. Isn't so easy, if you develop a large game with a small team in a gamedev startup, while privately financing the development. / Yann [edited by - Yann L on January 9, 2003 7:38:05 PM] |
||||
|
||||
![]() Crazy_Vasey Member since: 2/2/2000 From: England |
||||
|
|
||||
| Holy shit! Yann! How did you pull those frame rates off? That's incredible. |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| wow that looks awesome i read the article but sadly i only have a gf2 ultra i want to buy a new system with these FX cards in around 6 months so is there a way to do it on GF2 ultra cards as well or do i have to wait ? |
||||
|
||||
![]() zedzeek Member since: 7/8/2000 From: nelson, New Zealand |
||||
|
|
||||
| >>Holy shit! Yann! How did you pull those frame rates off? That's incredible. << shadowmaps aint really affected much unlike say stencil shadows but the scenes polygon count, BUT theyre not to good for positional lights + aint supported on a lot of hardware >>so is there a way to do it on GF2 ultra cards as well or do i have to wait ?<< arb_shadow is part of opengl1.4 ive done it on a gf2mx (but its very very slow <0.1fps) as its done in software. there is another method that does work on the gf2 (its what i used in the screenshots below of KEA) but its limited to 8bits resolution (there r ways around this though) + its slower than arb_shadow (on cards that support arb_shadow that is) check shadowmaping at the nvidia developer site http://uk.geocities.com/sloppyturds/kea/kea.html http://uk.geocities.com/sloppyturds/gotterdammerung.html |
||||
|
||||
![]() Basiror Member since: 8/18/2001 From: Germany |
||||
|
|
||||
| i have downloaded they demo it worked fine for me |
||||
|
||||
|
Page: 1 2 »» All times are ET (US) ![]() |
Last Thread Next Thread ![]() |
|