Home Unreal Engine

UDK - Material - Mutli-UV Changes

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
Hey to all,

I was wondering if it's possible to make multiple UV changes to a single texture?

What I mean for example is this:

unled1cni.jpg

I have a texture, which is divided into 4 details respectively, and I would like to blow them up to occupy the space of a single texture.

Then from there, I would like to be able to tile them.

Closest documentation I found is this: http://udn.epicgames.com/Three/TerrainAdvancedTextures.html

I tried using this techniques alongside UDK's material function system, but no avail. The Function material system doesn't work for multi textures or UV setups.

Anyone has tips on this? Would be much appreciated.

Replies

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    UV's are just a vector in udk, so you should be able to do anyhting you want to the texture coordinates, and input anything you want into UV's as longs as it's a 2 channel vector Red and Green for U and V.

    i will figure it out for you when i get home unelss someone else does.
  • WarrenM
    Options
    Offline / Send Message
    I don't believe that's possible. You can certainly do the "blow up" part by controlling the UV values but you can't tile a subsection of a texture like that. Not to my knowledge, anyway...
  • ImSlightlyBored
    Options
    Offline / Send Message
    ImSlightlyBored polycounter lvl 13
    erm in theory it's possible, fairly easy, just use fmod

    Tex Co-ordinate> fmod x,x > texture sample

    Unfortunately the way unreal handles this isn't ideal, and creates an infinitely thin flashy line on the repeat. What this means is, it's unusable, yet so tantalisingly close. I recently tried this on an asset and it was so close yet so nigglingly bothersome I had to take it out again.

    I've often wondered about multi-sampling and whether that would work...
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    passerby wrote: »
    UV's are just a vector in udk, so you should be able to do anyhting you want to the texture coordinates, and input anything you want into UV's as longs as it's a 2 channel vector Red and Green for U and V.

    i will figure it out for you when i get home unelss someone else does.

    That would be so awesome mate!
    I don't believe that's possible. You can certainly do the "blow up" part by controlling the UV values but you can't tile a subsection of a texture like that. Not to my knowledge, anyway...
    Argh, lets hope not. If it is truly not possible, that it will make me a VERY sad panda.
    erm in theory it's possible, fairly easy, just use fmod

    Tex Co-ordinate> fmod x,x > texture sample

    Unfortunately the way unreal handles this isn't ideal, and creates an infinitely thin flashy line on the repeat. What this means is, it's unusable, yet so tantalisingly close. I recently tried this on an asset and it was so close yet so nigglingly bothersome I had to take it out again.

    I've often wondered about multi-sampling and whether that would work...

    Interesting, if it works as I suspect that it does, could you not in theory, go about creating a padding around your respective details, and have them overlap each other through the 2 vector?

    So instead of having it set at 0.5, you could have it set at 0.49 for example? The padding should cover out any bleeds.

    Also, maybe thick in the preserve boxes for RGB?
  • RAL
    Options
    Offline / Send Message
    RAL
    Hey Ace I'm not sure if this would be helpful, but a buddy of mine asked me if we could do something that you were describing to save on importing many different textures, so I was able to come up with this:

    QFqQH.jpg

    He too asked me about tiling and the only way I can see it working is if the texture was tiled a couple times in advance before bringing it into unreal. If you look at the setup I have and adjust the vector 2 constant to the texture you want it is possible to adjust the tiling with the texture coordinate node, but you can't go past a value of 1 or it wont work. So you'd pretty much be dropping your values in the texture coordinate to get the amount of tiling you want.

    Hope this helps.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    ya blood falcon came up with the same thing i manged to figure out.

    they olny way i see being able to do tiling, would be writing your own equivalent of the texture coordinate that allows a vector input, or some trickery with render textures, if you could render the output of this material to a texture, than do the tiling in a new material.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Hey Ace I'm not sure if this would be helpful, but a buddy of mine asked me if we could do something that you were describing to save on importing many different textures, so I was able to come up with this:

    QFqQH.jpg

    He too asked me about tiling and the only way I can see it working is if the texture was tiled a couple times in advance before bringing it into unreal. If you look at the setup I have and adjust the vector 2 constant to the texture you want it is possible to adjust the tiling with the texture coordinate node, but you can't go past a value of 1 or it wont work. So you'd pretty much be dropping your values in the texture coordinate to get the amount of tiling you want.

    Hope this helps.

    Thanks, I'll keep that in mind.

    passerby wrote: »
    ya blood falcon came up with the same thing i manged to figure out.

    they olny way i see being able to do tiling, would be writing your own equivalent of the texture coordinate that allows a vector input, or some trickery with render textures, if you could render the output of this material to a texture, than do the tiling in a new material.

    I tried that unfortunately, UDK has a example custom node which has a UV and Sampler slots in it's Compendium webpage.

    http://udn.epicgames.com/Three/MaterialsCompendium.html#CustomTexture

    Problem is, you need to use a Custom node for the textures to get it to work, and the output for some reason loses all information if I use the same Custom node again, to play with the UV's again down the stream, giving me an error.

    I'm not sure since I don't HLSL, but I simply copied and pasted the code from that example and used it, so I could be miles off.
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Well, here is my previous outline code:
    float4 output;
    float4 total = tex2D(Sample, UV);
    output = tex2D(Sample, UV);
    return output;
    Here is my outline:

    unled5pa.jpg

    No idea where to go from there since it throws up errors for me.

    Also, I tried ImSlightlyBored technique, and the lines remain, even when I tried creating padding to the textures and creating a slight bias for the Fmod.
  • ImSlightlyBored
    Options
    Offline / Send Message
    ImSlightlyBored polycounter lvl 13
    Ace-Angel wrote: »
    Interesting, if it works as I suspect that it does, could you not in theory, go about creating a padding around your respective details, and have them overlap each other through the 2 vector?

    So instead of having it set at 0.5, you could have it set at 0.49 for example? The padding should cover out any bleeds.

    Also, maybe thick in the preserve boxes for RGB?

    You can set it to anything you want, so .5, .2, etc. It's the point at which the texture co-ords return to 0 and back to your number and so on.
  • Keytay
    Options
    Offline / Send Message
    Did anyone ever find a work around for this line problem?

    You'd think epic would have sorted this one out by now. 4 times the variation in terrain textures etc would be pretty bloody helpful. *rolls eyes
  • ambershee
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    xqefEH.jpg

    That's actually pretty fucking clever! They're using the gradient Mip to over the aliasing in the edge based upon the Y and X outside of the UV for the texture itself.

    The only problem is see is that it's view based, so if you something like 100 in your tile number, you can very easily end up with blurry maps at angles or from far away.

    Also, normal maps don't behave well with a TextureObject as they lose their data information, so I'm abit confused as to how they were able to get nice results all over a large field?
Sign In or Register to comment.