Packages shading method + surface parameters into one attachable asset. 更多...
#include <Material.h>
Public 成员函数 | |
| Material ()=default | |
| Material. | |
| ~Material ()=default | |
| Material. | |
| Material (const Material &)=delete | |
| Material & | operator= (const Material &)=delete |
| void | setShadingModel (const std::string &model) |
| "pbr" | "unlit" | "hair" | "custom" (unknown → pbr). | |
| std::string | getShadingModel () const |
| Returns the shading model. | |
| Result< void > | setPbrSurface (const PbrSurface &surface) |
| Atomically replace validated PBR bindings and enable the extended forward path. Texture pointers are borrowed from Graphics and must outlive this material/draws. Render-thread only; no callbacks. Failure preserves the previous material. | |
| PbrSurface | pbrSurface () const |
| Return an owning parameter snapshot; texture resources remain borrowed. | |
| bool | hasPbrSurface () const |
| Whether full PBR texture/extension rendering is requested. | |
| Result< void > | setFoliageTranslucency (float red, float green, float blue, float intensity, float strength, float normalDistortion, float scattering, float direct, float ambient, float shadow) |
| Enable validated two-sided foliage translucency while preserving imported PBR textures and factors. | |
| Result< void > | setClearcoat (float factor, float roughness) |
| Publish clearcoat layer factors on the current PBR surface snapshot. | |
| Result< void > | setFoliageWind (Texture *motionTexture, Texture *noiseTexture, float directionX, float directionZ, float strength, float bending, float bendingSpeed, float branch, float branchSpeed, float flutter, float flutterSpeed, float fadeDistance, float bendFactor) |
| Publish object-space foliage wind while preserving the current PBR material snapshot. | |
| Result< void > | setFoliageWindTime (float seconds) |
| Replace only the explicit foliage-motion time in the current material snapshot. | |
| void | setAlbedoTexture (Texture *texture) |
| Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data. | |
| Texture * | getAlbedoTexture () const |
| Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data. | |
| Result< void > | setAlbedoUvOffset (float u, float v) |
| Publish base-color UV offset and enable the extended PBR surface path. Sampling uses ‘uv’ = rotate(uv * scale) + offset`. Scroll a conveyor/tire strip by updating offset each frame; pair with Shape3D.setTangentVelocity for physics. | |
| float | getAlbedoUvOffsetU () const |
| Current base-color UV offset U. | |
| float | getAlbedoUvOffsetV () const |
| Current base-color UV offset V. | |
| Result< void > | setAlbedoUvScale (float u, float v) |
| Publish base-color UV scale (tiling) and enable the extended PBR surface path. | |
| float | getAlbedoUvScaleU () const |
| Current base-color UV scale U. | |
| float | getAlbedoUvScaleV () const |
| Current base-color UV scale V. | |
| Result< void > | setAlbedoUvRotation (float radians) |
| Publish base-color UV rotation (radians, around UV origin) and enable PBR. | |
| float | getAlbedoUvRotation () const |
| Current base-color UV rotation in radians. | |
| void | setNormalTexture (Texture *texture) |
| Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data. | |
| Texture * | getNormalTexture () const |
| Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data. | |
| void | setHeightTexture (Texture *texture) |
| Sets the height texture. | |
| Texture * | getHeightTexture () const |
| Returns the height texture. | |
| eve::Result< void > | enableVirtualTexture (const VirtualTextureStreamingConfig &config) |
| Author a layered virtual texture; residency is driven automatically on bind. | |
| eve::Result< std::uint32_t > | addVirtualTextureLayer (const VirtualTextureBlendLayer &layer) |
| Append one immutable source layer to the material-owned virtual texture. | |
| eve::Result< void > | setVirtualTexture (Texture *albedoAtlas, Texture *normalAtlas, Texture *pageTable, int pageCountX, int pageCountY, int atlasSlotsX, int atlasSlotsY, float borderFraction) |
| Opt this material into physical-atlas virtual-texture sampling. @ownership Internal Graphics upload path; game code should prefer enableVirtualTexture(). | |
| void | clearVirtualTexture () |
| Restore conventional albedo/normal/height interpretation and drop any owned streaming session. | |
| MaterialVirtualTextureMode | virtualTextureMode () const |
| Return the active virtual-texture sampling mode. | |
| void | setShader (Shader *shader) |
| Set an optional Mesh3D / hair shader; nullptr selects the built-in shading path. | |
| Shader * | getShader () const |
| Return the borrowed shader, or nullptr when the built-in path is active. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader. | |
| void | setTint (float r, float g, float b, float a=1.f) |
| Sets the tint. | |
| float | getTintR () const |
| Returns the tint r. | |
| float | getTintG () const |
| Returns the tint g. | |
| float | getTintB () const |
| Returns the tint b. | |
| float | getTintA () const |
| Returns the tint a. | |
| void | setMetallic (float metallic) |
| Sets the metallic. | |
| float | getMetallic () const |
| Returns the metallic. | |
| void | setRoughness (float roughness) |
| Sets the roughness. | |
| float | getRoughness () const |
| Returns the roughness. | |
| void | setTexCellBomb (float cellScale, float strength, float rotAmount=1.f) |
| Sets the tex cell bomb. | |
| float | getTexCellBombScale () const |
| Returns the tex cell bomb scale. | |
| float | getTexCellBombStrength () const |
| Returns the tex cell bomb strength. | |
| float | getTexCellBombRotation () const |
| Returns the tex cell bomb rotation. | |
| void | setParallax (float scale, float minLayers=8.f, float maxLayers=32.f) |
| Sets the parallax. | |
| float | getParallaxScale () const |
| Returns the parallax scale. | |
| float | getParallaxMinLayers () const |
| Returns the parallax min layers. | |
| float | getParallaxMaxLayers () const |
| Returns the parallax max layers. | |
| void | setReceiveLight (bool receive) |
| Sets the receive light. | |
| bool | getReceiveLight () const |
| Returns the receive light. | |
| void | setCastShadow (bool cast) |
| Sets the cast shadow. | |
| bool | getCastShadow () const |
| Returns the cast shadow. | |
| void | setReceiveShadow (bool receive) |
| Sets the receive shadow. | |
| bool | getReceiveShadow () const |
| Returns the receive shadow. | |
| void | setCastOcclusion (bool cast) |
| Sets the cast occlusion. | |
| bool | getCastOcclusion () const |
| Returns the cast occlusion. | |
| void | setHair (bool hair) |
| Sets the hair. | |
| bool | getHair () const |
| Returns the hair. | |
| bool | hasParam (const std::string &name) const |
| Optional named float knobs (style / custom shader params). | |
| void | setFloat (const std::string &name, float value) |
| Sets the float. | |
| float | getFloat (const std::string &name) const |
| Returns the float. | |
| Result< void > | bind (Graphics &gfx) const |
| Push this material onto Graphics mesh3d state for the next draw. Does not issue the draw itself. Layer-authored virtual textures tick once per mesh3d draw epoch during this call. | |
| Shader * | effectiveShader () const |
| Return the borrowed effective shader, or nullptr for the default PBR pipeline. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader. | |
| bool | isTransparentHair () const |
| True when this material should go through the hair transparent pass. | |
| void | setSurfaceMode (const std::string &mode) |
| Set "opaque", "masked", or "transparent" surface classification. | |
| std::string | getSurfaceMode () const |
| Returns the surface mode. | |
| SurfaceMode | surfaceMode () const |
| Surface mode. | |
| void | setAlphaCutoff (float cutoff) |
| Sets the alpha cutoff. | |
| float | getAlphaCutoff () const |
| Returns the alpha cutoff. | |
| void | setBlendMode (const std::string &mode) |
| Set "alpha", "premultiplied", "additive", or "multiply". | |
| std::string | getBlendMode () const |
| Returns the blend mode. | |
| BlendMode | blendMode () const |
| Blend mode. | |
| void | setDepthWrite (bool enabled) |
| Sets the depth write. | |
| bool | getDepthWrite () const |
| Returns the depth write. | |
| void | setDoubleSided (bool enabled) |
| Sets the double sided. | |
| bool | getDoubleSided () const |
| Returns the double sided. | |
| void | setCameraFacing (bool enabled) |
| Keep a bottom-anchored card facing the active camera around world Y during GPU-driven draws. | |
| bool | getCameraFacing () const |
| Return whether GPU-driven card vertices use cylindrical camera-facing orientation. | |
| void | setSortPriority (int priority) |
| Sets the sort priority. | |
| int | getSortPriority () const |
| Returns the sort priority. | |
| void | setAlphaTechnique (const std::string &technique) |
| Optional masked transparency quality: "cutoff", "dither", "coverage". | |
| std::string | getAlphaTechnique () const |
| Returns the alpha technique. | |
静态 Public 属性 | |
| static constexpr int | kMaxPartsHint = 8 |
详细描述
Packages shading method + surface parameters into one attachable asset.
Shading models (string, engine convention — no enums): "pbr" — default Mesh3D metallic-roughness (optional custom Shader*) "unlit" — forces receiveLight=false "hair" — alpha-blended hair/fur cards (isHair=true) "custom" — requires an explicit Mesh3D Shader*
Attach via Renderable3D::setMaterial / setPart. When a Material* is set, RenderSystem3D prefers it over the scattered MeshRenderer fields.
在文件 Material.h 第 38 行定义.
构造及析构函数说明
◆ Material() [1/2]
|
default |
◆ ~Material()
|
default |
◆ Material() [2/2]
|
delete |
成员函数说明
◆ addVirtualTextureLayer()
| eve::Result< std::uint32_t > eve::graphics::Material::addVirtualTextureLayer | ( | const VirtualTextureBlendLayer & | layer | ) |
Append one immutable source layer to the material-owned virtual texture.
- 返回
- Stable zero-based layer index, or a structured validation failure.
在文件 Material.cpp 第 41 行定义.
引用了 eve::Result< T >::failure() , 以及 layer.
◆ bind()
Push this material onto Graphics mesh3d state for the next draw. Does not issue the draw itself. Layer-authored virtual textures tick once per mesh3d draw epoch during this call.
- 参数
-
gfx Active Graphics backend that owns GPU textures and receives mesh3d state. @ownership Caller retains Graphics; this material only borrows it for the call. @lifetime gfx must outlive this call; virtual-texture GPU atlases remain owned by gfx. @thread Render-thread affine; may upload atlas/page-table regions when streaming ticks.
在文件 Material.cpp 第 328 行定义.
引用了 eve::Alpha, eve::graphics::Lighting3DPack::count, eve::graphics::Shader::hasUniform(), eve::Premultiplied, eve::graphics::Shader::sendFloat(), eve::graphics::Graphics::setMesh3DClusteredActive(), eve::graphics::Graphics::setMesh3DHeightTexture(), eve::graphics::Graphics::setMesh3DLighting(), eve::graphics::Graphics::setMesh3DMaterial(), eve::graphics::Graphics::setMesh3DNormalTexture(), eve::graphics::Graphics::setMesh3DPackedNormalMask(), eve::graphics::Graphics::setMesh3DParallax(), eve::graphics::Graphics::setMesh3DPbrSurface(), eve::graphics::Graphics::setMesh3DShadowReceive(), eve::graphics::Graphics::setMesh3DSurface(), eve::graphics::Graphics::setMesh3DTexCellBomb(), eve::graphics::Graphics::setMesh3DVirtualTexture(), snapshot, eve::Result< T >::success() , 以及 eve::graphics::PbrSurface::textures.
◆ blendMode()
|
inline |
Blend mode.
在文件 Material.h 第 336 行定义.
◆ clearVirtualTexture()
| void eve::graphics::Material::clearVirtualTexture | ( | ) |
Restore conventional albedo/normal/height interpretation and drop any owned streaming session.
在文件 Material.cpp 第 71 行定义.
◆ effectiveShader()
| Shader * eve::graphics::Material::effectiveShader | ( | ) | const |
Return the borrowed effective shader, or nullptr for the default PBR pipeline. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader.
在文件 Material.cpp 第 214 行定义.
◆ enableVirtualTexture()
| eve::Result< void > eve::graphics::Material::enableVirtualTexture | ( | const VirtualTextureStreamingConfig & | config | ) |
Author a layered virtual texture; residency is driven automatically on bind.
- 参数
-
config Producer + streaming budgets owned by this material.
- 返回
- Success after replacing any previous virtual-texture session, or a validation failure. @thread Render/authoring thread; no callbacks.
在文件 Material.cpp 第 23 行定义.
引用了 eve::graphics::VirtualTextureStreaming::create(), created, eve::Result< T >::failure(), eve::Result< T >::success() , 以及 eve::graphics::PbrSurface::textures.
◆ getAlbedoTexture()
|
inline |
Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
在文件 Material.h 第 128 行定义.
◆ getAlbedoUvOffsetU()
|
inline |
Current base-color UV offset U.
在文件 Material.h 第 141 行定义.
◆ getAlbedoUvOffsetV()
|
inline |
Current base-color UV offset V.
在文件 Material.h 第 143 行定义.
◆ getAlbedoUvRotation()
|
inline |
Current base-color UV rotation in radians.
在文件 Material.h 第 166 行定义.
◆ getAlbedoUvScaleU()
|
inline |
Current base-color UV scale U.
在文件 Material.h 第 154 行定义.
◆ getAlbedoUvScaleV()
|
inline |
Current base-color UV scale V.
在文件 Material.h 第 156 行定义.
◆ getAlphaCutoff()
|
inline |
Returns the alpha cutoff.
在文件 Material.h 第 330 行定义.
◆ getAlphaTechnique()
|
inline |
Returns the alpha technique.
在文件 Material.h 第 356 行定义.
◆ getBlendMode()
| std::string eve::graphics::Material::getBlendMode | ( | ) | const |
Returns the blend mode.
在文件 Material.cpp 第 194 行定义.
引用了 eve::Additive, eve::Multiply , 以及 eve::Premultiplied.
◆ getCameraFacing()
|
inline |
Return whether GPU-driven card vertices use cylindrical camera-facing orientation.
在文件 Material.h 第 348 行定义.
◆ getCastOcclusion()
|
inline |
Returns the cast occlusion.
在文件 Material.h 第 289 行定义.
◆ getCastShadow()
|
inline |
◆ getDepthWrite()
|
inline |
Returns the depth write.
在文件 Material.h 第 340 行定义.
◆ getDoubleSided()
|
inline |
Returns the double sided.
在文件 Material.h 第 344 行定义.
◆ getFloat()
| float eve::graphics::Material::getFloat | ( | const std::string & | name | ) | const |
◆ getHair()
|
inline |
Returns the hair.
在文件 Material.h 第 294 行定义.
◆ getHeightTexture()
|
inline |
Returns the height texture.
在文件 Material.h 第 182 行定义.
◆ getMetallic()
|
inline |
Returns the metallic.
在文件 Material.h 第 246 行定义.
◆ getNormalTexture()
|
inline |
Get the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
在文件 Material.h 第 177 行定义.
◆ getParallaxMaxLayers()
|
inline |
Returns the parallax max layers.
在文件 Material.h 第 269 行定义.
◆ getParallaxMinLayers()
|
inline |
Returns the parallax min layers.
在文件 Material.h 第 267 行定义.
◆ getParallaxScale()
|
inline |
Returns the parallax scale.
在文件 Material.h 第 265 行定义.
◆ getReceiveLight()
|
inline |
Returns the receive light.
在文件 Material.h 第 274 行定义.
◆ getReceiveShadow()
|
inline |
Returns the receive shadow.
在文件 Material.h 第 284 行定义.
◆ getRoughness()
|
inline |
Returns the roughness.
在文件 Material.h 第 251 行定义.
◆ getShader()
|
inline |
Return the borrowed shader, or nullptr when the built-in path is active. @lifetime The pointer remains valid only while its creating Graphics instance owns the shader.
在文件 Material.h 第 230 行定义.
◆ getShadingModel()
|
inline |
Returns the shading model.
在文件 Material.h 第 53 行定义.
◆ getSortPriority()
|
inline |
Returns the sort priority.
在文件 Material.h 第 352 行定义.
◆ getSurfaceMode()
| std::string eve::graphics::Material::getSurfaceMode | ( | ) | const |
Returns the surface mode.
在文件 Material.cpp 第 175 行定义.
◆ getTexCellBombRotation()
|
inline |
Returns the tex cell bomb rotation.
在文件 Material.h 第 260 行定义.
◆ getTexCellBombScale()
|
inline |
Returns the tex cell bomb scale.
在文件 Material.h 第 256 行定义.
◆ getTexCellBombStrength()
|
inline |
Returns the tex cell bomb strength.
在文件 Material.h 第 258 行定义.
◆ getTintA()
|
inline |
◆ getTintB()
|
inline |
◆ getTintG()
|
inline |
◆ getTintR()
|
inline |
◆ hasParam()
| bool eve::graphics::Material::hasParam | ( | const std::string & | name | ) | const |
◆ hasPbrSurface()
|
inline |
Whether full PBR texture/extension rendering is requested.
在文件 Material.h 第 67 行定义.
◆ isTransparentHair()
| bool eve::graphics::Material::isTransparentHair | ( | ) | const |
True when this material should go through the hair transparent pass.
在文件 Material.cpp 第 219 行定义.
◆ operator=()
◆ pbrSurface()
|
inline |
Return an owning parameter snapshot; texture resources remain borrowed.
在文件 Material.h 第 61 行定义.
引用了 s , 以及 eve::graphics::PbrSurface::unlit.
◆ setAlbedoTexture()
|
inline |
Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
在文件 Material.h 第 123 行定义.
引用了 texture.
被这些函数引用 eve::weather::Weather::init().
◆ setAlbedoUvOffset()
| Result< void > eve::graphics::Material::setAlbedoUvOffset | ( | float | u, |
| float | v | ||
| ) |
Publish base-color UV offset and enable the extended PBR surface path. Sampling uses ‘uv’ = rotate(uv * scale) + offset`. Scroll a conveyor/tire strip by updating offset each frame; pair with Shape3D.setTangentVelocity for physics.
- 参数
-
u Horizontal offset in UV units (REPEAT wrap). v Vertical offset in UV units.
- 返回
- Success, or InvalidArgument when a component is non-finite (material unchanged). @thread Render-thread affine; no callbacks.
在文件 Material.cpp 第 257 行定义.
引用了 eve::graphics::BaseColor, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, setPbrSurface(), eve::graphics::PbrSurface::textures, u , 以及 v.
◆ setAlbedoUvRotation()
| Result< void > eve::graphics::Material::setAlbedoUvRotation | ( | float | radians | ) |
Publish base-color UV rotation (radians, around UV origin) and enable PBR.
- 参数
-
radians Finite rotation applied after scale and before offset.
- 返回
- Success, or InvalidArgument without mutation. @thread Render-thread affine; no callbacks.
在文件 Material.cpp 第 276 行定义.
引用了 eve::graphics::BaseColor, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, setPbrSurface() , 以及 eve::graphics::PbrSurface::textures.
◆ setAlbedoUvScale()
| Result< void > eve::graphics::Material::setAlbedoUvScale | ( | float | u, |
| float | v | ||
| ) |
Publish base-color UV scale (tiling) and enable the extended PBR surface path.
- 参数
-
u Horizontal repeats across mesh UV 0..1; must be finite and non-zero. v Vertical repeats across mesh UV 0..1; must be finite and non-zero.
- 返回
- Success, or InvalidArgument without mutation. @thread Render-thread affine; no callbacks.
在文件 Material.cpp 第 266 行定义.
引用了 eve::graphics::BaseColor, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, setPbrSurface(), eve::graphics::PbrSurface::textures, u , 以及 v.
◆ setAlphaCutoff()
| void eve::graphics::Material::setAlphaCutoff | ( | float | cutoff | ) |
Sets the alpha cutoff.
在文件 Material.cpp 第 181 行定义.
◆ setAlphaTechnique()
| void eve::graphics::Material::setAlphaTechnique | ( | const std::string & | technique | ) |
Optional masked transparency quality: "cutoff", "dither", "coverage".
在文件 Material.cpp 第 201 行定义.
◆ setBlendMode()
| void eve::graphics::Material::setBlendMode | ( | const std::string & | mode | ) |
Set "alpha", "premultiplied", "additive", or "multiply".
在文件 Material.cpp 第 183 行定义.
引用了 eve::Additive, eve::Alpha, eve::Multiply , 以及 eve::Premultiplied.
◆ setCameraFacing()
|
inline |
Keep a bottom-anchored card facing the active camera around world Y during GPU-driven draws.
在文件 Material.h 第 346 行定义.
引用了 enabled.
◆ setCastOcclusion()
|
inline |
◆ setCastShadow()
|
inline |
Sets the cast shadow.
在文件 Material.h 第 277 行定义.
被这些函数引用 eve::graphics::hair::applyCardDefaults() , 以及 eve::weather::Weather::init().
◆ setClearcoat()
| Result< void > eve::graphics::Material::setClearcoat | ( | float | factor, |
| float | roughness | ||
| ) |
Publish clearcoat layer factors on the current PBR surface snapshot.
- 参数
-
factor Clearcoat weight in [0,1]. roughness Clearcoat roughness in [0,1].
- 返回
- Success after atomic publication, or validation failure with the material unchanged. @thread Render-thread affine; no callbacks.
在文件 Material.cpp 第 250 行定义.
引用了 eve::graphics::PbrSurface::clearcoatFactor, roughness , 以及 setPbrSurface().
◆ setDepthWrite()
|
inline |
◆ setDoubleSided()
|
inline |
◆ setFloat()
| void eve::graphics::Material::setFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
◆ setFoliageTranslucency()
| Result< void > eve::graphics::Material::setFoliageTranslucency | ( | float | red, |
| float | green, | ||
| float | blue, | ||
| float | intensity, | ||
| float | strength, | ||
| float | normalDistortion, | ||
| float | scattering, | ||
| float | direct, | ||
| float | ambient, | ||
| float | shadow | ||
| ) |
Enable validated two-sided foliage translucency while preserving imported PBR textures and factors.
- 参数
-
red Linear transmitted-light red multiplier. green Linear transmitted-light green multiplier. blue Linear transmitted-light blue multiplier. intensity Normalized translucency contribution in [0,1]. strength Nonnegative transmitted-light strength in [0,50].
- 参数
-
normalDistortion Normalized light-direction distortion in [0,1]. scattering Back-light lobe exponent in [1,50]. direct Normalized direct-light contribution in [0,1]. ambient Normalized ambient-light contribution in [0,1]. shadow Normalized shadow transmission in [0,1].
- 返回
- Success after atomic publication, or validation failure with the material unchanged.
在文件 Material.cpp 第 231 行定义.
引用了 ambient, eve::graphics::PbrTranslucency::color, eve::graphics::Flip, scattering, setPbrSurface(), strength, eve::Result< T >::success() , 以及 eve::graphics::PbrSurface::translucency.
◆ setFoliageWind()
| Result< void > eve::graphics::Material::setFoliageWind | ( | Texture * | motionTexture, |
| Texture * | noiseTexture, | ||
| float | directionX, | ||
| float | directionZ, | ||
| float | strength, | ||
| float | bending, | ||
| float | bendingSpeed, | ||
| float | branch, | ||
| float | branchSpeed, | ||
| float | flutter, | ||
| float | flutterSpeed, | ||
| float | fadeDistance, | ||
| float | bendFactor | ||
| ) |
Publish object-space foliage wind while preserving the current PBR material snapshot.
- 参数
-
motionTexture Borrowed nine-layer motion field owned by Graphics. noiseTexture Borrowed repeat-addressed noise owned by Graphics.
- 返回
- InvalidArgument without mutation, or a validated material snapshot. @ownership Texture pointers are borrowed and must outlive this material. @thread Render thread only; synchronous and callback-free.
在文件 Material.cpp 第 285 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::graphics::GpuFields, eve::InvalidArgument, eve::graphics::Object, setPbrSurface(), strength, eve::graphics::PbrVegetationMotion::texture , 以及 eve::graphics::PbrSurface::vegetationMotion.
◆ setFoliageWindTime()
| Result< void > eve::graphics::Material::setFoliageWindTime | ( | float | seconds | ) |
Replace only the explicit foliage-motion time in the current material snapshot.
- 返回
- InvalidArgument without mutation, including when object wind is not configured. @thread Render thread only; synchronous and callback-free.
在文件 Material.cpp 第 317 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::graphics::PbrVegetationMotion::mode, eve::graphics::Object, setPbrSurface(), eve::graphics::PbrVegetationMotion::time , 以及 eve::graphics::PbrSurface::vegetationMotion.
◆ setHair()
| void eve::graphics::Material::setHair | ( | bool | hair | ) |
◆ setHeightTexture()
|
inline |
◆ setMetallic()
| void eve::graphics::Material::setMetallic | ( | float | metallic | ) |
◆ setNormalTexture()
|
inline |
Set the borrowed material texture. @ownership Graphics factory owns the resource. @lifetime Keep alive through the material and every submitted draw; invalid after factory release. @thread Render-thread affine; no callbacks or retained temporary data.
在文件 Material.h 第 172 行定义.
引用了 texture.
◆ setParallax()
◆ setPbrSurface()
| Result< void > eve::graphics::Material::setPbrSurface | ( | const PbrSurface & | surface | ) |
Atomically replace validated PBR bindings and enable the extended forward path. Texture pointers are borrowed from Graphics and must outlive this material/draws. Render-thread only; no callbacks. Failure preserves the previous material.
在文件 Material.cpp 第 221 行定义.
引用了 setShadingModel(), eve::Result< T >::success(), eve::graphics::PbrSurface::unlit, valid , 以及 eve::graphics::validatePbrSurface().
被这些函数引用 setAlbedoUvOffset(), setAlbedoUvRotation(), setAlbedoUvScale(), setClearcoat(), setFoliageTranslucency(), setFoliageWind() , 以及 setFoliageWindTime().
◆ setReceiveLight()
|
inline |
◆ setReceiveShadow()
|
inline |
◆ setRoughness()
| void eve::graphics::Material::setRoughness | ( | float | roughness | ) |
◆ setShader()
|
inline |
Set an optional Mesh3D / hair shader; nullptr selects the built-in shading path.
- 参数
-
shader Borrowed shader owned by the creating Graphics instance; it must outlive this material.
在文件 Material.h 第 227 行定义.
引用了 shader.
被这些函数引用 eve::weather::Weather::init().
◆ setShadingModel()
| void eve::graphics::Material::setShadingModel | ( | const std::string & | model | ) |
"pbr" | "unlit" | "hair" | "custom" (unknown → pbr).
在文件 Material.cpp 第 106 行定义.
引用了 eve::Alpha, model , 以及 eve::graphics::Transparent.
被这些函数引用 eve::graphics::hair::applyCardDefaults(), eve::weather::Weather::init() , 以及 setPbrSurface().
◆ setSortPriority()
|
inline |
◆ setSurfaceMode()
| void eve::graphics::Material::setSurfaceMode | ( | const std::string & | mode | ) |
Set "opaque", "masked", or "transparent" surface classification.
在文件 Material.cpp 第 166 行定义.
引用了 eve::graphics::Masked, eve::graphics::Opaque , 以及 eve::graphics::Transparent.
◆ setTexCellBomb()
| void eve::graphics::Material::setTexCellBomb | ( | float | cellScale, |
| float | strength, | ||
| float | rotAmount = 1.f |
||
| ) |
◆ setTint()
| void eve::graphics::Material::setTint | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
◆ setVirtualTexture()
| eve::Result< void > eve::graphics::Material::setVirtualTexture | ( | Texture * | albedoAtlas, |
| Texture * | normalAtlas, | ||
| Texture * | pageTable, | ||
| int | pageCountX, | ||
| int | pageCountY, | ||
| int | atlasSlotsX, | ||
| int | atlasSlotsY, | ||
| float | borderFraction | ||
| ) |
Opt this material into physical-atlas virtual-texture sampling. @ownership Internal Graphics upload path; game code should prefer enableVirtualTexture().
- 参数
-
albedoAtlas Physical albedo pages; borrowed from Graphics. normalAtlas Physical tangent-space normal pages; borrowed from Graphics. pageTable RGBA8 virtual-to-physical page table; borrowed from Graphics. pageCountX Number of mip-zero virtual pages horizontally. pageCountY Number of mip-zero virtual pages vertically. atlasSlotsX Number of physical slots horizontally. atlasSlotsY Number of physical slots vertically. borderFraction Border texels divided by stored physical-page extent.
- 返回
- Success, or a validation error without changing this material.
在文件 Material.cpp 第 48 行定义.
引用了 eve::Result< T >::failure(), eve::Result< T >::success() , 以及 eve::graphics::PbrSurface::textures.
◆ surfaceMode()
|
inline |
Surface mode.
在文件 Material.h 第 326 行定义.
◆ virtualTextureMode()
|
inline |
Return the active virtual-texture sampling mode.
在文件 Material.h 第 218 行定义.
类成员变量说明
◆ kMaxPartsHint
|
staticconstexpr |
在文件 Material.h 第 40 行定义.
该类的文档由以下文件生成:
- src/modules/graphics/Material.h
- src/modules/graphics/Material.cpp