No announcement yet.

Baking down the shadows in Speedtree on the billboard texture.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Baking down the shadows in Speedtree on the billboard texture.


    I was wondering if it is possible to bake down the shadows from Speedtree onto the billboards texture when exporting to Ue4. Currently our billboards are very flat, and it would be useful if I could enhance the basecolor with some fake shadows.
    We have our own adjusted texture packer, but I don't see a variable for shadow output.

    Many thanks in advance.
    Last edited by VincentVangeel; 09-30-2019, 10:31 AM.

  • #2
    Hi Vincent, what version of the modeler are you using currently?


    • #3
      Speedtree Modeler v8.4.1 Games edition


      • #4

        Shadows imply a light direction. So to get it to look correct, the shadows cast on the billboards would need to match the sunlight direction in your game. Since tree instances are often rotated, it'll pretty much never line up.

        You could actually cast shadows on them. Instead of removing the billboard polygons facing the camera, remove them facing the light when doing shadows. This will get you a good shadow on the ground, but might make a hard shadow line up the middle of the billboard itself. One variable you do have available in the texture packer (only when exporting billboards) is m_fBillboardDepth. Using this you could conceivably offset the depth when casting and receiving shadows to make the tree seem more round. But, I unfortunately do not have any examples of this.

        You could also fake things by using AO, which you have available in the texture packer. Be sure to render the per-vertex AO on the tree before export (by hitting 'O'). Then you could bake AO into color or otherwise include AO in the textures you export for use later.

        Hope this helps


        • #5
          Yes, our trees are rotated randomly so matching it perfect with the light direction in Speedtree was always impossible, but I was hoping to create a fake enough shadow by putting the light directly above the tree and rendering out this as overlay of the basecolor to create a less flat version.

          We are currently using the billboard depth from the texture packer and inputting this into a pixel depth offset shader of Ue4, which does indeed fake shadows to a certain degree. But the transition is a bit too obvious and after a certain distance the distance field shadows stop (for optimization reasons) and the billboards become flat cutouts. Here having a fake shadow would help fake a beter transition.

          For now I will use Ao, but I will see what my options are in Ue4 to create a fake shadow there.

          Thank you for your time.


          • #6
            Shadows suggest a light heading. So to get it to look right, the shadows cast on the bulletins would need to coordinate the daylight bearing in your game. Since tree cases are regularly turned, it'll essentially never line up.