From b7c2dfddb58a1477e6023f32e314668541106957 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 20 Sep 2016 12:21:25 -0400 Subject: [PATCH] Rearrange shader construction --- Source/Scene/PointCloud3DTileContent.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index 8beb3e10a12c..9ab20054f425 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -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]; @@ -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';