Render in NDC
This commit is contained in:
parent
40a660b7cb
commit
05682dd2d5
5 changed files with 106 additions and 82 deletions
|
|
@ -9,6 +9,7 @@ export class DrawableBlob extends Blob implements IDrawable {
|
|||
uniformName: 'blobs',
|
||||
countMacroName: 'blobCount',
|
||||
shaderCombinationSteps: settings.shaderCombinations.blobSteps,
|
||||
empty: new DrawableBlob(vec2.fromValues(0, 0)),
|
||||
};
|
||||
|
||||
public serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ export class DrawableTunnel extends TunnelShape implements IDrawable {
|
|||
uniformName: 'lines',
|
||||
countMacroName: 'lineCount',
|
||||
shaderCombinationSteps: settings.shaderCombinations.lineSteps,
|
||||
empty: new DrawableTunnel(vec2.fromValues(0, 0), vec2.fromValues(0, 0), 0, 0),
|
||||
};
|
||||
|
||||
public serializeToUniforms(uniforms: any, scale: number, transform: mat2d): void {
|
||||
|
|
@ -19,7 +20,7 @@ export class DrawableTunnel extends TunnelShape implements IDrawable {
|
|||
|
||||
uniforms[uniformName].push({
|
||||
from: vec2.transformMat2d(vec2.create(), this.from, transform),
|
||||
toFromDelta: vec2.transformMat2d(vec2.create(), this.toFromDelta, transform),
|
||||
toFromDelta: vec2.scale(vec2.create(), this.toFromDelta, scale),
|
||||
fromRadius: this.fromRadius * scale,
|
||||
toRadius: this.toRadius * scale,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
import { IDrawable } from './i-drawable';
|
||||
|
||||
export interface IDrawableDescriptor {
|
||||
uniformName: string;
|
||||
countMacroName: string;
|
||||
shaderCombinationSteps: Array<number>;
|
||||
readonly empty: IDrawable;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export class CircleLight implements ILight {
|
|||
uniformName: 'circleLights',
|
||||
countMacroName: 'circleLightCount',
|
||||
shaderCombinationSteps: settings.shaderCombinations.circleLightSteps,
|
||||
empty: new CircleLight(vec2.fromValues(0, 0), 0, vec3.fromValues(0, 0, 0), 0),
|
||||
};
|
||||
|
||||
constructor(
|
||||
|
|
@ -17,7 +18,7 @@ export class CircleLight implements ILight {
|
|||
public lightness: number
|
||||
) {}
|
||||
|
||||
public distance(target: vec2): number {
|
||||
public distance(_: vec2): number {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export class PointLight implements ILight {
|
|||
uniformName: 'pointLights',
|
||||
countMacroName: 'pointLightCount',
|
||||
shaderCombinationSteps: settings.shaderCombinations.pointLightSteps,
|
||||
empty: new PointLight(vec2.fromValues(0, 0), 0, vec3.fromValues(0, 0, 0), 0),
|
||||
};
|
||||
|
||||
public constructor(
|
||||
|
|
|
|||
Loading…
Reference in a new issue