SpeedTree
    Show / Hide Table of Contents

    CMyTerrainData

    The reference application contains an example helper class used to populate the terrain with data. It's not necessarily intended for production use, but it does provide some useful functionality. The CMyTerrainData object, contained in MyTerrainData.h/cpp/inl, reads height maps and normal maps, providing all of the data needed by SpeedTree's terrain engine. Note that you are free to use any method you like to populate the terrain and that CMyTerrainData is completely decoupled and independent from the Runtime SDK's terrain system.

    The CMyTerrainData class also provides functionality for returning slope values at any point on the terrain which is useful for avoiding placing trees on areas that are too steep, or for providing slope cues that help you know how much to push the tree into the ground.

    See CMyTerrain::Populate() for an example use of the CMyTerrainData class as well as a fully implemented callback used to populate the terrain in the reference application.

    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX.