UNPKG

@openhps/core

Version:

Open Hybrid Positioning System - Core component

73 lines (67 loc) 1.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _NodeMaterial = _interopRequireDefault(require("./NodeMaterial.js")); var _VolumetricLightingModel = _interopRequireDefault(require("../../nodes/functions/VolumetricLightingModel.js")); var _constants = require("../../constants.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Volume node material. * * @augments NodeMaterial */ class VolumeNodeMaterial extends _NodeMaterial.default { static get type() { return 'VolumeNodeMaterial'; } /** * Constructs a new volume node material. * * @param {Object} [parameters] - The configuration parameter. */ constructor(parameters) { super(); /** * This flag can be used for type testing. * * @type {boolean} * @readonly * @default true */ this.isVolumeNodeMaterial = true; /** * Number of steps used for raymarching. * * @type {number} * @default 25 */ this.steps = 25; /** * Offsets the distance a ray has been traveled through a volume. * Can be used to implement dithering to reduce banding. * * @type {Node<float>} * @default null */ this.offsetNode = null; /** * Node used for scattering calculations. * * @type {Function|FunctionNode<vec4>} * @default null */ this.scatteringNode = null; this.lights = true; this.transparent = true; this.side = _constants.BackSide; this.depthTest = false; this.depthWrite = false; this.setValues(parameters); } setupLightingModel() { return new _VolumetricLightingModel.default(); } } var _default = exports.default = VolumeNodeMaterial;