Home Unreal Engine

UDK Material/Black Diffuse for metal

Accipiter
triangle
Offline / Send Message
Accipiter triangle
So I kind of quickly tried out joeriv's approach to the black diffuse with metal with only color from the spec.
http://www.polycount.com/forum/showpost.php?p=1942890&postcount=67

In the game world, it's a bit lack luster.
I'm guessing the ToolBag 2 tool has more settings to make things look more pretty than just a default material setup in Unreal.

I tried throwing a reflection map onto the cube, but I'd need to make a custom one (reflection mask) to make it look any good.
I believe I'd also need to create a custom gloss map and spec just to make it look better, but while moving around the object in the game, it looks ridiculous. Especially with just a black diffuse map.

Unreal_Texture_Test.jpg

Replies

  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    You're getting exactly what I'd expect from the setup you've described.
    What do you want it to look like?
  • Accipiter
    Offline / Send Message
    Accipiter triangle
    Yeeeah...not sure yet, I'll have to add some detail to the Spec and Gloss.

    I was kind of hoping for something amazing I guess.
    Just made me think, if this was a way of getting close to physical accurate I should try it. However without any light in the scene you're going to get a 100% black object.
    Which I wouldn't think metal itself is 100% black.

    Granted if you were in a dark room with any object, no matter what material, everything would be 100% black.

    I'm just not sure how this should be approached and I'm guessing with all the talk of next gen things will be laid out in an easier to understand approach.
    I've been reading Sebastien's blog on this, but I guess for just trying to make things look correct I'd have to take gir's approach.

    http://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/

    http://www.polycount.com/forum/showthread.php?t=124934

    Overwhelmed with info.
  • Madosho
    Offline / Send Message
    Madosho polycounter lvl 3
    To try and answer those questions:
    (This is the way i understand it, so feel free to shout at me if I get it wrong =D )
    Just made me think, if this was a way of getting close to physical accurate I should try it. However without any light in the scene you're going to get a 100% black object.
    If an object does not recieve any light, it will not reflect any light. And so, it will appear black.
    Which I wouldn't think metal itself is 100% black.
    The reason why the diffuse is black is because metals have the special property of not allowing light to enter. So this means that no diffuse reflection can take place. This leaves you with a specular reflection that gives the metal his color.

    And yeah, i suck at explaining. Lolololol =D.
  • Santewi
    The diffuse reflection part of metals is black (or at least very close to black), as no light is reflected. All of the reflections are specular reflections, and if you want good looking metal, you need a cubemap / RTT reflections multiplied by your spec color (something like HEX: FFE29B for gold) and blurriness of the reflection controlled by gloss/roughness.
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    Ah ok. That makes sense then.

    What it seems you're experiencing is difficulty reconciling physical lighting with the virtual approximations.

    You are correct in that in a dark room everything is black. This is actually a good insight into the nature of how we experience color. The concept of diffuse color is only valid in the computer graphics world. Everything in real life gets its color from reflection, which, to be more accurate, is absorption and emission.

    Some things are rough on a molecular level, so they scatter light all over, even if its only within a certain wavelength, so these appear soft and colored. They are highly diffuse surfaces. Some things are smooth and well ordered on a molecular level, so they scatter light much more like a mirror, or they are highly specular surfaces.

    Most polished metal is like this. So the colors it exhibits naturally are the colors of the environment. Many metals have no natural color, they're effectively black. This becomes very apparent when you have metal in powdered form:
    320px-Powder_steel.jpg (powdered steel)

    In a non physical shading model, like most current/previous gen renderers, you want to start with a black or dark diffuse, and have a reflection map of the environment provide color to the metal objects. This is because the reflections are added to the diffuse color for the final render, and black does not distort those reflected colors in any way. (color math 0,0,0 + r,g,b = r,g,b)
    The particular quality of the metal is communicated through the sharpness of those reflections, until we get to something approaching a grey diffuse for very rough metallics.

    There are a lot of approaches to creating realistic metals within a non physical render pipeline. What you'll wind up using will vary depending on your desired outcome, personal technical ability, and time you want to spend on it. :)

    UDK's basic shader is good. Its effectively the basic shader used in most CG since the mid 90's. So if you just plug stuff into it, you'll get that basic CG look. Anything special or spectacular comes from specifically building a shader to fit the needs of the result.

    A large part of what makes stuff look great in toolbag is the image based lighting. You're not really going to get that in UDK. There are some shaders for something approaching it floating around here (polycount), but its still not quite great because its not built directly into the engine, so performance suffers.


    I hope at least some of this is informative. If your current direction is "something that looks metallic" then you definitely are going to need an appropriate cubemap to ground it visually in the scene. Gloss and spec in the basic udk shader do not affect the cubemap, they affect the virtual lighting and how large or pronounced the hotspots are.
  • Accipiter
    Offline / Send Message
    Accipiter triangle
    @Madosho, yeah, that makes sense. When I was rotating the object around I caught the black diffuse and thought to myself, 'That doesn't seem right.'
    In the static mesh previewer I was getting those results because of the one light in that scene. So it makes sense.

    @Santewi, I didn't think about multiplying my spec color in with the reflection. Good insight. I ended up just attaching the diffuse to it, but giving me bad results.
    Just a minute ago I attached just the regular Spec to the reflection nodes, but it blooms the heck out of those metals/colors.

    @Vailias, Dude, rock on with this helpful info! I totally agree with your statement of "depending on the time spent". The stuff I'm working on needs to be done in a timely manner, but seeing everything out there on trying to achieve that physical shading had me intrigued.
    I'll have to spend some free time to get a good flow down.

    Thanks for all the useful information everyone!
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    Glad to be of help.
    Also what you said before about "just trying to make things look correct I'd have to take gir's approach." is correct. That's the main image based lighting shader hack I was talking about actually.

    One other concern I forgot to mention is "what else is in your scene?"
    If you have one photorealistic piece of shiny object and everything else looks like early 90's cg, then its all going to look more fake than if all of it was early 90's cg.

    Assuming you're looking for an xbox360 generation "realistic" look you'll want to have a few things to help out with the metal.

    Establish the shiny and less shiny bits early. This includes wear, nicks and scratches, polished faces, etc. This will be your gloss map. It should be greyscale. within the shader be sure to multiply the output of your cubemap by this gloss map before you plug it into the specular color input. Also if you're having other non metal bits that you're handling specular in the traditional way for, be sure to have them as black in the gloss map, or otherwise mask them out of the cubemapped reflections before adding in the spec color map or everything will look glossy. Likewise be sure your metal areas are black in the spec color map.

    The diffuse map for your metal can be a dark greyish color, potentially with some slight mottling if that suits your look. Take your gloss map for the previous step, copy it and invert it, then multiply it on the metal areas of your diffuse. What this will do is keep the shiny metal areas from getting overblown, while letting the rough metal areas still have "color" when they're lit, but never appear to be glossy.

    Specular power can be controlled by the gloss map, though I recommend that you use the map as the alpha input for a lerp between something like 3 and 50, then plugging that lerp into the spec power slot. Actual values will depend on your individual asset and its range of materials.

    The rest of your asset is basically just good "standard" texturing practice. :)
Sign In or Register to comment.