Skip to content

Commit 01e5e14

Browse files
authored
feat: add more properties to pbr materials (#579)
1 parent e2426d3 commit 01e5e14

File tree

1 file changed

+45
-2
lines changed
  • editor/src/editor/layout/inspector/material

1 file changed

+45
-2
lines changed

editor/src/editor/layout/inspector/material/pbr.tsx

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
5555
<>
5656
<EditorInspectorSwitchField label="Inverse X" object={this.props.material} property="invertNormalMapX" />
5757
<EditorInspectorSwitchField label="Inverse Y" object={this.props.material} property="invertNormalMapY" />
58+
<EditorInspectorSwitchField label="Use Object Space Normal Map" object={this.props.material} property="useObjectSpaceNormalMap" />
5859
<EditorInspectorSwitchField label="Use Parallax" object={this.props.material} property="useParallax" onChange={() => this.forceUpdate()} />
5960

6061
{this.props.material.useParallax && (
@@ -63,6 +64,7 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
6364
<EditorInspectorNumberField label="Parallax Scale Bias" object={this.props.material} property="parallaxScaleBias" />
6465
</>
6566
)}
67+
<EditorInspectorSwitchField label="Disable Bump Map" object={this.props.material} property="disableBumpMap" onChange={() => this.forceUpdate()} />
6668
</>
6769
)}
6870
</EditorInspectorTextureField>
@@ -89,6 +91,13 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
8991
<>
9092
<EditorInspectorSwitchField label="Use Gray Scale" object={this.props.material} property="useAmbientInGrayScale" />
9193
<EditorInspectorNumberField label="Strength" object={this.props.material} property="ambientTextureStrength" min={0} />
94+
<EditorInspectorNumberField
95+
label="Impact On Analytical Lights"
96+
object={this.props.material}
97+
property="ambientTextureImpactOnAnalyticalLights"
98+
min={0}
99+
max={1}
100+
/>
92101
</>
93102
)}
94103
</EditorInspectorTextureField>
@@ -122,7 +131,27 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
122131
)}
123132
</EditorInspectorTextureField>
124133

134+
<EditorInspectorTextureField object={this.props.material} title="Metallic Reflectance Texture" property="metallicReflectanceTexture" onChange={() => this.forceUpdate()}>
135+
{this.props.material.metallicReflectanceTexture && (
136+
<>
137+
<EditorInspectorSwitchField
138+
label="Use Only Metallic From Metallic Reflectance Texture"
139+
object={this.props.material}
140+
property="useOnlyMetallicFromMetallicReflectanceTexture"
141+
onChange={() => this.forceUpdate()}
142+
/>
143+
</>
144+
)}
145+
</EditorInspectorTextureField>
146+
125147
<EditorInspectorTextureField object={this.props.material} title="Emissive Texture" property="emissiveTexture" />
148+
<EditorInspectorTextureField object={this.props.material} title="Lightmap Texture" property="lightmapTexture">
149+
{this.props.material.lightmapTexture && (
150+
<>
151+
<EditorInspectorSwitchField label="Use Lightmap As Shadowmap" object={this.props.material} property="useLightmapAsShadowmap" />
152+
</>
153+
)}
154+
</EditorInspectorTextureField>
126155
</EditorInspectorSectionField>
127156

128157
<EditorInspectorSectionField title="Material Colors">
@@ -131,10 +160,14 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
131160
<EditorInspectorColorField label={<div className="w-14">Reflection</div>} object={this.props.material} property="reflectionColor" />
132161
<EditorInspectorColorField label={<div className="w-14">Ambient</div>} object={this.props.material} property="ambientColor" />
133162
<EditorInspectorColorField label={<div className="w-14">Emissive</div>} object={this.props.material} property="emissiveColor" />
163+
{this.props.material.metallic !== null && (
164+
<EditorInspectorColorField label={<div className="w-14">Metallic Reflectance</div>} object={this.props.material} property="metallicReflectanceColor" />
165+
)}
134166
</EditorInspectorSectionField>
135167

136168
<EditorInspectorSectionField title="Metallic / Roughness">
137169
<EditorInspectorNumberField label="Metallic F0 Factor" object={this.props.material} property="metallicF0Factor" />
170+
<EditorInspectorNumberField label="Base Weight" object={this.props.material} property="baseWeight" min={0} max={1} />
138171

139172
<EditorInspectorSwitchField
140173
label="Metallic"
@@ -197,18 +230,28 @@ export class EditorPBRMaterialInspector extends Component<IEditorPBRMaterialInsp
197230
</EditorInspectorSectionField>
198231
)}
199232

200-
<EditorInspectorSectionField title="Misc">
233+
<EditorInspectorSectionField title="Intensity Properties">
201234
<EditorInspectorNumberField label="Direct Intensity" object={this.props.material} property="directIntensity" min={0} />
202235
<EditorInspectorNumberField label="Environment Intensity" object={this.props.material} property="environmentIntensity" min={0} />
236+
<EditorInspectorNumberField label="Emissive Intensity" object={this.props.material} property="emissiveIntensity" min={0} />
237+
<EditorInspectorNumberField label="Specular Intensity" object={this.props.material} property="specularIntensity" min={0} />
238+
</EditorInspectorSectionField>
239+
240+
<EditorInspectorSectionField title="Misc">
203241
<EditorInspectorSwitchField label="Unlit" object={this.props.material} property="unlit" />
204242
<EditorInspectorSwitchField label="Disable Lighting" object={this.props.material} property="disableLighting" />
205-
<EditorInspectorSwitchField label="Use Specular Over Alpha" object={this.props.material} property="useSpecularOverAlpha" />
206243
<EditorInspectorSwitchField label="Enable Specular Anti Aliasing" object={this.props.material} property="enableSpecularAntiAliasing" />
207244
<EditorInspectorSwitchField label="Force Irradiance In Fragment" object={this.props.material} property="forceIrradianceInFragment" />
208245
<EditorInspectorSwitchField label="Use Radiance Occlusion" object={this.props.material} property="useRadianceOcclusion" />
246+
<EditorInspectorSwitchField label="Use Horizon Occlusion" object={this.props.material} property="useHorizonOcclusion" />
209247
<EditorInspectorSwitchField label="Use Physical Light Falloff" object={this.props.material} property="usePhysicalLightFalloff" />
248+
<EditorInspectorSwitchField label="Use Radiance Over Alpha" object={this.props.material} property="useRadianceOverAlpha" />
249+
<EditorInspectorSwitchField label="Use Specular Over Alpha" object={this.props.material} property="useSpecularOverAlpha" />
210250
<EditorInspectorSwitchField label="Separate Culling Pass" object={this.props.material} property="separateCullingPass" />
251+
<EditorInspectorSwitchField label="Force Alpha Test" object={this.props.material} property="forceAlphaTest" />
211252
<EditorInspectorNumberField label="Z Offset" object={this.props.material} property="zOffset" />
253+
<EditorInspectorNumberField label="Z Offset Units" object={this.props.material} property="zOffsetUnits" />
254+
<EditorInspectorSwitchField label="Fog Enabled" object={this.props.material} property="fogEnabled" />
212255
</EditorInspectorSectionField>
213256
</>
214257
);

0 commit comments

Comments
 (0)