446becc5d805f40747466a74ec38438c147a07895a9afe7917e245b3bb8facc5.json 46 KB

1
  1. {"ast":null,"code":"import { RawTexture } from \"../Textures/rawTexture.js\";\nimport { ShaderMaterial } from \"../shaderMaterial.js\";\nimport { Color3 } from \"../../Maths/math.color.js\";\nimport { Vector2 } from \"../../Maths/math.vector.js\";\nimport \"../../Shaders/greasedLine.fragment.js\";\nimport \"../../Shaders/greasedLine.vertex.js\";\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools.js\";\nimport { GreasedLineMaterialDefaults } from \"./greasedLineMaterialDefaults.js\";\n/**\n * GreasedLineSimpleMaterial\n */\nexport class GreasedLineSimpleMaterial extends ShaderMaterial {\n /**\n * GreasedLineSimple material constructor\n * @param name material name\n * @param scene the scene\n * @param options material options\n */\n constructor(name, scene, options) {\n var _options$visibility, _options$useDash, _options$dashRatio, _options$dashOffset, _options$dashCount, _options$sizeAttenuat, _options$color, _options$useColors, _options$colorDistrib, _options$colorsSampli, _options$colorMode, _options$colors, _options$cameraFacing, _options$resolution;\n const defines = [`COLOR_DISTRIBUTION_TYPE_LINE ${1 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE */}.`, `COLOR_DISTRIBUTION_TYPE_SEGMENT ${0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */}.`, `COLOR_MODE_SET ${0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */}.`, `COLOR_MODE_ADD ${1 /* GreasedLineMeshColorMode.COLOR_MODE_ADD */}.`, `COLOR_MODE_MULTIPLY ${2 /* GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY */}.`];\n const attributes = [\"position\", \"grl_widths\", \"grl_offsets\", \"grl_colorPointers\"];\n scene.useRightHandedSystem && defines.push(\"GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\");\n if (options.cameraFacing) {\n defines.push(\"GREASED_LINE_CAMERA_FACING\");\n attributes.push(\"grl_previousAndSide\", \"grl_nextAndCounters\");\n } else {\n attributes.push(\"grl_slopes\");\n attributes.push(\"grl_counters\");\n }\n super(name, scene, {\n vertex: \"greasedLine\",\n fragment: \"greasedLine\"\n }, {\n attributes,\n uniforms: [\"world\", \"viewProjection\", \"view\", \"projection\", \"grlColorsWidth\", \"grlUseColors\", \"grlWidth\", \"grlColor\", \"grl_colorModeAndColorDistributionType\", \"grlResolution\", \"grlAspect\", \"grlAizeAttenuation\", \"grlDashArray\", \"grlDashOffset\", \"grlDashRatio\", \"grlUseDash\", \"grlVisibility\"],\n samplers: [\"grlColors\"],\n defines\n });\n this._color = Color3.White();\n this._colorsDistributionType = 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;\n this._colorsTexture = null;\n options = options || {\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR\n };\n const engine = scene.getEngine();\n this.visibility = (_options$visibility = options.visibility) !== null && _options$visibility !== void 0 ? _options$visibility : 1;\n this.useDash = (_options$useDash = options.useDash) !== null && _options$useDash !== void 0 ? _options$useDash : false;\n this.dashRatio = (_options$dashRatio = options.dashRatio) !== null && _options$dashRatio !== void 0 ? _options$dashRatio : 0.5;\n this.dashOffset = (_options$dashOffset = options.dashOffset) !== null && _options$dashOffset !== void 0 ? _options$dashOffset : 0;\n this.dashCount = (_options$dashCount = options.dashCount) !== null && _options$dashCount !== void 0 ? _options$dashCount : 1; // calculate the _dashArray value, call the setter\n this.width = options.width ? options.width : options.sizeAttenuation && options.cameraFacing ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED : GreasedLineMaterialDefaults.DEFAULT_WIDTH;\n this.sizeAttenuation = (_options$sizeAttenuat = options.sizeAttenuation) !== null && _options$sizeAttenuat !== void 0 ? _options$sizeAttenuat : false;\n this.color = (_options$color = options.color) !== null && _options$color !== void 0 ? _options$color : Color3.White();\n this.useColors = (_options$useColors = options.useColors) !== null && _options$useColors !== void 0 ? _options$useColors : false;\n this.colorsDistributionType = (_options$colorDistrib = options.colorDistributionType) !== null && _options$colorDistrib !== void 0 ? _options$colorDistrib : 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;\n this.colorsSampling = (_options$colorsSampli = options.colorsSampling) !== null && _options$colorsSampli !== void 0 ? _options$colorsSampli : RawTexture.NEAREST_NEAREST;\n this.colorMode = (_options$colorMode = options.colorMode) !== null && _options$colorMode !== void 0 ? _options$colorMode : 0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */;\n this._colors = (_options$colors = options.colors) !== null && _options$colors !== void 0 ? _options$colors : null;\n this._cameraFacing = (_options$cameraFacing = options.cameraFacing) !== null && _options$cameraFacing !== void 0 ? _options$cameraFacing : true;\n this.resolution = (_options$resolution = options.resolution) !== null && _options$resolution !== void 0 ? _options$resolution : new Vector2(engine.getRenderWidth(), engine.getRenderHeight()); // calculate aspect call the setter\n if (options.colorsTexture) {\n this.colorsTexture = options.colorsTexture;\n } else {\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\n }\n if (this._colors) {\n if (this.useColors) {\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, this._colors, this.colorsSampling, scene);\n }\n }\n engine.onDisposeObservable.add(() => {\n GreasedLineTools.DisposeEmptyColorsTexture();\n });\n }\n /**\n * Disposes the plugin material.\n */\n dispose() {\n var _this$_colorsTexture;\n (_this$_colorsTexture = this._colorsTexture) === null || _this$_colorsTexture === void 0 || _this$_colorsTexture.dispose();\n super.dispose();\n }\n _setColorModeAndColorDistributionType() {\n this.setVector2(\"grl_colorModeAndColorDistributionType\", new Vector2(this._colorMode, this._colorsDistributionType));\n }\n /**\n * Updates the material. Use when material created in lazy mode.\n */\n updateLazy() {\n if (this._colors) {\n this.setColors(this._colors, false, true);\n }\n }\n /**\n * Returns the colors used to colorize the line\n */\n get colors() {\n return this._colors;\n }\n /**\n * Sets the colors used to colorize the line\n */\n set colors(value) {\n this.setColors(value);\n }\n /**\n * Creates or updates the colors texture\n * @param colors color table RGBA\n * @param lazy if lazy, the colors are not updated\n * @param forceNewTexture force creation of a new texture\n */\n setColors(colors, lazy = false, forceNewTexture = false) {\n var _this$_colors$length, _this$_colors;\n const origColorsCount = (_this$_colors$length = (_this$_colors = this._colors) === null || _this$_colors === void 0 ? void 0 : _this$_colors.length) !== null && _this$_colors$length !== void 0 ? _this$_colors$length : 0;\n this._colors = colors;\n if (colors === null || colors.length === 0) {\n var _this$_colorsTexture2;\n (_this$_colorsTexture2 = this._colorsTexture) === null || _this$_colorsTexture2 === void 0 || _this$_colorsTexture2.dispose();\n return;\n }\n if (lazy && !forceNewTexture) {\n return;\n }\n if (this._colorsTexture && origColorsCount === colors.length && !forceNewTexture) {\n const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);\n this._colorsTexture.update(colorArray);\n } else {\n var _this$_colorsTexture3;\n (_this$_colorsTexture3 = this._colorsTexture) === null || _this$_colorsTexture3 === void 0 || _this$_colorsTexture3.dispose();\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, colors, this.colorsSampling, this.getScene());\n }\n }\n /**\n * Gets the colors texture\n */\n get colorsTexture() {\n var _this$_colorsTexture4;\n return (_this$_colorsTexture4 = this._colorsTexture) !== null && _this$_colorsTexture4 !== void 0 ? _this$_colorsTexture4 : null;\n }\n /**\n * Sets the colorsTexture\n */\n set colorsTexture(value) {\n this._colorsTexture = value;\n this.setFloat(\"grlColorsWidth\", this._colorsTexture.getSize().width);\n this.setTexture(\"grlColors\", this._colorsTexture);\n }\n /**\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\n */\n get width() {\n return this._width;\n }\n /**\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\n */\n set width(value) {\n this._width = value;\n this.setFloat(\"grlWidth\", value);\n }\n /**\n * Whether to use the colors option to colorize the line\n */\n get useColors() {\n return this._useColors;\n }\n set useColors(value) {\n this._useColors = value;\n this.setFloat(\"grlUseColors\", GreasedLineTools.BooleanToNumber(value));\n }\n /**\n * The type of sampling of the colors texture. The values are the same when using with textures.\n */\n get colorsSampling() {\n return this._colorsSampling;\n }\n /**\n * The type of sampling of the colors texture. The values are the same when using with textures.\n */\n set colorsSampling(value) {\n this._colorsSampling = value;\n }\n /**\n * Normalized value of how much of the line will be visible\n * 0 - 0% of the line will be visible\n * 1 - 100% of the line will be visible\n */\n get visibility() {\n return this._visibility;\n }\n set visibility(value) {\n this._visibility = value;\n this.setFloat(\"grlVisibility\", value);\n }\n /**\n * Turns on/off dash mode\n */\n get useDash() {\n return this._useDash;\n }\n /**\n * Turns on/off dash mode\n */\n set useDash(value) {\n this._useDash = value;\n this.setFloat(\"grlUseDash\", GreasedLineTools.BooleanToNumber(value));\n }\n /**\n * Gets the dash offset\n */\n get dashOffset() {\n return this._dashOffset;\n }\n /**\n * Sets the dash offset\n */\n set dashOffset(value) {\n this._dashOffset = value;\n this.setFloat(\"grlDashOffset\", value);\n }\n /**\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\n */\n get dashRatio() {\n return this._dashRatio;\n }\n /**\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\n */\n set dashRatio(value) {\n this._dashRatio = value;\n this.setFloat(\"grlDashRatio\", value);\n }\n /**\n * Gets the number of dashes in the line\n */\n get dashCount() {\n return this._dashCount;\n }\n /**\n * Sets the number of dashes in the line\n * @param value dash\n */\n set dashCount(value) {\n this._dashCount = value;\n this._dashArray = 1 / value;\n this.setFloat(\"grlDashArray\", this._dashArray);\n }\n /**\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\n */\n get sizeAttenuation() {\n return this._sizeAttenuation;\n }\n /**\n * Turn on/off attenuation of the width option and widths array.\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\n */\n set sizeAttenuation(value) {\n this._sizeAttenuation = value;\n this.setFloat(\"grlSizeAttenuation\", GreasedLineTools.BooleanToNumber(value));\n }\n /**\n * Gets the color of the line\n */\n get color() {\n return this._color;\n }\n /**\n * Sets the color of the line\n * @param value Color3\n */\n set color(value) {\n this.setColor(value);\n }\n /**\n * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.\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).\n * @param value color\n */\n setColor(value) {\n var _value;\n value = (_value = value) !== null && _value !== void 0 ? _value : GreasedLineMaterialDefaults.DEFAULT_COLOR;\n this._color = value;\n this.setColor3(\"grlColor\", value);\n }\n /**\n * Gets the color distributiopn type\n */\n get colorsDistributionType() {\n return this._colorsDistributionType;\n }\n /**\n * Sets the color distribution type\n * @see GreasedLineMeshColorDistributionType\n * @param value color distribution type\n */\n set colorsDistributionType(value) {\n this._colorsDistributionType = value;\n this._setColorModeAndColorDistributionType();\n }\n /**\n * Gets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\n * @see GreasedLineMeshColorMode\n */\n get colorMode() {\n return this._colorMode;\n }\n /**\n * Sets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\n * @see GreasedLineMeshColorMode\n */\n set colorMode(value) {\n this._colorMode = value;\n this._setColorModeAndColorDistributionType();\n }\n /**\n * Gets the resolution\n */\n get resolution() {\n return this._resolution;\n }\n /**\n * Sets the resolution\n * @param value resolution of the screen for GreasedLine\n */\n set resolution(value) {\n this._resolution = value;\n this.setVector2(\"grlResolution\", value);\n this.setFloat(\"grlAspect\", value.x / value.y);\n }\n /**\n * Serializes this plugin material\n * @returns serializationObjec\n */\n serialize() {\n const serializationObject = super.serialize();\n const greasedLineMaterialOptions = {\n colorDistributionType: this._colorsDistributionType,\n colorsSampling: this._colorsSampling,\n colorMode: this._colorMode,\n color: this._color,\n dashCount: this._dashCount,\n dashOffset: this._dashOffset,\n dashRatio: this._dashRatio,\n resolution: this._resolution,\n sizeAttenuation: this._sizeAttenuation,\n useColors: this._useColors,\n useDash: this._useDash,\n visibility: this._visibility,\n width: this._width,\n cameraFacing: this._cameraFacing\n };\n this._colors && (greasedLineMaterialOptions.colors = this._colors);\n serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;\n return serializationObject;\n }\n /**\n * Parses a serialized objects\n * @param source serialized object\n * @param scene scene\n * @param _rootUrl root url for textures\n */\n parse(source, scene, _rootUrl) {\n var _this$_colorsTexture5, _greasedLineMaterialO;\n // TODO: super.parse?\n const greasedLineMaterialOptions = source.greasedLineMaterialOptions;\n (_this$_colorsTexture5 = this._colorsTexture) === null || _this$_colorsTexture5 === void 0 || _this$_colorsTexture5.dispose();\n greasedLineMaterialOptions.color && (this.color = greasedLineMaterialOptions.color);\n greasedLineMaterialOptions.colorDistributionType && (this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType);\n greasedLineMaterialOptions.colorsSampling && (this.colorsSampling = greasedLineMaterialOptions.colorsSampling);\n greasedLineMaterialOptions.colorMode && (this.colorMode = greasedLineMaterialOptions.colorMode);\n greasedLineMaterialOptions.useColors && (this.useColors = greasedLineMaterialOptions.useColors);\n greasedLineMaterialOptions.visibility && (this.visibility = greasedLineMaterialOptions.visibility);\n greasedLineMaterialOptions.useDash && (this.useDash = greasedLineMaterialOptions.useDash);\n greasedLineMaterialOptions.dashCount && (this.dashCount = greasedLineMaterialOptions.dashCount);\n greasedLineMaterialOptions.dashRatio && (this.dashRatio = greasedLineMaterialOptions.dashRatio);\n greasedLineMaterialOptions.dashOffset && (this.dashOffset = greasedLineMaterialOptions.dashOffset);\n greasedLineMaterialOptions.width && (this.width = greasedLineMaterialOptions.width);\n greasedLineMaterialOptions.sizeAttenuation && (this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation);\n greasedLineMaterialOptions.resolution && (this.resolution = greasedLineMaterialOptions.resolution);\n if (greasedLineMaterialOptions.colors) {\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, greasedLineMaterialOptions.colors, this.colorsSampling, this.getScene());\n } else {\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\n }\n this._cameraFacing = (_greasedLineMaterialO = greasedLineMaterialOptions.cameraFacing) !== null && _greasedLineMaterialO !== void 0 ? _greasedLineMaterialO : true;\n this.setDefine(\"GREASED_LINE_CAMERA_FACING\", this._cameraFacing);\n }\n}","map":{"version":3,"names":["RawTexture","ShaderMaterial","Color3","Vector2","GreasedLineTools","GreasedLineMaterialDefaults","GreasedLineSimpleMaterial","constructor","name","scene","options","_options$visibility","_options$useDash","_options$dashRatio","_options$dashOffset","_options$dashCount","_options$sizeAttenuat","_options$color","_options$useColors","_options$colorDistrib","_options$colorsSampli","_options$colorMode","_options$colors","_options$cameraFacing","_options$resolution","defines","attributes","useRightHandedSystem","push","cameraFacing","vertex","fragment","uniforms","samplers","_color","White","_colorsDistributionType","_colorsTexture","color","DEFAULT_COLOR","engine","getEngine","visibility","useDash","dashRatio","dashOffset","dashCount","width","sizeAttenuation","DEFAULT_WIDTH_ATTENUATED","DEFAULT_WIDTH","useColors","colorsDistributionType","colorDistributionType","colorsSampling","NEAREST_NEAREST","colorMode","_colors","colors","_cameraFacing","resolution","getRenderWidth","getRenderHeight","colorsTexture","PrepareEmptyColorsTexture","CreateColorsTexture","onDisposeObservable","add","DisposeEmptyColorsTexture","dispose","_this$_colorsTexture","_setColorModeAndColorDistributionType","setVector2","_colorMode","updateLazy","setColors","value","lazy","forceNewTexture","_this$_colors$length","_this$_colors","origColorsCount","length","_this$_colorsTexture2","colorArray","Color3toRGBAUint8","update","_this$_colorsTexture3","getScene","_this$_colorsTexture4","setFloat","getSize","setTexture","_width","_useColors","BooleanToNumber","_colorsSampling","_visibility","_useDash","_dashOffset","_dashRatio","_dashCount","_dashArray","_sizeAttenuation","setColor","_value","setColor3","_resolution","x","y","serialize","serializationObject","greasedLineMaterialOptions","parse","source","_rootUrl","_this$_colorsTexture5","_greasedLineMaterialO","setDefine"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/GreasedLine/greasedLineSimpleMaterial.js"],"sourcesContent":["import { RawTexture } from \"../Textures/rawTexture.js\";\nimport { ShaderMaterial } from \"../shaderMaterial.js\";\nimport { Color3 } from \"../../Maths/math.color.js\";\nimport { Vector2 } from \"../../Maths/math.vector.js\";\nimport \"../../Shaders/greasedLine.fragment.js\";\nimport \"../../Shaders/greasedLine.vertex.js\";\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools.js\";\nimport { GreasedLineMaterialDefaults } from \"./greasedLineMaterialDefaults.js\";\n/**\n * GreasedLineSimpleMaterial\n */\nexport class GreasedLineSimpleMaterial extends ShaderMaterial {\n /**\n * GreasedLineSimple material constructor\n * @param name material name\n * @param scene the scene\n * @param options material options\n */\n constructor(name, scene, options) {\n const defines = [\n `COLOR_DISTRIBUTION_TYPE_LINE ${1 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_LINE */}.`,\n `COLOR_DISTRIBUTION_TYPE_SEGMENT ${0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */}.`,\n `COLOR_MODE_SET ${0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */}.`,\n `COLOR_MODE_ADD ${1 /* GreasedLineMeshColorMode.COLOR_MODE_ADD */}.`,\n `COLOR_MODE_MULTIPLY ${2 /* GreasedLineMeshColorMode.COLOR_MODE_MULTIPLY */}.`,\n ];\n const attributes = [\"position\", \"grl_widths\", \"grl_offsets\", \"grl_colorPointers\"];\n scene.useRightHandedSystem && defines.push(\"GREASED_LINE_RIGHT_HANDED_COORDINATE_SYSTEM\");\n if (options.cameraFacing) {\n defines.push(\"GREASED_LINE_CAMERA_FACING\");\n attributes.push(\"grl_previousAndSide\", \"grl_nextAndCounters\");\n }\n else {\n attributes.push(\"grl_slopes\");\n attributes.push(\"grl_counters\");\n }\n super(name, scene, {\n vertex: \"greasedLine\",\n fragment: \"greasedLine\",\n }, {\n attributes,\n uniforms: [\n \"world\",\n \"viewProjection\",\n \"view\",\n \"projection\",\n \"grlColorsWidth\",\n \"grlUseColors\",\n \"grlWidth\",\n \"grlColor\",\n \"grl_colorModeAndColorDistributionType\",\n \"grlResolution\",\n \"grlAspect\",\n \"grlAizeAttenuation\",\n \"grlDashArray\",\n \"grlDashOffset\",\n \"grlDashRatio\",\n \"grlUseDash\",\n \"grlVisibility\",\n ],\n samplers: [\"grlColors\"],\n defines,\n });\n this._color = Color3.White();\n this._colorsDistributionType = 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;\n this._colorsTexture = null;\n options = options || {\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\n };\n const engine = scene.getEngine();\n this.visibility = options.visibility ?? 1;\n this.useDash = options.useDash ?? false;\n this.dashRatio = options.dashRatio ?? 0.5;\n this.dashOffset = options.dashOffset ?? 0;\n this.dashCount = options.dashCount ?? 1; // calculate the _dashArray value, call the setter\n this.width = options.width\n ? options.width\n : options.sizeAttenuation && options.cameraFacing\n ? GreasedLineMaterialDefaults.DEFAULT_WIDTH_ATTENUATED\n : GreasedLineMaterialDefaults.DEFAULT_WIDTH;\n this.sizeAttenuation = options.sizeAttenuation ?? false;\n this.color = options.color ?? Color3.White();\n this.useColors = options.useColors ?? false;\n this.colorsDistributionType = options.colorDistributionType ?? 0 /* GreasedLineMeshColorDistributionType.COLOR_DISTRIBUTION_TYPE_SEGMENT */;\n this.colorsSampling = options.colorsSampling ?? RawTexture.NEAREST_NEAREST;\n this.colorMode = options.colorMode ?? 0 /* GreasedLineMeshColorMode.COLOR_MODE_SET */;\n this._colors = options.colors ?? null;\n this._cameraFacing = options.cameraFacing ?? true;\n this.resolution = options.resolution ?? new Vector2(engine.getRenderWidth(), engine.getRenderHeight()); // calculate aspect call the setter\n if (options.colorsTexture) {\n this.colorsTexture = options.colorsTexture;\n }\n else {\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\n }\n if (this._colors) {\n if (this.useColors) {\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, this._colors, this.colorsSampling, scene);\n }\n }\n engine.onDisposeObservable.add(() => {\n GreasedLineTools.DisposeEmptyColorsTexture();\n });\n }\n /**\n * Disposes the plugin material.\n */\n dispose() {\n this._colorsTexture?.dispose();\n super.dispose();\n }\n _setColorModeAndColorDistributionType() {\n this.setVector2(\"grl_colorModeAndColorDistributionType\", new Vector2(this._colorMode, this._colorsDistributionType));\n }\n /**\n * Updates the material. Use when material created in lazy mode.\n */\n updateLazy() {\n if (this._colors) {\n this.setColors(this._colors, false, true);\n }\n }\n /**\n * Returns the colors used to colorize the line\n */\n get colors() {\n return this._colors;\n }\n /**\n * Sets the colors used to colorize the line\n */\n set colors(value) {\n this.setColors(value);\n }\n /**\n * Creates or updates the colors texture\n * @param colors color table RGBA\n * @param lazy if lazy, the colors are not updated\n * @param forceNewTexture force creation of a new texture\n */\n setColors(colors, lazy = false, forceNewTexture = false) {\n const origColorsCount = this._colors?.length ?? 0;\n this._colors = colors;\n if (colors === null || colors.length === 0) {\n this._colorsTexture?.dispose();\n return;\n }\n if (lazy && !forceNewTexture) {\n return;\n }\n if (this._colorsTexture && origColorsCount === colors.length && !forceNewTexture) {\n const colorArray = GreasedLineTools.Color3toRGBAUint8(colors);\n this._colorsTexture.update(colorArray);\n }\n else {\n this._colorsTexture?.dispose();\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, colors, this.colorsSampling, this.getScene());\n }\n }\n /**\n * Gets the colors texture\n */\n get colorsTexture() {\n return this._colorsTexture ?? null;\n }\n /**\n * Sets the colorsTexture\n */\n set colorsTexture(value) {\n this._colorsTexture = value;\n this.setFloat(\"grlColorsWidth\", this._colorsTexture.getSize().width);\n this.setTexture(\"grlColors\", this._colorsTexture);\n }\n /**\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\n */\n get width() {\n return this._width;\n }\n /**\n * Line base width. At each point the line width is calculated by widths[pointIndex] * width\n */\n set width(value) {\n this._width = value;\n this.setFloat(\"grlWidth\", value);\n }\n /**\n * Whether to use the colors option to colorize the line\n */\n get useColors() {\n return this._useColors;\n }\n set useColors(value) {\n this._useColors = value;\n this.setFloat(\"grlUseColors\", GreasedLineTools.BooleanToNumber(value));\n }\n /**\n * The type of sampling of the colors texture. The values are the same when using with textures.\n */\n get colorsSampling() {\n return this._colorsSampling;\n }\n /**\n * The type of sampling of the colors texture. The values are the same when using with textures.\n */\n set colorsSampling(value) {\n this._colorsSampling = value;\n }\n /**\n * Normalized value of how much of the line will be visible\n * 0 - 0% of the line will be visible\n * 1 - 100% of the line will be visible\n */\n get visibility() {\n return this._visibility;\n }\n set visibility(value) {\n this._visibility = value;\n this.setFloat(\"grlVisibility\", value);\n }\n /**\n * Turns on/off dash mode\n */\n get useDash() {\n return this._useDash;\n }\n /**\n * Turns on/off dash mode\n */\n set useDash(value) {\n this._useDash = value;\n this.setFloat(\"grlUseDash\", GreasedLineTools.BooleanToNumber(value));\n }\n /**\n * Gets the dash offset\n */\n get dashOffset() {\n return this._dashOffset;\n }\n /**\n * Sets the dash offset\n */\n set dashOffset(value) {\n this._dashOffset = value;\n this.setFloat(\"grlDashOffset\", value);\n }\n /**\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\n */\n get dashRatio() {\n return this._dashRatio;\n }\n /**\n * Length of the dash. 0 to 1. 0.5 means half empty, half drawn.\n */\n set dashRatio(value) {\n this._dashRatio = value;\n this.setFloat(\"grlDashRatio\", value);\n }\n /**\n * Gets the number of dashes in the line\n */\n get dashCount() {\n return this._dashCount;\n }\n /**\n * Sets the number of dashes in the line\n * @param value dash\n */\n set dashCount(value) {\n this._dashCount = value;\n this._dashArray = 1 / value;\n this.setFloat(\"grlDashArray\", this._dashArray);\n }\n /**\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\n */\n get sizeAttenuation() {\n return this._sizeAttenuation;\n }\n /**\n * Turn on/off attenuation of the width option and widths array.\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\n */\n set sizeAttenuation(value) {\n this._sizeAttenuation = value;\n this.setFloat(\"grlSizeAttenuation\", GreasedLineTools.BooleanToNumber(value));\n }\n /**\n * Gets the color of the line\n */\n get color() {\n return this._color;\n }\n /**\n * Sets the color of the line\n * @param value Color3\n */\n set color(value) {\n this.setColor(value);\n }\n /**\n * Sets the color of the line. If set the whole line will be mixed with this color according to the colorMode option.\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).\n * @param value color\n */\n setColor(value) {\n value = value ?? GreasedLineMaterialDefaults.DEFAULT_COLOR;\n this._color = value;\n this.setColor3(\"grlColor\", value);\n }\n /**\n * Gets the color distributiopn type\n */\n get colorsDistributionType() {\n return this._colorsDistributionType;\n }\n /**\n * Sets the color distribution type\n * @see GreasedLineMeshColorDistributionType\n * @param value color distribution type\n */\n set colorsDistributionType(value) {\n this._colorsDistributionType = value;\n this._setColorModeAndColorDistributionType();\n }\n /**\n * Gets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\n * @see GreasedLineMeshColorMode\n */\n get colorMode() {\n return this._colorMode;\n }\n /**\n * Sets the mixing mode of the color and colors paramaters. Default value is GreasedLineMeshColorMode.SET.\n * MATERIAL_TYPE_SIMPLE mixes the color and colors of the greased line material.\n * @see GreasedLineMeshColorMode\n */\n set colorMode(value) {\n this._colorMode = value;\n this._setColorModeAndColorDistributionType();\n }\n /**\n * Gets the resolution\n */\n get resolution() {\n return this._resolution;\n }\n /**\n * Sets the resolution\n * @param value resolution of the screen for GreasedLine\n */\n set resolution(value) {\n this._resolution = value;\n this.setVector2(\"grlResolution\", value);\n this.setFloat(\"grlAspect\", value.x / value.y);\n }\n /**\n * Serializes this plugin material\n * @returns serializationObjec\n */\n serialize() {\n const serializationObject = super.serialize();\n const greasedLineMaterialOptions = {\n colorDistributionType: this._colorsDistributionType,\n colorsSampling: this._colorsSampling,\n colorMode: this._colorMode,\n color: this._color,\n dashCount: this._dashCount,\n dashOffset: this._dashOffset,\n dashRatio: this._dashRatio,\n resolution: this._resolution,\n sizeAttenuation: this._sizeAttenuation,\n useColors: this._useColors,\n useDash: this._useDash,\n visibility: this._visibility,\n width: this._width,\n cameraFacing: this._cameraFacing,\n };\n this._colors && (greasedLineMaterialOptions.colors = this._colors);\n serializationObject.greasedLineMaterialOptions = greasedLineMaterialOptions;\n return serializationObject;\n }\n /**\n * Parses a serialized objects\n * @param source serialized object\n * @param scene scene\n * @param _rootUrl root url for textures\n */\n parse(source, scene, _rootUrl) {\n // TODO: super.parse?\n const greasedLineMaterialOptions = source.greasedLineMaterialOptions;\n this._colorsTexture?.dispose();\n greasedLineMaterialOptions.color && (this.color = greasedLineMaterialOptions.color);\n greasedLineMaterialOptions.colorDistributionType && (this.colorsDistributionType = greasedLineMaterialOptions.colorDistributionType);\n greasedLineMaterialOptions.colorsSampling && (this.colorsSampling = greasedLineMaterialOptions.colorsSampling);\n greasedLineMaterialOptions.colorMode && (this.colorMode = greasedLineMaterialOptions.colorMode);\n greasedLineMaterialOptions.useColors && (this.useColors = greasedLineMaterialOptions.useColors);\n greasedLineMaterialOptions.visibility && (this.visibility = greasedLineMaterialOptions.visibility);\n greasedLineMaterialOptions.useDash && (this.useDash = greasedLineMaterialOptions.useDash);\n greasedLineMaterialOptions.dashCount && (this.dashCount = greasedLineMaterialOptions.dashCount);\n greasedLineMaterialOptions.dashRatio && (this.dashRatio = greasedLineMaterialOptions.dashRatio);\n greasedLineMaterialOptions.dashOffset && (this.dashOffset = greasedLineMaterialOptions.dashOffset);\n greasedLineMaterialOptions.width && (this.width = greasedLineMaterialOptions.width);\n greasedLineMaterialOptions.sizeAttenuation && (this.sizeAttenuation = greasedLineMaterialOptions.sizeAttenuation);\n greasedLineMaterialOptions.resolution && (this.resolution = greasedLineMaterialOptions.resolution);\n if (greasedLineMaterialOptions.colors) {\n this.colorsTexture = GreasedLineTools.CreateColorsTexture(`${this.name}-colors-texture`, greasedLineMaterialOptions.colors, this.colorsSampling, this.getScene());\n }\n else {\n this.colorsTexture = GreasedLineTools.PrepareEmptyColorsTexture(scene);\n }\n this._cameraFacing = greasedLineMaterialOptions.cameraFacing ?? true;\n this.setDefine(\"GREASED_LINE_CAMERA_FACING\", this._cameraFacing);\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,2BAA2B;AACtD,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,MAAM,QAAQ,2BAA2B;AAClD,SAASC,OAAO,QAAQ,4BAA4B;AACpD,OAAO,uCAAuC;AAC9C,OAAO,qCAAqC;AAC5C,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,SAASL,cAAc,CAAC;EAC1D;AACJ;AACA;AACA;AACA;AACA;EACIM,WAAWA,CAACC,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAE;IAAA,IAAAC,mBAAA,EAAAC,gBAAA,EAAAC,kBAAA,EAAAC,mBAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,cAAA,EAAAC,kBAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,kBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,mBAAA;IAC9B,MAAMC,OAAO,GAAG,CACZ,gCAAgC,CAAC,CAAC,0EAA0E,EAC5G,mCAAmC,CAAC,CAAC,6EAA6E,EAClH,kBAAkB,CAAC,CAAC,gDAAgD,EACpE,kBAAkB,CAAC,CAAC,gDAAgD,EACpE,uBAAuB,CAAC,CAAC,qDAAqD,CACjF;IACD,MAAMC,UAAU,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,mB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