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

TypeNameDescription
stringcomponentPath of the component containing the material
stringmaterialName of the material to check
intfeatureFeature index to query
Refer Features section

Returns

TypeNameDescription
boolresulttrue if the feature is enabled, false otherwise

Features

ValueNameDescription
0FEATURE_EMISSIONEnables or disables emission, allowing the material to emit light
1FEATURE_NORMAL_MAPPINGEnables or disables a normal map to simulate surface detail
2FEATURE_RIMEnables or disables rim lighting for a backlit glow effect
3FEATURE_CLEARCOATEnables or disables a clearcoat layer, simulating a glossy top coat
4FEATURE_ANISOTROPYEnables or disables anisotropic reflections
5FEATURE_AMBIENT_OCCLUSIONEnables or disables ambient occlusion to darken crevices
6FEATURE_HEIGHT_MAPPINGEnables or disables a heightmap for parallax depth effects
7FEATURE_SUBSURFACE_SCATTERINGEnables or disables subsurface scattering, used for skin and organic surfaces
8FEATURE_SUBSURFACE_TRANSMITTANCEEnables or disables light transmittance through the surface
9FEATURE_BACKLIGHTEnables or disables backlight, simulating light passing through thin surfaces
10FEATURE_REFRACTIONEnables or disables refraction for transparent distortion effects
11FEATURE_DETAILEnables or disables a detail layer (secondary albedo/normal)
12FEATURE_BENT_NORMAL_MAPPINGEnables or disables bent normal mapping to improve ambient occlusion accuracy

Examples

Check if certain features are enabled on a material
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))

On this page