Home Technical Talk

AO, Lightmaps, and the problem of too many big textures.

Renzatic
polycounter lvl 10
Offline / Send Message
Renzatic polycounter lvl 10
The title pretty much describes my problems. I'm making a small papercraft style scene that may or may not end up in a game engine. To get it looking the way I want to, I've had to unwrap every surface and give it its own unique UV space. The upside is that it wasn't all that difficult to do. The downside is that I've now got 10 2048x textures. Too much for such a small scene. To give you an example...

Here.

The sheet that's onscreen just covers the back half of the center room. The front half, the tunnels the various stones, the details...they've all got their own sheets. When I add more stuff, I'll try to cram it into other sheets, but honestly, if I weren't worried about baking everything in, I could probably do this whole scene with 4 512x textures.

So the question is, is there a more efficient way to go about doing this? Something that doesn't require me to use an obscene amount of high res textures? Right now, efficient is about the very last thing this little map is.

Replies

  • HarlequiN
    Options
    Offline / Send Message
    HarlequiN polycounter lvl 18
    Well, I don't know MODO, but I do know Max. I'd be surprised if you couldn't use a similar technique. In Max, this is what I would do:

    Map my 512 textures with no baked AO as tiling across the surfaces in UV Channel 1.
    Map my AO bakes in UV Channel 2 - the AO bakes would be their own texture or textures - just greyscale.
    Set up a material that multiplied UV Channel 1 with UV Channel 2, blending the AO and the tiling textures together.

    Since it's unlikely the AO needs anywhere the fidelity of the other textures you could then either make your 2048's much smaller or rebake the AO onto one texture. The exact size of that texture would need some experimentation; but rescaling one texture rather than 10 is a big time saver, and one texture is always going to be more efficient than many. I highly doubt you'd need it bigger than a single 2048, and you might find it doesn't need to be any larger than a 512.
  • Renzatic
    Options
    Offline / Send Message
    Renzatic polycounter lvl 10
    Okay, to break it down:

    One UV channel for the color, corresponding to one small texture. Since each surface is basically a single color with a wrinkle textures thrown on to give it a paper look, I don't have to worry about keeping it too organized. I could overlap my islands without much worry. It'll be one texture per material.

    One UV channel for the AO bake. If I'm following you correctly, I'll basically be mapping every surface onto one single 2048 texture, rather than splitting them across 10, since AO bakes don't need much fidelity, right? I guess since it'll be blended in so much with the surrounding color, you wouldn't notice any jagged edges from the reduced resolution.

    That would cut down my texture usage by quite a bit, but...what about the lightmaps? Would I make a 3rd UV channel for that and bake them onto one sheet? It'll have to be higher resolution than the AO bake, which seems like it'd lead me back to where I started.

    The AO and materials I can fix, but the lighting is gonna give me trouble, I think. It's pretty simple stuff, nowhere near photorealistic, but I want to be able to maintain fidelity.

    edit: to give you more of an idea of what I'm trying to do, here are two shots, one with baked lighting, one with just the material and AO. For now at least, the UVs are the same for both of them.

    Unlit

    Lit.
  • Eric Chadwick
    Options
    Offline / Send Message
    Why not use vertex color instead? You have a ton of vertices in your mesh there. You should be able to bake all your static lighting info into the vertex colors.

    Did you say which game engine you're going out to?
  • Shadownami92
    Options
    Offline / Send Message
    Shadownami92 polycounter lvl 7
    Yeah I agree, you could easily use vertex color instead. Not only that but you don't really need a UV channel just for color do you? Based on the engine your using you could just set the color of an entire model that way if the whole model is one flat color. Then you could bake AO into a different vertex color channel.

    Then if the paper wrinkle texture is the same tiling one across everything you could use a smaller tiling texture for that and either have that use a uv channel or you could use a tri-planar projection maybe.

    Either way if you designed a shader corrrectly you could lower the whole thing down to 1 image-texture and then do the rest in the shader instruction for color and AO and lightmaps with vertex color. You could probably get away with the look you want with 1UV channel with 1 256x256 that tiles if you wanted.

    With a triplaner projection method you could maybe even get it without having to have any UV channel used really.

    To see a good use of vertex baked lighting you can take a look at some of the stuff that Reciever did.
  • Renzatic
    Options
    Offline / Send Message
    Renzatic polycounter lvl 10
    I think that might actually work! I watched this video, and it looks about perfect for what I want.

    Now I just have to figure out how to get it to work right. I tried it out on my mesh with my current lighting setup, and the end results weren't exactly as smooth as I hoped. In fact, it was kinda janky. Way too dark, and very spotty. From what I had read elsewhere, I was expecting a rougher version of the RayGL output.

    ...what I got was looked like what a guy with bad cataracts watching Tron with sunglasses on in a dark movie theater would see.

    edit: to clarify a bit.

    This is how I want it to look (roughly).

    And this is how it's turning out.

    Any idea what might be guffing me up?

    Oh, and I'm currently leaning towards using UE4. I've got Unity installed at the moment, and I've bene goofing around with it a bit, but from what I've seen from the videos, it looks a little more streamlined and easier to use in comparison.

    edit: it was a bug. I updated Modo, and now it works. And it's nice! :D
  • HarlequiN
    Options
    Offline / Send Message
    HarlequiN polycounter lvl 18
    Cool :) Sorry I didn't come back to help with the light map advice, but I see Eric and Shadowman had you covered.
  • Renzatic
    Options
    Offline / Send Message
    Renzatic polycounter lvl 10
    Arise old thread!

    Yeah, I figured I'd necro this thread instead of starting a new one to keep my questions grouped in one place.

    And the dumb question coming up? It's a relatively simple one.

    As you can tell from the shot above, the style I'm going for requires me to use a goodly bit of polys to get a nice faceted look. My meshes aren't so dense I'd call them high poly, but I'm definitely throwing around more geo than I otherwise would. Stuff I'd normally make a texture for I'm doing with geometry, because I feel it gives a better effect.

    And the question is: how much is too much?

    Right now, I'm throwing together assets for a little graveyard scene (olol I'm original), and I decided to start placing them together to see how they all look together. It's all coming together alright, but I saw I was up to 65,000 tris, which I thought might be a little on the high side.

    Yeah, you'll probably need a visual example to make a judgment call, so...here you go.

    Most of it is fairly low poly. The pine that make up most of the scene are just 800 tris. The little round tree about 600. The two mausoleums are 6500 and 5700, and the fountain is 3200. Those are a little on the high side, but they're not gonna be used all that often.

    The two I'm worried about the most are these more ornate trees, which are 2300 and 4900 tris (and yeah, they're the same tree. I got lazy).

    I'm not exactly going willy nilly with the geo here. I try to be as efficient as possible, getting rid of any geometry I don't think I need. But I'm still designing more towards how I want it to look, rather than pure efficiency. If I want jaggedity bits, I'll be throwing in loop cuts to get those jaggedity bits.

    ...but am I going too far? To reiterate: how much is too much? Keep in mind I'm gonna be adding in grass, and shrubs, and stones, and landscape in the near future.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Renzatic wrote: »
    ...but am I going too far? To reiterate: how much is too much? Keep in mind I'm gonna be adding in grass, and shrubs, and stones, and landscape in the near future.

    The best answer to this is a question:

    "what's the framerate on your minimum spec?"

    Because that's the only thing that really matters. If the framerate is ok then you've got no problems.

    Something you probably do want to avoid is too many small polygons. Lots of GPU's don't like this. So you should aim to keep your polygon density as even as possible. Don't put lots of polygons into small objects and small details unless necessary.
  • iconoplast
    Options
    Offline / Send Message
    iconoplast polycounter lvl 13
    sprunghunt wrote: »
    If the framerate is ok then you've got no problems.
    This is exactly what I was about to say before I saw there was another post.

    In addition to small triangles, be wary of very thin long triangles. Those also make trouble in a number of cases.

    Ultimately, I would put what you have now into whichever engine you've settled on and see what happens. (Trying things to see what happens is probably the advice I give most often, at least for software, but it's usually fastest and the most educational. What can you do?)
  • Renzatic
    Options
    Offline / Send Message
    Renzatic polycounter lvl 10
    So basically push it until it starts running back, then scale back. I think I could do that.

    The only thing I think I'll have to change is the way I was planning on doing grass. I was gonna make the blades out of a bunch of little doublesided 4 tri polys, but if I have to stay away from small triangles, I might have to go with the standard alpha masked setup. That's not too bad a deal.

    Now another small question. I'm just about sure I'll be using UDK to do my thing, and from what I understand, the models use two UV maps there. One is for your diffuse/normal/specs, and the other is for baked lights. The second map you don't do anything with, the engine itself produces a texture itself based on how you set up the lighting in the editor, correct?

    Oh, and my current models have AO baked in. I only planned on doing this for the smaller assets, and letting the engine handle the landscapes. But now I'm starting to wonder if I even need to do that. From the way things sound, all I need to worry about is that first UV. AO and lighting is handled entirely by UDK. Am I correct in that assumption?
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    Renzatic wrote: »
    The only thing I think I'll have to change is the way I was planning on doing grass. I was gonna make the blades out of a bunch of little doublesided 4 tri polys, but if I have to stay away from small triangles, I might have to go with the standard alpha masked setup. That's not too bad a deal.


    I've actually seen tests that indicate that really small low polygon grass models will run faster than standard alpha grass. The problem with alpha is overdraw from the transparency.

    The problem with the polygon grass is the triangles becoming very small at a distance (the same problem I mentioned earlier) - but you can make LODs for the grass model to reduce the triangle density as the model moves away from you.

    So it really does depend on various things - the ultimate solution is to test both versions in game and see which ones draw better - there's sometimes even huge differences between platforms - xbox and ps3 for example.

    to test stuff like a boss on the pc you should learn to use a tool like the NVIDIA perfhud:

    https://developer.nvidia.com/nvidia-perfhud

    Then you'll be admired by programmers and technical artists alike ;)
Sign In or Register to comment.