Jump to content

  • Log In with Google      Sign In   
  • Create Account

LIGHT MAP GENERATION


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
38 replies to this topic

#1 Basiror   Members   -  Reputation: 241

Like
Likes
Like

Posted 05 January 2003 - 01:01 PM

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]    


Sponsor:

#2 Drag0n   Members   -  Reputation: 186

Like
Likes
Like

Posted 05 January 2003 - 01:47 PM

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

#3 Basiror   Members   -  Reputation: 241

Like
Likes
Like

Posted 05 January 2003 - 09:25 PM

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

#4 Raduprv   Members   -  Reputation: 997

Like
Likes
Like

Posted 06 January 2003 - 08:33 AM

Actually, it depends on both...

Height Map Editor | Eternal lands

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 06 January 2003 - 02:35 PM

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



#6 CraZeE   Members   -  Reputation: 217

Like
Likes
Like

Posted 07 January 2003 - 02:08 AM

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

#7 Basiror   Members   -  Reputation: 241

Like
Likes
Like

Posted 07 January 2003 - 03:53 AM

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?

#8 ga   Members   -  Reputation: 126

Like
Likes
Like

Posted 07 January 2003 - 10:46 AM

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]

#9 Basiror   Members   -  Reputation: 241

Like
Likes
Like

Posted 08 January 2003 - 01:44 AM

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?



#10 ga   Members   -  Reputation: 126

Like
Likes
Like

Posted 08 January 2003 - 03:51 AM

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.

#11 Basiror   Members   -  Reputation: 241

Like
Likes
Like

Posted 08 January 2003 - 06:12 AM

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



#12 JuNC   Members   -  Reputation: 236

Like
Likes
Like

Posted 08 January 2003 - 08:14 AM

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.

#13 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 08 January 2003 - 05:54 PM


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

#14 Basiror   Members   -  Reputation: 241

Like
Likes
Like

Posted 09 January 2003 - 02:56 AM

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

#15 AljosaH   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 January 2003 - 10:45 AM

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

#16 Basiror   Members   -  Reputation: 241

Like
Likes
Like

Posted 09 January 2003 - 10:54 AM

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


#17 Yann L   Moderators   -  Reputation: 1798

Like
Likes
Like

Posted 09 January 2003 - 11:34 AM

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]

#18 Karg   Members   -  Reputation: 133

Like
Likes
Like

Posted 09 January 2003 - 11:41 AM

Yann, I hate you.

karg

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

#19 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 09 January 2003 - 11:57 AM

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

#20 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 09 January 2003 - 12:22 PM

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?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS