silphius/app/react-components/pixi/extensions.js
2024-07-18 04:18:06 -05:00

36 lines
825 B
JavaScript

import {ExtensionType} from '@pixi/core';
import {Layer, Stage as LayerStage} from '@pixi/layers';
import {
AmbientLight,
diffuseGroup,
normalGroup,
lightGroup,
} from './lights.js';
export const ApplicationStageLayers = {
type: ExtensionType.Application,
priority: 100,
ref: {
destroy: function() {},
init: function() {
this.stage = new LayerStage();
},
},
};
export const ApplicationStageLights = {
type: ExtensionType.Application,
ref: {
destroy: function() {},
init: function() {
const {stage} = this;
stage.addChild(new Layer(diffuseGroup));
stage.addChild(new Layer(normalGroup));
stage.addChild(new Layer(lightGroup));
// stage.addChild(new AmbientLight(0x2244ff, 0.1));
stage.addChild(new AmbientLight(0xffffff, 1));
},
},
};