Home Unreal Engine

Diffuse Tiling and AO map

decorix
polycounter lvl 11
Offline / Send Message
decorix polycounter lvl 11
Hi all,

Does anybody know if my material is setup correctly?

Basicly I want to mix my Diffuse Tilling texture with AO map.
My material is using Switchparameters.

Would you need to put constant one vector in the AO map set to false.
I noticed that I needed to put in value. Otherwise it would look very dark.
I'm not sure if its setup correct.

aomap.jpg

Replies

  • WarrenM
    That looks correct. If there's no AO map, everything gets multiplied against 1.0, which is effectively no change.
  • JonathanLambert
    Offline / Send Message
    JonathanLambert polycounter lvl 6
    If you multiply your Diffuse and AO in Photoshop before importing the texture, it would save you some texture memory and shader instructions.
  • decorix
    Offline / Send Message
    decorix polycounter lvl 11
    If you multiply your Diffuse and AO in Photoshop before importing the texture, it would save you some texture memory and shader instructions.

    Hi, but that doesn't work when you have tilling texture :-(
    you want to tile your texture, but you can't tile you AO!! if you had a rock or Pillar.
  • A-N-P
    Offline / Send Message
    A-N-P polycounter lvl 6
    decorix wrote: »
    Hi, but that doesn't work when you have tilling texture :-(
    you want to tile your texture, but you can't tile you AO!! if you had a rock or Pillar.

    If you have a tiling diffuse texture, your AO should tile too. So multiplying them in PS is the way to go. Unless I'm missing something.
  • GeeDave
    Offline / Send Message
    GeeDave polycounter lvl 11
    A-N-P wrote: »
    If you have a tiling diffuse texture, your AO should tile too. So multiplying them in PS is the way to go. Unless I'm missing something.

    In everything else I've used you just slam the lightmap (AO in this case) on a second map channel. I don't know how this is done in UDK, I'm assuming it looks for multiple map channels if you're using lightmaps?
  • Paunescu.Daniel
    For what you want to use the AO then you don't have to tile the AO
    UDK has blending modes like Photoshop does (Overlay, Darken, Screen and more) try and use those, i herd they work like a charm. You could do it this way using just multiply and lighten up the texture using....another multiply.
    I'm not so 100% sure on this one but, there is no "RIGHT WAY" of setting up a material, do whatever works for the texture sample in cause, for start anyway, then you can try and optimize it, see what operations can be done in Photoshop, compare results and so on.
    Generally it can be done with simple math operations, just add a few more if needed to adjust the textures after you blend them. If you have the latest version of UDK try using the blending modes too

    Edit @ what Dave said: I'm not sure if you can manipulate the lightmap channel in the way of combining it with an external map such as an AO in UDK, never seen it done before, or maybe you can?
  • GeeDave
    Offline / Send Message
    GeeDave polycounter lvl 11
    I'd be very surprised if you couldn't, this is pretty standard stuff. Last engine I used was unity and that was more than capable. Unless we're talking about different issues. OP seems to want a tiled diffuse, and a non-tiled AO... like so:

    2012-08-29_1616.png
  • Paunescu.Daniel
    @ Dave: Even if you can manipulate the lightmap channel in UDK, the example you showed can be achieved pretty easy using the diffuse channel, Epic seems to do it the same way for their demo assets that come with UDK
  • JonathanLambert
    Offline / Send Message
    JonathanLambert polycounter lvl 6
    Ahh.. I was just thinking about baking the AO details into the diffuse and using real time AO for things like that.^
  • gsokol
    Offline / Send Message
    gsokol polycounter lvl 14
    decorix...yea what you have there does work...multiplying by 1 will have no effect, and multiplying by the AO map will give you what you want.

    I'm thinking that you want to achieve what GeeDave mentioned, using a unique AO on an object while using a tiled texture..right? If so..you are missing a step in your material chain. Take a look at this:

    GS_MultipliedAo.jpg

    Notice that I have the AO's TexCoord node selected...take a look at the properties...I have it highlighted there...I changed the Coordinate index from 0 to 1. This means that this texture will use the second UV channel...so if you unwrap the second uv channel uniquely and...say...bake an AO map..it will give you the effect you want.
  • GeeDave
    Offline / Send Message
    GeeDave polycounter lvl 11
    the example you showed can be achieved pretty easy using the diffuse channel

    How so? The diffuse (brick texture) is tiling 20 times in that example, and the AO is unique. I don't understand what you mean really, I'm referring to different mapping channels, not different texture slots, so when say it can be achieved using the diffuse channel... yeah, probably, but you'd still need two map channels. One tiling. One unique.
  • Paunescu.Daniel
    Well you can just make one texture tile and the other leave it unique and blend them using a math operation this way you can break tiling in terrain texturing, having different maps at different tile sizes. Epic does the same for their Rock material they provide with UDK, they use the same channel and blend a unique diffuse with another tiling diffuse texture, that has no lighting information like the AO has.
    Now that i see Gsokol's reply i see that it is possible to add your AO to the Lightmap channel and i guess its the way to go in this case, but what if you don't have a AO? but something else like my terrain example from above.

    Edit: when i said channels i meant UV channels, so when i said Diffuse channel i meant the first UV channel (channel 0 in UDK) that is used by the diffuse
  • oobersli
    Offline / Send Message
    oobersli polycounter lvl 17
    don't use udk all the time, but I do this in infernal all day for stuff like this.

    you can tile the texture in the material instead of a seperate uv channel. In fact after doing my sample image I noticed udk has tiling properties int he texcoord node, so my image is a bit more than whats needed.

    anyways, you just multiply the uv coordinates of the diffuse map you want to tile more and leave the ao map coords alone. that what you're looking for?

    a0_blend.jpg
  • Paunescu.Daniel
    ^Yep that's what i was trying to explain
    Of course using that method with the AO you might not be able to interpret the lighting information from the AO as you would by using the lightmap channel.
  • gsokol
    Offline / Send Message
    gsokol polycounter lvl 14
    oobersli wrote: »
    don't use udk all the time, but I do this in infernal all day for stuff like this.

    you can tile the texture in the material instead of a seperate uv channel. In fact after doing my sample image I noticed udk has tiling properties int he texcoord node, so my image is a bit more than whats needed.

    anyways, you just multiply the uv coordinates of the diffuse map you want to tile more and leave the ao map coords alone. that what you're looking for?

    I never thought about doing it that way....if you change the tile factor when your unwrapping, and line up your unwrap as an atlas in the 0,1 space...then use the same tiling factor in the texcoord node (and unwrap everything uniquely with no overlapping uvs) that would probably work out pretty nicely.

    Awesome. I think I'm going to try that at some point.
  • Paunescu.Daniel
    gsokol wrote: »
    I never thought about doing it that way....if you change the tile factor when your unwrapping, and line up your unwrap as an atlas in the 0,1 space...then use the same tiling factor in the texcoord node (and unwrap everything uniquely with no overlapping uvs) that would probably work out pretty nicely.

    Awesome. I think I'm going to try that at some point.

    Sorry, I don't want to be rude or anything but i thought that that's how you actually do it :D. Epic does that for their models, same thing for adding detail with normal maps.
  • decorix
    Offline / Send Message
    decorix polycounter lvl 11
    Hi Gsokol,

    Thanks so much for the info.

    I noticed that you had AO tilling. Is this why you set ur Index coordinate to 1 ??

    What I have seen you don't need to set your index coordinate to 1. But I would like
    to know when you would do this?

    I wanted a tilling texture and a (seperate standalone AO texture which I already baked out from MAX)
    eg.. Pillar in which you have stone texture repeating and one AO overlay of the pillar (not tilling of course). Hopes it makes sence.

    The pillar mesh it self has 2 uv' channels one for the texture bake,, and the other for the lighting.

    I saw some other people responded as well.

    Thanks so far for you help.

    gsokol wrote: »
    decorix...yea what you have there does work...multiplying by 1 will have no effect, and multiplying by the AO map will give you what you want.

    I'm thinking that you want to achieve what GeeDave mentioned, using a unique AO on an object while using a tiled texture..right? If so..you are missing a step in your material chain. Take a look at this:

    GS_MultipliedAo.jpg

    Notice that I have the AO's TexCoord node selected...take a look at the properties...I have it highlighted there...I changed the Coordinate index from 0 to 1. This means that this texture will use the second UV channel...so if you unwrap the second uv channel uniquely and...say...bake an AO map..it will give you the effect you want.
Sign In or Register to comment.