Переглянути джерело

Added occlusion properties in inspector

David Catuhe 6 роки тому
батько
коміт
1aa4258b4b

+ 1 - 0
dist/preview release/what's new.md

@@ -22,6 +22,7 @@
 - Added support for morph targets ([Deltakosh](https://github.com/deltakosh/))
 - Added context menu to add `SSAORenderingPipeline` and `SSAO2RenderingPipeline` ([Deltakosh](https://github.com/deltakosh/))
 - Added support for texture creation and assignments per material ([Deltakosh](https://github.com/deltakosh/))
+- Added support for occlusion properties ([Deltakosh](https://github.com/deltakosh/))
 - Node material editor ([Deltakosh](https://github.com/deltakosh/)/[TrevorDev](https://github.com/TrevorDev))
 
 ### Tools

+ 18 - 0
inspector/src/components/actionTabs/tabs/propertyGrids/meshes/meshPropertyGridComponent.tsx

@@ -23,6 +23,8 @@ import { CustomPropertyGridComponent } from '../customPropertyGridComponent';
 import { StandardMaterial } from 'babylonjs/Materials/standardMaterial';
 import { Color3LineComponent } from '../../../lines/color3LineComponent';
 import { MorphTarget } from 'babylonjs/Morph/morphTarget';
+import { OptionsLineComponent } from '../../../lines/optionsLineComponent';
+import { AbstractMesh } from 'babylonjs/Meshes/abstractMesh';
 
 interface IMeshPropertyGridComponentProps {
     globalState: GlobalState;
@@ -218,6 +220,17 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
             }
         }
 
+        var algorithmOptions = [
+            { label: "Accurate", value: AbstractMesh.OCCLUSION_ALGORITHM_TYPE_ACCURATE },
+            { label: "Conservative", value: AbstractMesh.OCCLUSION_ALGORITHM_TYPE_CONSERVATIVE },
+        ];
+
+        var occlusionTypeOptions = [
+            { label: "None", value: AbstractMesh.OCCLUSION_TYPE_NONE },
+            { label: "Optimistic", value: AbstractMesh.OCCLUSION_TYPE_OPTIMISTIC },
+            { label: "Strict", value: AbstractMesh.OCCLUSION_TYPE_STRICT },
+        ];
+
         return (
             <div className="pane">
                 <CustomPropertyGridComponent globalState={this.props.globalState} target={mesh}
@@ -311,6 +324,11 @@ export class MeshPropertyGridComponent extends React.Component<IMeshPropertyGrid
                         <TextLineComponent label="Type" value={this.convertPhysicsTypeToString()} />
                     </LineContainerComponent>
                 }
+                <LineContainerComponent globalState={this.props.globalState} title="OCCLUSIONS" closed={true}>
+                    <OptionsLineComponent label="Type" options={occlusionTypeOptions} target={mesh} propertyName="occlusionType" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                    <SliderLineComponent label="Retry count" minimum={-1} maximum={10} decimalCount={0} step={1} target={mesh} propertyName="occlusionRetryCount" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                    <OptionsLineComponent label="Algorithm" options={algorithmOptions} target={mesh} propertyName="occlusionQueryAlgorithmType" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
+                </LineContainerComponent>
                 <LineContainerComponent globalState={this.props.globalState} title="EDGE RENDERING" closed={true}>
                     <CheckBoxLineComponent label="Enable" target={mesh} isSelected={() => mesh.edgesRenderer != null} onSelect={value => {
                         if (value) {