Make descriptor access faster

This commit is contained in:
schmelczerandras 2020-09-19 17:31:03 +02:00
parent 7a7273c2be
commit 4f726ddac2
6 changed files with 54 additions and 65 deletions

View file

@ -3,14 +3,12 @@ import { Drawable } from '../drawable';
import { DrawableDescriptor } from '../drawable-descriptor';
export class CircleLight extends Drawable {
public static get descriptor(): DrawableDescriptor {
return {
uniformName: 'circleLights',
uniformCountMacroName: 'CIRCLE_LIGHT_COUNT',
shaderCombinationSteps: [0, 1, 2, 4],
empty: new CircleLight(vec2.fromValues(0, 0), vec3.fromValues(0, 0, 0), 0),
};
}
public static readonly descriptor: DrawableDescriptor = {
uniformName: 'circleLights',
uniformCountMacroName: 'CIRCLE_LIGHT_COUNT',
shaderCombinationSteps: [0, 1, 2, 4],
empty: new CircleLight(vec2.fromValues(0, 0), vec3.fromValues(0, 0, 0), 0),
};
constructor(public center: vec2, public color: vec3, public intensity: number) {
super();