Hi Polycount Community :]
Sorry in advance for my awful english, I'm a frog :poly136:
I try to have some decent results while generating lightmaps with 3ds max via Vray.
First I tried without hlsl shader. The final RT engine (virtools) has some basic blend modes.
I used the multiply mode, but then, lightmaps only darken the model, so textures have to be over lightened.
I used what i think is called "modulate 2x". Here, average grey don't do any modification. Dark color darken the under texture, light color burn the under texture. So it's already more realistic than multiply mode, but all gradients are dirty, because the lighting range is divided by 2 : 128 levels to darken, 128 to lighten.
(hope i make sense
)
So, since I'm not in real time industry and have to find all tips by myself, I wonder what kind of blending modes hlsl shaders in video games are using. Coz it looks far better than what i have. And how cgartist can light there scenes, control them with some renders, and be sure that the result will be what they get into the engine. So how u guys generate ur lightmaps when u have no editor such as UE3 ?
Thanks to light my candel !
Replies
Modulate 2x is almost good, except those awful artefacts due to the divided range. And well i don't see that kind of thing in games.
I wonder how to make a nice static lighting on a RT scene like I've seen here.
http://boards.polycount.net/showthread.php?t=56421&highlight=lightmap
Ofc, here it's a quite complex hlsl shader, with normal/specu/env maps. i guess i have to study the code deeply to understand all blending modes. It scares me a bit.
I was asking for some tips. Dunno, lightmaps seems like a mystery to me.
thnx anyway :poly121:
Look for "radiosity normal mapping" by valve (half-life 2), similar technique is used in Unreal3 as well. However it requires dedicated support of the lightmap generator and of course some custom shadercode.
---
the screenshot you've shown very likely uses cubemaps for lighting. and maybe some image based ramping.
here is a shader for 3dsmax that supports this
http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf
Characters or moving objects wont use pre-generated lightmaps
finalcol=(finalcol*LightLayer* 2.0f);
clamp(finalcol,0,1);
finalcol = (finalcol)*(diffuselighting*2.0f);
finalcol *=lightColor*0.8f* burn;
Last line is for depth shadow maps,but otherwise its modulate2x i guess,and i haven't really seen this banding of gradients,mind posting a screen?
Here are 2 screens from virtools. It's a very basic scene. No hlsl shader, just full illuminated materials. Lightmap material is set to sourcecolor/destcolor.
It took me hours to discover how i should setup lightmaps to have same results between vray renders and virtools gah :poly142:
So well, it's not that bad with a average lighting :
but when lightmap is darker, i start to have some color artefacts and dirty gradients. I blured my lightmap a bit in ps, so it's a bit better. The problem is just that modulate 2* accentuate imperfections of the lightmap. I guess there are some issues with color clamping too.
Also this scene is pretty basic and doesn't need an extraordinary lighting, but i'm thinkin about more serious project in future too.