RE: [Algorithms] Real-time lightmapping
Brought to you by:
vexxed72
From: Akbar A. <sye...@ea...> - 2000-11-14 21:35:27
|
>I'm stuck at the part where I have to find what pixels on the lightmap the >poly covers. id's and uv coords.. check www.flipcode.com they got a lot of stuff there.. >be some way to sort of render the poly onto the lightmap to get what pixels >I should be lighting using the UVs. ? texture mapping is like gluing a texture onto a poly. you have a lightmap, usually precomputed, and part of a bigger texture with id's and size positions, your usualy. then you match up the id's, do your image changes and match, to the polygonol facets. there is a panda tutorial somewhere on the net about variuos blending modes.. check www.google.com for lightmapping panda ? theres a refrence to it in realtime rendering ;) laterz, akbar A. ;vertexabuse.cjb.net -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Jason Zisk Sent: Tuesday, November 14, 2000 1:03 PM To: Algorithms List Subject: [Algorithms] Real-time lightmapping Hi everyone, if you remember I was asking about how dynamic lighting is done on static lightmapped environments before. I think I want to try the "raytrace" approach for now, just because its a bit less hacky. I'll decide if its fast enough later. :) I have a lightmapped environment, the lightmap textures are already generated (packed onto larger textures), and the polygons have lightmap UVs set. I have a light source, point light for now, that has a radius, intensity, color, etc. I'd think the algo would go like this: find all the polys in the env that intersect the light's radius for each of those polys for each pixel in the lightmap this poly covers convert pixel to world space light pixel depending on distance from light source I'm stuck at the part where I have to find what pixels on the lightmap the poly covers. I'd think I could take the UV of vertex zero on the polygon, and find what pixel in the lightmap that is on, light it. Then I need to find some way to find which pixel to move to next. I'm not sure how to do that. I could just go left->right - up->down in a square on the lightmap, calculating the world position of each pixel and if its not inside the polygon don't do any lighting on it, but I'd imagine that would be incredibly slow. There must be some way to sort of render the poly onto the lightmap to get what pixels I should be lighting using the UVs. I figure once I have the pixel on the lightmap I want to light, I can just convert it to world space and light it. That's the easy part. :) Thanks for any help, - Jason Zisk - nFusion Interactive LLC _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |