- Adjusted Material/Texture/Lighting outline.

This commit is contained in:
2025-09-29 18:39:14 -04:00
parent 8925b3f2f0
commit 7b87828f06
3 changed files with 28 additions and 45 deletions

View File

@@ -35,11 +35,8 @@
#include <fennec/containers/list.h> #include <fennec/containers/list.h>
#include <fennec/containers/optional.h> #include <fennec/containers/optional.h>
#include <fennec/containers/traversal.h> #include <fennec/containers/traversal.h>
#include <fennec/math/exponential.h>
#include <fennec/memory/allocator.h> #include <fennec/memory/allocator.h>
// TODO: this should probably be refactored to use pointers over tables
namespace fennec namespace fennec
{ {

View File

@@ -241,15 +241,15 @@ public:
/// \param type The type of component /// \param type The type of component
/// \param id The id of the component instance /// \param id The id of the component instance
/// \return /// \return
static component* get(uint64_t type, size_t id) { static component* get(const component_t& c) {
auto& typei = _typelist[type]; auto& typei = _typelist[c.type];
return typei->get(id); return typei->get(c.id);
} }
template<typename ComponentT> template<typename ComponentT>
static component* get(size_t comp) { static component* get(size_t id) {
auto& typei = _typelist[uuid<ComponentT>()]; auto& typei = _typelist[uuid<ComponentT>()];
return typei->get(comp); return typei->get(id);
} }
static void destroy(size_t type, size_t comp) { static void destroy(size_t type, size_t comp) {

View File

@@ -57,7 +57,7 @@ struct Object
{ {
vec3 location, scale; // A matrix would be 64 bytes, this is instead 28 bytes vec3 location, scale; // A matrix would be 64 bytes, this is instead 28 bytes
quat rotation; quat rotation;
uint32 material, lighting; uint32 lighting;
} }
``` ```
@@ -68,42 +68,6 @@ Objects are identified with a manually provided type and ID. Object types includ
A user should never have to specify these and should be automatically generated by the respective components. A user should never have to specify these and should be automatically generated by the respective components.
Textures for 3D rendering are stored in various buffers with sizes of powers of 2. Ratios of `1:1`
`2:1`, and `4:1` are allowed. The `2:1` ratio is specifically for spherical and cylindrical projection. UVs
may be transformed to use a `2:1` as if it were `1:2`. Same applies for `4:1`
Cubemaps and 3D textures may only be `1:1`.
- 8-Bit R Texture `4096, 2048, 1024, 512` (8)
- 8-Bit RG Texture `4096, 2048, 1024, 512` (8)
- 8-Bit RGB Texture `4096, 2048, 1024, 512` (8)
- 8-Bit RGBA Texture `4096, 2048, 1024, 512` (8)
- 8-Bit R Cubemap `1024, 512, 256, 128` (4)
- 8-Bit RGB Cubemap `1024, 512, 256, 128` (4)
* 16-Bit HDR R Texture `4096, 2048, 1024, 512` (8)
* 16-Bit HDR RGB Texture `4096, 2048, 1024, 512` (8)
* 16-Bit HDR RGBA Texture `4096, 2048, 1024, 512` (8)
* 16-Bit HDR R Cubemap `1024, 512, 256, 128` (4)
* 16-Bit HDR RGB Cubemap `1024, 512, 256, 128` (4)
- 16-Bit Shadow Texture `4096, 2048, 1024, 512` (8)
- 16-Bit Shadow Cubemap `2048, 1024, 512, 256` (4)
* 8-Bit 3D R Texture `256, 128, 64, 32` (4)
* 8-Bit 3D RGB Texture `256, 128, 64, 32` (4)
* 16-Bit 3D HDR R Texture `256, 128, 64, 32` (4)
* 16-Bit 3D HDR RGB Texture `256, 128, 64, 32` (4)
Documentation should provide guidelines on categories of Art Assets and the resolution of textures to use.
Textures are identified by a 32-bit integer.
- `8 bits` &rarr; the texture buffer
- `24 bits` &rarr; the layer in the buffer
Artists should be informed on the texture structure of the engine and its limitations.
However, these principles should be followed in other game engines as these are
guided by what is most efficient for typical GPU hardware.
Materials are, for the most part, user-defined. Documentation should make the user aware of this. Materials are, for the most part, user-defined. Documentation should make the user aware of this.
Material buffers will be a sequence of the Material Struct instances. Material buffers will be a sequence of the Material Struct instances.
@@ -118,6 +82,28 @@ Types of materials:
- Post-Process - Post-Process
Each Material will have a buffer of Objects so that
each can be rendered in a single draw call.
## Lighting
When Dynamic Lighting is enabled, each light has two textures,
one for static lighting and one for dynamic lighting.
Shadows
- Directional Light &rarr; 16-bit Shadow Texture `4096`
- Spotlights &rarr; 16-bit Shadow Texture `2048`
- Point Lights &rarr; 16-bit Shadow Cubemap `1024`
- Area Lights &rarr; 16-bit Shadow Texture `2048`
Reflections
- Light Probe &rarr; 16-bit RGB Cubemap `512, 256`
## Stages ## Stages