Home » Community » Forums » OpenGL » LIGHT MAP GENERATION
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

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
Post New Topic  Post Reply 
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]    


 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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

 User Rating: 1057   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

it depends on the size of you texture the smaller the texture the more visible the step effect

 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Actually, it depends on both...

Height Map Editor | Eternal lands

 User Rating: 1598   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

Also, it depends on your filtering...
for a better filtering effect, filter all you lightmaps trilinearly...



 User Rating: 1015    Report this Post to a Moderator | Link

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

 User Rating: 1078   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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?

 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

quote:
Original post by Basiror
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?


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]

 User Rating: 1017   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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?



 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.

 User Rating: 1017   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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



 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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.

 User Rating: 1091   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link


instead you could make a nice large enough image with the lightmaps packed tight and export the necessary texture coordinates to go with it.

 User Rating: 1015    Report this Post to a Moderator | Link

thats what iam doing but this still needs a lot of memory for huge polygon counts

 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

BTW - do all good 3D engines based on OpenGL use lightmaps or can good enough effects be achieved with OGL lighting?

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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


 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Sorry for the shameless plug (again ), but I just had to post this, when I read the last post

"[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]

 User Rating: 1996   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Yann, I hate you.

karg

ps. how's the game going? any expected release dates?

 User Rating: 1022   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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...

 User Rating: 1015    Report this Post to a Moderator | Link

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?



 User Rating: 1015    Report this Post to a Moderator | Link

quote:

whats the difference between a lightmap and a shadowmap?


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:

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?


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:

ps. how's the game going? any expected release dates?


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]

 User Rating: 1996   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Holy shit! Yann! How did you pull those frame rates off? That's incredible.

 User Rating: 992   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

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 ?

 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

>>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

 User Rating: 1283   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

i have downloaded they demo it worked fine for me

 User Rating: 1093   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link
Page:   1 2 »»
All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: