Home Unreal Engine

UDK/Ddo Lighting Problem

Hi, I am currently working on a spaceship interior in UDK. I have made all of my texture maps using Ndo2 and Ddo. I just started compiling today when i noticed a few issues with lighting. For starters my metal materials are very flat, and no matter what material i tell ddo I want, it always gives me the same shade for my Spec map. My lod resolution seems rather low, but i have my assests set to a res of 64. and the big kicker are the hard shadows, before i build my lighting my hard shadows look fine, but after, they disappear completely. I have light maps on all of my assets so i'm not really sure where im going wrong. This has been frustrating me all day. Any help or pointers would be very much appreciated.

Replies

  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    From what I can tell is first want the glowy bits on your texture to help light your scene, try "Use Emissive For Static Lighting" on the static mesh properties and bake and see if you like that lighting effect. I feel the specular isn't doing much because the lights are so close to the surfrace of the models. Bump up the radius and mess with the fall off. "The light source radius for point and spot lights is drawn in yellow wireframe, while the influence radius is drawn in teal. In most cases you will want to make sure the light source doesn't intersect any shadow casting geometry, or the light will be emitting on both sides of that geometry." made sure your source radius or the yellow circle isn't intersecting anything. http://udn.epicgames.com/Three/Lightmass.html#Lightmass Features/
  • MaVCArt
    Options
    Offline / Send Message
    MaVCArt polycounter lvl 8
    UDK uses different shading than the dDO previewer, which runs on Unity, resulting in quite different material definitions, mostly due to a totally different light setup as well - the dDo previewer has three differently colored lights set up, with one set to a very high value so the specular and glossiness values really pop. To simulate this in UDK, you have to, for starters, use the glossiness slot (very important), and use quite extreme values for it. Say, a range from 0 for completely matte to about 500 for a mirror or chrome. As for specular, put that one through a power node, and multiply it a bit, to turn up the contrast. Also, what ZacD said: use your emissive as the lighting for the scene. It won't change the material definition but generally the lighting will look better.
  • FoeJred
    Options
    Offline / Send Message
    Thanks MaVCArt i never knew about this, it looks much better. Only problem now is the is having light reflect on the floor itself. but i suppose i cn get a small point light for that. And to ZacD I will have to try this out, i usually never render out texters in ddo with gloss maps. because i never truly understood their purpose.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    specular = what color the light reflection is and how bright.
    Glossyness = How big and soft, or small and sharp the light reflections are.

    You really only need a gloss map where there is 2 different looking materials on one texture.

    2652904396_530dfdfa27.jpg

    ybilHoz.jpg

    o1Tls3N.jpg
  • FoeJred
    Options
    Offline / Send Message
    Thank you for the reference photos, i have another question, Now that I have light coming through the emissive channel. I followed this tutorial [ame="http://www.youtube.com/watch?v=Vu5xkff50k4"]UDK Flickering Lights Tutorial - YouTube[/ame] on how to create flickering lights, however now my lights do not update when the emmisive channel flickers. is this a set back to using emissive lighting or is there a way to fix it?
  • lpcstr
    Options
    Offline / Send Message
    ZacD wrote: »
    You really only need a gloss map where there is 2 different looking materials on one texture.

    I think you have that mixed up. You're more likely to need a glossmap on just about anything, and will only need a specular map when you have two or more materials.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    lpcstr wrote: »
    I think you have that mixed up. You're more likely to need a glossmap on just about anything, and will only need a specular map when you have two or more materials.

    No, most models get a spec map and a constant gloss value. If there's 2 or more different looking materials on one texture, people will start to use gloss maps, and these are often lower rez because it is not as noticeable.

    Here's a decent post explaining more
    http://eat3d.com/forum/general-discussion/simple-description-gloss-map#comment-1019479
  • lpcstr
    Options
    Offline / Send Message
    ZacD wrote: »
    No, most models get a spec map and a constant gloss value. If there's 2 or more different looking materials on one texture, people will start to use gloss maps, and these are often lower rez because it is not as noticeable.

    Here's a decent post explaining more
    http://eat3d.com/forum/general-discussion/simple-description-gloss-map#comment-1019479

    I'm sorry, but that is still backwards. Just because some people are still handling their textures that way, doesn't mean it's the correct way of doing things. That procedure is typical of ad-hock lighting models. If you are using a normalized specular model (which you should), then your specular map is going to represent the reflectance of the material, which for most objects is very consistent and therefor does not require texture mapping. What does vary is the texture of the surface. A good example of when you would need a specular map is when you have parts of an object that are metal and other parts which are not.

    For example, take a human face. The reflectance of human skin is 0.028, and the reflectance of sweat is about 0.021 or so. That's a miniscule difference that you aren't going to be able to notice. What you DO notice is that the texture of dry skin is very rough, which causes a very diffuse specular reflection, compared to wet skin which is much smoother and therefor concentrates specular energy into a narrow reflection.
  • lpcstr
    Options
    Offline / Send Message
    For those of you who are confused, here is a basic shader that you can use to get your foot in the door for physically based shading. As you can see, it doesn't even cost much more instruction count wise then the dreadful default phong shader. To make it easy to implement and re-use I suggest you do as I did and implement it in a custom node inside of a material function, then simply hook it up to Custom Lighting.

    The code for the shader:
    float3 H = normalize(L + V);
    float NdotL = saturate(dot(N, L));
    float NdotH = dot(N, H);
    float LdotH = dot(L, H);
    
    float3 F = Ks + (1.0 - Ks) * pow(1.0 - LdotH, 5.0);
    
    float3 Rd = Kd * (1 - Ks);
    float3 Rs = pow(NdotH, n) * (n + 2) * F / (8 * LdotH * LdotH);
    
    return (Rs + Rd) * NdotL;
    

    This is a basic implementation of the Cook-Torrance BRDF with Lambert diffuse, using the Blinn-Phong distribution function, the Kelemen Szirmay-Kalos geometry approximation and Schlick's fresnel approximation. It gives pretty decent results for medium rough to smooth surfaces. If you want to render rough to super rough surfaces more accurately, you could use the Beckmann distribution, the Cook-Torrance geometry factor and Oren-Nayar diffuse instead, at the cost of more instructions:
    float3 H = normalize(L + V);
    float NdotL = saturate(dot(N, L));
    float NdotH = dot(N, H);
    float NdotV = dot(N, V);
    float LdotH = dot(V, H);
    
    float NdotH_2 = NdotH * NdotH;
    float NdotH_4 = NdotH_2 * NdotH_2;
    float m_2 = m * m;
    float D = exp((NdotH_2 - 1.0) / (NdotH_2 * m_2));
    
    float3 F = Ks + (1.0 - Ks) * pow(1.0 - LdotH, 5.0);
    
    float G = saturate(2 * NdotH * min(NdotV, NdotL) / LdotH);
    
    float3 Rs = (D * F * G) / (4 * m_2 * NdotH_4 * NdotV);
    
    float gamma = saturate(dot(V - N * NdotV, L - N * NdotL));
    float A = 1.0 - 0.5 * (m_2 / (m_2 + 0.33));
    float B = 0.45 * (m_2 / (m_2 + 0.09));
    float C = sqrt((1.0 - NdotV * NdotV) * (1.0 - NdotL * NdotL)) / max(NdotV, NdotL);
    
    float3 Rd = Kd * (A + B * gamma * C) * (1 - Ks);
    
    return Rs + Rd * NdotL;
    
  • FoeJred
    Options
    Offline / Send Message
    I have to agree with lpcstr. This is what they teach us in class and what i've read in a book about textures.
  • Joopson
    Options
    Offline / Send Message
    Joopson quad damage
    Hm, I always thought the way ZacD does. And clearly the way most game-artists do, considering spec is far more commonly used than gloss is. Of course, both is always best, when beauty is your main concern, but yeah, I'd use spec if I had to chose. Your explanations make sense, but if that is the case, why isn't gloss used more; some engines don't even support gloss maps. Hm. I'll have to do some experiments now...
  • lpcstr
    Options
    Offline / Send Message
    Joopson wrote: »
    And clearly the way most game-artists do

    That's really not the case. The majority of modern game engines have adopted at the very least a minimal version of a physically based lighting model, which could be at the very least normalized Blinn-Phong + Fresnel. When you switch from an ad-hoc lighting model, to a physically based one, you can no longer think about your textures the same way. They are no longer arbitrary values chosen by the artist because they "look good", instead they have an actual meaning. It's a paradigm change, and if you think about "gloss maps" and "spec maps" the same way you did before, you aren't going to get good results. Physically based models allow you to more easily create plausible materials that are more robust and predictable when moved from one environment to another. If it's 2013 and you are still using a simple Phong as your lighting model, and you don't have a really good excuse, then you are simply doing things wrong.
  • lpcstr
    Options
    Offline / Send Message
    If you still don't understand, then I suggest you do some reading. I would probably start with this and this.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Gloss/Roughness maps aren't used more because simply put, artists sometimes are too lazy to mask specific areas of a mesh that represents a certain material and try and work it out in their target render engine the value and how it will look.

    It's much easier to make a Spec Map (Cavity, AO, Diffuse, Normal formula, etc) then it is to make a PROPER Gloss map, I mean it's just only with plugins like DDO, that recently we have access to a real-time artist kit that allows us to define material in an "on the fly" kind of way with proper masking, allowing us to lower the gap between material definition and simple constant values thrown in on the entire mesh.

    And pretty much what LPStr said is true, even COD games have a basic Spec w/ Schlick fresnel formula applied to their models for the most basic assets, and alot of what you see in terms of 'good looks' required the artists to rethink their way to creating certain maps so they read much better and realistically.

    The funny part is, that it's very easy to learn this stuff and doesn't require extra time other then talking with your technical artist and asking them what they're using.
  • Shrike
    Options
    Offline / Send Message
    Shrike interpolator
    A good example of when you would need a specular map is when you have parts of an object that are metal and other parts which are not.

    For example, take a human face. The reflectance of human skin is 0.028, and the reflectance of sweat is about 0.021 or so. That's a miniscule difference that you aren't going to be able to notice. What you DO notice is that the texture of dry skin is very rough, which causes a very diffuse specular reflection, compared to wet skin which is much smoother and therefor concentrates specular energy into a narrow reflection.

    That sounds totally right but it seems that you took the specular map for the glossyness/Roughness map and vice versa, or i didnt get you right

    This is my point of knowledge at the moment


    spec.png

    If I break it down its pretty simple, specular gives the brightness intensity on specific places of the reflection, works like a mask, and glossyness defines the sharpness of the reflection


    The curve shows nicely what is meant by sharpness. Those are from cinema 4d, but you have them in 3Ds the same. Glossyness maps work the same as the curves, just simpler so it works only 2 ways, up or down. White to black

    And if I understand right, editors take a middle value from the glossyness curve if you do not define a glossyness by a glossyness map, so most models look alright without a glossyness map and thats why they where not used that much the last decade and people use them mainly to define different materials at one texture sheet and very glossy stuff.

    (I guess its different per engine which values they took as preset)
  • Santewi
    Options
    Offline / Send Message
    Shrike, you won't really need a spec map if the model consists of materials which reflect about the same amount of light, which a lot of materials do. If material A reflects 5% of the light and material B reflects 7%, the difference is very small, and is very hard to see. However, roughness/glossiness controls at which angles the light gets reflected, which is much more important for material definition. Rough materials have a very broad and low intensity specular reflection whereas more smooth materials have a brighter, more concentrated specular reflection.

    This is all for PBR though, so if you're using something like phong lighting, then you'll most likely need a specmap.
  • Shrike
    Options
    Offline / Send Message
    Shrike interpolator
    that is true, but you forget about the detail and definition the specular is mainly used for. Without a specular, flat surfaces will have a flat reflection like you would see on marble, my stone wall would miss out the depth and look flat and smooth, but what are we discussing here, both maps are an important asset to sell a material definition, its not about which is more important. If you miss one out, you miss out a part of the credibility
  • Santewi
    Options
    Offline / Send Message
    Well... If you have a stone wall, it's mainly made out of... stone, yeah? The same kind of stone, most likely. So it'll have pretty much the same specularity across the whole surface, however, the roughness most likely isn't. So you'll need a roughness/gloss map, but not necessarily a spec map.

    I'd recommend you to try some PBR shaders, like the one lpcstr posted in this thread, and see for yourself how roughness/glossiness affects the surface.
Sign In or Register to comment.