36 lines
825 B
JavaScript
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));
|
|
},
|
|
},
|
|
};
|