Packs SurfaceField channels into Graphics-uploadable RGBA8 textures. 更多...
#include <LifeFieldMaterialBinding.h>
Public 成员函数 | |
| LifeFieldMaterialBinding ()=default | |
| Life field material binding. | |
| Result< void > | syncFrom (const SurfaceField &field) |
| Rebuild CPU pixel buffers from a surface field. | |
| const LifeFieldMaterialUniforms & | uniforms () const |
| Current material uniforms (valid after successful sync). | |
| const std::vector< std::uint8_t > & | lifeFieldPixels () const |
| RGBA8 life-field pixels (R=trail, G=nutrient, B=danger, A=freshness). | |
| const std::vector< std::uint8_t > & | surfaceDataPixels () const |
| RGBA8 surface-data pixels (R=height01, GBA=normal*0.5+0.5). | |
| Result< graphics::Texture * > | uploadLifeField (graphics::Graphics *gfx) |
| Upload or refresh Graphics textures from the packed buffers. | |
| Result< graphics::Texture * > | uploadSurfaceData (graphics::Graphics *gfx) |
| Upload surface-data texture. | |
| Result< void > | updateTexture (graphics::Graphics *gfx, graphics::Texture *texture, bool lifeField) const |
| Update an existing texture in place. | |
详细描述
Packs SurfaceField channels into Graphics-uploadable RGBA8 textures.
Materials sample LifeFieldTexture and SurfaceDataTexture with Origin / WorldSize / FieldResolution uniforms from uniforms().
在文件 LifeFieldMaterialBinding.h 第 37 行定义.
构造及析构函数说明
◆ LifeFieldMaterialBinding()
|
default |
Life field material binding.
成员函数说明
◆ lifeFieldPixels()
|
inline |
RGBA8 life-field pixels (R=trail, G=nutrient, B=danger, A=freshness).
在文件 LifeFieldMaterialBinding.h 第 49 行定义.
◆ surfaceDataPixels()
|
inline |
RGBA8 surface-data pixels (R=height01, GBA=normal*0.5+0.5).
在文件 LifeFieldMaterialBinding.h 第 52 行定义.
◆ syncFrom()
| Result< void > eve::gpuagents::LifeFieldMaterialBinding::syncFrom | ( | const SurfaceField & | field | ) |
Rebuild CPU pixel buffers from a surface field.
在文件 LifeFieldMaterialBinding.cpp 第 21 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), h, eve::InvalidArgument, n, eve::gpuagents::LifeFieldMaterialUniforms::origin, p, eve::gpuagents::LifeFieldMaterialUniforms::resolution, eve::Result< T >::success(), eve::gpuagents::LifeFieldMaterialUniforms::worldSize, x , 以及 z.
◆ uniforms()
|
inline |
Current material uniforms (valid after successful sync).
在文件 LifeFieldMaterialBinding.h 第 46 行定义.
◆ updateTexture()
| Result< void > eve::gpuagents::LifeFieldMaterialBinding::updateTexture | ( | graphics::Graphics * | gfx, |
| graphics::Texture * | texture, | ||
| bool | lifeField | ||
| ) | const |
Update an existing texture in place.
- 参数
-
gfx Borrowed Graphics. texture Borrowed existing texture owned by caller. lifeField When true updates life-field pixels; otherwise surface-data. @ownership Borrowed; does not take ownership of texture. @lifetime texture must outlive the call.
在文件 LifeFieldMaterialBinding.cpp 第 99 行定义.
引用了 eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::InvalidArgument, pixels, eve::PreconditionViolation, eve::gpuagents::LifeFieldMaterialUniforms::resolution, eve::Result< T >::success() , 以及 eve::graphics::Graphics::updateTexture().
◆ uploadLifeField()
| Result< graphics::Texture * > eve::gpuagents::LifeFieldMaterialBinding::uploadLifeField | ( | graphics::Graphics * | gfx | ) |
Upload or refresh Graphics textures from the packed buffers.
- 参数
-
gfx Borrowed Graphics device. @ownership Created textures are owned by the caller; previous pointers are not freed. @lifetime Returned textures remain valid until Graphics tears them down or caller deletes them. @nullable Yes when gfx is null or sync buffers are empty.
在文件 LifeFieldMaterialBinding.cpp 第 63 行定义.
引用了 eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::InvalidArgument, eve::graphics::Graphics::newTexture(), eve::PreconditionViolation, eve::gpuagents::LifeFieldMaterialUniforms::resolution , 以及 eve::Result< T >::success().
◆ uploadSurfaceData()
| Result< graphics::Texture * > eve::gpuagents::LifeFieldMaterialBinding::uploadSurfaceData | ( | graphics::Graphics * | gfx | ) |
Upload surface-data texture.
- 参数
-
gfx Borrowed Graphics device. @ownership Caller owns the returned texture. @lifetime Until Graphics teardown or caller delete. @nullable Yes when gfx is null or buffers empty.
在文件 LifeFieldMaterialBinding.cpp 第 81 行定义.
引用了 eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::InvalidArgument, eve::graphics::Graphics::newTexture(), eve::PreconditionViolation, eve::gpuagents::LifeFieldMaterialUniforms::resolution , 以及 eve::Result< T >::success().
该类的文档由以下文件生成:
- src/modules/gpuagents/LifeFieldMaterialBinding.h
- src/modules/gpuagents/LifeFieldMaterialBinding.cpp