Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::ecs::MeshLightmap Struct Reference

Where a MeshRenderer's BAKED light comes from: the atlas, and the rectangle of it this object occupies. More...

#include <MeshRenderer.hpp>

Public Member Functions

 MeshLightmap ()=default

Public Attributes

resource::TextureHandle lightmap
 The baked atlas. Invalid = this object has no bake, which is not the same as a black one: it keeps the light it gets in real time.
glm::vec4 scaleOffset {1.0f, 1.0f, 0.0f, 0.0f}
 Where in the atlas: xy scales the mesh's second UV, zw offsets it. (1,1,0,0) reads the whole texture, which is what a bake of a single object produces.

Detailed Description

Where a MeshRenderer's BAKED light comes from: the atlas, and the rectangle of it this object occupies.

Per ENTITY and not part of the mesh because of the rectangle: one mesh placed twice is lit twice, in two patches of one atlas. Needs a mesh carrying TexCoord1 — one without draws as before.

Definition at line 259 of file MeshRenderer.hpp.

Constructor & Destructor Documentation

◆ MeshLightmap()

esengine::ecs::MeshLightmap::MeshLightmap ( )
default

Member Data Documentation

◆ lightmap

resource::TextureHandle esengine::ecs::MeshLightmap::lightmap

The baked atlas. Invalid = this object has no bake, which is not the same as a black one: it keeps the light it gets in real time.

Definition at line 263 of file MeshRenderer.hpp.

Referenced by meshlightmapApplyJS(), and meshlightmapToJS().

◆ scaleOffset

glm::vec4 esengine::ecs::MeshLightmap::scaleOffset {1.0f, 1.0f, 0.0f, 0.0f}

Where in the atlas: xy scales the mesh's second UV, zw offsets it. (1,1,0,0) reads the whole texture, which is what a bake of a single object produces.

Definition at line 269 of file MeshRenderer.hpp.

Referenced by meshlightmapApplyJS(), and meshlightmapToJS().


The documentation for this struct was generated from the following file:
  • /home/runner/work/estella/estella/src/esengine/ecs/components/MeshRenderer.hpp