PDA

View Full Version : Using Diffuse Maps in Games


NeptuneImaging
07-09-2004, 12:39 AM
I have a question for a lot of the modelers and game designers here, but are diffuse maps useful on models that resemble realism? Right now I am painting a dojo house with a color, translucent, bump, spec, and diffuse map, and I want to know if this is important...

It is a 512x512...

Thanks in advance.

TwoFaced
07-09-2004, 01:33 AM
I'm not so sure how useful it would be on a building, however, I know Unreal 2 used diffuse maps on some of thier player models. It really helped on the flesh of the humanoid models, gave it that little something that just made them seem a bit more realistic.

GoK
07-09-2004, 01:12 PM
ok i did a little research on this and found that diffuse maps can be usefull for anything that absorbes light :) well dahh you all say :P but anyway here is a link to a little article on diffuse maps i hope this helps

http://www.noir.org/tutorials/Sama/PowerOfDiffuse/powerofdeftut.html

and iv got a question of my own, in 3d max the diffuse map is the colour map ?!?! what is max's diffuse map channel called ?

Thanks, Jody

NeptuneImaging
07-09-2004, 01:19 PM
Wow, cool article. Good, because I look at games and some they don't even bother with a diffuse map. Sometimes, a good shortcut I found is I can pick the base color and lower the color's brightness to that diffuse level...

Ghostscape
07-09-2004, 01:34 PM
I always thought that the color map was the diffuse map?The Diffuse map he's showing looks more like a light map, which is already in use in level creation.

GoK
07-09-2004, 01:42 PM
ok i thought i knew what was going on with the subject but you just confused me :P so in max the colour channel is diffuse and the diffuse is the colour ? that seems like a majour problem or mistake to me... heheh

Jody

EricChadwick
07-09-2004, 01:44 PM
The Standard material type in 3ds max has a Diffuse Color channel which is really just color. The Raytrace material divides it into Diffuse (color) and Diffusion (true diffuse).

But in games, if you want the diffuse absorb-light effect, and your game engine doesn't have the newer lighting effects like ambient occlusion (darkening in recesses), then IMO the best bet is to just paint it into the color map. There's no real advantage to having a separate rendering pass just for a static painted lighting effect. Besides the increased texture memory overhead of another bitmap.

However, if your diffuse map somehow changed noticeably under different light conditions, then I can see it being worthwhile. But then you're talking a non-pre-computed texture, more of a run-time dynamic system, something that's usually adjustable by the artists (as light values) but applied to models by the coders (first as a pre-pocessing step to calculate varying lighting throughout the scene and store it in some intermediary textures, then applying the appropriate lighting info to models based on their location in the scene).

Half-Life 2 does something like this, and it's pretty effective since you can see soft lighting effects change on a character as it moves about the room. I believe they use a simplified form of Spherical Harmonics. Another term used for it is "cached Diffusive Irradiance Mapping" and it does look pretty good.

There's a PDF about it from ATI's site, with some great illustrations...

Half-Life 2 / Source Shading by Gary McTaggart, Valve Software
http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf

Hope that helps. I find this stuff very interesting. Next generation engines will be using this kind of technology more and more. If you're shooting to get into the games industry, you'll find that artists are in transition, from the old way of painting all your lighting into the color map, to the new way of separating your color information from your lighting information. It's kind of hard to make the transition, when you're used to painting all the shading.

Matt
07-09-2004, 02:09 PM
Personally I think lightmaps are a waste of a texture stage.

If your engine cannot support normal maps, then you could/should probably bake the shadow information into the diffuse/color map. Lightmaps are good sometimes when dynamic lighting is present, in a moody game, but it's just a waste to consider in these times, when we can have depth, shadows, and specularity in the same stage with normal maps.

Edit: Well, moderate specularity, that is.

EricChadwick
07-09-2004, 03:20 PM
Are you saying spherical harmonics and ambient occlusion are a waste? I have to disagree.

Normal maps, specularity, and shadows are only enahnced by good lightmapping techniques. Without good lighting, even the best normal maps look flat. Far Cry is a good example... just a directional light and a solid ambient makes for a poor lighting model IMO.

Take a good look at that paper, you should be able to see what's possible with the new lightmapping tricks...

NeptuneImaging
07-09-2004, 03:25 PM
As far as a diffuse mapping is concerned, I have a model with a 512x512 color, diffuse, spec, and bump maps. My 512x512 was a bit blurry looking but I enhanced it with a bump map.. Would that be considered one texture or four textures. Such as game engines only allow a limited amount of textures per model.

EricChadwick
07-09-2004, 03:41 PM
That's four. Though many engines let you combine maps together by using the different color channels, so you could narrow it down to two... RGB=color, alpha=diffusion; RGB=bump, alpha=specular. I've seen some schemes where each of the four RGBA channels were used for different monochrome effects... the image made no sense visually, but worked when separated by the engine.

NeptuneImaging
07-09-2004, 03:49 PM
So, I can simply ax the diffuse map and keep the bump, color, and specular. Okay, as long as the texture count is for one object, right? Because I even have a map for things I could not fit into the house map...

That is about 6 textures for the house. Could I also use my diffuse trick and paint the diffuse value into the color? Such as: 113, 113, 255 (color value) w/ brightness at 100%. My trick is to choose the color about and alter the brightness to 65% percent (My diffuse value in Lightwave).

Will that work?

NeptuneImaging
07-09-2004, 03:57 PM
Oh, wow. it DOES work...cool...

But I still want your input guys...I found that half life article extremely interesting...

Schwinnz
07-09-2004, 04:01 PM
Personally I think lightmaps are a waste of a texture stage.

If your engine cannot support normal maps, then you could/should probably bake the shadow information into the diffuse/color map. Lightmaps are good sometimes when dynamic lighting is present, in a moody game, but it's just a waste to consider in these times, when we can have depth, shadows, and specularity in the same stage with normal maps.

Edit: Well, moderate specularity, that is.
... but lightmaps are really useful on tileable texture. And often you can easily keep lightmaps at a very low resolution 128,64 and sometimes 32... unless you want crisp shadows.

EricChadwick
07-09-2004, 04:06 PM
The # of textures, and their pixel sizes, is a tricky thing to decide on. In my experience in game development, you have to do some calculations based on the hardware you'll be running the game on (what storage constraints there are, and how much "live" memory you have to work with), plus how prominent each particular game asset will be (how close you'll get, how often you'll see it, how important it is, how fast it will be moving, etc.), plus how much memory should be set aside for other non-art assets (A.I., game logic, sound, etc.). It can get complicated.

So there's really no short answer. On many projects the programmers will give the art team the limits, along with some extra padding because they know the artists will probably go over budget. Also there's often some reduction of the artists' textures late in the development cycle, because there's too much art and rendering performance is poor, or storage is getting tight. Either the programmers do this with some "smart" code, or some technical artists hand-tune the assets by lowering texture rez or decimating polygons or simplifying shaders. Painful but true. The best teams are ones that plan carefully, avoiding a lot of these problems upfront (but not all, hardware is an ever-changing target).

Not sure what diffuse trick you're referring to. Usually it's either "paint in the shading by hand using a paint program" or it's "bake in some lighting from my 3d software" or a combination of the two.

I hope the time it takes me to type all this stuff up helps you. I couldn't have learned all these things without others sharing their experiences with me (or going through it myself).

CGTalk Moderation
01-18-2006, 05:00 PM
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.