载入中...
搜索中...
未找到
Renderable3D.cpp
浏览该文件的文档.
40void Renderable3D::setNormalTexture(Texture* texture) { meshRenderer()->normalTexture = texture; }
42void Renderable3D::setPackedNormalMask(bool enabled) { meshRenderer()->packedNormalMask = enabled; }
44void Renderable3D::setHeightTexture(Texture* texture) { meshRenderer()->heightTexture = texture; }
174int Renderable3D::getReflectionCaptureMask() { return static_cast<int>(meshRenderer()->reflectionCaptureMask); }
202void Renderable3D::MeshRenderer::lodBlendForDistance(float distance, int& primary, int& secondary,
245int Renderable3D::getMeshLodLevelAtDistance(float distance) { return meshRenderer()->lodLevelForDistance(distance); }
248Result<void> Renderable3D::setMeshLodRendererState(int index, int skinQuality, int shadowCastingMode,
273 if (index < 0 || index >= MeshRenderer::kMaxLodLevels || !std::isfinite(width) || width < 0.f || width > 1.f)
311 if (mr->lodAnimatedCurrent == -2) {mr->lodAnimatedCurrent=target;mr->lodAnimatedProgress=1.f;return Result<void>::success();}
343 if (!std::isfinite(r) || !std::isfinite(g) || !std::isfinite(b) || r < 0.f || g < 0.f || b < 0.f)
353Result<void> Renderable3D::setCustomLightProbeCoefficient(int coefficient, float r, float g, float b) {
354 if (coefficient < 0 || coefficient >= 9 || !std::isfinite(r) || !std::isfinite(g) || !std::isfinite(b))
#define EV_PARAM_CHECK(cond,...)
Validate a function parameter / public API precondition.
Definition Assert.h:30
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Packages shading method + surface parameters into one attachable asset.
Definition Material.h:35
void setNormalTexture(Texture *texture)
Definition Renderable3D.cpp:40
void setCamera(Camera3D *camera)
Definition Renderable3D.cpp:186
void setReflectionCaptureMask(int mask)
Set the bit mask used to include this object in reflection-probe captures.
Definition Renderable3D.cpp:170
float getParallaxMaxLayers()
Definition Renderable3D.cpp:166
int getMeshLodLevelAtDistance(float distance)
Definition Renderable3D.cpp:245
void setPartSortPriority(int index, int priority)
Override transparent sorting for one part without mutating its shared Material.
Definition Renderable3D.cpp:73
void setCastOcclusion(bool cast)
Definition Renderable3D.cpp:182
std::string getPartName(int index)
Definition Renderable3D.cpp:105
float getParallaxMinLayers()
Definition Renderable3D.cpp:164
Material * getPartMaterial(int index)
Definition Renderable3D.cpp:117
Result< void > advanceMeshLodTransition(float distance, float dt)
Advance an animated transition using caller-injected distance and dt.
Definition Renderable3D.cpp:306
void setRotation(float yaw, float pitch, float roll)
Definition Renderable3D.cpp:16
float getTexCellBombRotation()
Definition Renderable3D.cpp:150
void setLayer(int layer)
Assign this renderable to a camera-culling layer in [0,31].
Definition Renderable3D.cpp:334
void setHeightTexture(Texture *texture)
Height map for parallax (R channel; white = raised). nullptr disables sampling.
Definition Renderable3D.cpp:44
void setPart(int index, const std::string &name, Mesh *mesh, Material *material)
Bind a named mesh+material part (e.g. Assimp submesh / body region). index 0..kMaxParts-1....
Definition Renderable3D.cpp:60
void setTexCellBomb(float cellScale, float strength, float rotAmount=1.f)
Texture cell bombing — random per-cell UV offset/rotation blended across a 2×2 neighborhood to hide t...
Definition Renderable3D.cpp:139
float getTexCellBombScale()
Definition Renderable3D.cpp:146
Mesh * getMesh()
Main (non-part) mesh attached via setMesh; nullptr when unset.
Definition Renderable3D.cpp:36
void setTint(float r, float g, float b, float a=1.f)
Definition Renderable3D.cpp:127
void clearCustomLightProbe()
Clear the custom diffuse probe and restore the camera ambient value.
Definition Renderable3D.cpp:362
void setMetallic(float metallic)
Definition Renderable3D.cpp:135
void setTexture(Texture *texture)
Definition Renderable3D.cpp:38
void setMeshLodCullDistance(float distance)
Set the distance that culls the whole mesh LOD chain; zero disables culling.
Definition Renderable3D.cpp:233
void setReceiveLight(bool receive)
Definition Renderable3D.cpp:176
float getMeshLodSecondaryWeightAtDistance(float distance)
Return secondary LOD weight in [0,1].
Definition Renderable3D.cpp:327
int getReflectionCaptureMask()
Return the reflection-probe capture bit mask.
Definition Renderable3D.cpp:174
Result< void > setMeshLodFadePolicy(int mode, bool animate, float duration)
Configure Unity LODFadeMode and deterministic time-driven transitions.
Definition Renderable3D.cpp:280
void setMaterial(Material *material)
Attach a Material that packages shading method + surface params.
Definition Renderable3D.cpp:48
void setPackedNormalMask(bool enabled)
Enable RG normal XY, B AO and A smoothness interpretation for the normal texture.
Definition Renderable3D.cpp:42
void setParallax(float scale, float minLayers=8.f, float maxLayers=32.f)
Parallax occlusion mapping. scale 0 disables (default). Typical scale 0.02..0.08. Requires a height t...
Definition Renderable3D.cpp:152
void setPosition(float x, float y, float z)
Definition Renderable3D.cpp:9
void clearPartSortPriority(int index)
Clear a part's per-instance sort override and use its Material priority.
Definition Renderable3D.cpp:80
void setXRayShader(Shader *shader)
Attach an X-ray mesh shader (see Shader::setXray) for occluded silhouettes.
Definition Renderable3D.cpp:52
Result< void > setCustomLightProbe(float r, float g, float b)
Supply baked diffuse irradiance for LOD levels using CustomProvided light probes.
Definition Renderable3D.cpp:342
int getMeshLodRendererState(int index, int field)
Return one LOD renderer policy field, or -1 for an invalid level/field.
Definition Renderable3D.cpp:290
float getTexCellBombStrength()
Definition Renderable3D.cpp:148
float getMeshLodCullDistance()
Return the mesh LOD culling distance; zero means disabled.
Definition Renderable3D.cpp:332
void setXRayHighlight(bool on)
When true, this entity is an X-ray target: its G-buffer pixels are replaced by occluders and it is re...
Definition Renderable3D.cpp:56
int getPartSortPriority(int index)
Return the effective per-part or Material transparent sort priority.
Definition Renderable3D.cpp:87
int getMeshLodSecondaryLevelAtDistance(float distance)
Return secondary LOD selected for a fade, or -1 for cull/no secondary.
Definition Renderable3D.cpp:322
Mesh * getPartMesh(int index)
Definition Renderable3D.cpp:111
void setCastShadow(bool cast)
Definition Renderable3D.cpp:178
float getParallaxScale()
Definition Renderable3D.cpp:162
Result< void > setMeshLodRendererState(int index, int skinQuality, int shadowCastingMode, bool receiveShadows, int motionVectorMode, bool skinnedMotionVectors, int lightProbeUsage, int reflectionProbeUsage)
Set one LOD's Pcg-compatible renderer policy using Unity enum numeric values.
Definition Renderable3D.cpp:248
void setMeshLod(int index, Mesh *mesh, float switchDistance=0.f)
Configure geometric LOD. index 0 = highest detail. For index > 0, switchDistance is the camera distan...
Definition Renderable3D.cpp:188
void setRoughness(float roughness)
Definition Renderable3D.cpp:137
Result< void > setMeshLodFadeWidth(int index, float width)
Configure per-level distance fade width.
Definition Renderable3D.cpp:272
void setScale(float sx, float sy, float sz)
Definition Renderable3D.cpp:27
void setReceiveShadow(bool receive)
Definition Renderable3D.cpp:180
Result< void > setCustomLightProbeCoefficient(int coefficient, float r, float g, float b)
Set one L0..L2 RGB spherical-harmonic coefficient for CustomProvided mode.
Definition Renderable3D.cpp:353
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
@ InvalidArgument
One mesh + material slot on a multi-part model (Assimp mesh / body region). When Material* is null,...
Definition Material.h:330
void lodBlendForDistance(float distance, int &primary, int &secondary, float &secondaryWeight) const
Select primary/secondary levels and secondary weight for the active fade policy.
Definition Renderable3D.cpp:202
float lodDistances[kMaxLodLevels - 1]
Definition RenderSystem3D.h:279
int lodAnimatedCurrent
Definition RenderSystem3D.h:298
float lodFadeWidths[kMaxLodLevels]
Definition RenderSystem3D.h:294
bool lodAnimateCrossFading
Definition RenderSystem3D.h:296
static constexpr int kMaxLodLevels
Definition RenderSystem3D.h:220
int lodFadeMode
Definition RenderSystem3D.h:295
int lodCount
Optional geometric LOD. When lodCount > 0, lodMeshes[0..lodCount) are used instead of mesh based on c...
Definition RenderSystem3D.h:277
float lodCullDistance
Distance beyond which the complete LOD chain is culled; zero disables.
Definition RenderSystem3D.h:281
float lodAnimatedProgress
Definition RenderSystem3D.h:300
int lodAnimatedPrevious
Definition RenderSystem3D.h:299
static constexpr int kMaxParts
Definition RenderSystem3D.h:221