No announcement yet.

Exporting AO from SpeedTree For Games v8.1.5

  • Filter
  • Time
  • Show
Clear All
new posts

  • Exporting AO from SpeedTree For Games v8.1.5


    Im wondering if there is a way to export the AO that SpeedTree For Games generates in v8.1.5? Ive been looking around but can seem to find a way to do it. Ideally I would want it embedded in the model as a vertex color set or something like that and not as a texture.


  • #2
    If you are exporting to UE4 (with .st files), the vertex color is AO in the color and blending amount (for branch seams, etc) in the alpha.

    If you export to FBX, there is an additional UV layer called blend_ao that has blend in the U and AO in the V.

    But the final AO value should be the per-vertex AO value multiplied by the AO texture, if you wish to match the Modeler exactly.


    • #3
      Ah I see! Is there a way to configure so that when exporting to FBX it gets the AO in the vertex colors?


      • #4
        We use a UV layer because not all apps import vertex color from FBX. But you can access them in the same manner in most apps.

        In Max, all extra uv sets and colors come in as "maps", and a vertex color node in the material can use "blend_ao" as the source.

        In Maya, it depends on your renderer. But with vray, for instance, the VRayVertexColors shading node can be set to "blend_ao".

        You didn't mention if you are doing static mesh exports or game exports. With static mesh exports, you can use our various third-party scripts to import the model and set up the materials: Maya, Max, Houdini, etc. Game exports are a little trickier with the various texture packing options, but all the vertex data is still there.


        • #5
          I'm using "Export to game" where I've already set up a custom texture packing. So it should be possible to within that same .fx file to have it put the AO in a vertex color set?


          • #6
            Texture packing does what its name implies - it combines the textures however you want. It does not affect per-vertex data.

            There are two AO values, btw. One is the per-vertex one we compute. The other is the AO map in the material, to get smaller details. We multiply those together to get the final AO value used during rendering. Texture packing lets you do whatever you want with the AO texture. (this is why you can't use our import scripts with game exports, the texture maps may be anywhere)

            If you absolutely have to have AO in a vertex color to import into your engine, just open the tree in your preferred app, copy the data from the UV into a color, and save back out.


            • #7
              Alright, guess ill make a script to move that data then

              Thanks for the help Greg Croft !