Home Technical Talk

Quick question, the cost of alpha blend.

polycounter lvl 10
Offline / Send Message
GlowingPotato polycounter lvl 10

Hey, I have a quick question about alpha blend materials in UE5.

If a rendered pixel is 100% opaque, does it incur less processing cost, or does the shader still process all pixels equally since it's using alpha blending? The reason I ask is that I'm trying to optimize an object with a small translucent visor. Would it be more efficient to render it with two separate materials—one for the opaque part and another for the translucent visor—or stick to a single material, where only a small area of the texture uses an alpha map with less than 100% opacity?

An example of this object would be a fire extinguisher and the plastic cover of the pressure meter. 

Replies

  • GlowingPotato
    Offline / Send Message
    GlowingPotato polycounter lvl 10
    Well, after posting this here, I asked GPT, and it gave me this. 

    In Unreal Engine 5, when using an alpha blend material, the cost of rendering doesn't necessarily decrease for pixels that are 100% opaque. Even if a pixel is fully opaque, the alpha blending still takes place, which means there is some overhead involved in processing the blend mode. The engine doesn't automatically skip alpha blend calculations for fully opaque pixels.

    Now, regarding your specific scenario:

    Two Separate Materials:

    • Opaque Material: The opaque part of the object can use a fully opaque material, which is cheaper to render because it doesn’t involve transparency or alpha blending. Opaque materials benefit from early depth testing and more efficient rendering.
    • Translucent Material for Visor: Only the small translucent visor would use the alpha blend material, which can be more expensive to render but is isolated to a smaller portion of the object.

    Single Material with Alpha Map:

    • Alpha Blend Across the Whole Object: In this case, even though only a small part of the texture (the visor) is translucent, the entire object would be rendered with alpha blending, incurring a higher cost across the entire material because the GPU still needs to evaluate the blend for every pixel.

    Optimization Advice:

    It’s generally more efficient to split the object into two materials—one opaque and one translucent—because opaque materials are less costly to render. You would limit the expensive alpha blending to just the small visor, while the rest of the object benefits from the cheaper opaque rendering.

    In summary, using two materials is likely to be more optimized, especially if the translucent area is small.

    Anyway, I prefer a expert human response if possible. But GPT answer seems plausible enough. 

  • gnoop
    Offline / Send Message
    gnoop sublime tool
         Ask GPT  about "alpha test"  ,  "screen door alpha" ,   "alpha to coverage"  speed tree uses  and  "Hash alpha blending"  Blender uses . Might be useful for your topic too.   Games  hardly use classical alpha blending at all .   It creates  z sorting issues and calculative expensive.
    Some games also do alpha channels with gradients and threshold value shifting for distant mips.  
         Alpha blending is used in layered materials  mostly with a height blend based masking  since it's usually  just 4 materials ( by count of rgba channels where their masks are packed in )  and not gazillion of grass blades or trees.
Sign In or Register to comment.