Skip to content

Commit cd6c877

Browse files
committed
Fix inspector
1 parent 4a67d9c commit cd6c877

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

packages/dev/core/src/PostProcesses/postProcess.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ export class PostProcess {
211211
@serialize()
212212
public adaptScaleToCurrentViewport = false;
213213

214+
public forceStencil = false;
215+
214216
private _camera: Camera;
215217
protected _scene: Scene;
216218
private _engine: Engine;
@@ -656,7 +658,7 @@ export class PostProcess {
656658
const textureOptions = {
657659
generateMipMaps: needMipMaps,
658660
generateDepthBuffer: forceDepthStencil || firstPP === this,
659-
generateStencilBuffer: (forceDepthStencil || firstPP === this) && this._engine.isStencilEnable,
661+
generateStencilBuffer: (forceDepthStencil || firstPP === this || this.forceStencil || true) && this._engine.isStencilEnable,
660662
samplingMode: this.renderTargetSamplingMode,
661663
type: this._textureType,
662664
format: this._textureFormat,

packages/dev/core/src/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class FluidRenderingDepthTextureCopy {
2626
format: Constants.TEXTUREFORMAT_R,
2727
samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,
2828
generateDepthBuffer: true,
29-
generateStencilBuffer: false,
29+
generateStencilBuffer: true,
3030
samples,
3131
noColorAttachment: true,
3232
}

packages/dev/core/src/Rendering/fluidRenderer/fluidRenderingTargetRenderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ export class FluidRenderingTargetRenderer {
716716
true,
717717
undefined
718718
);
719+
this._renderPostProcess.forceStencil = true;
719720
this._renderPostProcess.updateEffect(defines.join("\n"));
720721

721722
this._renderPostProcess.samples = this._samples;

packages/dev/core/src/Rendering/fluidRenderer/fluidRenderingTextures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class FluidRenderingTextures {
166166
format: this._textureFormat,
167167
samplingMode: Constants.TEXTURE_NEAREST_SAMPLINGMODE,
168168
generateDepthBuffer: this._generateDepthBuffer,
169-
generateStencilBuffer: false,
169+
generateStencilBuffer: true,
170170
samples: this._samples,
171171
}
172172
);

packages/dev/inspector/src/components/actionTabs/tabs/propertyGrids/materials/pbrMaterialPropertyGridComponent.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type { LockObject } from "shared-ui-components/tabs/propertyGrids/lockObj
1616
import type { GlobalState } from "../../../../globalState";
1717
import { Vector2LineComponent } from "shared-ui-components/lines/vector2LineComponent";
1818

19+
import "core/Materials/material.decalMap";
1920
import "core/Rendering/prePassRendererSceneComponent";
2021
import "core/Rendering/subSurfaceSceneComponent";
2122

@@ -152,12 +153,14 @@ export class PBRMaterialPropertyGridComponent extends React.Component<IPBRMateri
152153
propertyName="isEnabled"
153154
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
154155
/>
155-
<CheckBoxLineComponent
156-
label="Use decalmap"
157-
target={material.decalMap}
158-
propertyName="isEnabled"
159-
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
160-
/>
156+
{ material.decalMap &&
157+
<CheckBoxLineComponent
158+
label="Use decalmap"
159+
target={material.decalMap}
160+
propertyName="isEnabled"
161+
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
162+
/>
163+
}
161164
</LineContainerComponent>
162165
);
163166
}

packages/dev/inspector/src/components/actionTabs/tabs/propertyGrids/materials/standardMaterialPropertyGridComponent.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import type { LockObject } from "shared-ui-components/tabs/propertyGrids/lockObj
1313
import type { GlobalState } from "../../../../globalState";
1414
import { CheckBoxLineComponent } from "shared-ui-components/lines/checkBoxLineComponent";
1515

16+
import "core/Materials/material.decalMap";
17+
1618
interface IStandardMaterialPropertyGridComponentProps {
1719
globalState: GlobalState;
1820
material: StandardMaterial;
@@ -128,12 +130,14 @@ export class StandardMaterialPropertyGridComponent extends React.Component<IStan
128130
propertyName="isEnabled"
129131
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
130132
/>
131-
<CheckBoxLineComponent
132-
label="Use decalmap"
133-
target={material.decalMap}
134-
propertyName="isEnabled"
135-
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
136-
/>
133+
{ material.decalMap &&
134+
<CheckBoxLineComponent
135+
label="Use decalmap"
136+
target={material.decalMap}
137+
propertyName="isEnabled"
138+
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
139+
/>
140+
}
137141
</LineContainerComponent>
138142
);
139143
}

0 commit comments

Comments
 (0)