@@ -5,6 +5,7 @@ import { PBRMaterial, AbstractMesh } from "babylonjs";
55import { registerSimpleUndoRedo } from "../../../../tools/undoredo" ;
66
77import { EditorInspectorColorField } from "../fields/color" ;
8+ import { EditorInspectorBlockField } from "../fields/block" ;
89import { EditorInspectorStringField } from "../fields/string" ;
910import { EditorInspectorNumberField } from "../fields/number" ;
1011import { EditorInspectorSwitchField } from "../fields/switch" ;
@@ -26,6 +27,8 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
2627 }
2728
2829 public render ( ) : ReactNode {
30+ const scene = this . props . material . getScene ( ) ;
31+
2932 return (
3033 < >
3134 < EditorInspectorSectionField title = "Material" label = { this . props . material . getClassName ( ) } >
@@ -234,6 +237,39 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
234237 </ EditorInspectorSectionField >
235238 ) }
236239
240+ < EditorInspectorSectionField title = "Sub Surface" >
241+ < EditorInspectorTextureField scene = { scene } object = { this . props . material . subSurface } property = "thicknessTexture" title = "Thickness Texture" >
242+ < EditorInspectorSwitchField label = "Use Mask From Thickness Texture" object = { this . props . material . subSurface } property = "useMaskFromThicknessTexture" />
243+ < EditorInspectorNumberField label = "Minimum Thickness" object = { this . props . material . subSurface } property = "minimumThickness" min = { 0 } />
244+ < EditorInspectorNumberField label = "Maximum Thickness" object = { this . props . material . subSurface } property = "maximumThickness" min = { 0 } />
245+ </ EditorInspectorTextureField >
246+
247+ < EditorInspectorColorField label = { < div className = "w-14" > Tint</ div > } object = { this . props . material . subSurface } property = "tintColor" />
248+
249+ < EditorInspectorBlockField >
250+ < div className = "font-semibold text-base text-center" > Refraction</ div >
251+ < EditorInspectorSwitchField label = "Enabled" object = { this . props . material . subSurface } property = "isRefractionEnabled" onChange = { ( ) => this . forceUpdate ( ) } />
252+
253+ { this . props . material . subSurface . isRefractionEnabled && (
254+ < >
255+ < EditorInspectorNumberField label = "Intensity" object = { this . props . material . subSurface } property = "refractionIntensity" min = { 0 } />
256+ < EditorInspectorNumberField label = "Index of Refraction" object = { this . props . material . subSurface } property = "indexOfRefraction" min = { 0 } />
257+ </ >
258+ ) }
259+ </ EditorInspectorBlockField >
260+
261+ < EditorInspectorBlockField >
262+ < div className = "font-semibold text-base text-center" > Translucency</ div >
263+ < EditorInspectorSwitchField label = "Enabled" object = { this . props . material . subSurface } property = "isTranslucencyEnabled" onChange = { ( ) => this . forceUpdate ( ) } />
264+
265+ { this . props . material . subSurface . isTranslucencyEnabled && (
266+ < >
267+ < EditorInspectorNumberField label = "Intensity" object = { this . props . material . subSurface } property = "translucencyIntensity" min = { 0 } />
268+ </ >
269+ ) }
270+ </ EditorInspectorBlockField >
271+ </ EditorInspectorSectionField >
272+
237273 < EditorInspectorSectionField title = "Intensity Properties" >
238274 < EditorInspectorNumberField label = "Direct Intensity" object = { this . props . material } property = "directIntensity" min = { 0 } />
239275 < EditorInspectorNumberField label = "Environment Intensity" object = { this . props . material } property = "environmentIntensity" min = { 0 } />
0 commit comments