WIP before removing barycentric coordinates
This commit is contained in:
parent
9af3bac11f
commit
3b8ecfd74c
|
@ -134,11 +134,13 @@ impl Renderer {
|
|||
self.upload_solid_tiles(&built_scene.solid_tiles);
|
||||
self.draw_solid_tiles(&built_scene);
|
||||
|
||||
/*
|
||||
for batch in &built_scene.batches {
|
||||
self.upload_batch(batch);
|
||||
self.draw_batch_fills(batch);
|
||||
self.draw_batch_mask_tiles(&built_scene, batch);
|
||||
}
|
||||
*/
|
||||
|
||||
if self.postprocessing_needed() {
|
||||
self.postprocess();
|
||||
|
|
|
@ -63,14 +63,20 @@ void main() {
|
|||
vec2 pixelPosition = (aTileOrigin + aTessCoord) * uTileSize + uViewBoxOrigin;
|
||||
vec2 position = (pixelPosition / uFramebufferSize * 2.0 - 1.0) * vec2(1.0, -1.0);
|
||||
|
||||
vec4 depths = vec4(uQuadP0.z, uQuadP1.z, uQuadP2.z, uQuadP3.z);
|
||||
float depth = dot(barycentricQuad(position), depths);
|
||||
vec4 lambda = barycentricQuad(position);
|
||||
//vec4 depths = vec4(uQuadP0.z, uQuadP1.z, uQuadP2.z, uQuadP3.z);
|
||||
//float depth = dot(lambda, depths);
|
||||
float red = lambda.x;
|
||||
float green = lambda.y;
|
||||
float blue = lambda.z + 1.0;
|
||||
float depth = 0.0;
|
||||
|
||||
vec2 texCoord = computeTileOffset(tileIndex, uStencilTextureSize.x) + aTessCoord * uTileSize;
|
||||
vec2 colorTexCoord = computeFillColorTexCoord(aObject, uFillColorsTextureSize);
|
||||
|
||||
vTexCoord = texCoord / uStencilTextureSize;
|
||||
vBackdrop = float(aBackdrop);
|
||||
vColor = texture(uFillColorsTexture, colorTexCoord);
|
||||
//vColor = texture(uFillColorsTexture, colorTexCoord);
|
||||
vColor = vec4(red, green, blue, 1.0);
|
||||
gl_Position = vec4(position, depth, 1.0);
|
||||
}
|
||||
|
|
|
@ -52,11 +52,18 @@ void main() {
|
|||
vec2 pixelPosition = (aTileOrigin + aTessCoord) * uTileSize + uViewBoxOrigin;
|
||||
vec2 position = (pixelPosition / uFramebufferSize * 2.0 - 1.0) * vec2(1.0, -1.0);
|
||||
|
||||
vec4 depths = vec4(uQuadP0.z, uQuadP1.z, uQuadP2.z, uQuadP3.z);
|
||||
float depth = dot(barycentricQuad(position), depths);
|
||||
//vec4 depths = vec4(uQuadP0.z, uQuadP1.z, uQuadP2.z, uQuadP3.z);
|
||||
//float depth = dot(barycentricQuad(position), depths);
|
||||
|
||||
vec4 lambda = barycentricQuad(position);
|
||||
float red = lambda.x;
|
||||
float green = lambda.y;
|
||||
float blue = lambda.z;
|
||||
float depth = 0.0;
|
||||
|
||||
vec2 colorTexCoord = computeFillColorTexCoord(aObject, uFillColorsTextureSize);
|
||||
|
||||
vColor = texture(uFillColorsTexture, colorTexCoord);
|
||||
//vColor = texture(uFillColorsTexture, colorTexCoord);
|
||||
vColor = vec4(red, green, blue, 1.0);
|
||||
gl_Position = vec4(position, depth, 1.0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue