Skip to content

How to create a procedural model or mesh in code? #1041

Answered by tebjan
tebjan asked this question in Q&A
Discussion options

You must be logged in to vote

The accepted answer is:

You can make your own procedural model by inheriting from PrimitiveProceduralModelBase. This has several advantages:

  • Write less code
  • Available in Game Studio with preview and gizmo in scene editor
  • Properties (including material) are editable in Game Studio
  • Auto-generate tangents and bi-tangents required for normal maps
  • Auto-generate bounding box and bounding sphere for correct shadow map bias
  • Auto-generate additional texture coordinate channels
  • Model space position offset
  • Better upload/render performance due to correct data types

The workflow to add the model in Game Studio is then:

  • Add any procedural model (Cube, Plane, etc.)
  • Change the dropdown to your custom…

Replies: 3 comments 3 replies

Comment options

tebjan
Apr 5, 2021
Maintainer Author

You must be logged in to vote
3 replies
@tagcode
Comment options

@manio143
Comment options

@tagcode
Comment options

Answer selected by tebjan
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants