Home Unreal Engine

UDK - Material - Texture Defined Specular

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Hey to all, been reading on this:

http://udn.epicgames.com/Three/TextureDefinedSpecularReflection.html#Settings

Which is cool, but I get this instead:

69329232.png

I tried everything that comes to mind, from putting up a hacked in Transform node, to keep the Blue channel as an additive from the RG, and none of them seem to work.

Much appreciated for any feedback, cheers!

Replies

  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    What does your specular texture look like?
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    I've only used this technique a few times and I'm the one who made it :X

    Maybe check your UVs? I know since a lot of this technique is tangent space hackery it could easily get messed up with UV seams/distortion.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    So Jordan: is this effectively blending the specular shape like a decal in uv space using a transformed light vector for the center offset?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    ambershee: The defined Spec is the standard one found from UDK, which looks like a rectangle, I didn't use anything else.

    However, since you mentioned, I went back to look, and it seems like if I use another one Texture (again, from UDK) which is more rounded and looks a Phong highlight, it doesn't mess up at the seams. That's very odd.

    LoTekK: I do have mirrored UV's, but the paradox is that my mirrored seam actually doesn't show the problem in the middle of my problem, while other parts do.

    JordanW: Aha! The creator himself. I don't know what else to say about the issue, since I tried it on a couple of UDK assets and the problem still seems to exist, albeit much less obvious. Naturally, environmental with hidden seams don't seem to have this problem.

    I was wondering if this could have anything to do with Tangents and Binormals of my model when I exported it. I used FBX and Explicit Normals to import it from Max, don't know if that adds up.

    Vailias: *sniff sniff* is that a solution I smell?
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Lol no it's not a solution. It would error at the seams severely. Hence my questioning.

    It's what I did to make the moon texture follow the dominant light in that other thread.
  • Ace-Angel
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    Sorry, have a lot of Real-Life goin on lately so i'm not on forums much :)

    Vaillias: Yes, it's basically placing a blurred image in the direction of the light and instead of doing a pow on it, it does some contrast enhancing/clipping.


    It's been a long time since i looked at that material, maybe the seam issue can be avoided by transferring to another space or something.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    ah ha. Cool fun to be able to guess the technique.


    What WOULD get rid of the seaming problem is if this could be projected into the texture from worldspace like an actual decal or ut2k4 style projector.

    Hmm.. That might be doable in shader, or something similar enough.

    I'll think on it.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Damn you and your interesting problems! I need to sleep some time! :P

    I'm on to something
    Image_Reflect.jpg

    Very early test to see if my thoughts held any water. They DO and I'll see if I can make this work later on.

    The short of it is this:
    Transform the object's normals into Light space(in this example they're in view space since that's a built in transform node)
    Modify the range of values from -1 to +1 to 0-1 (Constant bias scale node: bias 1 scale .5)
    Mask R and G channels, use as UV coord lookups for specular texture.

    To modify "spec power" we essentially need to change the middle slope of the uv coord curve but leave the end points the same. A TCB spline interpolation would be perfect for this with control points of 0, 0.5, 1. Adjusting the bias on 1 and 0 will effectively alter the size of the image based highlight while maintaining its center point.

    alter the image contrast/brightness as needed for effect
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hey Vailias, thanks for the help, this is awesome, much appreciated and sorry for keeping you awake.

    I tried taking a run for it, but it seems like as usual, I did it wrong, here is what I got:

    EDIT: Oops, just noticed you weren't done with it, sorry for the bum-rush :poly136:83899199.png
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    no worries.
    The transform will be the biggest thing to set up.

    It will need a custom node since its going to need a mul(vector, matrix) operation that isn't exposed as a UDK node.

    I'll need to revew how to do that exactly.. been a while since I was messing with matrices.
Sign In or Register to comment.