SkyBox¶
Inherits: EntityHandle
C++ type: SkyBox
Cubemap sky rendering and the source environment for image-based lighting (IBL).
When a Sky entity has a valid cubemap texture, the engine generates irradiance and prefiltered specular environment maps from it. Meshes with Receive IBL enabled on their Mesh component use those maps for reflections and indirect diffuse lighting.
Editor-only component fields¶
These are edited on the Sky component in the Properties window and serialized with
the scene (not yet exposed on the SkyBox script class):
| Field | Default | Purpose |
|---|---|---|
| visible | true |
Draw the sky background. When false, the sky is hidden but IBL maps are still built from the texture. |
| texture | — | Cubemap source (six faces or single file). |
| color | white | Linear RGBA tint. |
| rotation | 0 |
Y-axis rotation in degrees. |
Use Visible = false for invisible HDR environments that only drive reflections.
Properties¶
| Name | Languages |
|---|---|
color |
C++ | Lua |
alpha |
C++ | Lua |
rotation |
C++ | Lua |
customShader |
C++ | Lua |
Methods¶
| Name | Languages |
|---|---|
setTextures |
C++ | Lua |
setTexture |
C++ | Lua |
setTexturePositiveX |
C++ | Lua |
setTextureNegativeX |
C++ | Lua |
setTexturePositiveY |
C++ | Lua |
setTextureNegativeY |
C++ | Lua |
setTexturePositiveZ |
C++ | Lua |
setTextureNegativeZ |
C++ | Lua |
setColor |
C++ | Lua |
setShaderUniform |
C++ | Lua |
getShaderUniform |
C++ | Lua |
removeShaderUniform |
C++ | Lua |
Example¶
Enable Receive IBL on meshes that should reflect this environment. See Rendering Pipeline — IBL.
Method details¶
customShader¶
- Setter:
void setCustomShader(const std::string& path) - Getter:
std::string getCustomShader() const
Project-relative base path of a forked shader ("shaders/dayNight" resolves to shaders/dayNight.vert and shaders/dayNight.frag, or "a.vert|b.frag" names the files separately). Empty (default) uses the scene default shader for this type, or the engine built-in. Changing it reloads the component. Same semantics as Mesh.customShader; see Custom Shaders.
setShaderUniform¶
void setShaderUniform(const std::string& name, const Vector4& value)void setShaderUniform(const std::string& name, const Vector3& value)void setShaderUniform(const std::string& name, const Vector2& value)void setShaderUniform(const std::string& name, float value)Vector4 getShaderUniform(const std::string& name) constbool removeShaderUniform(const std::string& name)
Values for the members of the custom shader's u_vs_customParams / u_fs_customParams blocks, by member name. Setting a value only rewrites the uploaded block, so it can run every frame; a member with no value reads zero, or the scene's value under a scene default shader, and time (seconds since startup) and resolution (render target size) are reserved for the engine. Same semantics as Mesh.setShaderUniform; see Custom Shaders — Shader uniforms.