Creates grid mesh with automatic reflection rendering system (mirror/water surface with render-to-texture).
Takes textureSlots, uvMode, unique, sizeX (width), sizeZ (depth), subdivisionsX (quads along X), subdivisionsZ (quads along Z).
Returns reflective mesh entity handle or 0 on failure.
3D Graphics
Parameters & Returns
Parameters
textureSlotsInt
uvModeInt
uniqueInt
sizeXDouble
sizeZDouble
subdivisionsXInt
subdivisionsZInt
Returns
Int
Quick Summary
Creates grid mesh with automatic reflection rendering system (mirror/water surface with render-to-texture).
Takes textureSlots, uvMode, unique, sizeX (width), sizeZ (depth), subdivisionsX (quads along X), subdivisionsZ (quads along Z).
Returns reflective mesh entity handle or 0 on failure.
Technical Exegesis...
Creates grid mesh with automatic reflection rendering system (mirror/water surface with render-to-texture). Takes textureSlots, uvMode, unique, sizeX (width), sizeZ (depth), subdivisionsX (quads along X), subdivisionsZ (quads along Z). Returns reflective mesh entity handle or 0 on failure.
Creates grid mesh with automatic reflection rendering system (mirror/water surface with render-to-texture). Takes textureSlots, uvMode, unique, sizeX (width), sizeZ (depth), subdivisionsX (quads along X), subdivisionsZ (quads along Z). Returns reflective mesh entity handle or 0 on failure. Creates base grid via b3dCreateGrid, marks entity as reflective (isReflective=true), sets default reflection texture resolution 1024x1024, creates hidden reflection camera positioned below grid looking up, parents camera to grid, sets camera FOV to 90 degrees, increments reflection surface counter (max limit enforced). Returns mesh entity handle with reflection system attached.
This function creates mirror/water surface with automatic scene reflection via render-to-texture. Reflection system: (1) Creates base grid mesh (same as b3dCreateGrid), (2) Marks entity as reflective, (3) Creates hidden camera below surface looking upward, (4) Renders scene from reflection camera to texture each frame, (5) Applies reflection texture to grid surface. Reflection camera setup: positioned at distance = max(sizeX,sizeZ)/2 x 1.2 below grid (minimum 5.0 units), rotated +90 degrees pitch (looking up), 90 degrees FOV for wide capture, viewport matches reflection texture resolution (1:1 aspect). Camera parenting: reflection camera is child of grid entity, moves/rotates with grid automatically. Reflection texture: default 1024x1024 resolution (use b3dSetReflectionQuality to change after creation). Clear color: inherits from active camera's clear color (matches sky). MAX_REFLECTION_SURFACES limit: system enforces maximum number of reflective surfaces (implementation-defined limit), if exceeded creates normal grid instead with warning. Reflection counter: g_reflectionSurfaceCount tracks active reflective surfaces. Use cases: (1) Water surfaces (lakes, pools, oceans), (2) Mirror floors (polished marble, reflective metal), (3) Portal effects, (4) Real-time reflections for architectural visualization, (5) Planar reflections (flat mirrors). Common pattern: water=b3dCreateReflectiveGrid(BBR_ONE_SLOT, BBR_TEXTURE_UV, 0, 50.0, 50.0, 32, 32), b3dSetEntityReflectionAlphaFX(water, 0.7) for semi-transparent water reflection. Reflection quality: higher texture resolution (via b3dSetReflectionQuality) = sharper reflections but more GPU memory/bandwidth. Typical resolutions: 512x512 for performance, 1024x1024 for quality, 2048x2048 for high-end. Performance: reflection camera renders entire scene each frame (expensive), use sparingly. Optimization: limit reflection surface count, reduce reflection texture resolution, use smaller grids. Reflection control functions: b3dSetEntityReflectionAlphaFX (opacity 0.0-1.0), b3dEnableEntityReflectionTint (apply entity color to reflection), b3dSetEntityReflectionClearColorFX (sky color), b3dSetReflectionQuality (texture resolution). Hidden camera: reflection camera handle stored in entity.reflectionCameraHandle, automatically hidden (not rendered by main camera), user doesn't see it. Vertex/triangle count: same as b3dCreateGrid ((subdivisionsX+1)x(subdivisionsZ+1) vertices, 2xsubdivisionsXxsubdivisionsZ triangles). Alternative: b3dCreateGrid with manual reflection setup for custom control, cube mapping for non-planar reflections, screen-space reflections for dynamic surfaces. Modification: surface-based grid (fully editable), reflection system persists through mesh modifications. Typical setup: create reflective grid -> position at water level -> set blue tint color -> adjust reflection alpha -> add waves via vertex animation.