Skip to content

Commit

Permalink
Rearrange shader construction
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Sep 20, 2016
1 parent 8e98836 commit b7c2dfd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Source/Scene/PointCloud3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,11 @@ define([
attributeLocations.a_batchId = batchIdLocation;
}

var attributeIncludes = '';
var vs = 'attribute vec3 a_position; \n' +
'varying vec4 v_color; \n' +
'uniform float u_pointSize; \n' +
'uniform vec4 u_highlightColor; \n';

var length = styleableProperties.length;
for (i = 0; i < length; ++i) {
name = styleableProperties[i];
Expand All @@ -861,16 +865,10 @@ define([
attributeType = 'vec' + componentCount;
}

attributeIncludes += 'attribute ' + attributeType + ' ' + attributeName + '; \n';
vs += 'attribute ' + attributeType + ' ' + attributeName + '; \n';
attributeLocations[attributeName] = attribute.location;
}

var vs = 'attribute vec3 a_position; \n' +
'varying vec4 v_color; \n' +
'uniform float u_pointSize; \n' +
'uniform vec4 u_highlightColor; \n' +
attributeIncludes;

if (hasColors && !hasColorStyle) {
if (isTranslucent) {
vs += 'attribute vec4 a_color; \n';
Expand Down

0 comments on commit b7c2dfd

Please sign in to comment.