Home Technical Talk

[Maya] What is your solution to making double-sided planes ?

greentooth
Offline / Send Message
MBauer17 greentooth
Currently, my go to method when it comes to things such as grass and leaves is to duplicate the plane, reverse it, shift it down slightly and then merge the two planes together creating a single "plane but not really." I am wondering if there is a more elegant solution, particulary when it comes to rounded objects like this tree I'm working on below. The "duplicate/shift down" method doesn't seem to work as well for complicated shapes, and even scaling down the duplicated object doesn't seem to create a smooth transition. 


Replies

  • .Wiki
    Options
    Offline / Send Message
    .Wiki polycounter lvl 8
    Why are you shifting the geometry down? 

    It doesn´t matter if you merge the vertices at the borders or not. Since you will have a uv split at the border the geometries will be rendered seperate.
  • MBauer17
    Options
    Offline / Send Message
    MBauer17 greentooth
    @.Wiki When duplicated the surface of the new object is in line with the original, creating an effect like below. Are you saying that the effect is only visible in the workspace?



    Now if I scale the second object slightly (-0.05) I get the desired result


  • .Wiki
    Options
    Offline / Send Message
    .Wiki polycounter lvl 8
    You want to put this in a game engine, right? Then ignore the effect. Or turn of backfaces in your viewport. These are artifacts caused by rendering the polygons on top of each other, but in a game engine it will only render one side.
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    If all you're doing is that, you might as well do a two sided material, right? What's the point in duplicating it?

    The reason you're seeing all that black is because you've duplicated a two sided mesh and flipped the normals inwards. Just enable backface culling and you'll see that you won't really have to scale it at all (except for Z fighting).

    Also for complicated meshes, you want to do a transformation along the normals of an object, lookup how to do that.
  • m4dcow
    Options
    Offline / Send Message
    m4dcow interpolator
    Like others have mentioned you would be better served by using a double sided shader, but if you wanted to do what you're describing, switch to vertex selection mode and in the move settings, select normal and drag the N handle. This will move the vertices along their normal direction and offset them enough to avoid the Z fighting artifacts.
  • MBauer17
    Options
    Offline / Send Message
    MBauer17 greentooth
    @Axi5 and @m4dcow Just wondering, is this effective for materials with alphas like leaves? I utilized this tutorial  create the hypershade map for a leaf but I never seemed to get the desired result. 
  • Axi5
    Options
    Offline / Send Message
    Axi5 interpolator
    That's not ideal no, since that's just for offline rendering. You don't want to do have a shader for each normal direction, you just want one shader that's not backface culled and lit from both sides.

    Literally in your example all you'll have to do is go to Lighting > Two Sided Lighting and you should see your texture correctly on both sides. When it comes to putting it in a game engine you'll want to find a similar setting and again, make sure backface culling is off.
  • TTools
    Options
    Offline / Send Message
    TTools polycounter lvl 4
    Surprisingly, all game engines will have doublesided shader options (aka: diasable backface culling), not that many seem to support Two Sided Lighting, or in some  engines referred to as: "Light from both sides".  In the case where Two sided lighting is not an option, strictly using doublesided can be problematic for lighting.  Lighting data is captured by the object from the direction of the face normal, and thus will light the "inside" of the foliage with the same value as the exterior of the foliage.  This makes the inside of the tree much brighter than it should be.

    Now this starts to get into a conversation about transmission of light through the leaves, but based on the supplied screenshot we're not going for photoreal here,and can avoid going down that rabbit hole.

    So, if Two Sided Lighting is not available in your engine, you will get the most accurate lighting results by duplicating the crown of your tree and inverting the normals with backface culling enabled (in other words, both out and in facing cards are single sided).  I would very strongly suggest that you DO slightly scale the crown vertices "in" using  @m4dcow method of moving along the vert normal so the polygons do NOT reside exactly on top of each other as was suggested.  Doing so and merging those polygons coplaner with each other will  make your life hell later. Selection becomes a huge pain, polyCleanup will throw errors, and it is very difficult to undo that later, particularly if you haven't planned for it by offsetting UVs or creating selection sets.

    If you absolutely must merge outward/inward planes together, definitely make sure you offset the UVs or create selection sets so you can easily re-select inside versus outside crown geo easily.
  • MBauer17
    Options
    Offline / Send Message
    MBauer17 greentooth


    @TTools and @Axi5 Took your advice and did a quick render and it all worked out! Thank you !!
Sign In or Register to comment.