self:is_material_feature
Shared
Retrieves whether a specific rendering feature is enabled on a material
Syntax
local result = self:is_material_feature(
component,
material,
feature
)Parameters
| Type | Name | Description |
|---|---|---|
string | component | Path of the component containing the material |
string | material | Name of the material to check |
int | feature | Feature index to query Refer Features section |
Returns
| Type | Name | Description |
|---|---|---|
bool | result | true if the feature is enabled, false otherwise |
Features
| Value | Name | Description |
|---|---|---|
0 | FEATURE_EMISSION | Enables or disables emission, allowing the material to emit light |
1 | FEATURE_NORMAL_MAPPING | Enables or disables a normal map to simulate surface detail |
2 | FEATURE_RIM | Enables or disables rim lighting for a backlit glow effect |
3 | FEATURE_CLEARCOAT | Enables or disables a clearcoat layer, simulating a glossy top coat |
4 | FEATURE_ANISOTROPY | Enables or disables anisotropic reflections |
5 | FEATURE_AMBIENT_OCCLUSION | Enables or disables ambient occlusion to darken crevices |
6 | FEATURE_HEIGHT_MAPPING | Enables or disables a heightmap for parallax depth effects |
7 | FEATURE_SUBSURFACE_SCATTERING | Enables or disables subsurface scattering, used for skin and organic surfaces |
8 | FEATURE_SUBSURFACE_TRANSMITTANCE | Enables or disables light transmittance through the surface |
9 | FEATURE_BACKLIGHT | Enables or disables backlight, simulating light passing through thin surfaces |
10 | FEATURE_REFRACTION | Enables or disables refraction for transparent distortion effects |
11 | FEATURE_DETAIL | Enables or disables a detail layer (secondary albedo/normal) |
12 | FEATURE_BENT_NORMAL_MAPPING | Enables or disables bent normal mapping to improve ambient occlusion accuracy |
Examples
local entity = model.create("character")
-- Check if emission is enabled on a material
engine.print("info", "Emission enabled:", entity:is_material_feature("Skeleton3D/Body", "skin", 0))
-- Check if subsurface scattering is active
engine.print("info", "Subsurface scattering:", entity:is_material_feature("Skeleton3D/Head", "face", 7))