Skip to content

Commit

Permalink
Tweak naming in draw_hillshade
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick committed Dec 5, 2017
1 parent 678506a commit dd6d831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/render/draw_hillshade.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function renderHillshade(painter, tile, layer) {
const latRange = getTileLatRange(painter, tile.tileID);
context.activeTexture.set(gl.TEXTURE0);

gl.bindTexture(gl.TEXTURE_2D, tile.texture.colorAttachment.get());
gl.bindTexture(gl.TEXTURE_2D, tile.fbo.colorAttachment.get());

gl.uniformMatrix4fv(program.uniforms.u_matrix, false, posMatrix);
gl.uniform2fv(program.uniforms.u_latrange, latRange);
Expand Down Expand Up @@ -126,15 +126,15 @@ function prepareHillshade(painter, tile) {
}

context.activeTexture.set(gl.TEXTURE0);
if (!tile.texture) {
const _texture = new Texture(context, {width: tileSize, height: tileSize, data: null}, gl.RGBA);
_texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);
if (!tile.fbo) {
const renderTexture = new Texture(context, {width: tileSize, height: tileSize, data: null}, gl.RGBA);
renderTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);

tile.texture = context.createFramebuffer();
tile.texture.colorAttachment.set(_texture.texture);
tile.fbo = context.createFramebuffer();
tile.fbo.colorAttachment.set(renderTexture.texture);
}

context.bindFramebuffer.set(tile.texture.framebuffer);
context.bindFramebuffer.set(tile.fbo.framebuffer);
context.viewport.set([0, 0, tileSize, tileSize]);

const matrix = mat4.create();
Expand Down
1 change: 1 addition & 0 deletions src/source/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class Tile {
needsHillshadePrepare: ?boolean
request: any;
texture: any;
fbo: any;
demTexture: ?Texture;
refreshedUponExpiration: boolean;
reloadCallback: any;
Expand Down

0 comments on commit dd6d831

Please sign in to comment.