Home Unreal Engine

backface lighting

polycounter lvl 17
Offline / Send Message
Oniram polycounter lvl 17
is there any way to have a mesh with no backface cast a shadow? ive got a bunch of wall pieces that are meant for an interior, and light just goes right through them. a small fix ive got for that is to just build up a BSP wall around the inside of the walls.. but thats a bit tedious. any suggestions?

Replies

  • Xendance
    Options
    Offline / Send Message
    Xendance polycounter lvl 7
    Make the material of the walls two sided?
  • Legend286
    Options
    Offline / Send Message
    Legend286 polycounter lvl 9
    Enable the double sided switch in the material, it should work.
  • cholden
    Options
    Offline / Send Message
    cholden polycounter lvl 18
    Unless you're just goofin' around making some art, avoid the 2-sided fix, and either fill with bsp or give those pieces a backface for shadow casting. Everything being 2-sided unnecessarily makes your materials more expensive.
  • Legend286
    Options
    Offline / Send Message
    Legend286 polycounter lvl 9
    cholden wrote: »
    Unless you're just goofin' around making some art, avoid the 2-sided fix, and either fill with bsp or give those pieces a backface for shadow casting. Everything being 2-sided unnecessarily makes your materials more expensive.

    It's actually better not to add a backface in the modelling program, doing it through the shader culls it if it's not visible anyway, so you don't need to worry about performance loss.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    Legend286 wrote: »
    It's actually better not to add a backface in the modelling program, doing it through the shader culls it if it's not visible anyway, so you don't need to worry about performance loss.
    Are you sure of that ?
    It's better to have a two-sided shader than more faces on a mesh ? For the GPU it's not too much hard ?
  • Ben Apuna
    Options
    Offline / Send Message
    I believe that a two sided shader is more expensive than actual geometry.

    Two sided shader turns OFF backface culling forcing the GPU to render all triangles (might even be 2 draw calls...).

    Actual geometry backfaces get culled by default resulting in less triangles drawn.

    So as cholden says avoid the two sided material hack like the plague.

    EDIT:

    On a side note, why are so many people trying this two sided material thing lately? Is it being taught somewhere as a good way to do things?

    one post and another from the Terrible Advice/Myth Thread.
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    yea my original intention was adding geometry or bsps. i knew that the two sided materials were way too expensive for this scene (given that the master material for everything is already kinda expensive). so yea, i guess ill do the geometry thing. thx

    and just to add my input to the whole argument.. ive NEVER found geometry to be an issue in UDK. for the most part since ive seen the FoliageMap that has just simple rubble pieces over 4k, i figured that UDK can handle geometry pretty well (which it does), and ive never concerned myself with geometry since. all my lag/gpu issues come into play with materials and/or lighting.
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    I have generally found the lighting caluculations on the backfaces of a two sided material to not be very reliable in any engine. You'll often get weirdly dark or strangely bright backfaces.
  • Ben Apuna
    Options
    Offline / Send Message
    Yeah me too, I used to make double sided materials for foliage in the past.

    The lighting/normal calculations were reversed on the backsides and it really made things look strange.

    That was back with UE3 though and not with UDK/lightmass maybe it has been "fixed"?

    Even then though double sided is probably not good for performance reasons.
Sign In or Register to comment.