载入中...
搜索中...
未找到
Renderable3D.cpp
浏览该文件的文档.
47void Renderable3D::setNormalTexture(Texture* texture) { meshRenderer()->normalTexture = texture; }
49void Renderable3D::setPackedNormalMask(bool enabled) { meshRenderer()->packedNormalMask = enabled; }
51void Renderable3D::setHeightTexture(Texture* texture) { meshRenderer()->heightTexture = texture; }
181int Renderable3D::getReflectionCaptureMask() { return static_cast<int>(meshRenderer()->reflectionCaptureMask); }
209void Renderable3D::MeshRenderer::lodBlendForDistance(float distance, int& primary, int& secondary,
252int Renderable3D::getMeshLodLevelAtDistance(float distance) { return meshRenderer()->lodLevelForDistance(distance); }
255Result<void> Renderable3D::setMeshLodRendererState(int index, int skinQuality, int shadowCastingMode,
280 if (index < 0 || index >= MeshRenderer::kMaxLodLevels || !std::isfinite(width) || width < 0.f || width > 1.f)
318 if (mr->lodAnimatedCurrent == -2) {mr->lodAnimatedCurrent=target;mr->lodAnimatedProgress=1.f;return Result<void>::success();}
350 if (!std::isfinite(r) || !std::isfinite(g) || !std::isfinite(b) || r < 0.f || g < 0.f || b < 0.f)
360Result<void> Renderable3D::setCustomLightProbeCoefficient(int coefficient, float r, float g, float b) {
361 if (coefficient < 0 || coefficient >= 9 || !std::isfinite(r) || !std::isfinite(g) || !std::isfinite(b))
EVEngine assertion entry point, backed by zeroerr.
#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={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Packages shading method + surface parameters into one attachable asset.
Definition Material.h:38
void setNormalTexture(Texture *texture)
Definition Renderable3D.cpp:47
void setCamera(Camera3D *camera)
Definition Renderable3D.cpp:193
void setReflectionCaptureMask(int mask)
Set the bit mask used to include this object in reflection-probe captures.
Definition Renderable3D.cpp:177
float getParallaxMaxLayers()
Definition Renderable3D.cpp:173
int getMeshLodLevelAtDistance(float distance)
Definition Renderable3D.cpp:252
void setPartSortPriority(int index, int priority)
Override transparent sorting for one part without mutating its shared Material.
Definition Renderable3D.cpp:80
void setCastOcclusion(bool cast)
Definition Renderable3D.cpp:189
std::string getPartName(int index)
Definition Renderable3D.cpp:112
float getParallaxMinLayers()
Definition Renderable3D.cpp:171
Material * getPartMaterial(int index)
Definition Renderable3D.cpp:124
Result< void > advanceMeshLodTransition(float distance, float dt)
Advance an animated transition using caller-injected distance and dt.
Definition Renderable3D.cpp:313
void setRotation(float yaw, float pitch, float roll)
Definition Renderable3D.cpp:18
float getTexCellBombRotation()
Definition Renderable3D.cpp:157
void setLayer(int layer)
Assign this renderable to a camera-culling layer in [0,31].
Definition Renderable3D.cpp:341
void setHeightTexture(Texture *texture)
Height map for parallax (R channel; white = raised). nullptr disables sampling.
Definition Renderable3D.cpp:51
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:67
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:146
float getTexCellBombScale()
Definition Renderable3D.cpp:153
Mesh * getMesh()
Main (non-part) mesh attached via setMesh; nullptr when unset.
Definition Renderable3D.cpp:43
void setTint(float r, float g, float b, float a=1.f)
Definition Renderable3D.cpp:134
void clearCustomLightProbe()
Clear the custom diffuse probe and restore the camera ambient value.
Definition Renderable3D.cpp:369
void setMetallic(float metallic)
Definition Renderable3D.cpp:142
void setTexture(Texture *texture)
Definition Renderable3D.cpp:45
void setMeshLodCullDistance(float distance)
Set the distance that culls the whole mesh LOD chain; zero disables culling.
Definition Renderable3D.cpp:240
void setReceiveLight(bool receive)
Definition Renderable3D.cpp:183
float getMeshLodSecondaryWeightAtDistance(float distance)
Return secondary LOD weight in [0,1].
Definition Renderable3D.cpp:334
int getReflectionCaptureMask()
Return the reflection-probe capture bit mask.
Definition Renderable3D.cpp:181
Result< void > setMeshLodFadePolicy(int mode, bool animate, float duration)
Configure Unity LODFadeMode and deterministic time-driven transitions.
Definition Renderable3D.cpp:287
void setMaterial(Material *material)
Attach a Material that packages shading method + surface params.
Definition Renderable3D.cpp:55
void setPackedNormalMask(bool enabled)
Enable RG normal XY, B AO and A smoothness interpretation for the normal texture.
Definition Renderable3D.cpp:49
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:159
void setPosition(float x, float y, float z)
Definition Renderable3D.cpp:10
void clearPartSortPriority(int index)
Clear a part's per-instance sort override and use its Material priority.
Definition Renderable3D.cpp:87
void setXRayShader(Shader *shader)
Attach an X-ray mesh shader (see Shader::setXray) for occluded silhouettes.
Definition Renderable3D.cpp:59
Result< void > setCustomLightProbe(float r, float g, float b)
Supply baked diffuse irradiance for LOD levels using CustomProvided light probes.
Definition Renderable3D.cpp:349
int getMeshLodRendererState(int index, int field)
Return one LOD renderer policy field, or -1 for an invalid level/field.
Definition Renderable3D.cpp:297
float getTexCellBombStrength()
Definition Renderable3D.cpp:155
float getMeshLodCullDistance()
Return the mesh LOD culling distance; zero means disabled.
Definition Renderable3D.cpp:339
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:63
int getPartSortPriority(int index)
Return the effective per-part or Material transparent sort priority.
Definition Renderable3D.cpp:94
int getMeshLodSecondaryLevelAtDistance(float distance)
Return secondary LOD selected for a fade, or -1 for cull/no secondary.
Definition Renderable3D.cpp:329
Mesh * getPartMesh(int index)
Definition Renderable3D.cpp:118
void setCastShadow(bool cast)
Definition Renderable3D.cpp:185
float getParallaxScale()
Definition Renderable3D.cpp:169
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:255
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:195
void setRoughness(float roughness)
Definition Renderable3D.cpp:144
Result< void > setMeshLodFadeWidth(int index, float width)
Configure per-level distance fade width.
Definition Renderable3D.cpp:279
void setScale(float sx, float sy, float sz)
Definition Renderable3D.cpp:33
void setReceiveShadow(bool receive)
Definition Renderable3D.cpp:187
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:360
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
卡牌游戏 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:404
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:209
float lodDistances[kMaxLodLevels - 1]
Definition RenderSystem3D.h:349
int lodAnimatedCurrent
Definition RenderSystem3D.h:368
float lodFadeWidths[kMaxLodLevels]
Definition RenderSystem3D.h:364
bool lodAnimateCrossFading
Definition RenderSystem3D.h:366
static constexpr int kMaxLodLevels
Definition RenderSystem3D.h:290
int lodFadeMode
Definition RenderSystem3D.h:365
int lodCount
Optional geometric LOD. When lodCount > 0, lodMeshes[0..lodCount) are used instead of mesh based on c...
Definition RenderSystem3D.h:347
float lodCullDistance
Distance beyond which the complete LOD chain is culled; zero disables.
Definition RenderSystem3D.h:351
float lodAnimatedProgress
Definition RenderSystem3D.h:370
int lodAnimatedPrevious
Definition RenderSystem3D.h:369
static constexpr int kMaxParts
Definition RenderSystem3D.h:291