Skip to content

nfCore Resources

Michał Witanowski edited this page Nov 19, 2015 · 3 revisions

Resources Manager

Holds map of resources. Each resource has it’s name and it’s lifetime is managed via reference counting. Resources are loaded asynchronously on multiple threads (using AsyncThreadPool).

Resource Types

Shader (aka. Multi shader)

Holds set of compiled shaders with different macro values (read from JSON file). Compiled shaders are cached if low-level renderer supports compilation to intermediate shader representation (for example Direct3D does).

Shader Program (aka. Multi shader program)

Hold set of linked shader programs with different macro values (read from JSON file).

Texture

2D or cube image. Read from DDS/BMP/JPG/PNG file.

Material

Set of attributes defining renderer’s material properties - colors, textures, shader, etc. Read from JSON file.

Mesh

Consists of vertex and index buffer and list of submeshes (index buffer ranges that have common file). A Mesh can also contain bones and their animations. Read from NFM/JSON file.

CollisionShape

Describes 3D shape used for collision detection. It can hold triangle mesh (for static bodies) or set of convex shapes (for dynamic bodies). Read from NFCS/JSON file. Collision Shape can be used as BodyComponent and Trigger shape.

ParticleMaterial (Not implemented)

Describles properties of emitted particles form a Particle Emitter.

SoundSample (Not implemented)

Finite, decoded audio sample. Read from WAV/OGG Vorbis/AAC files.

Script (Not implemented)

Lua/Python/etc. script.

SceneSegmentDescriptor (Not implemented)

Describes scene segment - part of a scene. Consist of list of all entities, components, etc. Read from JSON file.