PDA

View Full Version : Directional Lightmaps


ma3stro
04-17-2007, 07:14 AM
We're working with a game engine that does not have a lightmap renderer, but supports pixel shaders up to 3.0. We can create any shaders we need in order to get the results we want, but we need to preprocess lightmaps in a special way to achieve directional lightmapping (Source Engine/UE3/Crysis, etc).

Does anyone have any ideas on how we can achieve this in Max? The only idea that comes to mind is writing a special mental ray shader that gives us the desired output, but we'd have to contract that out since no one here has experience with mental ray shaders.

Here are some papers that explain the technique:

http://stud3.tuwien.ac.at/~e9907459/directionalLightmaps.pdf
http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf

MasterZap
04-26-2007, 08:16 AM
Interesting technique!

I don't think you'll find any of the built in shaders being able to do the job. However, something could probably fairly trivially be written for mental ray to do it. You could probably take some help from mental ray's final gathering feature, since it already stores data in a directional manner, so you could, in principle, simply do a final gathering pass, and then build the three basis functions out of directional lookups into that.... (by changing state->normal prior to the lookup)

/Z

ma3stro
04-26-2007, 08:26 AM
Yeah, I figured as much! Unfortunately nobody here has the faintest clue how to write a mental ray shader (for Max or anything else). Well, if anyone has some free time and can do some contract work let me know! ;)

CGTalk Moderation
04-26-2007, 08:26 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.