Home Technical Talk

Foliage - alphas vs geometry

polycounter lvl 19
Offline / Send Message
Gmanx polycounter lvl 19
I've been hearing recently that with the current state of polygon rendering it's much more efficient to build trees/foliage with leaves made solely from geometry rather than planes with alpha mapped leaf image textures.

Obviously it will be engine/GPU dependent but is there a general shift toward geometry?

Replies

  • Ramseus
    Options
    Offline / Send Message
    Ramseus polycounter lvl 13
    Well, yeah, it's more efficient to have geometry rather than a bunch of overlapping transparent faces... you still have an upper limit to total triangles though and to replace the fine organic detail in alphas with entirely geometry is asking a lot. Think of all the leaves on a tree, now you need to give each one enough faces to have some sort of shape. I don't see that ever happening in an even semi realistic looking game (until we can render movie levels of triangles in real time)

    There's certainly more geometry in foliage in games these days though, if nothing else it catches light better on alpha'd shapes.
  • jfitch
    Options
    Offline / Send Message
    jfitch polycounter lvl 5
    Depends on the foliage too I would assume, something like a fern might be mostly geo while something like a tree with thousands of leaves would have alpha textures.
  • Eric Chadwick
    Options
    Offline / Send Message
    Gmanx, I'm curious where you've been hearing this. Indeed games can render more polygons these days, you could probably get away with a small tree alone in a courtyard, but not if you're talking about a forest.
  • Ashaman73
    Options
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    In modern rendering engine, mostly based on deferred shading/lighting, alpha transparency is really nasty. Besides sorting the foilage, you although have a lot of overdraw (no early z-rejection) and you can't utlize the deferred lighting pipeline without major issues. Therefor foilage is often rendered with a forward renderer which leaves you with old issues: keep the number of influencing lights and shadows low.

    Therefor it could be more efficient to push out more polys instead of alpha transparent tris, but then you have visual issues (well, they are no longer transparent, the edges are harder). The latter could be handled by AA. Nevertheless, if you want hard edges, you could use alpha masking, which would discard pixels accordingly to the alpha values. This would be a compromise of both world, you could add it to the deferred rendering pipeline (all these lights and shadows :) ) and you could still keep the number of polys low enough, but you will have hard edges.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    Alpha test/ alpha to coverage is not the same as costly blended transparency. Using masks for foliage is still efficient to do. Geometry may allow better image quality if hw anti aliasing can be made use of, but you pay a constant high price for the geometry, there's no easy lod like via texture mipmaps...


    About hard edges: look up alpha to coverage it can improve quality quite a bit, same goes for postfx aa like txaa and friends.
  • Gmanx
    Options
    Offline / Send Message
    Gmanx polycounter lvl 19
    Gmanx, I'm curious where you've been hearing this. Indeed games can render more polygons these days, you could probably get away with a small tree alone in a courtyard, but not if you're talking about a forest.

    I first heard about this in a discussion about Arch Viz renders, particularly Alex Roman's 'The Third and Seventh'. Of course that's 3dMax and Vray - very different to a real-time game engine. Chatting with other devs I heard that some guys are modelling more detail into (lets say) a tree and relying less on alpha mapped planes.

    I appreciate that there's clearly an upper limit to how many triangles we can throw at the screen - and we need to balance that against the number of instructions needed to sort out the alpha on a quad plane. I think it's interesting looking at the trade-off given GPU power these days, and the different methods of achieving the desired leaf shape.

    Interesting stuff. :)
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    when it comes to throwing more tris at GPU keep in mind that having many triangles smaller than a pixel is still not ideal, which will quickly happen if you were to model leaves individually.
  • Ashaman73
    Options
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    Geometry allows better image quality due to hw anti aliasing
    Hardware AA does not work in a deferred rendering pipeline(eg UDK4=deferred based, UDK3=forward based), you can't use it to build your g-buffer.
  • grimsonfart
    Options
    Offline / Send Message
    grimsonfart polycounter lvl 4
    I'm confused. Are we talking about actual in-game trees with geometrical leaves or geometrical leaves when you make high-poly for render?
    Using geometry leaves in-game sounds like a really, really bad idea.
  • Gmanx
    Options
    Offline / Send Message
    Gmanx polycounter lvl 19
    We're talking about the use of alphas vs geo in-game.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    unless you really have a "single tree" up close scenario, keep using alpha for the leaves, and throw a bit more polys out the windows for branches or leave planes for additional "volume"
Sign In or Register to comment.