Home Technical Talk

next gen and alpha

Ruz
polycount lvl 666
Offline / Send Message
Ruz polycount lvl 666
seems that although the technology is getting more advanced stuff like alpha has a taken a backward step.
In some next gen engines, alpha os so expensive as to render it unuseable.

Replies

  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    if you mean transparency, yes it never was cheap, the main issue now is that once you start applying shaders that require more than one pass you are kinda screwed up, if you want to preserve transparency...
    what some do is render it as solid, then save result into texture and blend this texture back on framebuffer...
    if you can manage to do all work in a single pass, it is same as now.
    but because we now have much more postprocessing it is trickier to handle transparent fx, cause you would need different info for the "pixel below"...

    so it gets complex if you want it with same "detail" as solid stuff, but often that is not required
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    but surely when desigbning an enigne the coders must have thought at some point what about transparency, lets fix it so we can use it. perhaps not?
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    transparency is not an easy thing to just "fix"
    think about it, you only have your framebuffer, the pixels you see. now when you look thru something transparent, you know that there are 2 surfaces (the transparent, and whatever is behind) but on framebuffer it is just 1 pixel, which got mixed out of two color values, each represented different surfaces.
    this information now got lost, your brain makes it up again, cause it interprets the similar colored stuff as one surface and so on.
    so you have just pixels that contain only one piece of information a time, but transparent stuff has 1 information per surface. even when you have more than one buffer, like depthbuffer, normalbuffer... you still have one information per pixel,you cant easily come around that...
    if there is just one surface (all solid), you have all necessary data you need to do fancy fx, but what happens when there is 2 or 3 or many, what if they overlap, intersect...

    this is not raytracing, where you just shoot from the eye until you hit a surface,compute color, then go along the ray if transparent...
    but in realtime engines, you render each object (triangle soup) after another. each one has no clue about the others...
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    I understand that it is a difficult technical thing to get right, but then I am not a coder and it just seesm weird that we have gone from having alpha that works reasonably well to having it not work.
    seems like a backward step thats all.
  • headengine
    Options
    Offline / Send Message
    headengine polycounter lvl 18
    It is, frankly, a major pain in the tits. Just when you think it was going to be easier it got harder again.

    There are ways to do it, but to be honest a lot of the nice work you see in challenges etc that use multi layered alpha simply would not work in many engines.

    However - I'm sure it's possible... just takes time, effort and tears.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    well hopefully as the coders get more and more in to the next gen stuff they will crack this particular problem, but from what CrazyButcher was saying, it might not happen anytime soon
  • ElysiumGX
    Options
    Offline / Send Message
    ElysiumGX polycounter lvl 18
    One problem I always seem to run into when playing with alpha transparencies is what's called Z-fighting. There's where back surfaces cause artifacts over front surfaces. Really annoying.
  • spacemonkey
    Options
    Offline / Send Message
    spacemonkey polycounter lvl 18
    Right now I am really pissed at work.. all because of the lack of blended transparency.. I can use alpha test.. but to actually have bleneded.. which is what I need... nada
    frown.gif
    next gen woes...
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Most engines support one bit alpha which is free to use and lets you sort as many transparencies on top of each other as you like. I would imagine sorting every single triangle that has transparency with all the other triangles in the game is fairly cpu intensive, so it depends on the game really and where you want to spend your cycles. Fill rate is an issue to with using giant quads with an alpha map on them, on the xbox and xbox360.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    1 bit alpha is garbage, especially for hair
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    Ely: That's no Z-fighting, when drawing transparent surfaces you disable Z buffer testing.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    no you disable z-writing (hence intersections create those z-fight like stuff), but you definetely keep z-testing and want that a glass behind a wall is not rendered...

    more on those z-fight like things, when sorting triangles, it can happen that they intersect in such a fashion that they are partially in front of each other. now to do the transparency effect accurately, you would need to split the triangles along their intersection line. but that would be really cpu heavy. the main problem is that the blend used for transparency the "lerping" (decal..) is not associative. so ((a lerp b) lerp c) is not the same as (a lerp (b lerp c)), you must not change order.
    thats why particle systems often use additive blends, saves sorting time. (order of adding values doesnt change result, cept some rounding problems), but results into that ugly "glowing smoke", as many particles with dark grey on top of each other sum up to white quickly.
  • hawken
    Options
    Offline / Send Message
    hawken polycounter lvl 19
    I was trying to get alpha to work in such a simple engine as Director 3d. Still fucks up.

    Why can't alpha be as simple as the DS/N64?
  • Eric Chadwick
    Options
    Offline / Send Message
    It's all the hardware's fault. Dreamcast had awesome sorting of soft-transparent surfaces. I don't know why the hell no one is adding depth-peeling to their hardware anymore.
  • arshlevon
    Options
    Offline / Send Message
    arshlevon polycounter lvl 18
    its got a lot to do with diret x's architecture and the dx hardware as EC just stated. after talking with some folks that have been coding for direct x 10 this problem is over and done with on the next generation of PC games that use DX10 and DX10cards. sad thing is your going to have to get a DX10 card to handle it. because its all or nothing with DX10 games, it is not backwards compatible with DX9, so you wont be playing DX10 games on your DX9 harware unless they put 2 versions of the game on the disk, but i do think DX10 hardware has the capibility to emulate DX9 to run your old games. thats why i am holding out for vista and DX10 before upgrading my graphics card, all you people who went out and got a 7800 are going to hate yourself when the new cards come out.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    I think we'd still see backwards compatibility, just like engine coders are used to multiple codepaths anyway (pc,console,linux,mac...), you cant afford to put millions in development and then have just a small percentage of hardcore gamers with latest cards buy it (different for consoles).
    Also a lot of the new stuff can often be emulated on cpu, just like old drivers would perform vertex-shaders on cpu with SIMD. while I'm no expert I think neither xbox2 nor the ps3 have so called geometry shaders (the only real big new thing about dx10, although a friend told me xbox2 has something similar, and well ps3 has enough cells to do it one).
    it's definetely going to be cool to see what comes out of the new tech, but until stuff becomes mainstream it surely will take a while.
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    I remember how long it took until shaders became a requirement for games and until DVDs became the standard medium for large games. While it may be good for MS, NVidia and Ati if games require upgrades it's not good for the game itself and that's one of the things managers want to avoid as much as possible. I'd expect it to be another 3-4 years (at least) before games (not made by Microsoft) drop DX9 support. At a sufficient level of abstraction (e.g. SDL) it doesn't matter what graphics API you're using so games supporting DX9, DX10 and OGL are still possible.
  • rawkstar
    Options
    Offline / Send Message
    rawkstar polycounter lvl 18
    yeah I wouldn't get new hardware until windows vista comes out.

    as for the alpha problem... hehe in doom 3 u have to chose between either having alpha or normal maps... hehee uber ghey, but thats how it is. one of the reasons why alot of the next gen games have alot of chunky solid characters. I'm sure this will get fixed eventually.
  • Thegodzero
    Options
    Offline / Send Message
    Thegodzero polycounter lvl 18
    vista sounds like when they moved away from DOS. After reading up on it, it seems like they are realising that the old way isn't always the best way and moving on. I can't wait to see characters with hair that doesnt look like its made of rubber as seen in ll gaves with normal mapped hair. KDR, i wouldnt say dropped id say you will have to get a diffrent version in the store. Just like when they moved from dos based games to windows based games.
  • Eric Chadwick
    Options
    Offline / Send Message
    That's interesting about Doom 3 and alpha. I'd bet it was a performance choice, similar to how characters can only be lit by one light at a time.

    One trick we've used to get soft-alpha to sort in the proper order is to divide the mesh up into chunks by material, so that even though the surface is a single entity (head of hair, or whole tree), it gets sent to the vertex cache in separate chunks, so then each can be sorted against the others, for better layering.

    Problem is, this can be very slow, since (as I understand it) you can only have one chunk at a time in the cache, clearing it out and loading the next one takes time. Then there's the fill-rate issue on top of that, rendering each chunk in its entirety before rendering the next one, etc.

    Alpha-test seems to avoid all that, so it's super fast, you can just send a single chunk for the whole tree (or attach multiple trees together as one massive chunk, so it's even faster). The clear texels are simply not drawn, so you don't have to render as many of those underlying never-seen pixels.

    Or at least that's the way I understand it so far, with my puny artist's brain. smile.gif

    BTW, we have the term "alpha-test" for 1-bit alpha... anybody know the analogous term for soft transparency? Is it just "alpha-sort"? I can't remember.
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    alpha-blend I would guess
    in opengl alpha-test is used for the 1bit stuff, and blend is used for blending (decal,additive... whatever) of a surface on top of the framebuffer.

    alphatest is fast because it can replace the pixel below, whilst alphablend will need the previous drawn pixel and mix it with the new one
  • KDR_11k
    Options
    Offline / Send Message
    KDR_11k polycounter lvl 18
    TGZ: I think it should be doable to fit multiple binaries for different OSes on one DVD (as has been done with e.g. UT2004). Multiple versions of any product are economically ineffective, it's cheapest to have one unified product that everyone buys.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Just something that crossed my mind - what about these "light transmission maps" that UT2k7 has going on? Remember the video demo of the creatures, and there was that one flying thing, and they demonstrated light passing through the wing membrane (which looked normal-mapped to me), and being able to see through it slightly, and casting soft shadows?
    Can anyone shed any light (pardon the pun) on this?
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    i do not believe that is a transparency map. lets say you have a 2 sided face and a light from above, it's basically telling how much of the light the bottom face will get instead of it being pitch black. I assume this could also be a colorized map so that you can have the on the underside of the face shift towards say red since it's 'passing through' blood.
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    Right, i see... hmm. well, I guess that's better than nothing. You could use alpha-test for silhouette outlines (like say for ragged wing membrane edges), then use a transmission map to make the surface look thinner... it'd kinda work for some things... but yeah, blended alpha is definitely something to look forward to.
  • Thegodzero
    Options
    Offline / Send Message
    Thegodzero polycounter lvl 18
    Ok so thats a transparacncy thing not a SSS thing? So what would the effect you get when light passes threw a leaf be? SSS or Trans? Wouldnt that be like the wing? After all in the wing where you see it so a color shift and veins like in sss, but you can also see threw the wing like trans. Is this the same as the nvidia tech demo where you could see the bones with in the mesh?

    So many shaders never enough time to memorise what does what.
  • JordanW
    Options
    Offline / Send Message
    JordanW polycounter lvl 19
    Basically Tranlucency is just a specific scenario of Sub Surface Scattering. However it's such a specific situation that you can use a tranlucency shader because SSS would be overkill for what is trying to be accomplished.
  • Toomas
    Options
    Offline / Send Message
    Toomas polycounter lvl 18
    [ QUOTE ]
    TGZ: I think it should be doable to fit multiple binaries for different OSes on one DVD (as has been done with e.g. UT2004). Multiple versions of any product are economically ineffective, it's cheapest to have one unified product that everyone buys.

    [/ QUOTE ]

    Blizzard games use PC/MAC CD's but they are bloody slow for some reason (atleast WoW is).
  • Asthane
    Options
    Offline / Send Message
    Asthane polycounter lvl 18
    [ QUOTE ]
    [ QUOTE ]
    TGZ: I think it should be doable to fit multiple binaries for different OSes on one DVD (as has been done with e.g. UT2004). Multiple versions of any product are economically ineffective, it's cheapest to have one unified product that everyone buys.

    [/ QUOTE ]

    Blizzard games use PC/MAC CD's but they are bloody slow for some reason (atleast WoW is).

    [/ QUOTE ]

    Err, you're implying an extra couple files on a CD can make it slower? CD's use a generic filesystem readable from any OS (ISO 9660) and DvDs are similarly compatable. If Blizzazrd's CD's actually are 'slow' on a large scale, it's not because they're PC/Mac compatible.
Sign In or Register to comment.