@babylonjs/core 9.1.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.js +2 -2
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.js +1 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/animatorAvatar.js +13 -12
- package/Animations/animatorAvatar.js.map +1 -1
- package/Animations/easing.js +1 -1
- package/Animations/easing.js.map +1 -1
- package/Animations/pathCursor.js +1 -2
- package/Animations/pathCursor.js.map +1 -1
- package/Cameras/geospatialCameraMovement.js +4 -5
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Engines/Extensions/engine.multiview.js +6 -0
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +9 -4
- package/Engines/constants.js +9 -4
- package/Engines/constants.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +6 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +38 -11
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +4 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +4 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/Layers/selectionOutlineLayer.d.ts +7 -0
- package/Layers/selectionOutlineLayer.js +18 -1
- package/Layers/selectionOutlineLayer.js.map +1 -1
- package/Layers/thinSelectionOutlineLayer.d.ts +7 -0
- package/Layers/thinSelectionOutlineLayer.js +86 -36
- package/Layers/thinSelectionOutlineLayer.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.d.ts +6 -0
- package/Lights/Clustered/clusteredLightContainer.js +42 -0
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Lights/light.d.ts +7 -0
- package/Lights/light.js +10 -0
- package/Lights/light.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +13 -3
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +155 -53
- package/Materials/PBR/openpbrMaterial.js +149 -61
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +36 -31
- package/Materials/PBR/pbrBaseMaterial.js +2 -32
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +10 -0
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/environmentLighting.defines.d.ts +31 -0
- package/Materials/environmentLighting.defines.js +33 -0
- package/Materials/environmentLighting.defines.js.map +1 -0
- package/Materials/material.js +1 -0
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.functions.js +8 -2
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.js +10 -3
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/prepass.defines.d.ts +43 -0
- package/Materials/prepass.defines.js +45 -0
- package/Materials/prepass.defines.js.map +1 -0
- package/Materials/standardMaterial.d.ts +36 -31
- package/Materials/standardMaterial.js +2 -32
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +8 -1
- package/Meshes/abstractMesh.js +9 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +31 -4
- package/Meshes/mesh.js.map +1 -1
- package/Misc/greasedLineTools.js +5 -0
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/tools.js +1 -1
- package/Misc/tools.js.map +1 -1
- package/Particles/EmitterTypes/coneParticleEmitter.js +2 -4
- package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
- package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.d.ts +3 -9
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +35 -12
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +20 -0
- package/Rendering/geometryBufferRenderer.js +203 -14
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/objectRenderer.js +1 -0
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/prePassRenderer.js +7 -1
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +5 -0
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js +1 -1
- package/Shaders/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBlockPrePass.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js +77 -0
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +37 -17
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +43 -17
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +10 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.d.ts +1 -0
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js +14 -38
- package/Shaders/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +4 -2
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.js +35 -0
- package/Shaders/ShadersInclude/openpbrSubsurfaceLayerData.js.map +1 -0
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js +1 -1
- package/Shaders/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +9 -0
- package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.d.ts +5 -0
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js +67 -0
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js.map +1 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +14 -3
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
- package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentReflectionDeclaration.d.ts +5 -0
- package/Shaders/ShadersInclude/pbrFragmentReflectionDeclaration.js +43 -0
- package/Shaders/ShadersInclude/pbrFragmentReflectionDeclaration.js.map +1 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.d.ts +1 -0
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +2 -32
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/sceneFragmentDeclaration.js +1 -1
- package/Shaders/ShadersInclude/sceneFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/sceneUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/sceneUboDeclaration.js.map +1 -1
- package/Shaders/geometry.fragment.d.ts +12 -0
- package/Shaders/geometry.fragment.js +102 -1
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/geometry.vertex.d.ts +1 -0
- package/Shaders/geometry.vertex.js +46 -2
- package/Shaders/geometry.vertex.js.map +1 -1
- package/Shaders/iblShadowVoxelTracing.fragment.d.ts +1 -0
- package/Shaders/iblShadowVoxelTracing.fragment.js +2 -5
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/Shaders/openpbr.fragment.d.ts +3 -1
- package/Shaders/openpbr.fragment.js +69 -8
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/Shaders/openpbr.vertex.js +11 -5
- package/Shaders/openpbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/helperFunctions.js +5 -0
- package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +3 -2
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +101 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +39 -19
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +39 -13
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js +14 -34
- package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +5 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.js +35 -0
- package/ShadersWGSL/ShadersInclude/openpbrSubsurfaceLayerData.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrTransmissionLayerData.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrUboDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js +68 -0
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +15 -4
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +2 -2
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrFragmentReflectionDeclaration.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentReflectionDeclaration.js +39 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentReflectionDeclaration.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +2 -28
- package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +2 -1
- package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.d.ts +11 -0
- package/ShadersWGSL/geometry.fragment.js +103 -1
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/geometry.vertex.d.ts +1 -0
- package/ShadersWGSL/geometry.vertex.js +47 -3
- package/ShadersWGSL/geometry.vertex.js.map +1 -1
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.d.ts +1 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +3 -7
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.d.ts +3 -1
- package/ShadersWGSL/openpbr.fragment.js +70 -9
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.vertex.js +6 -0
- package/ShadersWGSL/openpbr.vertex.js.map +1 -1
- package/XR/webXRSessionManager.js +7 -5
- package/XR/webXRSessionManager.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +4 -0
- package/scene.d.ts +7 -0
- package/scene.js +13 -0
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"greasedLineSimpleMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GreasedLine/greasedLineSimpleMaterial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,CAAC,MAAM,yCAAyC,GAAG,0BAA0B,CAAC;AAEpF;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAwBzD;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I,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACtK,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,aAAa,GAAG,gBAAgB,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;QAC3E,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,0BAA0B,CAAC,YAAY,IAAI,IAAI,CAAC;QACrE,IAAI,CAAC,SAAS,CAAC,4BAA4B,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACrE,CAAC;;AAhhBD;;GAEG;AACW,mCAAS,GAAG,KAAK,AAAR,CAAS","sourcesContent":["import { type Scene } from \"../../scene\";\r\nimport { RawTexture } from \"../Textures/rawTexture\";\r\nimport { ShaderMaterial } from \"../shaderMaterial\";\r\nimport { type Nullable } from \"../../types\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport { Vector2 } from \"../../Maths/math.vector\";\r\nimport { ShaderLanguage } from \"../shaderLanguage\";\r\nimport { TextureSampler } from \"../Textures/textureSampler\";\r\n\r\nimport { type GreasedLineMaterialOptions, type IGreasedLineMaterial, GreasedLineMeshColorDistributionType, GreasedLineMeshColorMode } from \"./greasedLineMaterialInterfaces\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport { GreasedLineMaterialDefaults } from \"./greasedLineMaterialDefaults\";\r\n\r\nexport const GreasedLineUseOffsetsSimpleMaterialDefine = \"GREASED_LINE_USE_OFFSETS\";\r\n\r\n/**\r\n * GreasedLineSimpleMaterial\r\n */\r\nexport class GreasedLineSimpleMaterial extends ShaderMaterial implements IGreasedLineMaterial {\r\n /**\r\n * Force to use GLSL in WebGPU\r\n */\r\n public static ForceGLSL = false;\r\n\r\n private _visibility: number;\r\n private _width: number;\r\n private _useDash: boolean;\r\n private _dashCount: number;\r\n private _dashArray: number;\r\n private _dashRatio: number;\r\n private _dashOffset: number;\r\n private _useColors: boolean;\r\n private _color: Color3 = Color3.White();\r\n private _colors: Nullable<Color3[]>;\r\n private _colorsDistributionType: GreasedLineMeshColorDistributionType = GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT;\r\n private _colorMode: GreasedLineMeshColorMode;\r\n private _colorsSampling: number;\r\n private _resolution: Vector2;\r\n private _sizeAttenuation: boolean;\r\n private _colorsTexture: Nullable<RawTexture> = null;\r\n private _cameraFacing: boolean;\r\n\r\n /**\r\n * GreasedLineSimple material constructor\r\n * @param name material name\r\n * @param scene the scene\r\n * @param options material options\r\n */\r\n constructor(name: string, scene: Scene, options: GreasedLineMaterialOptions) {\r\n const engine = scene.getEngine();\r\n const isWGSL = engine.isWebGPU && !(options.forceGLSL || GreasedLineSimpleMaterial.ForceGLSL);\r\n\r\n const defines = [\r\n `COLOR_DISTRIBUTION_TYPE_LINE ${GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE}.`,\r\n `COLOR_DISTRIBUTION_TYPE_SEGMENT ${GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT}.`,\r\n `COLOR_MODE_SET ${GreasedLineMeshColorMode.COLOR_MODE_SET}.`,\r\n `COLOR_MODE_ADD ${GreasedLineMeshColorMode.COLOR_MODE_ADD}.`,\r\n `COLOR_MODE_MULTIPLY ${GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY}.`,\r\n ];\r\n if (scene.useRightHandedSystem) {\r\n defines.push(\"GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\");\r\n }\r\n\r\n const attributes = [\"position\", \"grl_widths\", \"grl_offsets\", \"grl_colorPointers\"];\r\n\r\n if (options.cameraFacing) {\r\n defines.push(\"GREASED_LINE_CAMERA_FACING\");\r\n attributes.push(\"grl_previousAndSide\", \"grl_nextAndCounters\");\r\n } else {\r\n attributes.push(\"grl_slopes\");\r\n attributes.push(\"grl_counters\");\r\n }\r\n\r\n const uniforms = [\r\n \"grlColorsWidth\",\r\n \"grlUseColors\",\r\n \"grlWidth\",\r\n \"grlColor\",\r\n \"grl_colorModeAndColorDistributionType\",\r\n \"grlResolution\",\r\n \"grlAspect\",\r\n \"grlAizeAttenuation\",\r\n \"grlDashArray\",\r\n \"grlDashOffset\",\r\n \"grlDashRatio\",\r\n \"grlUseDash\",\r\n \"grlVisibility\",\r\n \"grlColors\",\r\n ];\r\n\r\n if (!isWGSL) {\r\n uniforms.push(\"world\", \"viewProjection\", \"view\", \"projection\");\r\n }\r\n\r\n super(\r\n name,\r\n scene,\r\n {\r\n vertex: \"greasedLine\",\r\n fragment: \"greasedLine\",\r\n },\r\n {\r\n uniformBuffers: isWGSL ? [\"Scene\", \"Mesh\"] : undefined,\r\n attributes,\r\n uniforms,\r\n samplers: isWGSL ? [] : [\"grlColors\"],\r\n defines,\r\n extraInitializationsAsync: async () => {\r\n if (isWGSL) {\r\n await Promise.all([import(\"../../ShadersWGSL/greasedLine.vertex\"), import(\"../../ShadersWGSL/greasedLine.fragment\")]);\r\n } else {\r\n await Promise.all([import(\"../../Shaders/greasedLine.vertex\"), import(\"../../Shaders/greasedLine.fragment\")]);\r\n }\r\n },\r\n shaderLanguage: isWGSL ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\r\n }\r\n );\r\n\r\n options = options || {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n\r\n this.visibility = options.visibility ?? 1;\r\n this.useDash = options.useDash ?? false;\r\n this.dashRatio = options.dashRatio ?? 0.5;\r\n this.dashOffset = options.dashOffset ?? 0;\r\n this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter\r\n this.width = options.width\r\n ? options.width\r\n : options.sizeAttenuation && options.cameraFacing\r\n ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED\r\n : GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n this.sizeAttenuation = options.sizeAttenuation ?? false;\r\n this.color = options.color ?? Color3.White();\r\n this.useColors = options.useColors ?? false;\r\n this.colorsDistributionType = options.colorDistributionType ?? GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT;\r\n this.colorsSampling = options.colorsSampling ?? RawTexture.NEAREST_NEAREST;\r\n this.colorMode = options.colorMode ?? GreasedLineMeshColorMode.COLOR_MODE_SET;\r\n this._colors = options.colors ?? null;\r\n this._cameraFacing = options.cameraFacing ?? true;\r\n this.resolution = options.resolution ?? new Vector2(engine.getRenderWidth(), engine.getRenderHeight()); // calculate aspect call the setter\r\n\r\n if (options.colorsTexture) {\r\n this.colorsTexture = options.colorsTexture;\r\n } else {\r\n if (this._colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, this._colors, this.colorsSampling, scene);\r\n } else {\r\n this._color = this._color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;\r\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\r\n }\r\n }\r\n\r\n if (isWGSL) {\r\n const sampler = new TextureSampler();\r\n sampler.setParameters(); // use the default values\r\n sampler.samplingMode = this.colorsSampling;\r\n this.setTextureSampler(\"grlColorsSampler\", sampler);\r\n }\r\n\r\n engine.onDisposeObservable.add(() => {\r\n GreasedLineTools.DisposeEmptyColorsTexture();\r\n });\r\n }\r\n\r\n /**\r\n * Disposes the plugin material.\r\n */\r\n public override dispose(): void {\r\n this._colorsTexture?.dispose();\r\n super.dispose();\r\n }\r\n\r\n private _setColorModeAndColorDistributionType() {\r\n this.setVector2(\"grl_colorModeAndColorDistributionType\", new Vector2(this._colorMode, this._colorsDistributionType));\r\n }\r\n\r\n /**\r\n * Updates the material. Use when material created in lazy mode.\r\n */\r\n public updateLazy() {\r\n if (this._colors) {\r\n this.setColors(this._colors, false, true);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the colors used to colorize the line\r\n */\r\n get colors() {\r\n return this._colors;\r\n }\r\n\r\n /**\r\n * Sets the colors used to colorize the line\r\n */\r\n set colors(value: Nullable<Color3[]>) {\r\n this.setColors(value);\r\n }\r\n\r\n /**\r\n * Creates or updates the colors texture\r\n * @param colors color table RGBA\r\n * @param lazy if lazy, the colors are not updated\r\n * @param forceNewTexture force creation of a new texture\r\n */\r\n public setColors(colors: Nullable<Color3[]>, lazy = false, forceNewTexture = false): void {\r\n const origColorsCount = this._colors?.length ?? 0;\r\n\r\n this._colors = colors;\r\n\r\n if (colors === null || colors.length === 0) {\r\n this._colorsTexture?.dispose();\r\n return;\r\n }\r\n\r\n if (lazy && !forceNewTexture) {\r\n return;\r\n }\r\n\r\n if (this._colorsTexture && origColorsCount === colors.length && !forceNewTexture) {\r\n const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);\r\n this._colorsTexture.update(colorArray);\r\n } else {\r\n this._colorsTexture?.dispose();\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, colors, this.colorsSampling, this.getScene());\r\n }\r\n }\r\n\r\n /**\r\n * Gets the colors texture\r\n */\r\n get colorsTexture() {\r\n return (this._colorsTexture as RawTexture) ?? null;\r\n }\r\n\r\n /**\r\n * Sets the colorsTexture\r\n */\r\n set colorsTexture(value: RawTexture) {\r\n this._colorsTexture = value;\r\n this.setFloat(\"grlColorsWidth\", this._colorsTexture.getSize().width);\r\n this.setTexture(\"grlColors\", this._colorsTexture);\r\n }\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n get width() {\r\n return this._width;\r\n }\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n set width(value: number) {\r\n this._width = value;\r\n this.setFloat(\"grlWidth\", value);\r\n }\r\n\r\n /**\r\n * Whether to use the colors option to colorize the line\r\n */\r\n get useColors() {\r\n return this._useColors;\r\n }\r\n\r\n set useColors(value: boolean) {\r\n this._useColors = value;\r\n this.setFloat(\"grlUseColors\", GreasedLineTools.BooleanToNumber(value));\r\n }\r\n\r\n /**\r\n * The type of sampling of the colors texture. The values are the same when using with textures.\r\n */\r\n get colorsSampling() {\r\n return this._colorsSampling;\r\n }\r\n\r\n /**\r\n * The type of sampling of the colors texture. The values are the same when using with textures.\r\n */\r\n set colorsSampling(value: number) {\r\n this._colorsSampling = value;\r\n }\r\n\r\n /**\r\n * Normalized value of how much of the line will be visible\r\n * 0 - 0% of the line will be visible\r\n * 1 - 100% of the line will be visible\r\n */\r\n get visibility() {\r\n return this._visibility;\r\n }\r\n\r\n set visibility(value: number) {\r\n this._visibility = value;\r\n this.setFloat(\"grlVisibility\", value);\r\n }\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n get useDash() {\r\n return this._useDash;\r\n }\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n set useDash(value: boolean) {\r\n this._useDash = value;\r\n this.setFloat(\"grlUseDash\", GreasedLineTools.BooleanToNumber(value));\r\n }\r\n\r\n /**\r\n * Gets the dash offset\r\n */\r\n get dashOffset() {\r\n return this._dashOffset;\r\n }\r\n\r\n /**\r\n * Sets the dash offset\r\n */\r\n set dashOffset(value: number) {\r\n this._dashOffset = value;\r\n this.setFloat(\"grlDashOffset\", value);\r\n }\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n get dashRatio() {\r\n return this._dashRatio;\r\n }\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n set dashRatio(value: number) {\r\n this._dashRatio = value;\r\n this.setFloat(\"grlDashRatio\", value);\r\n }\r\n\r\n /**\r\n * Gets the number of dashes in the line\r\n */\r\n get dashCount() {\r\n return this._dashCount;\r\n }\r\n /**\r\n * Sets the number of dashes in the line\r\n * @param value dash\r\n */\r\n set dashCount(value: number) {\r\n this._dashCount = value;\r\n this._dashArray = 1 / value;\r\n this.setFloat(\"grlDashArray\", this._dashArray);\r\n }\r\n\r\n /**\r\n * False means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines\r\n */\r\n get sizeAttenuation() {\r\n return this._sizeAttenuation;\r\n }\r\n\r\n /**\r\n * Turn on/off attenuation of the width option and widths array.\r\n * @param value false means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines\r\n */\r\n set sizeAttenuation(value: boolean) {\r\n this._sizeAttenuation = value;\r\n this.setFloat(\"grlSizeAttenuation\", GreasedLineTools.BooleanToNumber(value));\r\n }\r\n\r\n /**\r\n * Gets the color of the line\r\n */\r\n get color() {\r\n return this._color;\r\n }\r\n\r\n /**\r\n * Sets the color of the line\r\n * @param value Color3\r\n */\r\n set color(value: Color3) {\r\n this.setColor(value);\r\n }\r\n\r\n /**\r\n * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.\r\n * The simple material always needs a color to be set. If you set it to null it will set the color to the default color (GreasedLineSimpleMaterial.DEFAULT_COLOR).\r\n * @param value color\r\n */\r\n public setColor(value: Nullable<Color3>) {\r\n value = value ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;\r\n this._color = value;\r\n this.setColor3(\"grlColor\", value);\r\n }\r\n\r\n /**\r\n * Gets the color distributiopn type\r\n */\r\n get colorsDistributionType() {\r\n return this._colorsDistributionType;\r\n }\r\n\r\n /**\r\n * Sets the color distribution type\r\n * @see GreasedLineMeshColorDistributionType\r\n * @param value color distribution type\r\n */\r\n set colorsDistributionType(value: GreasedLineMeshColorDistributionType) {\r\n this._colorsDistributionType = value;\r\n this._setColorModeAndColorDistributionType();\r\n }\r\n\r\n /**\r\n * Gets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\r\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\r\n * @see GreasedLineMeshColorMode\r\n */\r\n get colorMode() {\r\n return this._colorMode;\r\n }\r\n\r\n /**\r\n * Sets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\r\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\r\n * @see GreasedLineMeshColorMode\r\n */\r\n set colorMode(value: GreasedLineMeshColorMode) {\r\n this._colorMode = value;\r\n this._setColorModeAndColorDistributionType();\r\n }\r\n\r\n /**\r\n * Gets the resolution\r\n */\r\n get resolution() {\r\n return this._resolution;\r\n }\r\n\r\n /**\r\n * Sets the resolution\r\n * @param value resolution of the screen for GreasedLine\r\n */\r\n set resolution(value: Vector2) {\r\n this._resolution = value;\r\n this.setVector2(\"grlResolution\", value);\r\n this.setFloat(\"grlAspect\", value.x / value.y);\r\n }\r\n\r\n /**\r\n * Serializes this plugin material\r\n * @returns serializationObjec\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n const greasedLineMaterialOptions: GreasedLineMaterialOptions = {\r\n colorDistributionType: this._colorsDistributionType,\r\n colorsSampling: this._colorsSampling,\r\n colorMode: this._colorMode,\r\n color: this._color,\r\n dashCount: this._dashCount,\r\n dashOffset: this._dashOffset,\r\n dashRatio: this._dashRatio,\r\n resolution: this._resolution,\r\n sizeAttenuation: this._sizeAttenuation,\r\n useColors: this._useColors,\r\n useDash: this._useDash,\r\n visibility: this._visibility,\r\n width: this._width,\r\n cameraFacing: this._cameraFacing,\r\n };\r\n\r\n if (this._colors) {\r\n greasedLineMaterialOptions.colors = this._colors;\r\n }\r\n\r\n serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parses a serialized objects\r\n * @param source serialized object\r\n * @param scene scene\r\n * @param _rootUrl root url for textures\r\n */\r\n public parse(source: any, scene: Scene, _rootUrl: string): void {\r\n const greasedLineMaterialOptions = <GreasedLineMaterialOptions>source.greasedLineMaterialOptions;\r\n\r\n this._colorsTexture?.dispose();\r\n\r\n if (greasedLineMaterialOptions.color) {\r\n this.color = greasedLineMaterialOptions.color;\r\n }\r\n if (greasedLineMaterialOptions.colorDistributionType) {\r\n this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType;\r\n }\r\n if (greasedLineMaterialOptions.colorsSampling) {\r\n this.colorsSampling = greasedLineMaterialOptions.colorsSampling;\r\n }\r\n if (greasedLineMaterialOptions.colorMode) {\r\n this.colorMode = greasedLineMaterialOptions.colorMode;\r\n }\r\n if (greasedLineMaterialOptions.useColors) {\r\n this.useColors = greasedLineMaterialOptions.useColors;\r\n }\r\n if (greasedLineMaterialOptions.visibility) {\r\n this.visibility = greasedLineMaterialOptions.visibility;\r\n }\r\n if (greasedLineMaterialOptions.useDash) {\r\n this.useDash = greasedLineMaterialOptions.useDash;\r\n }\r\n if (greasedLineMaterialOptions.dashCount) {\r\n this.dashCount = greasedLineMaterialOptions.dashCount;\r\n }\r\n if (greasedLineMaterialOptions.dashRatio) {\r\n this.dashRatio = greasedLineMaterialOptions.dashRatio;\r\n }\r\n if (greasedLineMaterialOptions.dashOffset) {\r\n this.dashOffset = greasedLineMaterialOptions.dashOffset;\r\n }\r\n if (greasedLineMaterialOptions.width) {\r\n this.width = greasedLineMaterialOptions.width;\r\n }\r\n if (greasedLineMaterialOptions.sizeAttenuation) {\r\n this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation;\r\n }\r\n if (greasedLineMaterialOptions.resolution) {\r\n this.resolution = greasedLineMaterialOptions.resolution;\r\n }\r\n if (greasedLineMaterialOptions.colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, greasedLineMaterialOptions.colors, this.colorsSampling, this.getScene());\r\n } else {\r\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\r\n }\r\n\r\n this._cameraFacing = greasedLineMaterialOptions.cameraFacing ?? true;\r\n this.setDefine(\"GREASED_LINE_CAMERA_FACING\", this._cameraFacing);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"greasedLineSimpleMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GreasedLine/greasedLineSimpleMaterial.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE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cesContent":["import { type Scene } from \"../../scene\";\r\nimport { RawTexture } from \"../Textures/rawTexture\";\r\nimport { ShaderMaterial } from \"../shaderMaterial\";\r\nimport { type Nullable } from \"../../types\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport { Vector2 } from \"../../Maths/math.vector\";\r\nimport { ShaderLanguage } from \"../shaderLanguage\";\r\nimport { TextureSampler } from \"../Textures/textureSampler\";\r\n\r\nimport { type GreasedLineMaterialOptions, type IGreasedLineMaterial, GreasedLineMeshColorDistributionType, GreasedLineMeshColorMode } from \"./greasedLineMaterialInterfaces\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport { GreasedLineMaterialDefaults } from \"./greasedLineMaterialDefaults\";\r\n\r\nexport const GreasedLineUseOffsetsSimpleMaterialDefine = \"GREASED_LINE_USE_OFFSETS\";\r\n\r\n/**\r\n * GreasedLineSimpleMaterial\r\n */\r\nexport class GreasedLineSimpleMaterial extends ShaderMaterial implements IGreasedLineMaterial {\r\n /**\r\n * Force to use GLSL in WebGPU\r\n */\r\n public static ForceGLSL = false;\r\n\r\n private _visibility: number;\r\n private _width: number;\r\n private _useDash: boolean;\r\n private _dashCount: number;\r\n private _dashArray: number;\r\n private _dashRatio: number;\r\n private _dashOffset: number;\r\n private _useColors: boolean;\r\n private _color: Color3 = Color3.White();\r\n private _colors: Nullable<Color3[]>;\r\n private _colorsDistributionType: GreasedLineMeshColorDistributionType = GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT;\r\n private _colorMode: GreasedLineMeshColorMode;\r\n private _colorsSampling: number;\r\n private _resolution: Vector2;\r\n private _sizeAttenuation: boolean;\r\n private _colorsTexture: Nullable<RawTexture> = null;\r\n private _cameraFacing: boolean;\r\n\r\n /**\r\n * GreasedLineSimple material constructor\r\n * @param name material name\r\n * @param scene the scene\r\n * @param options material options\r\n */\r\n constructor(name: string, scene: Scene, options: GreasedLineMaterialOptions) {\r\n const engine = scene.getEngine();\r\n const isWGSL = engine.isWebGPU && !(options.forceGLSL || GreasedLineSimpleMaterial.ForceGLSL);\r\n\r\n const defines = [\r\n `COLOR_DISTRIBUTION_TYPE_LINE ${GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE}.`,\r\n `COLOR_DISTRIBUTION_TYPE_SEGMENT ${GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT}.`,\r\n `COLOR_MODE_SET ${GreasedLineMeshColorMode.COLOR_MODE_SET}.`,\r\n `COLOR_MODE_ADD ${GreasedLineMeshColorMode.COLOR_MODE_ADD}.`,\r\n `COLOR_MODE_MULTIPLY ${GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY}.`,\r\n ];\r\n if (scene.useRightHandedSystem) {\r\n defines.push(\"GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\");\r\n }\r\n\r\n const attributes = [\"position\", \"grl_widths\", \"grl_offsets\", \"grl_colorPointers\"];\r\n\r\n if (options.cameraFacing) {\r\n defines.push(\"GREASED_LINE_CAMERA_FACING\");\r\n attributes.push(\"grl_previousAndSide\", \"grl_nextAndCounters\");\r\n } else {\r\n attributes.push(\"grl_slopes\");\r\n attributes.push(\"grl_counters\");\r\n }\r\n\r\n const uniforms = [\r\n \"grlColorsWidth\",\r\n \"grlUseColors\",\r\n \"grlWidth\",\r\n \"grlColor\",\r\n \"grl_colorModeAndColorDistributionType\",\r\n \"grlResolution\",\r\n \"grlAspect\",\r\n \"grlAizeAttenuation\",\r\n \"grlDashArray\",\r\n \"grlDashOffset\",\r\n \"grlDashRatio\",\r\n \"grlUseDash\",\r\n \"grlVisibility\",\r\n \"grlColors\",\r\n ];\r\n\r\n if (!isWGSL) {\r\n uniforms.push(\"world\", \"viewProjection\", \"view\", \"projection\");\r\n }\r\n\r\n super(\r\n name,\r\n scene,\r\n {\r\n vertex: \"greasedLine\",\r\n fragment: \"greasedLine\",\r\n },\r\n {\r\n uniformBuffers: isWGSL ? [\"Scene\", \"Mesh\"] : undefined,\r\n attributes,\r\n uniforms,\r\n samplers: isWGSL ? [] : [\"grlColors\"],\r\n defines,\r\n extraInitializationsAsync: async () => {\r\n if (isWGSL) {\r\n await Promise.all([import(\"../../ShadersWGSL/greasedLine.vertex\"), import(\"../../ShadersWGSL/greasedLine.fragment\")]);\r\n } else {\r\n await Promise.all([import(\"../../Shaders/greasedLine.vertex\"), import(\"../../Shaders/greasedLine.fragment\")]);\r\n }\r\n },\r\n shaderLanguage: isWGSL ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\r\n }\r\n );\r\n\r\n options = options || {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n\r\n this.visibility = options.visibility ?? 1;\r\n this.useDash = options.useDash ?? false;\r\n this.dashRatio = options.dashRatio ?? 0.5;\r\n this.dashOffset = options.dashOffset ?? 0;\r\n this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter\r\n this.width = options.width\r\n ? options.width\r\n : options.sizeAttenuation && options.cameraFacing\r\n ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED\r\n : GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n this.sizeAttenuation = options.sizeAttenuation ?? false;\r\n this.color = options.color ?? Color3.White();\r\n this.useColors = options.useColors ?? false;\r\n this.colorsDistributionType = options.colorDistributionType ?? GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT;\r\n this.colorsSampling = options.colorsSampling ?? RawTexture.NEAREST_NEAREST;\r\n this.colorMode = options.colorMode ?? GreasedLineMeshColorMode.COLOR_MODE_SET;\r\n this._colors = options.colors ?? null;\r\n this._cameraFacing = options.cameraFacing ?? true;\r\n this.resolution = options.resolution ?? new Vector2(engine.getRenderWidth(), engine.getRenderHeight()); // calculate aspect call the setter\r\n\r\n if (options.colorsTexture) {\r\n this.colorsTexture = options.colorsTexture;\r\n } else {\r\n if (this._colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, this._colors, this.colorsSampling, scene);\r\n } else {\r\n this._color = this._color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;\r\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\r\n }\r\n }\r\n\r\n if (isWGSL) {\r\n const sampler = new TextureSampler();\r\n sampler.setParameters(); // use the default values\r\n sampler.samplingMode = this.colorsSampling;\r\n this.setTextureSampler(\"grlColorsSampler\", sampler);\r\n }\r\n\r\n engine.onDisposeObservable.add(() => {\r\n GreasedLineTools.DisposeEmptyColorsTexture();\r\n });\r\n }\r\n\r\n /**\r\n * Disposes the plugin material.\r\n */\r\n public override dispose(): void {\r\n if (this._colorsTexture && this._colorsTexture !== GreasedLineMaterialDefaults.EmptyColorsTexture) {\r\n this._colorsTexture.dispose();\r\n }\r\n super.dispose();\r\n }\r\n\r\n private _setColorModeAndColorDistributionType() {\r\n this.setVector2(\"grl_colorModeAndColorDistributionType\", new Vector2(this._colorMode, this._colorsDistributionType));\r\n }\r\n\r\n /**\r\n * Updates the material. Use when material created in lazy mode.\r\n */\r\n public updateLazy() {\r\n if (this._colors) {\r\n this.setColors(this._colors, false, true);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the colors used to colorize the line\r\n */\r\n get colors() {\r\n return this._colors;\r\n }\r\n\r\n /**\r\n * Sets the colors used to colorize the line\r\n */\r\n set colors(value: Nullable<Color3[]>) {\r\n this.setColors(value);\r\n }\r\n\r\n /**\r\n * Creates or updates the colors texture\r\n * @param colors color table RGBA\r\n * @param lazy if lazy, the colors are not updated\r\n * @param forceNewTexture force creation of a new texture\r\n */\r\n public setColors(colors: Nullable<Color3[]>, lazy = false, forceNewTexture = false): void {\r\n const origColorsCount = this._colors?.length ?? 0;\r\n\r\n this._colors = colors;\r\n\r\n if (colors === null || colors.length === 0) {\r\n if (this._colorsTexture && this._colorsTexture !== GreasedLineMaterialDefaults.EmptyColorsTexture) {\r\n this._colorsTexture.dispose();\r\n }\r\n const scene = this.getScene();\r\n if (scene) {\r\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\r\n }\r\n return;\r\n }\r\n\r\n if (lazy && !forceNewTexture) {\r\n return;\r\n }\r\n\r\n if (this._colorsTexture && origColorsCount === colors.length && !forceNewTexture) {\r\n const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);\r\n this._colorsTexture.update(colorArray);\r\n } else {\r\n if (this._colorsTexture && this._colorsTexture !== GreasedLineMaterialDefaults.EmptyColorsTexture) {\r\n this._colorsTexture.dispose();\r\n }\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, colors, this.colorsSampling, this.getScene());\r\n }\r\n }\r\n\r\n /**\r\n * Gets the colors texture\r\n */\r\n get colorsTexture() {\r\n return (this._colorsTexture as RawTexture) ?? null;\r\n }\r\n\r\n /**\r\n * Sets the colorsTexture\r\n */\r\n set colorsTexture(value: RawTexture) {\r\n this._colorsTexture = value;\r\n this.setFloat(\"grlColorsWidth\", this._colorsTexture.getSize().width);\r\n this.setTexture(\"grlColors\", this._colorsTexture);\r\n }\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n get width() {\r\n return this._width;\r\n }\r\n\r\n /**\r\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\r\n */\r\n set width(value: number) {\r\n this._width = value;\r\n this.setFloat(\"grlWidth\", value);\r\n }\r\n\r\n /**\r\n * Whether to use the colors option to colorize the line\r\n */\r\n get useColors() {\r\n return this._useColors;\r\n }\r\n\r\n set useColors(value: boolean) {\r\n this._useColors = value;\r\n this.setFloat(\"grlUseColors\", GreasedLineTools.BooleanToNumber(value));\r\n }\r\n\r\n /**\r\n * The type of sampling of the colors texture. The values are the same when using with textures.\r\n */\r\n get colorsSampling() {\r\n return this._colorsSampling;\r\n }\r\n\r\n /**\r\n * The type of sampling of the colors texture. The values are the same when using with textures.\r\n */\r\n set colorsSampling(value: number) {\r\n this._colorsSampling = value;\r\n }\r\n\r\n /**\r\n * Normalized value of how much of the line will be visible\r\n * 0 - 0% of the line will be visible\r\n * 1 - 100% of the line will be visible\r\n */\r\n get visibility() {\r\n return this._visibility;\r\n }\r\n\r\n set visibility(value: number) {\r\n this._visibility = value;\r\n this.setFloat(\"grlVisibility\", value);\r\n }\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n get useDash() {\r\n return this._useDash;\r\n }\r\n\r\n /**\r\n * Turns on/off dash mode\r\n */\r\n set useDash(value: boolean) {\r\n this._useDash = value;\r\n this.setFloat(\"grlUseDash\", GreasedLineTools.BooleanToNumber(value));\r\n }\r\n\r\n /**\r\n * Gets the dash offset\r\n */\r\n get dashOffset() {\r\n return this._dashOffset;\r\n }\r\n\r\n /**\r\n * Sets the dash offset\r\n */\r\n set dashOffset(value: number) {\r\n this._dashOffset = value;\r\n this.setFloat(\"grlDashOffset\", value);\r\n }\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n get dashRatio() {\r\n return this._dashRatio;\r\n }\r\n\r\n /**\r\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\r\n */\r\n set dashRatio(value: number) {\r\n this._dashRatio = value;\r\n this.setFloat(\"grlDashRatio\", value);\r\n }\r\n\r\n /**\r\n * Gets the number of dashes in the line\r\n */\r\n get dashCount() {\r\n return this._dashCount;\r\n }\r\n /**\r\n * Sets the number of dashes in the line\r\n * @param value dash\r\n */\r\n set dashCount(value: number) {\r\n this._dashCount = value;\r\n this._dashArray = 1 / value;\r\n this.setFloat(\"grlDashArray\", this._dashArray);\r\n }\r\n\r\n /**\r\n * False means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines\r\n */\r\n get sizeAttenuation() {\r\n return this._sizeAttenuation;\r\n }\r\n\r\n /**\r\n * Turn on/off attenuation of the width option and widths array.\r\n * @param value false means 1 unit in width = 1 unit on scene, true means 1 unit in width is reduced on the screen to make better looking lines\r\n */\r\n set sizeAttenuation(value: boolean) {\r\n this._sizeAttenuation = value;\r\n this.setFloat(\"grlSizeAttenuation\", GreasedLineTools.BooleanToNumber(value));\r\n }\r\n\r\n /**\r\n * Gets the color of the line\r\n */\r\n get color() {\r\n return this._color;\r\n }\r\n\r\n /**\r\n * Sets the color of the line\r\n * @param value Color3\r\n */\r\n set color(value: Color3) {\r\n this.setColor(value);\r\n }\r\n\r\n /**\r\n * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.\r\n * The simple material always needs a color to be set. If you set it to null it will set the color to the default color (GreasedLineSimpleMaterial.DEFAULT_COLOR).\r\n * @param value color\r\n */\r\n public setColor(value: Nullable<Color3>) {\r\n value = value ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;\r\n this._color = value;\r\n this.setColor3(\"grlColor\", value);\r\n }\r\n\r\n /**\r\n * Gets the color distributiopn type\r\n */\r\n get colorsDistributionType() {\r\n return this._colorsDistributionType;\r\n }\r\n\r\n /**\r\n * Sets the color distribution type\r\n * @see GreasedLineMeshColorDistributionType\r\n * @param value color distribution type\r\n */\r\n set colorsDistributionType(value: GreasedLineMeshColorDistributionType) {\r\n this._colorsDistributionType = value;\r\n this._setColorModeAndColorDistributionType();\r\n }\r\n\r\n /**\r\n * Gets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\r\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\r\n * @see GreasedLineMeshColorMode\r\n */\r\n get colorMode() {\r\n return this._colorMode;\r\n }\r\n\r\n /**\r\n * Sets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\r\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\r\n * @see GreasedLineMeshColorMode\r\n */\r\n set colorMode(value: GreasedLineMeshColorMode) {\r\n this._colorMode = value;\r\n this._setColorModeAndColorDistributionType();\r\n }\r\n\r\n /**\r\n * Gets the resolution\r\n */\r\n get resolution() {\r\n return this._resolution;\r\n }\r\n\r\n /**\r\n * Sets the resolution\r\n * @param value resolution of the screen for GreasedLine\r\n */\r\n set resolution(value: Vector2) {\r\n this._resolution = value;\r\n this.setVector2(\"grlResolution\", value);\r\n this.setFloat(\"grlAspect\", value.x / value.y);\r\n }\r\n\r\n /**\r\n * Serializes this plugin material\r\n * @returns serializationObjec\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n const greasedLineMaterialOptions: GreasedLineMaterialOptions = {\r\n colorDistributionType: this._colorsDistributionType,\r\n colorsSampling: this._colorsSampling,\r\n colorMode: this._colorMode,\r\n color: this._color,\r\n dashCount: this._dashCount,\r\n dashOffset: this._dashOffset,\r\n dashRatio: this._dashRatio,\r\n resolution: this._resolution,\r\n sizeAttenuation: this._sizeAttenuation,\r\n useColors: this._useColors,\r\n useDash: this._useDash,\r\n visibility: this._visibility,\r\n width: this._width,\r\n cameraFacing: this._cameraFacing,\r\n };\r\n\r\n if (this._colors) {\r\n greasedLineMaterialOptions.colors = this._colors;\r\n }\r\n\r\n serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parses a serialized objects\r\n * @param source serialized object\r\n * @param scene scene\r\n * @param _rootUrl root url for textures\r\n */\r\n public parse(source: any, scene: Scene, _rootUrl: string): void {\r\n const greasedLineMaterialOptions = <GreasedLineMaterialOptions>source.greasedLineMaterialOptions;\r\n\r\n this._colorsTexture?.dispose();\r\n\r\n if (greasedLineMaterialOptions.color) {\r\n this.color = greasedLineMaterialOptions.color;\r\n }\r\n if (greasedLineMaterialOptions.colorDistributionType) {\r\n this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType;\r\n }\r\n if (greasedLineMaterialOptions.colorsSampling) {\r\n this.colorsSampling = greasedLineMaterialOptions.colorsSampling;\r\n }\r\n if (greasedLineMaterialOptions.colorMode) {\r\n this.colorMode = greasedLineMaterialOptions.colorMode;\r\n }\r\n if (greasedLineMaterialOptions.useColors) {\r\n this.useColors = greasedLineMaterialOptions.useColors;\r\n }\r\n if (greasedLineMaterialOptions.visibility) {\r\n this.visibility = greasedLineMaterialOptions.visibility;\r\n }\r\n if (greasedLineMaterialOptions.useDash) {\r\n this.useDash = greasedLineMaterialOptions.useDash;\r\n }\r\n if (greasedLineMaterialOptions.dashCount) {\r\n this.dashCount = greasedLineMaterialOptions.dashCount;\r\n }\r\n if (greasedLineMaterialOptions.dashRatio) {\r\n this.dashRatio = greasedLineMaterialOptions.dashRatio;\r\n }\r\n if (greasedLineMaterialOptions.dashOffset) {\r\n this.dashOffset = greasedLineMaterialOptions.dashOffset;\r\n }\r\n if (greasedLineMaterialOptions.width) {\r\n this.width = greasedLineMaterialOptions.width;\r\n }\r\n if (greasedLineMaterialOptions.sizeAttenuation) {\r\n this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation;\r\n }\r\n if (greasedLineMaterialOptions.resolution) {\r\n this.resolution = greasedLineMaterialOptions.resolution;\r\n }\r\n if (greasedLineMaterialOptions.colors) {\r\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, greasedLineMaterialOptions.colors, this.colorsSampling, this.getScene());\r\n } else {\r\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\r\n }\r\n\r\n this._cameraFacing = greasedLineMaterialOptions.cameraFacing ?? true;\r\n this.setDefine(\"GREASED_LINE_CAMERA_FACING\", this._cameraFacing);\r\n }\r\n}\r\n"]}
|
|
@@ -16,6 +16,42 @@ import { PushMaterial } from "../pushMaterial.js";
|
|
|
16
16
|
import { type IAnimatable } from "../../Animations/animatable.interface.js";
|
|
17
17
|
import { type UniformBuffer } from "../../Materials/uniformBuffer.js";
|
|
18
18
|
declare const OpenPBRMaterialDefinesBase_base: {
|
|
19
|
+
new (...args: any[]): {
|
|
20
|
+
PREPASS: boolean;
|
|
21
|
+
PREPASS_COLOR: boolean;
|
|
22
|
+
PREPASS_COLOR_INDEX: number;
|
|
23
|
+
PREPASS_IRRADIANCE_LEGACY: boolean;
|
|
24
|
+
PREPASS_IRRADIANCE_LEGACY_INDEX: number;
|
|
25
|
+
PREPASS_IRRADIANCE: boolean;
|
|
26
|
+
PREPASS_IRRADIANCE_INDEX: number;
|
|
27
|
+
PREPASS_ALBEDO: boolean;
|
|
28
|
+
PREPASS_ALBEDO_INDEX: number;
|
|
29
|
+
PREPASS_ALBEDO_SQRT: boolean;
|
|
30
|
+
PREPASS_ALBEDO_SQRT_INDEX: number;
|
|
31
|
+
PREPASS_DEPTH: boolean;
|
|
32
|
+
PREPASS_DEPTH_INDEX: number;
|
|
33
|
+
PREPASS_SCREENSPACE_DEPTH: boolean;
|
|
34
|
+
PREPASS_SCREENSPACE_DEPTH_INDEX: number;
|
|
35
|
+
PREPASS_NORMALIZED_VIEW_DEPTH: boolean;
|
|
36
|
+
PREPASS_NORMALIZED_VIEW_DEPTH_INDEX: number;
|
|
37
|
+
PREPASS_NORMAL: boolean;
|
|
38
|
+
PREPASS_NORMAL_INDEX: number;
|
|
39
|
+
PREPASS_NORMAL_WORLDSPACE: boolean;
|
|
40
|
+
PREPASS_WORLD_NORMAL: boolean;
|
|
41
|
+
PREPASS_WORLD_NORMAL_INDEX: number;
|
|
42
|
+
PREPASS_POSITION: boolean;
|
|
43
|
+
PREPASS_POSITION_INDEX: number;
|
|
44
|
+
PREPASS_LOCAL_POSITION: boolean;
|
|
45
|
+
PREPASS_LOCAL_POSITION_INDEX: number;
|
|
46
|
+
PREPASS_VELOCITY: boolean;
|
|
47
|
+
PREPASS_VELOCITY_INDEX: number;
|
|
48
|
+
PREPASS_VELOCITY_LINEAR: boolean;
|
|
49
|
+
PREPASS_VELOCITY_LINEAR_INDEX: number;
|
|
50
|
+
PREPASS_REFLECTIVITY: boolean;
|
|
51
|
+
PREPASS_REFLECTIVITY_INDEX: number;
|
|
52
|
+
SCENE_MRT_COUNT: number;
|
|
53
|
+
};
|
|
54
|
+
} & {
|
|
19
55
|
new (...args: any[]): {
|
|
20
56
|
MAINUV1: boolean;
|
|
21
57
|
MAINUV2: boolean;
|
|
@@ -33,6 +69,33 @@ declare const OpenPBRMaterialDefinesBase_base: {
|
|
|
33
69
|
} & typeof MaterialDefines;
|
|
34
70
|
declare class OpenPBRMaterialDefinesBase extends OpenPBRMaterialDefinesBase_base {
|
|
35
71
|
}
|
|
72
|
+
declare const OpenPBRMaterialDefinesWithEnvLighting_base: {
|
|
73
|
+
new (...args: any[]): {
|
|
74
|
+
REFLECTION: boolean;
|
|
75
|
+
REFLECTIONMAP_3D: boolean;
|
|
76
|
+
REFLECTIONMAP_SPHERICAL: boolean;
|
|
77
|
+
REFLECTIONMAP_PLANAR: boolean;
|
|
78
|
+
REFLECTIONMAP_CUBIC: boolean;
|
|
79
|
+
USE_LOCAL_REFLECTIONMAP_CUBIC: boolean;
|
|
80
|
+
REFLECTIONMAP_PROJECTION: boolean;
|
|
81
|
+
REFLECTIONMAP_SKYBOX: boolean;
|
|
82
|
+
REFLECTIONMAP_EXPLICIT: boolean;
|
|
83
|
+
REFLECTIONMAP_EQUIRECTANGULAR: boolean;
|
|
84
|
+
REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
|
|
85
|
+
REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
|
|
86
|
+
INVERTCUBICMAP: boolean;
|
|
87
|
+
USESPHERICALFROMREFLECTIONMAP: boolean;
|
|
88
|
+
USEIRRADIANCEMAP: boolean;
|
|
89
|
+
USE_IRRADIANCE_DOMINANT_DIRECTION: boolean;
|
|
90
|
+
USESPHERICALINVERTEX: boolean;
|
|
91
|
+
REFLECTIONMAP_OPPOSITEZ: boolean;
|
|
92
|
+
LODINREFLECTIONALPHA: boolean;
|
|
93
|
+
GAMMAREFLECTION: boolean;
|
|
94
|
+
RGBDREFLECTION: boolean;
|
|
95
|
+
};
|
|
96
|
+
} & typeof OpenPBRMaterialDefinesBase;
|
|
97
|
+
declare class OpenPBRMaterialDefinesWithEnvLighting extends OpenPBRMaterialDefinesWithEnvLighting_base {
|
|
98
|
+
}
|
|
36
99
|
declare const OpenPBRMaterialDefines_base: {
|
|
37
100
|
new (...args: any[]): {
|
|
38
101
|
IMAGEPROCESSING: boolean;
|
|
@@ -51,7 +114,7 @@ declare const OpenPBRMaterialDefines_base: {
|
|
|
51
114
|
SKIPFINALCOLORCLAMP: boolean;
|
|
52
115
|
EXPOSURE: boolean;
|
|
53
116
|
};
|
|
54
|
-
} & typeof
|
|
117
|
+
} & typeof OpenPBRMaterialDefinesWithEnvLighting;
|
|
55
118
|
/**
|
|
56
119
|
* Manages the defines for the PBR Material.
|
|
57
120
|
* @internal
|
|
@@ -60,6 +123,7 @@ export declare class OpenPBRMaterialDefines extends OpenPBRMaterialDefines_base
|
|
|
60
123
|
NUM_SAMPLES: string;
|
|
61
124
|
REALTIME_FILTERING: boolean;
|
|
62
125
|
IBL_CDF_FILTERING: boolean;
|
|
126
|
+
LIGHTCOUNT: number;
|
|
63
127
|
VERTEXCOLOR: boolean;
|
|
64
128
|
BAKED_VERTEX_ANIMATION_TEXTURE: boolean;
|
|
65
129
|
VERTEXALPHA: boolean;
|
|
@@ -136,6 +200,26 @@ export declare class OpenPBRMaterialDefines extends OpenPBRMaterialDefines_base
|
|
|
136
200
|
* Enables subsurface scattering
|
|
137
201
|
*/
|
|
138
202
|
SCATTERING: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Enables the use of screen-space irradiance texture for scattering
|
|
205
|
+
*/
|
|
206
|
+
USE_IRRADIANCE_TEXTURE_FOR_SCATTERING: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Enables transmission slab
|
|
209
|
+
*/
|
|
210
|
+
TRANSMISSION_SLAB: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Enables transmission slab with volume
|
|
213
|
+
*/
|
|
214
|
+
TRANSMISSION_SLAB_VOLUME: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Enables subsurface slab
|
|
217
|
+
*/
|
|
218
|
+
SUBSURFACE_SLAB: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Enables thin-walled geometry
|
|
221
|
+
*/
|
|
222
|
+
GEOMETRY_THIN_WALLED: boolean;
|
|
139
223
|
/**
|
|
140
224
|
* Refraction of the 2D background texture. Might include the rest of the scene or just the background.
|
|
141
225
|
*/
|
|
@@ -150,63 +234,11 @@ export declare class OpenPBRMaterialDefines extends OpenPBRMaterialDefines_base
|
|
|
150
234
|
REFRACTED_ENVIRONMENT: boolean;
|
|
151
235
|
REFRACTED_ENVIRONMENT_OPPOSITEZ: boolean;
|
|
152
236
|
REFRACTED_ENVIRONMENT_LOCAL_CUBE: boolean;
|
|
153
|
-
REFLECTION: boolean;
|
|
154
|
-
REFLECTIONMAP_3D: boolean;
|
|
155
|
-
REFLECTIONMAP_SPHERICAL: boolean;
|
|
156
|
-
REFLECTIONMAP_PLANAR: boolean;
|
|
157
|
-
REFLECTIONMAP_CUBIC: boolean;
|
|
158
|
-
USE_LOCAL_REFLECTIONMAP_CUBIC: boolean;
|
|
159
|
-
REFLECTIONMAP_PROJECTION: boolean;
|
|
160
|
-
REFLECTIONMAP_SKYBOX: boolean;
|
|
161
|
-
REFLECTIONMAP_EXPLICIT: boolean;
|
|
162
|
-
REFLECTIONMAP_EQUIRECTANGULAR: boolean;
|
|
163
|
-
REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
|
|
164
|
-
REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
|
|
165
|
-
INVERTCUBICMAP: boolean;
|
|
166
|
-
USESPHERICALFROMREFLECTIONMAP: boolean;
|
|
167
|
-
USEIRRADIANCEMAP: boolean;
|
|
168
|
-
USE_IRRADIANCE_DOMINANT_DIRECTION: boolean;
|
|
169
|
-
USESPHERICALINVERTEX: boolean;
|
|
170
|
-
REFLECTIONMAP_OPPOSITEZ: boolean;
|
|
171
|
-
LODINREFLECTIONALPHA: boolean;
|
|
172
|
-
GAMMAREFLECTION: boolean;
|
|
173
|
-
RGBDREFLECTION: boolean;
|
|
174
237
|
RADIANCEOCCLUSION: boolean;
|
|
175
238
|
HORIZONOCCLUSION: boolean;
|
|
176
239
|
INSTANCES: boolean;
|
|
177
240
|
THIN_INSTANCES: boolean;
|
|
178
241
|
INSTANCESCOLOR: boolean;
|
|
179
|
-
PREPASS: boolean;
|
|
180
|
-
PREPASS_COLOR: boolean;
|
|
181
|
-
PREPASS_COLOR_INDEX: number;
|
|
182
|
-
PREPASS_IRRADIANCE: boolean;
|
|
183
|
-
PREPASS_IRRADIANCE_INDEX: number;
|
|
184
|
-
PREPASS_ALBEDO: boolean;
|
|
185
|
-
PREPASS_ALBEDO_INDEX: number;
|
|
186
|
-
PREPASS_ALBEDO_SQRT: boolean;
|
|
187
|
-
PREPASS_ALBEDO_SQRT_INDEX: number;
|
|
188
|
-
PREPASS_DEPTH: boolean;
|
|
189
|
-
PREPASS_DEPTH_INDEX: number;
|
|
190
|
-
PREPASS_SCREENSPACE_DEPTH: boolean;
|
|
191
|
-
PREPASS_SCREENSPACE_DEPTH_INDEX: number;
|
|
192
|
-
PREPASS_NORMALIZED_VIEW_DEPTH: boolean;
|
|
193
|
-
PREPASS_NORMALIZED_VIEW_DEPTH_INDEX: number;
|
|
194
|
-
PREPASS_NORMAL: boolean;
|
|
195
|
-
PREPASS_NORMAL_INDEX: number;
|
|
196
|
-
PREPASS_NORMAL_WORLDSPACE: boolean;
|
|
197
|
-
PREPASS_WORLD_NORMAL: boolean;
|
|
198
|
-
PREPASS_WORLD_NORMAL_INDEX: number;
|
|
199
|
-
PREPASS_POSITION: boolean;
|
|
200
|
-
PREPASS_POSITION_INDEX: number;
|
|
201
|
-
PREPASS_LOCAL_POSITION: boolean;
|
|
202
|
-
PREPASS_LOCAL_POSITION_INDEX: number;
|
|
203
|
-
PREPASS_VELOCITY: boolean;
|
|
204
|
-
PREPASS_VELOCITY_INDEX: number;
|
|
205
|
-
PREPASS_VELOCITY_LINEAR: boolean;
|
|
206
|
-
PREPASS_VELOCITY_LINEAR_INDEX: number;
|
|
207
|
-
PREPASS_REFLECTIVITY: boolean;
|
|
208
|
-
PREPASS_REFLECTIVITY_INDEX: number;
|
|
209
|
-
SCENE_MRT_COUNT: number;
|
|
210
242
|
NUM_BONE_INFLUENCERS: number;
|
|
211
243
|
BonesPerMesh: number;
|
|
212
244
|
BONETEXTURE: boolean;
|
|
@@ -485,6 +517,54 @@ export declare class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
485
517
|
*/
|
|
486
518
|
transmissionDispersionAbbeNumber: number;
|
|
487
519
|
private _transmissionDispersionAbbeNumber;
|
|
520
|
+
/**
|
|
521
|
+
* Defines the amount of subsurface scattering on the surface.
|
|
522
|
+
* See OpenPBR's specs for subsurface_weight
|
|
523
|
+
*/
|
|
524
|
+
subsurfaceWeight: number;
|
|
525
|
+
private _subsurfaceWeight;
|
|
526
|
+
/**
|
|
527
|
+
* Subsurface weight texture.
|
|
528
|
+
* See OpenPBR's specs for subsurface_weight
|
|
529
|
+
*/
|
|
530
|
+
subsurfaceWeightTexture: Nullable<BaseTexture>;
|
|
531
|
+
private _subsurfaceWeightTexture;
|
|
532
|
+
/**
|
|
533
|
+
* Defines the color of the subsurface scattering in the volume.
|
|
534
|
+
* See OpenPBR's specs for subsurface_color
|
|
535
|
+
*/
|
|
536
|
+
subsurfaceColor: Color3;
|
|
537
|
+
private _subsurfaceColor;
|
|
538
|
+
/**
|
|
539
|
+
* Subsurface color texture.
|
|
540
|
+
* See OpenPBR's specs for subsurface_color
|
|
541
|
+
*/
|
|
542
|
+
subsurfaceColorTexture: Nullable<BaseTexture>;
|
|
543
|
+
private _subsurfaceColorTexture;
|
|
544
|
+
/**
|
|
545
|
+
* Defines the radius of the subsurface scattering in the volume.
|
|
546
|
+
* See OpenPBR's specs for subsurface_radius
|
|
547
|
+
*/
|
|
548
|
+
subsurfaceRadius: number;
|
|
549
|
+
private _subsurfaceRadius;
|
|
550
|
+
/**
|
|
551
|
+
* Defines the scale factor applied to the subsurface radius.
|
|
552
|
+
* See OpenPBR's specs for subsurface_radius_scale
|
|
553
|
+
*/
|
|
554
|
+
subsurfaceRadiusScale: Color3;
|
|
555
|
+
private _subsurfaceRadiusScale;
|
|
556
|
+
/**
|
|
557
|
+
* Subsurface radius scale texture.
|
|
558
|
+
* See OpenPBR's specs for subsurface_radius_scale
|
|
559
|
+
*/
|
|
560
|
+
subsurfaceRadiusScaleTexture: Nullable<BaseTexture>;
|
|
561
|
+
private _subsurfaceRadiusScaleTexture;
|
|
562
|
+
/**
|
|
563
|
+
* Defines the anisotropy of the subsurface scattering in the volume.
|
|
564
|
+
* See OpenPBR's specs for subsurface_scatter_anisotropy
|
|
565
|
+
*/
|
|
566
|
+
subsurfaceScatterAnisotropy: number;
|
|
567
|
+
private _subsurfaceScatterAnisotropy;
|
|
488
568
|
/**
|
|
489
569
|
* Defines the amount of clear coat on the surface.
|
|
490
570
|
* See OpenPBR's specs for coat_weight
|
|
@@ -596,6 +676,12 @@ export declare class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
596
676
|
*/
|
|
597
677
|
fuzzRoughnessTexture: Nullable<BaseTexture>;
|
|
598
678
|
private _fuzzRoughnessTexture;
|
|
679
|
+
/**
|
|
680
|
+
* Defines whether the geometry is thin-walled (like a sheet of paper) or not.
|
|
681
|
+
* See OpenPBR's specs for geometry_thin_walled
|
|
682
|
+
*/
|
|
683
|
+
geometryThinWalled: number;
|
|
684
|
+
private _geometryThinWalled;
|
|
599
685
|
/**
|
|
600
686
|
* Defines the normal of the material's geometry.
|
|
601
687
|
* See OpenPBR's specs for geometry_normal
|
|
@@ -725,6 +811,16 @@ export declare class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
725
811
|
*/
|
|
726
812
|
ambientOcclusionTexture: Nullable<BaseTexture>;
|
|
727
813
|
private _ambientOcclusionTexture;
|
|
814
|
+
/**
|
|
815
|
+
* Defines the irradiance texture used for subsurface scattering.
|
|
816
|
+
* If it's not provided, the irradiance will be looked for in the scene.geometryBufferRenderer.
|
|
817
|
+
*/
|
|
818
|
+
sssIrradianceTexture: Nullable<BaseTexture>;
|
|
819
|
+
/**
|
|
820
|
+
* Defines the depth texture used for subsurface scattering. This is the depth defined
|
|
821
|
+
* in screen space. If it's not provided, the depth will be looked for in the scene.geometryBufferRenderer.
|
|
822
|
+
*/
|
|
823
|
+
sssDepthTexture: Nullable<BaseTexture>;
|
|
728
824
|
private _propertyList;
|
|
729
825
|
private _uniformsList;
|
|
730
826
|
private _samplersList;
|
|
@@ -760,6 +856,12 @@ export declare class OpenPBRMaterial extends OpenPBRMaterialBase {
|
|
|
760
856
|
* Specifies if the ambient texture contains the ambient occlusion information in its red channel only.
|
|
761
857
|
*/
|
|
762
858
|
useAmbientInGrayScale: boolean;
|
|
859
|
+
/**
|
|
860
|
+
* Specifies if we can see through the surface of the material due to subsurface scattering or transmission.
|
|
861
|
+
*/
|
|
862
|
+
get hasTransparency(): boolean;
|
|
863
|
+
/** Specifies if the material has scattering properties such as subsurface scattering or transmission scattering. */
|
|
864
|
+
get hasScattering(): boolean;
|
|
763
865
|
/**
|
|
764
866
|
* BJS is using an hardcoded light falloff based on a manually sets up range.
|
|
765
867
|
* In PBR, one way to represents the falloff is to use the inverse squared root algorithm.
|