Announcement

Collapse
No announcement yet.

Want Up/Out/Right Rotations be ignored by Camera Facing leaves

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Want Up/Out/Right Rotations be ignored by Camera Facing leaves

    Hi,

    I adjusted Leaves (Simple leaf/Sky sensitive) > Meshes > Up/Out/Right Rotations so all leaves largely face outward from the tree. I need this kind of initial leaf normals to have lightmaps built properly in UE4.

    Then in UE4 I changed the leaves material's SpeedTree node > Geometry Type to Facing Leaf. The leaves try to face the camera, however, the rotation is affected by the Up/Out/Right Rotations I set in the Modeler, it would be good if Up/Out/Right Rotations can be ignored in the shader for Facing Leaf.

    Thanks!
    Last edited by macrod; 05-08-2015, 04:57 AM.

  • #2
    You can't switch the geometry type in UE4 like that. Each geometry type has different data in the vertex.

    Comment


    • #3
      Then how can I handle static lighting for Camera Facing leaves? A tree asset could be placed upright and rotated to the side, the face normals really count.

      "You can't switch the geometry type in UE4 like that. Each geometry type has different data in the vertex."
      Looks the Camera Facing mechanism assumes all leaves face up.
      Last edited by macrod; 05-11-2015, 11:16 PM.

      Comment


      • #4
        Hello,

        I'm not sure what you are trying to solve. Are you experiencing a particular problem?

        Lightmapping should work fine on a tree with camera-facing leaves, as long as you tune the lightmap UVs well. See this docs page for more information on doing that.

        Comment


        • #5
          Well, I come to a conclusion that, if you change Up/Out/Right Rotations in Modeler to not facing camera, the geometries will come into UE4 like that, and no further way to re-orient those leaves to really face to the camera. The camera facing shader code can only orient the geometries with the incoming positions as the basis:
          // face camera-facing leaves to the camera, if needed
          if (GeometryType == SPEEDTREE_GEOMETRY_TYPE_FACINGLEAF)
          {
          // have to rotate the view into local space
          FinalPosition = FinalPosition.x * View.ViewRight +
          FinalPosition.y * View.ViewUp +
          FinalPosition.z * View.ViewForward;


          Looks I should seek to resolve it with Leaves > Lighting options.
          Last edited by macrod; 05-12-2015, 12:42 AM.

          Comment

          Working...
          X