Add textures

This commit is contained in:
schmelczerandras 2020-10-04 10:48:26 +02:00
parent 5723b91b32
commit 7bfad8711b
25 changed files with 407 additions and 104 deletions

View file

@ -1,6 +1,7 @@
import { vec2 } from 'gl-matrix';
import { LightDrawable } from '../../../drawables/lights/light-drawable';
import { clamp01 } from '../../../helper/clamp';
import { Texture } from '../../graphics-library/texture/texture';
import { Insights } from '../insights';
import { RenderPass } from './render-pass';
@ -13,7 +14,14 @@ export class LightsRenderPass extends RenderPass {
this.drawables.push(drawable);
}
public render(commonUniforms: any, ...inputTextures: Array<WebGLTexture>) {
public render(
commonUniforms: any,
distanceTexture: WebGLTexture,
inputTextures: Array<Texture>
) {
this.gl.activeTexture(this.gl.TEXTURE0);
this.gl.bindTexture(this.gl.TEXTURE_2D, distanceTexture);
this.frame.bindAndClear(inputTextures);
const tileCenterWorldCoordinates = vec2.transformMat2d(