Home Technical Talk

Memory Efficiency Question

If I have a 2048 map and want a small part to glow, and a small part to have alpha. What is the most efficient way to do it?

1. include alpha in diffuse alpha channel, include glow in normals alpha channel (waste alot of unused texture space)

2. seperate 16 bit, 128x128 texture with glow in one channel and alpha in the other, model would also need 2 uv channels (waste ram on uv channels, (models 9ktri), + another texture call)

3. ?

Replies

  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
  • NautalusX
    Options
    Offline / Send Message
    using udk here.

    intresting info, so the G is best, R is second best, and B is worst to use, how does the A stack up? full quality as green?


    Also, if i store somthing in the normal maps alpha, will the compression used there mess somthing up as far as quality goes?


    I intend to use a 128x128 texture using G for alpha, and R for glow, which uses the models second UV channel. :)
  • EarthQuake
    Options
    Offline / Send Message
    In most systems a separate smaller texture for the glow/alpha bits makes sense. Simply using alpha on a 2048 doubles your vmem! On consoles where vmem is really small this wouldn't be an option.

    An additional draw call is probably not a big deal in this case, and you don't need a "second" uv channel to have two materials.

    A second material with a diff+alpha/normal/spec/glow maps at say 128 or so is practically nothing compared to having alpha in a 2048. I would do this unless its going to cause seams or other problems.
  • Parkar
  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    it really depends on what it is can you show a picture ?

    if its really small and your engine supports lods id say make 2 new materials (and bite the bullet on those 2 drawcalls) and make sure that stuff gets turned off as soon as you go 2 steps away from the object !
  • NautalusX
    Options
    Offline / Send Message
    85858585855.jpg
    Pink= alpha
    Green= Glow

    Its just this small area, I'll try the Crop E assist on it, from the link you gave.

    2 steps away?, I could see turning the alpha off, but I would think the glow would always have to be on, sorry im very new to all this.
  • EarthQuake
    Options
    Offline / Send Message
    How do these areas relate to the model? I twould be nice to see the model in 3d with the areas marked.

    What is the alpha for? You might be better off just "faking" the holes here with black in the diffuse/spec.
  • NautalusX
    Options
    Offline / Send Message
    5484818511.jpg
    pink=alpha
    Green=glow

    Ok I think I realize im getting to picky about small things that could be faked. But I do like to learn for the future things, youd fake the glow as well?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    I don't see why not, unless they're something important and dynamic? Considering how tucked away the Green is, the user will almost never see them an an angle to make them stand out and glow, so a simple 'bleed' of your diffuse should be enough.
  • Ghostscape
    Options
    Offline / Send Message
    Ghostscape polycounter lvl 13
    I odn't know how important the +/- are for your battery to glow properly and with what level of fidelity you want them to glow - do you want lots of fake 'cast' light on the area next to it, or do you want the +/- to be clear? If it's the latter, consider modeling them and floating them above slightly, and giving them a shader with only diffuse/glow with no/white maps and tinting in the shader. I've done this for various bits before.

    I also am unsure as to why you wouldn't cut those holes in the blades when you have serrations already modeled into the blades - either make the blades flat quads with alpha or model the whole thing, don't half-ass it like you would be in your image there because you'll get the worse visual quality of the alpha with the increased vert density of the modeled blades.

    The first step to determining how best to optimize is to ask yourself "is this important, and why is it important to do it this way?"

    For memory it's always cheaper to use a second, smaller map with alpha rather than using alpha, and it's even better to cram shit into the RGB channels rather than adding an alpha. A second set of UVs is much cheaper, memory-wise, than all but the smallest of maps on the densest of meshes.

    The second UV channel does inflate your CPU (rather than GPU) memory which matters on the PS3, as it has a split memory architecture, so that's something to potentially consider, but a second UV channel on a 9k tri mesh is still going to be smaller than an alpha channel on a 2048.

    Doing some quick math, I believe 9k verts (which is way more than 9k tris) is about 105kb per UV channel (4bytes per float, 3 floats per UVW for verts.) In comparison, a 1024x1024RGB compressed with DXT5 compression is about 768kb, a 512x512 is 192kb. and a 256x256 is 48kb. Alpha doubles those numbers, so the cost of alpha at 1024x1024 is an additional 768. Thus you can see the extra UV pays for itself if you can cut your map in half, assuming your map is 512x512 or larger.
  • NautalusX
    Options
    Offline / Send Message
    Ghostscape wrote: »
    I odn't know how important the +/- are for your battery to glow properly and with what level of fidelity you want them to glow - do you want lots of fake 'cast' light on the area next to it, or do you want the +/- to be clear?

    I prefer cast light, it's pretty important to make the battery seem super powered.

    Thanks for all the info.
Sign In or Register to comment.