Make the hints a uniform instead of a buffer texture.
Saves a good bit of memory traffic during vertex shading.
This commit is contained in:
parent
28837f72a6
commit
6a7c013e61
|
@ -25,6 +25,7 @@ import {BUILTIN_FONT_URI, ExpandedMeshData} from "./text";
|
||||||
import {GlyphStore, Hint, PathfinderFont, TextFrame, TextRun} from "./text";
|
import {GlyphStore, Hint, PathfinderFont, TextFrame, TextRun} from "./text";
|
||||||
import {assert, panic, PathfinderError, unwrapNull} from "./utils";
|
import {assert, panic, PathfinderError, unwrapNull} from "./utils";
|
||||||
import {DemoView, Timings} from "./view";
|
import {DemoView, Timings} from "./view";
|
||||||
|
import { UniformMap } from './gl-utils';
|
||||||
|
|
||||||
const TEXT_AVAILABLE_WIDTH: number = 150000;
|
const TEXT_AVAILABLE_WIDTH: number = 150000;
|
||||||
const TEXT_PADDING: number = 2000;
|
const TEXT_PADDING: number = 2000;
|
||||||
|
@ -304,6 +305,10 @@ class ThreeDView extends DemoView {
|
||||||
this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, CUBE_INDICES, this.gl.STATIC_DRAW);
|
this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, CUBE_INDICES, this.gl.STATIC_DRAW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setHintsUniform(uniforms: UniformMap): void {
|
||||||
|
this.gl.uniform4f(uniforms.uHints, 0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
protected pathColorsForObject(objectIndex: number): Uint8Array {
|
protected pathColorsForObject(objectIndex: number): Uint8Array {
|
||||||
return TEXT_COLOR;
|
return TEXT_COLOR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import {BUILTIN_FONT_URI, ExpandedMeshData, GlyphStore, PathfinderFont, TextFram
|
||||||
import {TextRun} from "./text";
|
import {TextRun} from "./text";
|
||||||
import {assert, PathfinderError, unwrapNull, unwrapUndef} from "./utils";
|
import {assert, PathfinderError, unwrapNull, unwrapUndef} from "./utils";
|
||||||
import {DemoView, MonochromeDemoView, Timings } from "./view";
|
import {DemoView, MonochromeDemoView, Timings } from "./view";
|
||||||
|
import { UniformMap } from './gl-utils';
|
||||||
|
|
||||||
const STRING: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
const STRING: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
|
|
||||||
|
@ -125,7 +126,6 @@ class BenchmarkAppController extends DemoAppController<BenchmarkTestView> {
|
||||||
this.view.then(view => {
|
this.view.then(view => {
|
||||||
view.uploadPathColors(1);
|
view.uploadPathColors(1);
|
||||||
view.uploadPathTransforms(1);
|
view.uploadPathTransforms(1);
|
||||||
view.uploadHints();
|
|
||||||
view.attachMeshes([expandedMeshes.meshes]);
|
view.attachMeshes([expandedMeshes.meshes]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -246,13 +246,8 @@ class BenchmarkTestView extends MonochromeDemoView {
|
||||||
this.camera.onZoom = () => this.setDirty();
|
this.camera.onZoom = () => this.setDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadHints(): void {
|
setHintsUniform(uniforms: UniformMap): void {
|
||||||
const glyphCount = unwrapNull(this.appController.textRun).glyphIDs.length;
|
this.gl.uniform4f(uniforms.uHints, 0, 0, 0, 0);
|
||||||
const pathHints = new Float32Array((glyphCount + 1) * 4);
|
|
||||||
|
|
||||||
const pathHintsBufferTexture = new PathfinderBufferTexture(this.gl, 'uPathHints');
|
|
||||||
pathHintsBufferTexture.upload(this.gl, pathHints);
|
|
||||||
this.pathHintsBufferTexture = pathHintsBufferTexture;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected createAAStrategy(aaType: AntialiasingStrategyName,
|
protected createAAStrategy(aaType: AntialiasingStrategyName,
|
||||||
|
|
|
@ -379,8 +379,7 @@ export abstract class ECAAStrategy extends AntialiasingStrategy {
|
||||||
this.bVertexPositionBufferTexture.bind(view.gl, uniforms, 0);
|
this.bVertexPositionBufferTexture.bind(view.gl, uniforms, 0);
|
||||||
this.bVertexPathIDBufferTexture.bind(view.gl, uniforms, 1);
|
this.bVertexPathIDBufferTexture.bind(view.gl, uniforms, 1);
|
||||||
view.pathTransformBufferTextures[0].bind(view.gl, uniforms, 2);
|
view.pathTransformBufferTextures[0].bind(view.gl, uniforms, 2);
|
||||||
if (view.pathHintsBufferTexture !== null)
|
view.setHintsUniform(uniforms);
|
||||||
view.pathHintsBufferTexture.bind(view.gl, uniforms, 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private antialiasLines(view: MonochromeDemoView) {
|
private antialiasLines(view: MonochromeDemoView) {
|
||||||
|
|
|
@ -23,6 +23,7 @@ import SSAAStrategy from "./ssaa-strategy";
|
||||||
import {BUILTIN_SVG_URI, SVGLoader} from './svg-loader';
|
import {BUILTIN_SVG_URI, SVGLoader} from './svg-loader';
|
||||||
import {panic, unwrapNull} from './utils';
|
import {panic, unwrapNull} from './utils';
|
||||||
import {DemoView, Timings} from './view';
|
import {DemoView, Timings} from './view';
|
||||||
|
import { UniformMap } from './gl-utils';
|
||||||
|
|
||||||
const parseColor = require('parse-color');
|
const parseColor = require('parse-color');
|
||||||
|
|
||||||
|
@ -120,6 +121,10 @@ class SVGDemoView extends DemoView {
|
||||||
return this.destAllocatedSize;
|
return this.destAllocatedSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setHintsUniform(uniforms: UniformMap): void {
|
||||||
|
this.gl.uniform4f(uniforms.uHints, 0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
protected pathColorsForObject(objectIndex: number): Uint8Array {
|
protected pathColorsForObject(objectIndex: number): Uint8Array {
|
||||||
const instances = this.appController.loader.pathInstances;
|
const instances = this.appController.loader.pathInstances;
|
||||||
const pathColors = new Uint8Array(4 * (instances.length + 1));
|
const pathColors = new Uint8Array(4 * (instances.length + 1));
|
||||||
|
|
|
@ -342,6 +342,15 @@ class TextDemoView extends MonochromeDemoView {
|
||||||
this.setDirty();
|
this.setDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setHintsUniform(uniforms: UniformMap): void {
|
||||||
|
const hint = this.createHint();
|
||||||
|
this.gl.uniform4f(uniforms.uHints,
|
||||||
|
hint.xHeight,
|
||||||
|
hint.hintedXHeight,
|
||||||
|
hint.stemHeight,
|
||||||
|
hint.hintedStemHeight);
|
||||||
|
}
|
||||||
|
|
||||||
protected initContext() {
|
protected initContext() {
|
||||||
super.initContext();
|
super.initContext();
|
||||||
}
|
}
|
||||||
|
@ -568,19 +577,6 @@ class TextDemoView extends MonochromeDemoView {
|
||||||
this.uploadPathTransforms(1);
|
this.uploadPathTransforms(1);
|
||||||
|
|
||||||
// TODO(pcwalton): Regenerate the IBOs to include only the glyphs we care about.
|
// TODO(pcwalton): Regenerate the IBOs to include only the glyphs we care about.
|
||||||
const pathCount = this.appController.pathCount;
|
|
||||||
const pathHints = new Float32Array((pathCount + 1) * 4);
|
|
||||||
|
|
||||||
for (let pathID = 0; pathID < pathCount; pathID++) {
|
|
||||||
pathHints[pathID * 4 + 0] = hint.xHeight;
|
|
||||||
pathHints[pathID * 4 + 1] = hint.hintedXHeight;
|
|
||||||
pathHints[pathID * 4 + 2] = hint.stemHeight;
|
|
||||||
pathHints[pathID * 4 + 3] = hint.hintedStemHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pathHintsBufferTexture = new PathfinderBufferTexture(this.gl, 'uPathHints');
|
|
||||||
pathHintsBufferTexture.upload(this.gl, pathHints);
|
|
||||||
this.pathHintsBufferTexture = pathHintsBufferTexture;
|
|
||||||
|
|
||||||
this.setGlyphTexCoords();
|
this.setGlyphTexCoords();
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,6 @@ export abstract class DemoView extends PathfinderView {
|
||||||
meshData: PathfinderMeshData[];
|
meshData: PathfinderMeshData[];
|
||||||
|
|
||||||
pathTransformBufferTextures: PathfinderBufferTexture[];
|
pathTransformBufferTextures: PathfinderBufferTexture[];
|
||||||
pathHintsBufferTexture: PathfinderBufferTexture | null;
|
|
||||||
|
|
||||||
protected timerQueryExt: any;
|
protected timerQueryExt: any;
|
||||||
|
|
||||||
|
@ -280,6 +279,8 @@ export abstract class DemoView extends PathfinderView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract setHintsUniform(uniforms: UniformMap): void;
|
||||||
|
|
||||||
protected resized(): void {
|
protected resized(): void {
|
||||||
super.resized();
|
super.resized();
|
||||||
|
|
||||||
|
@ -500,14 +501,13 @@ export abstract class DemoView extends PathfinderView {
|
||||||
// Draw direct interior parts.
|
// Draw direct interior parts.
|
||||||
this.setTransformUniform(directInteriorProgram.uniforms, objectIndex);
|
this.setTransformUniform(directInteriorProgram.uniforms, objectIndex);
|
||||||
this.setFramebufferSizeUniform(directInteriorProgram.uniforms);
|
this.setFramebufferSizeUniform(directInteriorProgram.uniforms);
|
||||||
|
this.setHintsUniform(directInteriorProgram.uniforms);
|
||||||
this.pathColorsBufferTextures[objectIndex].bind(this.gl,
|
this.pathColorsBufferTextures[objectIndex].bind(this.gl,
|
||||||
directInteriorProgram.uniforms,
|
directInteriorProgram.uniforms,
|
||||||
0);
|
0);
|
||||||
this.pathTransformBufferTextures[objectIndex].bind(this.gl,
|
this.pathTransformBufferTextures[objectIndex].bind(this.gl,
|
||||||
directInteriorProgram.uniforms,
|
directInteriorProgram.uniforms,
|
||||||
1);
|
1);
|
||||||
if (this.pathHintsBufferTexture != null)
|
|
||||||
this.pathHintsBufferTexture.bind(this.gl, directInteriorProgram.uniforms, 2);
|
|
||||||
let indexCount = this.gl.getBufferParameter(this.gl.ELEMENT_ARRAY_BUFFER,
|
let indexCount = this.gl.getBufferParameter(this.gl.ELEMENT_ARRAY_BUFFER,
|
||||||
this.gl.BUFFER_SIZE) / UINT32_SIZE;
|
this.gl.BUFFER_SIZE) / UINT32_SIZE;
|
||||||
if (instanceCount == null) {
|
if (instanceCount == null) {
|
||||||
|
@ -538,14 +538,13 @@ export abstract class DemoView extends PathfinderView {
|
||||||
// Draw direct curve parts.
|
// Draw direct curve parts.
|
||||||
this.setTransformUniform(directCurveProgram.uniforms, objectIndex);
|
this.setTransformUniform(directCurveProgram.uniforms, objectIndex);
|
||||||
this.setFramebufferSizeUniform(directCurveProgram.uniforms);
|
this.setFramebufferSizeUniform(directCurveProgram.uniforms);
|
||||||
|
this.setHintsUniform(directInteriorProgram.uniforms);
|
||||||
this.pathColorsBufferTextures[objectIndex].bind(this.gl,
|
this.pathColorsBufferTextures[objectIndex].bind(this.gl,
|
||||||
directCurveProgram.uniforms,
|
directCurveProgram.uniforms,
|
||||||
0);
|
0);
|
||||||
this.pathTransformBufferTextures[objectIndex].bind(this.gl,
|
this.pathTransformBufferTextures[objectIndex].bind(this.gl,
|
||||||
directCurveProgram.uniforms,
|
directCurveProgram.uniforms,
|
||||||
1);
|
1);
|
||||||
if (this.pathHintsBufferTexture != null)
|
|
||||||
this.pathHintsBufferTexture.bind(this.gl, directCurveProgram.uniforms, 2);
|
|
||||||
indexCount = this.gl.getBufferParameter(this.gl.ELEMENT_ARRAY_BUFFER,
|
indexCount = this.gl.getBufferParameter(this.gl.ELEMENT_ARRAY_BUFFER,
|
||||||
this.gl.BUFFER_SIZE) / UINT32_SIZE;
|
this.gl.BUFFER_SIZE) / UINT32_SIZE;
|
||||||
if (instanceCount == null) {
|
if (instanceCount == null) {
|
||||||
|
|
|
@ -11,12 +11,11 @@
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
uniform vec4 uHints;
|
||||||
uniform ivec2 uPathColorsDimensions;
|
uniform ivec2 uPathColorsDimensions;
|
||||||
uniform ivec2 uPathTransformDimensions;
|
uniform ivec2 uPathTransformDimensions;
|
||||||
uniform ivec2 uPathHintsDimensions;
|
|
||||||
uniform sampler2D uPathColors;
|
uniform sampler2D uPathColors;
|
||||||
uniform sampler2D uPathTransform;
|
uniform sampler2D uPathTransform;
|
||||||
uniform sampler2D uPathHints;
|
|
||||||
|
|
||||||
attribute vec2 aPosition;
|
attribute vec2 aPosition;
|
||||||
attribute vec2 aTexCoord;
|
attribute vec2 aTexCoord;
|
||||||
|
@ -31,10 +30,9 @@ varying float vSign;
|
||||||
void main() {
|
void main() {
|
||||||
int pathID = int(aPathID);
|
int pathID = int(aPathID);
|
||||||
|
|
||||||
vec4 pathHints = fetchFloat4Data(uPathHints, pathID, uPathHintsDimensions);
|
|
||||||
vec4 pathTransform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
vec4 pathTransform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
||||||
|
|
||||||
vec2 position = hintPosition(aPosition, pathHints);
|
vec2 position = hintPosition(aPosition, uHints);
|
||||||
position = transformVertexPositionST(position, pathTransform);
|
position = transformVertexPositionST(position, pathTransform);
|
||||||
position = transformVertexPosition(position, uTransform);
|
position = transformVertexPosition(position, uTransform);
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,11 @@
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
uniform vec4 uHints;
|
||||||
uniform ivec2 uPathColorsDimensions;
|
uniform ivec2 uPathColorsDimensions;
|
||||||
uniform ivec2 uPathTransformDimensions;
|
uniform ivec2 uPathTransformDimensions;
|
||||||
uniform ivec2 uPathHintsDimensions;
|
|
||||||
uniform sampler2D uPathColors;
|
uniform sampler2D uPathColors;
|
||||||
uniform sampler2D uPathTransform;
|
uniform sampler2D uPathTransform;
|
||||||
uniform sampler2D uPathHints;
|
|
||||||
|
|
||||||
attribute vec2 aPosition;
|
attribute vec2 aPosition;
|
||||||
attribute float aPathID;
|
attribute float aPathID;
|
||||||
|
@ -27,10 +26,9 @@ varying vec2 vPathID;
|
||||||
void main() {
|
void main() {
|
||||||
int pathID = int(aPathID);
|
int pathID = int(aPathID);
|
||||||
|
|
||||||
vec4 pathHints = fetchFloat4Data(uPathHints, pathID, uPathHintsDimensions);
|
|
||||||
vec4 pathTransform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
vec4 pathTransform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
||||||
|
|
||||||
vec2 position = hintPosition(aPosition, pathHints);
|
vec2 position = hintPosition(aPosition, uHints);
|
||||||
position = transformVertexPositionST(position, pathTransform);
|
position = transformVertexPositionST(position, pathTransform);
|
||||||
position = transformVertexPosition(position, uTransform);
|
position = transformVertexPosition(position, uTransform);
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,14 @@
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
uniform vec4 uTransformST;
|
uniform vec4 uTransformST;
|
||||||
|
uniform vec4 uHints;
|
||||||
uniform ivec2 uFramebufferSize;
|
uniform ivec2 uFramebufferSize;
|
||||||
uniform ivec2 uBVertexPositionDimensions;
|
uniform ivec2 uBVertexPositionDimensions;
|
||||||
uniform ivec2 uBVertexPathIDDimensions;
|
uniform ivec2 uBVertexPathIDDimensions;
|
||||||
uniform ivec2 uPathTransformDimensions;
|
uniform ivec2 uPathTransformDimensions;
|
||||||
uniform ivec2 uPathHintsDimensions;
|
|
||||||
uniform sampler2D uBVertexPosition;
|
uniform sampler2D uBVertexPosition;
|
||||||
uniform sampler2D uBVertexPathID;
|
uniform sampler2D uBVertexPathID;
|
||||||
uniform sampler2D uPathTransform;
|
uniform sampler2D uPathTransform;
|
||||||
uniform sampler2D uPathHints;
|
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
attribute vec4 aUpperPointIndices;
|
attribute vec4 aUpperPointIndices;
|
||||||
|
@ -51,11 +50,10 @@ void main() {
|
||||||
|
|
||||||
int pathID = fetchUInt16Data(uBVertexPathID, pointIndices.x, uBVertexPathIDDimensions);
|
int pathID = fetchUInt16Data(uBVertexPathID, pointIndices.x, uBVertexPathIDDimensions);
|
||||||
|
|
||||||
vec4 hints = fetchFloat4Data(uPathHints, pathID, uPathHintsDimensions);
|
|
||||||
vec4 transform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
vec4 transform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
||||||
|
|
||||||
upperLeftPosition = hintPosition(upperLeftPosition, hints);
|
upperLeftPosition = hintPosition(upperLeftPosition, uHints);
|
||||||
lowerRightPosition = hintPosition(lowerRightPosition, hints);
|
lowerRightPosition = hintPosition(lowerRightPosition, uHints);
|
||||||
|
|
||||||
upperLeftPosition = transformVertexPositionST(upperLeftPosition, transform);
|
upperLeftPosition = transformVertexPositionST(upperLeftPosition, transform);
|
||||||
lowerRightPosition = transformVertexPositionST(lowerRightPosition, transform);
|
lowerRightPosition = transformVertexPositionST(lowerRightPosition, transform);
|
||||||
|
|
|
@ -11,15 +11,14 @@
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
uniform vec4 uTransformST;
|
uniform vec4 uTransformST;
|
||||||
|
uniform vec4 uHints;
|
||||||
uniform ivec2 uFramebufferSize;
|
uniform ivec2 uFramebufferSize;
|
||||||
uniform ivec2 uBVertexPositionDimensions;
|
uniform ivec2 uBVertexPositionDimensions;
|
||||||
uniform ivec2 uBVertexPathIDDimensions;
|
uniform ivec2 uBVertexPathIDDimensions;
|
||||||
uniform ivec2 uPathTransformDimensions;
|
uniform ivec2 uPathTransformDimensions;
|
||||||
uniform ivec2 uPathHintsDimensions;
|
|
||||||
uniform sampler2D uBVertexPosition;
|
uniform sampler2D uBVertexPosition;
|
||||||
uniform sampler2D uBVertexPathID;
|
uniform sampler2D uBVertexPathID;
|
||||||
uniform sampler2D uPathTransform;
|
uniform sampler2D uPathTransform;
|
||||||
uniform sampler2D uPathHints;
|
|
||||||
uniform bool uLowerPart;
|
uniform bool uLowerPart;
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
|
@ -46,7 +45,6 @@ void main() {
|
||||||
|
|
||||||
int pathID = fetchUInt16Data(uBVertexPathID, pointIndices.x, uBVertexPathIDDimensions);
|
int pathID = fetchUInt16Data(uBVertexPathID, pointIndices.x, uBVertexPathIDDimensions);
|
||||||
|
|
||||||
vec4 hints = fetchFloat4Data(uPathHints, pathID, uPathHintsDimensions);
|
|
||||||
vec4 transform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
vec4 transform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
||||||
|
|
||||||
// Transform the points, and compute the position of this vertex.
|
// Transform the points, and compute the position of this vertex.
|
||||||
|
@ -58,8 +56,8 @@ void main() {
|
||||||
uFramebufferSize,
|
uFramebufferSize,
|
||||||
transform,
|
transform,
|
||||||
uTransformST,
|
uTransformST,
|
||||||
hints)) {
|
uHints)) {
|
||||||
controlPointPosition = hintPosition(controlPointPosition, hints);
|
controlPointPosition = hintPosition(controlPointPosition, uHints);
|
||||||
controlPointPosition = transformVertexPositionST(controlPointPosition, transform);
|
controlPointPosition = transformVertexPositionST(controlPointPosition, transform);
|
||||||
controlPointPosition = transformVertexPositionST(controlPointPosition, uTransformST);
|
controlPointPosition = transformVertexPositionST(controlPointPosition, uTransformST);
|
||||||
controlPointPosition = convertClipToScreenSpace(controlPointPosition, uFramebufferSize);
|
controlPointPosition = convertClipToScreenSpace(controlPointPosition, uFramebufferSize);
|
||||||
|
|
|
@ -11,15 +11,14 @@
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
uniform vec4 uTransformST;
|
uniform vec4 uTransformST;
|
||||||
|
uniform vec4 uHints;
|
||||||
uniform ivec2 uFramebufferSize;
|
uniform ivec2 uFramebufferSize;
|
||||||
uniform ivec2 uBVertexPositionDimensions;
|
uniform ivec2 uBVertexPositionDimensions;
|
||||||
uniform ivec2 uBVertexPathIDDimensions;
|
uniform ivec2 uBVertexPathIDDimensions;
|
||||||
uniform ivec2 uPathTransformDimensions;
|
uniform ivec2 uPathTransformDimensions;
|
||||||
uniform ivec2 uPathHintsDimensions;
|
|
||||||
uniform sampler2D uBVertexPosition;
|
uniform sampler2D uBVertexPosition;
|
||||||
uniform sampler2D uBVertexPathID;
|
uniform sampler2D uBVertexPathID;
|
||||||
uniform sampler2D uPathTransform;
|
uniform sampler2D uPathTransform;
|
||||||
uniform sampler2D uPathHints;
|
|
||||||
uniform bool uLowerPart;
|
uniform bool uLowerPart;
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
|
@ -40,7 +39,6 @@ void main() {
|
||||||
|
|
||||||
int pathID = fetchUInt16Data(uBVertexPathID, pointIndices.x, uBVertexPathIDDimensions);
|
int pathID = fetchUInt16Data(uBVertexPathID, pointIndices.x, uBVertexPathIDDimensions);
|
||||||
|
|
||||||
vec4 hints = fetchFloat4Data(uPathHints, pathID, uPathHintsDimensions);
|
|
||||||
vec4 transform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
vec4 transform = fetchFloat4Data(uPathTransform, pathID, uPathTransformDimensions);
|
||||||
|
|
||||||
// Transform the points, and compute the position of this vertex.
|
// Transform the points, and compute the position of this vertex.
|
||||||
|
@ -52,7 +50,7 @@ void main() {
|
||||||
uFramebufferSize,
|
uFramebufferSize,
|
||||||
transform,
|
transform,
|
||||||
uTransformST,
|
uTransformST,
|
||||||
hints);
|
uHints);
|
||||||
|
|
||||||
float depth = convertPathIndexToViewportDepthValue(pathID);
|
float depth = convertPathIndexToViewportDepthValue(pathID);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue