Home Unreal Engine

using bitmap in specular power slot.

polycounter lvl 12
Offline / Send Message
Count Vader polycounter lvl 12
Hi, so I've tried researching this but can't seem to find a straight answer.

I have an asset in UDK where part is glass and part is not glass. Glass needs to be glossier than the rest of the material.

Previously I had assumed that the 'specular power' slot behaved similarly to the gloss map slot in 3d programs, but now I seem to be learning it's only meant for a single value and UDK doesn't like when you try to use a bitmap in it? (I tried the 'multiply' trick but it didn't help at all, the highlight was reduced but remained the same radius through the whole asset)

So what's the deal? Is there any way to get an image to work in this context? And if not, how are we supposed to achieve material separation in UDK with no control over the gloss factor?

Replies

  • mAlkAv!An
    Options
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    Not sure what's your problem here, multiplying a texture by a large number works just fine for the Spec Power input.
    I'd guess the brightness difference in your texture is too small or it's some sRGB/linear space issue.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    mAlkAv!An wrote: »
    Not sure what's your problem here, multiplying a texture by a large number works just fine for the Spec Power input.
    I'd guess the brightness difference in your texture is too small or it's some sRGB/linear space issue.

    Hmm, I think I got it working. I had to REALLY crank the contrast/material difference on the gloss and combine that with multiplying by a VERY high value (of 2000) to get a noticeable difference in highlight radius. Thanks for the tip!

    I confused cause I was going through some threads on other forums and the explanations ranged from everything from 'spec power slot only wants a constant value' to using some bizzare lerp node network to get it going lol
  • Shift`
    Options
    Offline / Send Message
    Found this:
    A gloss map defines the size of the specular highlight per pixel also called specular power, where as a a typical specular map defines the intensity per pixel meaning it represents the amount of light reflected.

    Also are you using a specular map? Because that will be the defining feature to truly give the light reflection of the glass.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Shift` wrote: »
    Found this:


    Also are you using a specular map? Because that will be the defining feature to truly give the light reflection of the glass.

    Yup, of course. Specular and also a cubemap (right now some generic UDK one but I'll prob make a custom one that represents my level more)
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    for specularPower (gloss) i find it;s best to use a lerp and with your high and low values hooked up, and your gloss texture as the lerps alpha.


    this lets you explicitly tell the shader what the lowest and highest specular exponents you want to represent, than just have it interpolate everything in between.

    or i just use a constant.

    The only times i tend to use the lerp setup, is if im making a material for a object, that has multiple material types like wood, metal, glass, rubber etc. Since all of those materials got very different specular exponents.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    passerby wrote: »
    for specularPower (gloss) i find it;s best to use a lerp and with your high and low values hooked up, and your gloss texture as the lerps alpha.


    this lets you explicitly tell the shader what the lowest and highest specular exponents you want to represent, than just have it interpolate everything in between.

    or i just use a constant.

    The only times i tend to use the lerp setup, is if im making a material for a object, that has multiple material types like wood, metal, glass, rubber etc. Since all of those materials got very different specular exponents.

    so would that basically be analogous to using the "levels" function in photoshop on an image?
  • mAlkAv!An
    Options
    Offline / Send Message
    mAlkAv!An polycounter lvl 5
    Hmm, I think I got it working. I had to REALLY crank the contrast/material difference on the gloss and combine that with multiplying by a VERY high value (of 2000) to get a noticeable difference in highlight radius. Thanks for the tip!

    Still sounds like there is something off if such a large contrast and multiply value is required. Mind showing your spec textures?
    For a quick comparison, this is what I get with a texture with pure white and mid grey and a multiply by 50. You can clearly tell the difference in the spec highlights: http://abload.de/img/texturespecpower01cpunh.png

    Also it's true that a Lerp node will give you more control over the spec power values within the editor.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    mAlkAv!An wrote: »
    Still sounds like there is something off if such a large contrast and multiply value is required. Mind showing your spec textures?
    For a quick comparison, this is what I get with a texture with pure white and mid grey and a multiply by 50. You can clearly tell the difference in the spec highlights: http://abload.de/img/texturespecpower01cpunh.png

    Also it's true that a Lerp node will give you more control over the spec power values within the editor.

    Sure, here are the textures I'm using for spec:

    sr3oswp.jpg


    And this is what the asset looks like with, like I said, the spec power multiplied by a value of 2000:

    GEH5AHW.jpg
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    so would that basically be analogous to using the "levels" function in photoshop on an image?

    Well it good to level gloss textures before export so your using the full range of values in the image, but no.

    Levelling maxmizes the usage in the 0 to 1 range, the lerp let's me take data that is in 0 to 1, and represent a new range like say 15 to 80.

    Really your door is pretty much all metal so you could have it all as a cconstant.

    Also I think you glass should have dark colour in gloss not a high colour.

    In the specular power low values like say around 5 will give you very wide and large highlights which is more ideal for glass. For the metal I would try for values between 30 and 80.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    passerby wrote: »

    Really your door is pretty much all metal so you could have it all as a cconstant.


    Yeah metal and glass aren't thaaaat different in spec, it probably wouldn't be that noticeable esp. once there's a cubemap there but I'd rather just get this figured out, since sometimes i like to use a gloss map even when there's no difference in materials, just to give the spec a richer and more dynamic feel.
    passerby wrote: »
    Also I think you glass should have dark colour in gloss not a high colour.

    Wait, so are you saying lighter values = broader highlight, and darker values = smaller highlight ?
  • LMP
    Options
    Offline / Send Message
    LMP polycounter lvl 13
    Wait, so are you saying lighter values = broader highlight, and darker values = smaller highlight ?

    That might depend on the target engine. In UDK, I know that smaller value = broader highlight, bigger value = tighter.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Low values broud highlight, high values tight highlight, with flat glass the highlight gets spread out amungts most of the glasses surface.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    sorry, i'm not good with the math things. are low values drawn as lighter or darker pixels? And also, shouldn't the highlight on glass be super small, like a mirror?
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Low is darker I was saying wider looks good for glass but that is more my oppion.

    Really most of glass look you will need to use a cubemap for.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Yeah I dunno, I was watching a tutorial on glass materials in UDK and they said to use a very thin highlight.

    I mean when you think about, the reason things like cube maps are used for glass is it's supposed to simulate a mirror-like reflection, which is enabled by the fact that the highlights on glass are so small, they allow for the "resolution" to reflect light down to being able to make out individual objects in a reflection, at least that's my understanding, and why in Marmoset for instance, "cubemap" reflection is enabled only when you have a very high gloss on a surface.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Yes that is true but with out pbr you are fakeing most things.

    Just expirment make the prop and shader place it in the scene, and tweak.
Sign In or Register to comment.