Improve color handling approach

This commit is contained in:
schmelczerandras 2020-10-13 22:37:23 +02:00
parent e53ca905af
commit f29293c475
22 changed files with 259 additions and 181 deletions

View file

@ -4,8 +4,10 @@ import { Texture } from './texture';
/** @internal */
export class PaletteTexture extends Texture {
public static readonly textureUnitId = 2;
constructor(gl: UniversalRenderingContext, private readonly paletteSize: number) {
super(gl, 1);
super(gl, PaletteTexture.textureUnitId);
}
public setPalette(colors: Array<vec3 | vec4>) {