Home Technical Talk

Alpha Planes, two Materials?

polycounter lvl 9
Offline / Send Message
S_ource polycounter lvl 9
Hey there!

I'm currently working on a prop which is a crate with hay in it. And I'm going to use alpha planes with hay and would like to know the best way to do this performance wise. If I have understood it correct, materials with alpha is heavier to render and therefore should use it as little as possible.

So what is the best way? To keep the alpha parts in the same texture and have two separate materials for the parts that use and don't use alpha. Or have a separate texture for the alpha parts, and therefore also two separate materials. Or can I just have one texture and one material?

And also for this particular case I'm using source engine, but if it differs from engine to engine it would be nice for future projects to know that to do.

Thanks In Advance!

Replies

  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    does it have to be soft alpha ? if alpha-test/masked is good enough id say make the whole thing one material.

    if this prop is supposed to be used 1000+ on screen id also say one material only !

    but if its a one two or three times on screen deal and you must have soft alpha than do 2 materials !
  • S_ource
    Options
    Offline / Send Message
    S_ource polycounter lvl 9
    warby wrote: »
    does it have to be soft alpha ? if alpha-test/masked is good enough id say make the whole thing one material.

    if this prop is supposed to be used 1000+ on screen id also say one material only !

    but if its a one two or three times on screen deal and you must have soft alpha than do 2 materials !

    I will most likely use $alphatest and I don't know how much the prop will be used in maps but i would guess around 10 on screen. So one material and all on one texture?
  • EarthQuake
    Options
    Offline / Send Message
    Theres really two main considerations here, draw calls and texture memory.

    If you need soft alpha, that means 8 bit alpha which will double the vmemory for that texture sheet when compressed. In that case it usually makes sense to have the bits that need alpha be on a separate, smaller texture, and of course a separate material. The drawback to this is increase draw calls, which tend to be a big factor in performance in modern game engines.

    If you'll only use alphatest and DX1 1-bit alpha, the texture memory isn't an issue, so you can pretty safely use 1 material, though if the section of your model that requires alpha is only a small %, you might want to use a separate material for it anyway.
  • S_ource
    Options
    Offline / Send Message
    S_ource polycounter lvl 9
    Alright, thanks for the help guys!
Sign In or Register to comment.