Class RenderSurface

Namespace
Elegy.Common.Assets.ElegyMapData
Assembly
Elegy.Common.dll

An ELF render surface is concrete render data that describes a little part of world geometry. It is not necessarily a single face or a few coplanar faces, but rather a mesh consisting of all faces belonging to one octree leaf, where the faces share the same material.

public class RenderSurface
Inheritance
RenderSurface
Inherited Members

Properties

BoundingBox

AABB of this render surface.

public Box3 BoundingBox { get; set; }

Property Value

Box3

Colours

Colour buffer.

public List<Vector4> Colours { get; set; }

Property Value

List<Vector4>

Indices

Index buffer.

public List<int> Indices { get; set; }

Property Value

List<int>

LightmapTexture

Lightmap texture name. It's up to the engine to autogenerate materials for these lightmaps.

public string LightmapTexture { get; set; }

Property Value

string

LightmapUvs

Secondary UV buffer for lightmaps.

public List<Vector2> LightmapUvs { get; set; }

Property Value

List<Vector2>

Material

The name of the material associated with this surface. Multimaterials could perhaps be autogenerated from a collection of surfaces with fundamentally similar materials.

public string Material { get; set; }

Property Value

string

Normals

Normals buffer. Tangents and bitangents are built from normals and UVs.

public List<Vector3> Normals { get; set; }

Property Value

List<Vector3>

Positions

Position buffer.

public List<Vector3> Positions { get; set; }

Property Value

List<Vector3>

Uvs

UV buffer.

public List<Vector2> Uvs { get; set; }

Property Value

List<Vector2>

VertexCount

Actual number of vertices.

public int VertexCount { get; set; }

Property Value

int

Methods

AddTriangle(int, int, int)

Adds vertex indices to form a new triangle.

public void AddTriangle(int a, int b, int c)

Parameters

a int
b int
c int

AddVertex(Vector3, Vector3, Vector2, Vector2, Vector4)

Adds a new vertex to the surface.

public void AddVertex(Vector3 position, Vector3 normal, Vector2 uv, Vector2 lightmapUv, Vector4 colour)

Parameters

position Vector3
normal Vector3
uv Vector2
lightmapUv Vector2
colour Vector4

ToMesh()

Converts this into an Elegy render mesh.

public Mesh ToMesh()

Returns

Mesh