Lighting players based on lightmaps
Blitz3D Forums/Blitz3D Programming/Lighting players based on lightmaps
| ||
`m trying to use this technique to light my characters correctly in-game, and real time. I found this: http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=kusonagi09182003234308&comments=no But can`t seem to get it to work, it just reports the same value all the time no matter where I am in my level. Has anyone got any advice / tips? Is there a better way? I`m using levels output from Cartography Shop, with lightmaps. |
| ||
I got tired of using lightmaps to do that, for example, if the player jumps off a ledge, the lighting would be incorrect... |
| ||
You can try using these functions: http://www.blitzbasic.com/codearcs/codearcs.php?code=515 |
| ||
Rob: Yeah I thought of that, but haven`t worked out any better way to do it yet :S Fredborg: Cheers for the functions, but will these do what I want (calculate the pixel colour from the lightmap, based on a linepick from the player in the 3d world) ? What is the best way to do this? |
| ||
Thats how the old Unreal Tournament engine did the lighting on the player models, from the light map directly below the player. I would think the only other way to do it would be to create volume lighting data. Anyway you do it you are going to come up with errors unless you are doing light mapping calculations on the player. One other way I could think is to cast a ray from the light positions to the player checking collision and including fall off. you could place 3 lights parented to the player and consider only the most significant lights around the player in the the setting of those light colors. |
| ||
So is using this method good or bad, are there better ways? I also beleive Ravey used this method in Root (if my mind serves me correctly!) |
| ||
Am I asking a hard question - cos I`m not getting any replies on BC.com either? |
| ||
This method is fine. But it does depend greatly upon the game. If the objects you are going to light in this manner are never far from the floor then this method is perfect acceptable. |
| ||
another method is to use fog on a cubemap camera and render the very low res cubemap to the player, but I've no idea how good this will look. |