Home Technical Talk

Environment texture help

McG
McG
Hey there, can anyone point me in the way of a good tutorial on seamless/tile textures for game environments. I mostly create character textures with a UV layout, but im starting to get into environments and buildings.
Im looking for something that will go into detail, an example would be placing graffiti on a repeatable brick wall texture. Im using maya & would this be done with the use of a layered shader? are layered shaders used in game textures?
Thanks McG

Replies

  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    In Photoshop go Filter > Other > Offset

    Have fun!
  • EarthQuake
    Options
    Offline / Send Message
    Lol useful post adam, you toolbag. Way to not even read the thread.

    I'n no expert but i would assume a lot of the time things like graffiti can be easily placed as a decal. A decal would just be a single quad overlayed onto the surface with an alpha mapped texture, you probablly wouldnt want any sort of layered shader because then your grafiti would repeat over and over. Unless you have some sort of control map on 2nd uvs or something of that nature, which really is getting a little excessive.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    yeah McG, a layered shader or layered texture would do this.
    EQ: actually i've seen this method used on PS2 stuff, with 2 UV sets, one tiling a generic texture underneath, and the 2nd UV set holding the UV info for decal textures.
    However you could also use the method Earthquake describes, just float a plane over your surface and use an opacity-mapped texture on that, this is the way a lot of games do that sort of thing.
    Ignore Adam, he didn't read your question smile.gif
  • EarthQuake
    Options
    Offline / Send Message
    Oh yes, i wasnt trying to say its imposible to do. It gets done all of the time, but is better suited IMO for blending a bunch of textures together to get rid of tiling artifacts than it would be to simple apply a single unique texture.
  • Jeff Parrott
    Options
    Offline / Send Message
    Jeff Parrott polycounter lvl 19
    Decals are easier on the PS2, but other systems don't handle the sorting as well. What sort of environment are you doing? Next gen with all the fixins or last gen/portable environment? Mop gave you the 2 ways to do it.
  • adam
    Options
    Offline / Send Message
    adam polycounter lvl 19
    I'm lazy. I read the first sentence then made my post. I win.
  • Eric Chadwick
    Options
    Offline / Send Message
    Opacity is over the top for overlaying decals, since if I'm not mistaken it could incur a sort (depending hardware) and also requires the behind color to be modulated first (behind * opacity inverted, + decal * opacity = blended result). Better to use a straight blend op like multiply, less ops/passes, faster fillrate.

    Reality Engine has a neat tutorial in their wiki about decals, similar to Doom3's projectors. Unreal2 also has a tut in theirs. Sorry don't have the links handy.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Good point Eric. Although it often depends on what type of decal effect you're trying to create, and what engine the thing is going into.
    You're right though, using a blend function or something (ie. white is transparent, darker colours multiply on top of the underlying texture) is what's done most of the time, from what I've seen.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    there is 2 kinds of "blending".
    - frame buffer blending:
    which is typically done for decals (if they are separate polys) any blended surfaces such as transparent, or additive particles...

    they all use the same formula:
    out = newcolor * a + oldcolor * b.

    a and b can be changed like "newcolor.alpha" or "newcolor.invalpha", "one", "zero, "oldcolor" ... that way you can do interpolation and additive or multiplication with the same formula.

    hence the performance should always be the same when this type of blending is used.

    - multitexture blending
    when not using pixel shaders, there was a set of different operations that can be done between texture stages mostly it was just multiplication

    typical lightmap setup
    texture0 = texturecolor
    texture1 = previous color * texturecolor

    there was set of different functions like "interpolate", "add", "modulate", while I never really tested for it, but I guess the performance of those would be very similar with interpolate being slowest as it needs 2 muls and 1 add, while the others need less ops.

    todays hardware would do this in pixel shaders and simply break it down to just some vector math like "a*b..."

    ----

    that said the "blending" as in framebuffer blending is not very flexible and even in todays hardware is just that one formula. So what we do for more fancy framebuffer effects is that the framebuffer is rendered into a texture (or grabbed) so that pixel shaders can be used and more fancy math and fx can be used. however as we cant write and read to the same texture within one drawcall, it is still a bit problematic and can be mostly used only for full frame fx and not so much for per object effects.

    this mostly affects per-pixel lit transparent surfaces, as those would normally be multipass-rendered (for # of affecting lights) and then you run into the problem of actually needing to have additive blending for light, but still that decal blend for transparency... a work around is rendering the object as opaque and store results into a texture and then blend that texture back to framebuffer...

    or just ignore multiple lights on transparent surfaces, or make sure they just need 1 pass wink.gif

    I think part of dx10/gl3.0 will be programmable framebuffer blending as well.

    drifting away here a bit, but anyway if you can do it with a second texturestage (layered) then go for it as that is cheap on todays hardware and saves the issues that come with those decal polys (sort, finding proper triangles for not overlapping..)
  • Eric Chadwick
Sign In or Register to comment.