Enables/disables detail texture tiling for specific layer (WRAP vs CLAMP mode).
Takes entityHandle (mesh entity), textureHandle (detail texture to configure), enable (1 = tile/wrap, 0 = clamp).
Returns nothing.
3D Graphics
Parameters & Returns
Parameters
entityHandleInt
textureHandleInt
enableInt
Returns
Void
Quick Summary
Enables/disables detail texture tiling for specific layer (WRAP vs CLAMP mode).
Takes entityHandle (mesh entity), textureHandle (detail texture to configure), enable (1 = tile/wrap, 0 = clamp).
Returns nothing.
Technical Exegesis...
Enables/disables detail texture tiling for specific layer (WRAP vs CLAMP mode). Takes entityHandle (mesh entity), textureHandle (detail texture to configure), enable (1 = tile/wrap, 0 = clamp). Returns nothing. Sets material.tileDetail[i] flag for specified detail texture layer.
This function controls detail tiling.
Enables/disables detail texture tiling for specific layer (WRAP vs CLAMP mode). Takes entityHandle (mesh entity), textureHandle (detail texture to configure), enable (1 = tile/wrap, 0 = clamp). Returns nothing. Sets material.tileDetail[i] flag for specified detail texture layer.
This function controls detail tiling. Detail textures: up to 3 detail layers per material (detail texture slots 0-2), each layer can have independent tiling mode, textureHandle identifies which layer to configure, function searches material.detailTextureIndex[0-2] for matching handle. Tiling modes: enable=1 (WRAP mode, texture repeats), enable=0 (CLAMP mode, texture edges stretched), same as base texture tiling but per-detail-layer, affects detail texture sampling in shader. Layer identification: searches for textureHandle in material.detailTextureIndex[], finds matching layer index (0, 1, or 2), sets material.tileDetail[matching_index], no effect if textureHandle not found in material. Use cases: (1) Terrain detail (tiled dirt overlay on base grass), (2) Decals (clamped stickers on tiled base), (3) Grunge overlays (tiled wear patterns), (4) Unique markings (clamped logos on tiled surface), (5) Multi-scale detail (tiled fine detail on coarse base). Common patterns: base tiled + detail tiled = repeating pattern on repeating base (brick with moss detail), base tiled + detail clamped = unique decal on repeating surface (number on tiled floor), base clamped + detail tiled = fine detail on unique texture (scratches on character), all tiled = multi-scale repetition (terrain with multiple detail scales). Typical usage: call after adding detail texture to entity, configure each detail layer independently, combine with b3dScaleDetailTexture for repetition control, enable for seamless detail textures, disable for unique decals/markings. Material targeting: updates entity's material.tileDetail[i] flag, finds layer by textureHandle (not index), handles material override, surface-based meshes, loaded meshes, change propagates via g_materialPropertiesDirty. Detail texture layers: layer 0 = first detail texture added, layer 1 = second detail texture, layer 2 = third detail texture, maximum 3 layers per material, textureHandle matches handle returned by b3dAddEntityDetailTexture. Sampler state: tileDetail[i] controls ADDRESS_MODE for that layer, enable=1 uses WRAP, enable=0 uses CLAMP, independent sampler state per detail layer, set during material upload to GPU. UV scaling: detail textures typically have different UV scales than base, tiling only meaningful if UV scale > 1.0, combine with b3dScaleDetailTexture to control repetition, clamped mode doesn't benefit from scaling beyond 1.0. Use with base texture: base and detail tiling modes are independent, common: base=WRAP, detail=CLAMP for decals on tiled surfaces, or base=WRAP, detail=WRAP for multi-scale terrain detail, mix and match based on artistic needs. Texture search: function searches all 3 detail slots for matching textureHandle, returns early if textureHandle found and tiling set, no effect if textureHandle not in any slot (silent fail), ensures correct layer configured even if order unknown. Example combinations: terrain (base grass WRAP, detail dirt WRAP, detail rocks WRAP), building (base brick WRAP, detail graffiti CLAMP, detail wear WRAP), floor (base tiles WRAP, detail number CLAMP), character (base skin CLAMP, detail tattoo CLAMP, detail dirt WRAP). Performance: same as base texture tiling (no cost difference), sampler mode set once during material setup, GPU handles both modes efficiently, change triggers material upload (minimal cost). Validation: checks entity is valid mesh, prints error if invalid entity handle, prints error if not a mesh, no validation for textureHandle (silently does nothing if not found). Related: b3dSetBaseTextureTiling sets base texture tiling (independent from detail), b3dScaleDetailTexture scales detail UVs (repetition count), b3dAddEntityDetailTexture adds detail texture (returns textureHandle), b3dRemoveEntityDetailTexture removes detail layer.