New FileMesh, MaterialComponent and MeshRenderer components

In the new WaveEngine 2.4.0, the model load process has been improved, so there are some important changes that you should know when working with models.

The following components are deprecated. You will able to use them in WaveEngine 2.4.0 by retro-compatibility but they will be removed in a future release.

  • Model
  • ModelRenderer
  • MaterialsMap

These have been replaced by the following components:

  • FileMesh: This component replaces the Model component and allows loading of a single mesh inside a model.
  • MeshRenderer: This component replaces ModelRenderer drawable3D.
  • MaterialComponent: This component replaces MaterialsMap component. It is marked as “AllowMultipleInstances” so you can add multiple MaterialComponent instances to an entity.

You can find new 3D primitive components that allow you to have a better control of primitive geometry:

  • CapsuleMesh
  • ConeMesh
  • CubeMesh
  • CylinderMesh
  • PlaneMesh
  • PyramidMesh
  • SphereMesh
  • TeapotMesh
  • TorusMesh

There is also a new CustomMesh component that you can use to create your own custom mesh, either generating it from code or importing it from a file in a custom format.

Important: All primitive components and FileMesh extend from MeshComponent base class.

It is very useful if you want to remove a mesh component but you don’t know whether it is a primitive or from a file.

  
// public Entity RemoveComponent(Type componentType, bool isExactType = true)
MyEntity.RemoveComponent(typeof(MeshComponent), false);

Finally, an important new feature to bear in mind is that when you import or drag a model file into WaveEditor (FBX, 3DS, OBJ), the materials and texture references become automatically included in the file.

So if you want to load a model with textures, the following steps must be taken:

  1.  Import all model textures into WaveEditor Assets folder (you can put them in any folder)
  2. Import the model file (FBX, 3DS, OBJ) into WaveEditor Asset folder and it will create a Materials folder with all materials of your model. The textures are referenced automatically by these materials.
  3. Drag a model asset from Asset folder to WaveEditor viewport and it will create a series of hierarchy entities with the differents mesh parts.

In addition, a new feature is that you can load hierarchy meshes from model files.

Published by

Jorge Canton

He is an engineer in computer science, #WaveEngine team member is a technology enthusiast determined to stay on the cutting edge of development. He is a very dynamic person who loves solving challenges, puzzles and riddles. He usually spends his free time with his family or playing videogames on his console or mobile phone and plays the piano to relax.

Leave a Reply

Your email address will not be published. Required fields are marked *