View previous topic :: View next topic |
Lightmapper which casts shadows on bump maps? |
Useful |
|
50% |
[ 3 ] |
Why not |
|
16% |
[ 1 ] |
Totally useless |
|
33% |
[ 2 ] |
|
Total Votes : 6 |
|
Author |
Message |
HardTop Member
Joined: 10 Feb 2006 Posts: 15 Location: Belgium
|
Posted: Thu Jun 22, 2006 11:19 am Post subject: Bump-map aware Lightmapper? |
|
|
Hi folks,
I'm just thinking something that could be really useful:
As you can see it in the User Projects section of the forum (topic HT3D), I'm developing a 3D engine, featuring bump-mapping. The issue I have is that when I generate lightmaps on these bump-mapped textures, the lightmapper doesn't of course cast shadows on the bumps. Do you people think it could be useful/quick to develop enough to provide us with that feature in a future version of DeleD (be it PRO) ?
Thanks for your attention
Laurent AKA HardTop _________________ Sailing on the seven seas the
day tripper diem's ready
Jack the Ripper Owens Wilson
Phillips and my supper's ready |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Thu Jun 22, 2006 11:36 am Post subject: |
|
|
Bump mapping is a real time effect, the whole illusion only works when you view it from the right angle, to bake this in would kill the illusion. Also it's a per texel thing, and the lightmaps are not 1:1 with the texels in the bump maps most of the time.
Just a thought. _________________
|
|
Back to top |
|
|
HardTop Member
Joined: 10 Feb 2006 Posts: 15 Location: Belgium
|
Posted: Thu Jun 22, 2006 1:13 pm Post subject: |
|
|
I'd say that Parallax mapping is view dependent, whereas bump mapping is light dependent.
We can consider the lightmapping source as a static light which projects shadows on the bumps, regardless the viewing angle
As for the ratio, i'd say it depends on the UV coordinates
HT _________________ Sailing on the seven seas the
day tripper diem's ready
Jack the Ripper Owens Wilson
Phillips and my supper's ready |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Thu Jun 22, 2006 1:19 pm Post subject: |
|
|
I think the biggest problem is that not only the lumels aren't 1:1 with the texels from the bump/normal map, they are usually a _lot_ bigger (unless you are generating lightmaps at an insane resolution). Bumpmaps are used to add extra detail at exactly that fine grained level where lightmaps are just a blur. |
|
Back to top |
|
|
Sindwiller DeleD PRO user
Joined: 25 May 2005 Posts: 331 Location: Zürich. Switzerland
|
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Thu Jun 22, 2006 7:53 pm Post subject: |
|
|
I don't think at this point in time DeleD should be calculating Horizon maps. Horizon maps are directly derived from the underlying bump map (i.e. they are not based on the geometry or the lights)... oh, did I mention that DeleD is not even bump map aware yet?
Then again, I don't really think horizon maps are what Hardtop had in mind. They are not exactly a common technique in game engines. |
|
Back to top |
|
|
HardTop Member
Joined: 10 Feb 2006 Posts: 15 Location: Belgium
|
Posted: Thu Jun 22, 2006 9:36 pm Post subject: |
|
|
Yeah, horizons maps are used to generate real-time, self-casting shadows with bump maps. What I'd like to see here is the same as in a 3D engine: a lightmapper which uses the normals stored in a bump map to generate extra light detail on a surface.
The purpose is to be able to use no extra OpenGL light to see the bump effect. At this time, I see the bumps only when the flashlight is on. If I switch off the OpenGL light, I still see the lightmapped geometry, but the bump effect disappears, of course.
HT _________________ Sailing on the seven seas the
day tripper diem's ready
Jack the Ripper Owens Wilson
Phillips and my supper's ready |
|
Back to top |
|
|
Sindwiller DeleD PRO user
Joined: 25 May 2005 Posts: 331 Location: Zürich. Switzerland
|
Posted: Fri Jun 23, 2006 10:19 am Post subject: |
|
|
Well, "normal" Bumpmapping is crap (correct me when im wrong^^). It is pure Texture-Blending, no per-pixel lighting there. I would prefer either normal mapping or parallax/parallax occlusion mapping. They maybe cost more performance but have more effect than Dot3(right?) Bumpmapping.
Wfr, Sindwiller |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Fri Jun 23, 2006 5:53 pm Post subject: |
|
|
Hardtop: like posted above, on an average surface the bumpmap is at a way way higher resolution than the lightmap. Remember the lightmap is not per-pixel, far from it. The resolution is closer to 1 lumel every 16 texels (as a very rough average). This means your bumpmap will only result in approximately correct lighting if it is very very low-resolution... in which case you wouldn't be using a bumpmap in the first place.
If you know any existing implementations of the technique you propose, please point me towards them. Perhaps there are simple ways to overcome the resolution-issue, but at the moment I don't see how.
That said, we might actually implement this behaviour in the future, but only after DeleD has full integrated normalmap support... at the moment, DeleD doesn't understand the concept of normal maps at all, so adding support for it to the lightmapper is simply not an option. |
|
Back to top |
|
|
HardTop Member
Joined: 10 Feb 2006 Posts: 15 Location: Belgium
|
Posted: Fri Jun 23, 2006 8:40 pm Post subject: |
|
|
to Sindwiller: what I mean is normal mapping: a normal map storing normals XYZ into RGB values
to PJ: I understand what you mean. Each lumel is way lower resolution than each "bumpxel" The lightmapper is currently not per-pixel. I understand it's not an option, and I don't know how to overcome this issue. It was just a thought thanks anyway for giving feedback folks! Keep up the good work!
HT, a happy DeleD PRO user _________________ Sailing on the seven seas the
day tripper diem's ready
Jack the Ripper Owens Wilson
Phillips and my supper's ready |
|
Back to top |
|
|
Daaark DeleD PRO user
Joined: 01 Sep 2004 Posts: 2696 Location: Ottawa, Canada
|
Posted: Fri Jun 23, 2006 8:46 pm Post subject: |
|
|
HardTop wrote: |
to Sindwiller: what I mean is normal mapping: a normal map storing normals XYZ into RGB values
to PJ: I understand what you mean. Each lumel is way lower resolution than each "bumpxel" The lightmapper is currently not per-pixel. I understand it's not an option, and I don't know how to overcome this issue. It was just a thought thanks anyway for giving feedback folks! Keep up the good work!
HT, a happy DeleD PRO user |
Why not a shader that takes the lumel as the light value and modifies it by the normal in the normal map layer? You get the best of both worlds. (I don't do shaders, and I'm not the guy to get talking about that low level stuff, but sounds like it might work?)
I remember they did something like that in the Buffy Game on xbox and it looked really nice. The lightmaps were just the standard low res ones, but the bricks were bumpy underneath it, and other objects had highlights on them too as if lit in realtime... _________________
|
|
Back to top |
|
|
Twixn DeleD PRO user
Joined: 01 Dec 2005 Posts: 136 Location: Melbourne Australia
|
Posted: Sat Jun 24, 2006 11:28 am Post subject: |
|
|
IMO the only way to combine bump mapping and lightmapping
nicely is to remove the NdotL calculation from the lightmapper
in DeleD, and use only the distance attenuation and shadows
from the lightmap, while shifting the NdotL calculation
to the realtime shader.
Otherwise Using bumpmapping and lightmapping would cause
the NdotL calculation do be done twice, causing the scene
to be inconsistantly darker than it should be.
Although I think Vampyre_Dark said the same thing.
-Twixn- _________________ Failure is not an option!....It comes bundled with the software. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Sun Jun 25, 2006 3:03 pm Post subject: |
|
|
Jokingly: I think DeleD versions before 1.2 didn't do NdotL at all, so you could trying reverting that that.
But on a serious note, good point. It would mean that even light with a negative NdotL would still affect the surface in the lightmap, right? (as the lokal bumpmap angle could be a lot different)
If we'd make an option like that available through the interface at some point in time, what would it be called? "Light angle falloff' disabled/enabled?
Sounds a bit arcane for a material setting. And it's very technical, because in the eyes of an artist it's just the setting that makes 'the lighting look all wrong' (until you do the post-processing stage).
Once DeleD gets full support for bump/normalmapping, this setting would be implicit. I wonder if it's something worth having before that time.
It depends a bit on feasible it would be to cover up the 'double-fallen-offiness' (lol) of the scene for someone doing bumpmapping (like hardtop and team). |
|
Back to top |
|
|
|