Vital.sandbox
Model

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_EMISSIONWhether emission is enabled, allowing the material to emit light
1FEATURE_NORMAL_MAPPINGWhether a normal map is applied to simulate surface detail
2FEATURE_RIMWhether rim lighting is enabled for a backlit glow effect
3FEATURE_CLEARCOATWhether a clearcoat layer is applied, simulating a glossy top coat
4FEATURE_ANISOTROPYWhether anisotropic reflections are enabled
5FEATURE_AMBIENT_OCCLUSIONWhether ambient occlusion is applied to darken crevices
6FEATURE_HEIGHT_MAPPINGWhether a heightmap is used for parallax depth effects
7FEATURE_SUBSURFACE_SCATTERINGWhether subsurface scattering is enabled, used for skin and organic surfaces
8FEATURE_SUBSURFACE_TRANSMITTANCEWhether light transmittance through the surface is enabled
9FEATURE_BACKLIGHTWhether backlight is enabled, simulating light passing through thin surfaces
10FEATURE_REFRACTIONWhether refraction is enabled for transparent distortion effects
11FEATURE_DETAILWhether a detail layer (secondary albedo/normal) is enabled
12FEATURE_BENT_NORMAL_MAPPINGWhether bent normal mapping is used 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