question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Standard SpeedTree static export/import support

See original GitHub issue

Is your feature request related to a problem? Please describe.

Currently the support for SpeedTree are problematic in 3 ways:

  • Nature/* class shaders are special and require reading from a different set of texture ids, currently glTFast ignore all textures on such materials.

  • Large trees often need to be visible from a long distance, so have LODGroup on them, glTFast currently doesn’t recognize Unity’s LOD import convention. So on a round trip export/import, the LODGroup component is lost. (Obviously even a FBX round trip will lose the LODGroup settings, but Unity is able to set a sensible default LOD cascade on import.)

  • I also ran into an issue exporting TIFF (.tif) normal maps, glTFast doesn’t appear to recognize them as linear map, so the exported texture looks much bluer than the original, PNG normal map doesn’t suffer from this issue.

I don’t use SpeedTree assets in real-time due to their performance cost, and I generally convert them to static meshes for my Blender / Unity workflow. So having a semi-automated workflow via glTF would be great.

Describe the solution you’d like

  • Handle texture export for PBR maps for bulit-in Nature class of shaders, note that their Metallic/AO channel are packed differently from default Lit Shader (and isn’t ORM). In addition we need to check if texture ids are different among BIRP, URP and HDRP shaders.

  • Reconsider texture import strategy, currently the glTF spec’s ORM texture is not compatible with default Lit in Unity, this makes round trip more time consuming (potential solution includes 1. texture import post processor, 2. glb importer allowing texture channel repack).

  • LOD solution can be solved via #20 , should be mostly compatible with Unity’s LODGroup, barring the cross fade settings.

  • Reopen #67 as it appears only partially resolved.

Describe alternatives you’ve considered

Doing all of these manually.

Additional context

Unity has recently released free SpeedTree assets and scenes, in case you want to investigate this issue. It contains both TIFF normal map and usage of SpeedTree (Nature) shaders. I tested with the HDRP demo.

https://assetstore.unity.com/packages/3d/environments/unity-terrain-hdrp-demo-scene-213198 https://assetstore.unity.com/packages/3d/environments/unity-terrain-urp-demo-scene-213197

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hybridherbstcommented, Mar 21, 2022

In general I think the way to support “each and every weird custom thing” (trees, TMPro, Canvas, whatever you want to export/import) is to build custom callbacks, at least that’s the plan for UnityGltf. Some of those could of course be built in at some point (trees make sense) but others would be very workflow and project specific.

0reactions
bitinncommented, Mar 21, 2022

Just to limit the scope a bit: for now, I am happy if I can get the basic PBR maps out and in again. Main problem currently is texture channel packing differences and import material assignments.

Sent from my iPhone

On Mar 21, 2022, at 20:01, hybridherbst @.***> wrote:

Yes, if you want to fully recreate the tree you might need to emit additional userData or a simple extension (possible through callbacks) with everything that can’t properly be transferred via glTF itself.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

Read more comments on GitHub >

github_iconTop Results From Across the Web

User Interface > Exporting
Importing SpeedTree Materials into 3rd Party Software. The standard 'FBX' importer that ships with most third party software supports only a few of...
Read more >
Importing into Unreal Engine (Legacy)
SpeedTrees are supported in the Unreal Engine game engine. The .ST files exported by SpeedTree 9 can be imported with Unreal Engine 4.19.2...
Read more >
SpeedTree Cinema's Blender Add-On
The add-on correctly imports the SpeedTree model's PBR textures using the .stmat (SpeedTree material) file that exports alongside the static mesh (ex: .abc, ......
Read more >
Manual: SpeedTree Import Settings window
Unity recognizes and imports SpeedTree Model Assets in the same way that it handles other Assets. If you're using SpeedTree Modeler 7, make...
Read more >
SpeedTree
Unity recognizes and imports SpeedTree Assets in the same way that it handles other Assets. If you're using SpeedTree Modeler 7, make sure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found