Home Technical Talk

Question about Diffuse map

Krisonrik
polycounter lvl 17
Offline / Send Message
Krisonrik polycounter lvl 17
I don't quite get the idea of diffuse map. How to create a diffuse map and so on. Anyone can give me some tips or link to creation of diffuse map?

Replies

  • Eric Chadwick
    Leigh is wrong, IMHO. She seems to have learned about real-world light by examining the way CG lighting has been broken down into lighting elements. But CG lighting is really just a bunch of hacks, optimizations written for performance reasons, basically CG lighting has been written to render faster than its real-world lighting counterpart would, if you converted real-world formulae into CG rendering.

    Diffuse is the same as color, it is albedo response. Leigh's diffuse map is basically just a mask for her colour map. She says it isn't the same to just darken the colormap, but it is in fact the same result, in my experience.
  • sinistergfx
    Offline / Send Message
    sinistergfx polycounter lvl 18
    It probably depends largely on the software and renderer you're using.
  • thomasp
    Offline / Send Message
    thomasp hero character
    indeed. the problem comes from 3ds max using the term diffuse map for what the rest of the world calls a color map. in max's raytrace material, you can find the diffusion map slot, that is probably, what leigh is talking about when she's referring to a diffuse map (do recall her old cgtalk article only very vaguely but wasn't it lightwave-oriented?).
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    in max / simple Cg world: diffuse is surface with normal at maximum 90° to the light. beyond that (backfacing light) is ambient.

    so in opengl or whatever you will find two color values you can tweak for light and material: diffuse/ambient. which will be picked based on normal/light relationship.
    however as normally those engines still use just one texture for both, ie mix the result of the lighting color (which either be diffuse or ambient) with the texture, it is probably, why she thinks of it as a mask.

    so simple lighting is like this:
    . check dot product tolight/normal
    . if normal frontfaces (dot product > 0)
    -> resultcolor = material.diffusecolor * light.diffuseintensity * dotproduct (the closer the two directions match the closer it gets to 1)
    else
    -> resultcolor = material.ambientcolor * light.ambientintensity
    . final color = resultcolor * texturecolor

    as you see that ambient is just a single plain color, no shading involved, hence it looks rather dull, and isnt really realistic. there are other lighting models that also make use of the dotpruduct when facing away from the light.
    e.g.gooch shading http://images.google.de/images?q=gooch+shading&hl=de&btnG=Bilder-Suche
    it is often used for npr stuff

    in reality I would say there is only diffuse lighting, ambient is just a Cg hack for radiosity, as they need to shade areas with colors where the light doesnt hit directly, but they couldnt afford doing the diffuse reflections for the whole world (light hits wall, fraction of it reflects from wall to floor, reflects again...)

    that is why you bake ambient occlusion maps, so that the flat ambient color does take some of those reflections in account.
    also lightmap generators with radiosity try to work around the cheap ambient.

    because when rendering in realtime, you normally have no clue how the environment looks like, every model, actually every vertex/pixel is on its own, with know knowledge about the rest. so two pixels on the same triangle, no shit about each other, neither do vertices of the same. (however this is changing with dx10 generation)

    compared to offline renderers where you know the full world and can afford to shoot rays around it, this is a major disadvantage.

    that is also why offline renderers are used to precompute some results in form of textures, or other lighting coeffcients (in case of those realtime "radiosity" renderes), to give every vertex/pixel an easy lookup method of some world/object properties.
  • Eric Chadwick
    Max's Diffusion slot in the raytrace material merely darkens the map in Max's Diffuse slot. Here's what the help file says (yeah, not much). I'd love to see what other apps say in their help files.

    [ QUOTE ]

    Diffusion Mapping
    The Diffusion map component lets you apply an additional, second texture to modify the Diffuse component. Typically, you will want to reduce the Amount of this map to allow the main Diffuse map to show through.

    For example, you might have a clean, bright image for a billboard. You use this image as the Diffuse map, and then use a second map as a Diffusion map to apply soot and city grime.


    [/ QUOTE ]

    Back to the original question, I guess you might be asking how to approach color maps in general, not specifically the rarely-used diffusion thingy?

    One thing that helps me is to imagine what the surface would look like if it was illuminated from all sides, so it wasn't shadowed in any of its crevices or underhangs. Also I try to imagine the surface without any shininess at all, just what the "base" colors would be.

    But then when it comes to painting game textures, you'll want to add in some ambient occlusion (crevice shading) to overcome the generally low quality of in-game lighting.
Sign In or Register to comment.