载入中...
搜索中...
未找到
eve::graphics::GrassField类 参考

Dense grass + sparse dark tufts on a mesh. Caller owns GrassField*; GPU Mesh / Shader / Texture are owned by Graphics. 更多...

#include <Grass.h>

类 eve::graphics::GrassField 继承关系图:
eve::IPhotoModeFieldSink

类

struct  BakeParams
 BakeParams public API. 更多...
 

Public 成员函数

 GrassField (Graphics *gfx)
 
 ~GrassField ()
 
 GrassField (const GrassField &)=delete
 
GrassField & operator= (const GrassField &)=delete
 
void bake (const float *posXYZ, const float *nrmXYZ, int vertexCount, const uint32_t *indices, int indexCount, const BakeParams &params)
 
void bakePlane (float sizeX, float sizeZ, int segX, int segZ)
 
void bakePlane (float sizeX, float sizeZ, int segX, int segZ, const BakeParams &params)
 
Result< int > bakePoints (const std::vector< grass::Point > &points, float width, float height)
 Upload explicit grass roots without resampling, using the built-in four-frame atlas.
 
Result< int > bakeTexturedPoints (const std::vector< grass::Point > &points, float width, float height, const image::ImageData &image)
 Upload roots with one static RGBA8 image, preserving original RGB and alpha. Image storage is borrowed only during upload; the resulting texture belongs to Graphics. Same thread, atomic publication and point validation contract as bakePoints. Image dimensions must be positive with complete RGBA8 storage. No atlas slicing or generated animation is applied.
 
Result< int > bakeFoliagePoints (const std::vector< grass::Point > &points, float width, float height, const image::ImageData &albedo, const image::ImageData &normal, const image::ImageData &mask, const grass::GrassFoliageSettings &settings)
 Upload static foliage albedo, tangent normal and metallic/occlusion/thickness/smoothness masks. All images must be complete, equally sized RGBA8 data. Validation and GPU publication are atomic. Textures are copied during the call and then owned by Graphics. Called on the Graphics owner thread.
 
Result< int > setTerrainDetailOverwrite (const grass::TerrainDetailOverwriteSettings &settings)
 Apply Pcg terrain detail hard distance, shader fade and density to an uploaded foliage field.
 
float getTerrainDetailHardDistance () const noexcept
 Return the currently applied Unity-style hard detail distance.
 
float getTerrainDetailDensity () const noexcept
 Return the currently applied normalized detail density.
 
void setPhotoModeAuthority (bool enabled)
 Register or revoke this field as the unique Pcg photo-mode grass authority.
 
float getPhotoModeDensity () const noexcept
 Return the Pcg global density multiplier.
 
float getPhotoModeDistance () const noexcept
 Return the Pcg global distance multiplier.
 
float getPhotoModeCellDistance () const noexcept
 Return the effective camera-cell distance multiplier.
 
int getPhotoModeCellSubdivision () const noexcept
 Return the signed camera-cell subdivision level.
 
PhotoModeFieldAcceptance acceptsPhotoModeField (const PhotoModeAssignment &assignment) const noexcept override
 Return true only for fields owned by this provider.
 
Result< void > applyPhotoModeField (const PhotoModeAssignment &assignment) override
 Apply one accepted assignment atomically on the game thread.
 
void update (float dt)
 
void setTime (float seconds)
 
float getTime () const
 
void setFrameDuration (float seconds)
 
float getFrameDuration () const
 
void draw (const glm::mat4 &model)
 
void draw ()
 
void setReflectionCaptureEnabled (bool enabled)
 Enable or disable inclusion in reflection-probe captures.
 
bool getReflectionCaptureEnabled () const
 Return whether this field is included in reflection-probe captures.
 
void setReflectionCaptureMask (uint32_t mask)
 Set the reflection-capture visibility layer mask.
 
uint32_t getReflectionCaptureMask () const
 Return the reflection-capture visibility layer mask.
 
Mesh * getDenseMesh () const
 Borrow the dense mesh on the owner thread; valid until this field rebakes or is destroyed.
 
Mesh * getSparseMesh () const
 Borrow the sparse mesh on the owner thread; valid until this field rebakes or is destroyed.
 
Shader * getShader () const
 Borrow the shader on the owner thread; valid until this field is destroyed.
 
Texture * getAtlas () const
 Borrow the atlas on the owner thread; valid until this field uploads another atlas or is destroyed.
 
int getDenseCount () const
 
int getSparseCount () const
 
- Public 成员函数 继承自 eve::IPhotoModeFieldSink
virtual ~IPhotoModeFieldSink ()=default
 Releases IPhotoModeFieldSink resources.
 

额外继承的成员函数

- 静态 Public 属性 继承自 eve::IPhotoModeFieldSink
static constexpr const char * capabilityName ="eve.photo-mode.field"
 

详细描述

Dense grass + sparse dark tufts on a mesh. Caller owns GrassField*; GPU Mesh / Shader / Texture are owned by Graphics.

在文件 Grass.h 第 193 行定义.

构造及析构函数说明

◆ GrassField() [1/2]

eve::graphics::GrassField::GrassField ( Graphics *  gfx)
explicit

在文件 Grass.cpp 第 597 行定义.

引用了 eve::graphics::RenderSystem3D::addCaptureExtraDrawer(), draw(), mask , 以及 u.

◆ ~GrassField()

eve::graphics::GrassField::~GrassField ( )

◆ GrassField() [2/2]

eve::graphics::GrassField::GrassField ( const GrassField &  )
delete

成员函数说明

◆ acceptsPhotoModeField()

PhotoModeFieldAcceptance eve::graphics::GrassField::acceptsPhotoModeField ( const PhotoModeAssignment &  assignment) const
overridevirtualnoexcept

Return true only for fields owned by this provider.

实现了 eve::IPhotoModeFieldSink.

在文件 Grass.cpp 第 610 行定义.

引用了 a, eve::Accepted, eve::Grass , 以及 eve::Rejected.

◆ applyPhotoModeField()

Result< void > eve::graphics::GrassField::applyPhotoModeField ( const PhotoModeAssignment &  assignment)
overridevirtual

Apply one accepted assignment atomically on the game thread.

实现了 eve::IPhotoModeFieldSink.

在文件 Grass.cpp 第 611 行定义.

引用了 a, eve::Diagnostic::error(), f, eve::Result< T >::failure(), eve::InvalidArgument, m , 以及 eve::Result< T >::success().

◆ bake()

◆ bakeFoliagePoints()

Result< int > eve::graphics::GrassField::bakeFoliagePoints ( const std::vector< grass::Point > &  points,
float  width,
float  height,
const image::ImageData &  albedo,
const image::ImageData &  normal,
const image::ImageData &  mask,
const grass::GrassFoliageSettings &  settings 
)

Upload static foliage albedo, tangent normal and metallic/occlusion/thickness/smoothness masks. All images must be complete, equally sized RGBA8 data. Validation and GPU publication are atomic. Textures are copied during the call and then owned by Graphics. Called on the Graphics owner thread.

返回
Uploaded point count or InvalidArgument while preserving the prior published field.

在文件 GrassPoints.cpp 第 15 行定义.

引用了 albedo, height, mask, normal, points, settings , 以及 width.

◆ bakePlane() [1/2]

void eve::graphics::GrassField::bakePlane ( float  sizeX,
float  sizeZ,
int  segX,
int  segZ 
)

在文件 Grass.cpp 第 693 行定义.

引用了 bakePlane().

被这些函数引用 bakePlane().

◆ bakePlane() [2/2]

void eve::graphics::GrassField::bakePlane ( float  sizeX,
float  sizeZ,
int  segX,
int  segZ,
const BakeParams &  params 
)

在文件 Grass.cpp 第 697 行定义.

引用了 bake(), idx, eve::graphics::grass::makePlane(), params , 以及 pos.

◆ bakePoints()

Result< int > eve::graphics::GrassField::bakePoints ( const std::vector< grass::Point > &  points,
float  width,
float  height 
)

Upload explicit grass roots without resampling, using the built-in four-frame atlas.

参数
pointsBorrowed finite world roots and height scales greater than 0.001 and nonnegative independent width scales; IDs fit 24 bits.
widthPositive finite billboard width.
heightPositive finite billboard height.
返回
Uploaded count or InvalidArgument; validation failure preserves the previous field. GPU creation/allocation exceptions also preserve published field pointers. Graphics owns newly allocated meshes, shaders and textures until its teardown, including interrupted uploads. Called on the Graphics owner thread, outside draw/capture callbacks. Retains no input references. Replaces both previous layers with one dense layer; empty input clears their published meshes.

在文件 GrassPoints.cpp 第 8 行定义.

引用了 height, points , 以及 width.

◆ bakeTexturedPoints()

Result< int > eve::graphics::GrassField::bakeTexturedPoints ( const std::vector< grass::Point > &  points,
float  width,
float  height,
const image::ImageData &  image 
)

Upload roots with one static RGBA8 image, preserving original RGB and alpha. Image storage is borrowed only during upload; the resulting texture belongs to Graphics. Same thread, atomic publication and point validation contract as bakePoints. Image dimensions must be positive with complete RGBA8 storage. No atlas slicing or generated animation is applied.

返回
Uploaded count or InvalidArgument; invalid image leaves the previous field unchanged.

在文件 GrassPoints.cpp 第 11 行定义.

引用了 height, image, points , 以及 width.

◆ draw() [1/2]

void eve::graphics::GrassField::draw ( )

在文件 Grass.cpp 第 719 行定义.

引用了 draw().

被这些函数引用 draw() , 以及 GrassField().

◆ draw() [2/2]

◆ getAtlas()

Texture * eve::graphics::GrassField::getAtlas ( ) const
inline

Borrow the atlas on the owner thread; valid until this field uploads another atlas or is destroyed.

在文件 Grass.h 第 299 行定义.

◆ getDenseCount()

int eve::graphics::GrassField::getDenseCount ( ) const
inline

在文件 Grass.h 第 301 行定义.

◆ getDenseMesh()

Mesh * eve::graphics::GrassField::getDenseMesh ( ) const
inline

Borrow the dense mesh on the owner thread; valid until this field rebakes or is destroyed.

在文件 Grass.h 第 293 行定义.

◆ getFrameDuration()

float eve::graphics::GrassField::getFrameDuration ( ) const
inline

在文件 Grass.h 第 278 行定义.

◆ getPhotoModeCellDistance()

float eve::graphics::GrassField::getPhotoModeCellDistance ( ) const
inlinenoexcept

Return the effective camera-cell distance multiplier.

在文件 Grass.h 第 268 行定义.

◆ getPhotoModeCellSubdivision()

int eve::graphics::GrassField::getPhotoModeCellSubdivision ( ) const
inlinenoexcept

Return the signed camera-cell subdivision level.

在文件 Grass.h 第 269 行定义.

◆ getPhotoModeDensity()

float eve::graphics::GrassField::getPhotoModeDensity ( ) const
inlinenoexcept

Return the Pcg global density multiplier.

在文件 Grass.h 第 266 行定义.

◆ getPhotoModeDistance()

float eve::graphics::GrassField::getPhotoModeDistance ( ) const
inlinenoexcept

Return the Pcg global distance multiplier.

在文件 Grass.h 第 267 行定义.

◆ getReflectionCaptureEnabled()

bool eve::graphics::GrassField::getReflectionCaptureEnabled ( ) const
inline

Return whether this field is included in reflection-probe captures.

在文件 Grass.h 第 286 行定义.

◆ getReflectionCaptureMask()

uint32_t eve::graphics::GrassField::getReflectionCaptureMask ( ) const
inline

Return the reflection-capture visibility layer mask.

在文件 Grass.h 第 290 行定义.

◆ getShader()

Shader * eve::graphics::GrassField::getShader ( ) const
inline

Borrow the shader on the owner thread; valid until this field is destroyed.

在文件 Grass.h 第 297 行定义.

◆ getSparseCount()

int eve::graphics::GrassField::getSparseCount ( ) const
inline

在文件 Grass.h 第 302 行定义.

◆ getSparseMesh()

Mesh * eve::graphics::GrassField::getSparseMesh ( ) const
inline

Borrow the sparse mesh on the owner thread; valid until this field rebakes or is destroyed.

在文件 Grass.h 第 295 行定义.

◆ getTerrainDetailDensity()

float eve::graphics::GrassField::getTerrainDetailDensity ( ) const
inlinenoexcept

Return the currently applied normalized detail density.

在文件 Grass.h 第 263 行定义.

◆ getTerrainDetailHardDistance()

float eve::graphics::GrassField::getTerrainDetailHardDistance ( ) const
inlinenoexcept

Return the currently applied Unity-style hard detail distance.

在文件 Grass.h 第 261 行定义.

◆ getTime()

float eve::graphics::GrassField::getTime ( ) const
inline

在文件 Grass.h 第 276 行定义.

◆ operator=()

GrassField & eve::graphics::GrassField::operator= ( const GrassField &  )
delete

◆ setFrameDuration()

void eve::graphics::GrassField::setFrameDuration ( float  seconds)

在文件 Grass.cpp 第 714 行定义.

引用了 eve::graphics::grass::setFrameDuration().

◆ setPhotoModeAuthority()

void eve::graphics::GrassField::setPhotoModeAuthority ( bool  enabled)

Register or revoke this field as the unique Pcg photo-mode grass authority.

在文件 Grass.cpp 第 609 行定义.

引用了 enabled.

◆ setReflectionCaptureEnabled()

void eve::graphics::GrassField::setReflectionCaptureEnabled ( bool  enabled)
inline

Enable or disable inclusion in reflection-probe captures.

在文件 Grass.h 第 284 行定义.

引用了 enabled.

◆ setReflectionCaptureMask()

void eve::graphics::GrassField::setReflectionCaptureMask ( uint32_t  mask)
inline

Set the reflection-capture visibility layer mask.

在文件 Grass.h 第 288 行定义.

引用了 mask.

◆ setTerrainDetailOverwrite()

Result< int > eve::graphics::GrassField::setTerrainDetailOverwrite ( const grass::TerrainDetailOverwriteSettings &  settings)

Apply Pcg terrain detail hard distance, shader fade and density to an uploaded foliage field.

返回
Derived TerrainDetailQuality ordinal, or InvalidArgument without changing the live shader state. @ownership Settings are copied; no caller data or callback is retained. Owner-thread only.

在文件 GrassPoints.cpp 第 20 行定义.

引用了 eve::graphics::grass::applyTerrainDetailOverwrite(), eve::graphics::grass::GrassFoliageSettings::density, eve::Diagnostic::error(), eve::graphics::grass::GrassFoliageSettings::fadeRange, eve::Result< T >::failure(), eve::graphics::grass::GrassFoliageSettings::hardRenderDistance, eve::InvalidArgument, eve::graphics::Shader::pushConstantData(), eve::graphics::grass::GrassFoliageSettings::renderDistance , 以及 settings.

◆ setTime()

void eve::graphics::GrassField::setTime ( float  seconds)

在文件 Grass.cpp 第 709 行定义.

引用了 eve::graphics::grass::setTime().

◆ update()

void eve::graphics::GrassField::update ( float  dt)

在文件 Grass.cpp 第 704 行定义.

引用了 eve::graphics::grass::setTime().


该类的文档由以下文件生成: