Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Component:RawMesh

RawMesh allows building of an arbitrary mesh using arrays of data


Component image 
RawMesh component as seen in the Scene Inspector


The RawMesh component(Added 2026.9.1.1216 ) is a procedural mesh with various SyncArrays which represent the mesh's raw data. It can be used to create user made procedural meshes by defining the individual triangles that make up the mesh using ProtoFlux, or for direct 3D modeling in game.

Each array in the mesh represents the ordered parameters of each vertex in the mesh, using a given index on each array returns all the associated data for that particular vertex.

Data Fields

Points is an array of 3 dimensional points, each one is a vertex in the geometry of the mesh. If the Submesh Topology is Triangles, this array is grouped into threes, each group representing one triangle in the geometry. The order is important: the front and back of the triangle is determined by the order of the points, if the points are in clockwise order then the front of the triangle is facing you.

Normals is an array of 3 dimensional vectors representing the direction a particular point is facing. Like Points, they are grouped into threes. All the normals facing the same direction (see Triangle Normal for a node that can help calculate this) creates the flat shading effect on cubes and such. All the normals on the same vertex having the same normal creates the smooth shading effect as seen on spheres and such. If this array is shorter than the Points array, all extra points will have the same normal as the last item of this array.

UV0 through UV7 are arrays of 4 dimensional vectors representing the UV mapping of the vertices. Currently, Resonite cannot use any of these except UV0 in its materials, which is where these items are defined. If left blank, the mesh defaults to utilizing the origin of the texture. It is recommended that if the mesh will only be used with materials with no texture fields filled or the Projection360Material that these arrays be left empty. Each one of these arrays also has a dimension int field below it, which can be 2, 3, or 4. This is why the UV arrays are 4 dimensional.

Colors is an array of Colors which represent the associated vertex's color. Most materials have a checkbox for using vertex colors; this is the part of the RawMesh where that can be edited. ColorsProfile is the associated Color Profile of every color in the array.

Submeshes is a list of the submesh topology of every mesh. Each entry here gives a slot for a Material on a Mesh Renderer to render. It must at least contain one entry in order for the mesh to be visible.

Oddities

It is unclear how the RawMesh assigns each point to an entry in Submeshes.

RawMesh has an internal buffer of data. Exceeding this buffer causes extra vertices to not be rendered. This buffer can be expanded by changing the submesh topology and then changing it back, at which point the buffer size will equal the array size if it started smaller. This is why a fresh RawMesh doesn't display anything even when set up properly, simply change this field and change it back to view the RawMesh.

As the size of the RawMesh grows larger, the cost of editing the points arrays grows. Point counts under 50k should be fine. This produces a momentary hitch; RawMesh is no more expensive to render than a static mesh.