Packages shading method + surface parameters into one attachable asset. 更多...
#include <Material.h>
Public 成员函数 | |
| Material ()=default | |
| ~Material ()=default | |
| 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 |
| void | setAlbedoTexture (Texture *texture) |
| Texture * | getAlbedoTexture () const |
| void | setNormalTexture (Texture *texture) |
| Texture * | getNormalTexture () const |
| void | setHeightTexture (Texture *texture) |
| Texture * | getHeightTexture () const |
| void | setShader (Shader *shader) |
| Optional Mesh3D / hair Shader. nullptr → built-in path for the shading model. | |
| Shader * | getShader () const |
| void | setTint (float r, float g, float b, float a=1.f) |
| float | getTintR () const |
| float | getTintG () const |
| float | getTintB () const |
| float | getTintA () const |
| void | setMetallic (float metallic) |
| float | getMetallic () const |
| void | setRoughness (float roughness) |
| float | getRoughness () const |
| void | setTexCellBomb (float cellScale, float strength, float rotAmount=1.f) |
| float | getTexCellBombScale () const |
| float | getTexCellBombStrength () const |
| float | getTexCellBombRotation () const |
| void | setParallax (float scale, float minLayers=8.f, float maxLayers=32.f) |
| float | getParallaxScale () const |
| float | getParallaxMinLayers () const |
| float | getParallaxMaxLayers () const |
| void | setReceiveLight (bool receive) |
| bool | getReceiveLight () const |
| void | setCastShadow (bool cast) |
| bool | getCastShadow () const |
| void | setReceiveShadow (bool receive) |
| bool | getReceiveShadow () const |
| void | setCastOcclusion (bool cast) |
| bool | getCastOcclusion () const |
| void | setHair (bool hair) |
| bool | getHair () const |
| bool | hasParam (const std::string &name) const |
| Optional named float knobs (style / custom shader params). | |
| void | setFloat (const std::string &name, float value) |
| float | getFloat (const std::string &name) const |
| void | bind (Graphics &gfx) const |
| Push this material onto Graphics mesh3d state for the next draw. Does not issue the draw itself. | |
| Shader * | effectiveShader () const |
| Effective shader for Mesh3D draws (may be null → default PBR pipeline). | |
| bool | isTransparentHair () const |
| True when this material should go through the hair transparent pass. | |
静态 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 第 26 行定义.
构造及析构函数说明
◆ Material() [1/2]
|
default |
◆ ~Material()
|
default |
◆ Material() [2/2]
|
delete |
成员函数说明
◆ bind()
| void eve::graphics::Material::bind | ( | Graphics & | gfx | ) | const |
Push this material onto Graphics mesh3d state for the next draw. Does not issue the draw itself.
在文件 Material.cpp 第 72 行定义.
引用了 eve::graphics::Lighting3DPack::count, eve::graphics::Shader::hasUniform(), 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::setMesh3DParallax(), eve::graphics::Graphics::setMesh3DShadowReceive() , 以及 eve::graphics::Graphics::setMesh3DTexCellBomb().
◆ effectiveShader()
| Shader * eve::graphics::Material::effectiveShader | ( | ) | const |
Effective shader for Mesh3D draws (may be null → default PBR pipeline).
在文件 Material.cpp 第 63 行定义.
◆ getAlbedoTexture()
|
inline |
在文件 Material.h 第 41 行定义.
◆ getCastOcclusion()
|
inline |
在文件 Material.h 第 85 行定义.
◆ getCastShadow()
|
inline |
◆ getFloat()
| float eve::graphics::Material::getFloat | ( | const std::string & | name | ) | const |
在文件 Material.cpp 第 58 行定义.
引用了 name.
◆ getHair()
|
inline |
在文件 Material.h 第 88 行定义.
◆ getHeightTexture()
|
inline |
在文件 Material.h 第 47 行定义.
◆ getMetallic()
|
inline |
在文件 Material.h 第 60 行定义.
◆ getNormalTexture()
|
inline |
在文件 Material.h 第 44 行定义.
◆ getParallaxMaxLayers()
|
inline |
在文件 Material.h 第 73 行定义.
◆ getParallaxMinLayers()
|
inline |
在文件 Material.h 第 72 行定义.
◆ getParallaxScale()
|
inline |
在文件 Material.h 第 71 行定义.
◆ getReceiveLight()
|
inline |
在文件 Material.h 第 76 行定义.
◆ getReceiveShadow()
|
inline |
在文件 Material.h 第 82 行定义.
◆ getRoughness()
|
inline |
在文件 Material.h 第 63 行定义.
◆ getShader()
|
inline |
在文件 Material.h 第 51 行定义.
◆ getShadingModel()
|
inline |
在文件 Material.h 第 38 行定义.
◆ getTexCellBombRotation()
|
inline |
在文件 Material.h 第 68 行定义.
◆ getTexCellBombScale()
|
inline |
在文件 Material.h 第 66 行定义.
◆ getTexCellBombStrength()
|
inline |
在文件 Material.h 第 67 行定义.
◆ getTintA()
|
inline |
在文件 Material.h 第 57 行定义.
◆ getTintB()
|
inline |
在文件 Material.h 第 56 行定义.
◆ getTintG()
|
inline |
在文件 Material.h 第 55 行定义.
◆ getTintR()
|
inline |
在文件 Material.h 第 54 行定义.
◆ hasParam()
| bool eve::graphics::Material::hasParam | ( | const std::string & | name | ) | const |
◆ isTransparentHair()
| bool eve::graphics::Material::isTransparentHair | ( | ) | const |
True when this material should go through the hair transparent pass.
在文件 Material.cpp 第 68 行定义.
被这些函数引用 eve::graphics::Renderable3D::MeshRenderer::effectiveHair() , 以及 eve::graphics::RenderSystem3D::render().
◆ operator=()
◆ setAlbedoTexture()
|
inline |
在文件 Material.h 第 40 行定义.
◆ setCastOcclusion()
|
inline |
在文件 Material.h 第 84 行定义.
◆ setCastShadow()
|
inline |
在文件 Material.h 第 78 行定义.
被这些函数引用 eve::weather::Weather::init().
◆ setFloat()
| void eve::graphics::Material::setFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
在文件 Material.cpp 第 56 行定义.
◆ setHair()
| void eve::graphics::Material::setHair | ( | bool | hair | ) |
在文件 Material.cpp 第 49 行定义.
引用了 hair.
◆ setHeightTexture()
|
inline |
在文件 Material.h 第 46 行定义.
◆ setMetallic()
| void eve::graphics::Material::setMetallic | ( | float | metallic | ) |
在文件 Material.cpp 第 26 行定义.
引用了 metallic.
◆ setNormalTexture()
|
inline |
在文件 Material.h 第 43 行定义.
◆ setParallax()
| void eve::graphics::Material::setParallax | ( | float | scale, |
| float | minLayers = 8.f, |
||
| float | maxLayers = 32.f |
||
| ) |
在文件 Material.cpp 第 40 行定义.
引用了 scale.
◆ setReceiveLight()
|
inline |
在文件 Material.h 第 75 行定义.
被这些函数引用 eve::weather::Weather::init().
◆ setReceiveShadow()
|
inline |
在文件 Material.h 第 81 行定义.
被这些函数引用 eve::weather::Weather::init().
◆ setRoughness()
| void eve::graphics::Material::setRoughness | ( | float | roughness | ) |
在文件 Material.cpp 第 30 行定义.
引用了 roughness.
◆ setShader()
|
inline |
Optional Mesh3D / hair Shader. nullptr → built-in path for the shading model.
在文件 Material.h 第 50 行定义.
引用了 shader.
被这些函数引用 eve::weather::Weather::init().
◆ setShadingModel()
| void eve::graphics::Material::setShadingModel | ( | const std::string & | model | ) |
"pbr" | "unlit" | "hair" | "custom" (unknown → pbr).
在文件 Material.cpp 第 9 行定义.
引用了 model.
被这些函数引用 eve::weather::Weather::init().
◆ setTexCellBomb()
| void eve::graphics::Material::setTexCellBomb | ( | float | cellScale, |
| float | strength, | ||
| float | rotAmount = 1.f |
||
| ) |
在文件 Material.cpp 第 34 行定义.
◆ setTint()
| void eve::graphics::Material::setTint | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
类成员变量说明
◆ kMaxPartsHint
|
staticconstexpr |
在文件 Material.h 第 28 行定义.
该类的文档由以下文件生成:
- src/modules/graphics/Material.h
- src/modules/graphics/Material.cpp