Lightmaps + bump mapping

Started by
4 comments, last by emosoft05 19 years, 3 months ago
Hi, I am trying to add bumpmapping to my game. Currently it uses lightmaps... I love lightmaps because you get beautiful shading from radiosity + quality shadows, for free. So, my first instinct was to try some kind of hybrid approach (read: hack) which combines lightmaps and bump mapping... Here's my result so far: It seems to be the kind of effect I am going for, but I still have some problems/questions... Sorry if this is basic stuff, this is my first time doing bumpmapping of any sort, so pls bear with me ;) 1. Currently, only areas which are lit up by a dynamic light appear "bumpy". So, if you put a light near the wall, suddenly it will look like it has bricks. If you move the camera to a different area, away from the light, then the wall looks like it doesn't have bricks... Does this mean that, to have a bumpy surface, I'm going to have to place a crapload of lights all over my levels? 2. Another basic question... Let's say my level geometry is simply 1 huge mesh that I am rendering in one go. Say the level has 5 rooms, each room has 1 light. Is it possible to prevent the light in 1 room from lighting up a different room? Thanks very much, roos
Advertisement
try a google for radiosity normal mapping and check the ATI dev pages for the GDC04 paper on it from Valve, well the paper is about the HL2 engine but they have some stuff in there about what I think you are trying todo
maybe use emboss bump-mapping or detail textures for ambient lit surfaces.

do you plan on using bsp+pvs or a cluster/portal? basically you would want to identify which area you the light is in. leaf for bsp based, sector for portal based. then you need to determine if that leaf/sector can see to the leaf/sector you are in or vice versa. a quick hack would be to define each room as a sector and just check to see if the light is in the camera's sector.
Thanks very much guys, this clears up a lot of things :)
One approach that helps is to have some ambient occlusion built in to your textures or normal maps.

In other words, you should be able to see the brick outlines just from ambient light, right?

One way to do this is to encode an ambient occlusion term into the texture itself, or into the normal map alpha. Then you take this into account when doing all lighting ( including light maps ).

This way you get high frequency local shadowing from the normal or diffuse map, and the lightmap can stay low-res.
also, theres a trick used in some games where a fake light is placed at the camera's origin. you could use this for bump-mapping ambient lit surfaces. just make sure that you are not adding specular highlights. if you are using a normalization cubemap, you can probably just scale the vertextolight vector by some uniform value. or you could adjust the normalization cubemaps brightness.

This topic is closed to new replies.

Advertisement