From e5ca77545d11c6e1c7b7545225fed655d1b22f33 Mon Sep 17 00:00:00 2001 From: Dan Bagnell Date: Wed, 11 Apr 2018 17:28:02 -0400 Subject: [PATCH] Remove more picking code in favor of derived commands. Add dev Sandcastle example for picking. --- .../gallery/development/Picking.html | 190 ++++++++++++++++++ Source/Scene/PointCloud3DTileContent.js | 69 +------ Source/Scene/PointPrimitiveCollection.js | 80 +------- Source/Scene/PolylineCollection.js | 36 +--- Source/Scene/PostProcessStage.js | 2 +- Source/Scene/Scene.js | 72 +++++-- Source/Scene/SceneFramebuffer.js | 21 +- .../Shaders/PointPrimitiveCollectionFS.glsl | 10 +- .../Shaders/PointPrimitiveCollectionVS.glsl | 17 +- Source/Shaders/PolylineVS.glsl | 4 +- 10 files changed, 292 insertions(+), 209 deletions(-) create mode 100644 Apps/Sandcastle/gallery/development/Picking.html diff --git a/Apps/Sandcastle/gallery/development/Picking.html b/Apps/Sandcastle/gallery/development/Picking.html new file mode 100644 index 000000000000..68fa56d34685 --- /dev/null +++ b/Apps/Sandcastle/gallery/development/Picking.html @@ -0,0 +1,190 @@ + + + + + + + + + Cesium Demo + + + + + + +
+

Loading...

+
+ + + diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index 78638b9d62d3..056f5a70cb90 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -735,26 +735,21 @@ define([ }); var drawUniformMap = uniformMap; + var pickId; + var pickIdDeclaration; if (hasBatchTable) { drawUniformMap = batchTable.getUniformMapCallback()(uniformMap); - } - - var pickUniformMap; - - if (hasBatchTable) { - pickUniformMap = batchTable.getPickUniformMapCallback()(uniformMap); + pickId = batchTable.getPickId(); + pickIdDeclaration = batchTable.getPickIdDeclarations(); } else { - content._pickId = context.createPickId({ - primitive : content._tileset, - content : content - }); - - pickUniformMap = combine(uniformMap, { + drawUniformMap = combine(uniformMap, { czm_pickColor : function() { return content._pickId.color; } }); + pickId = 'czm_pickColor'; + pickIdDeclaration = 'uniform vec4 czm_pickId;'; } content._opaqueRenderState = RenderState.fromCache({ @@ -784,21 +779,9 @@ define([ pass : isTranslucent ? Pass.TRANSLUCENT : Pass.CESIUM_3D_TILE, owner : content, castShadows : false, - receiveShadows : false - }); - - content._pickCommand = new DrawCommand({ - boundingVolume : undefined, // Updated in update - cull : false, // Already culled by 3D Tiles - modelMatrix : new Matrix4(), - primitiveType : PrimitiveType.POINTS, - vertexArray : vertexArray, - count : pointsLength, - shaderProgram : undefined, // Updated in createShaders - uniformMap : pickUniformMap, - renderState : isTranslucent ? content._translucentRenderState : content._opaqueRenderState, - pass : isTranslucent ? Pass.TRANSLUCENT : Pass.CESIUM_3D_TILE, - owner : content + receiveShadows : false, + pickId : pickId, + pickIdDeclaration : pickIdDeclaration }); } @@ -1149,16 +1132,6 @@ define([ drawFS = batchTable.getFragmentShaderCallback(false, undefined)(drawFS); } - var pickVS = vs; - var pickFS = fs; - - if (hasBatchTable) { - pickVS = batchTable.getPickVertexShaderCallback('a_batchId')(pickVS); - pickFS = batchTable.getPickFragmentShaderCallback()(pickFS); - } else { - pickFS = ShaderSource.createPickFragmentShaderSource(pickFS, 'uniform'); - } - var drawCommand = content._drawCommand; if (defined(drawCommand.shaderProgram)) { // Destroy the old shader @@ -1171,18 +1144,6 @@ define([ attributeLocations : attributeLocations }); - var pickCommand = content._pickCommand; - if (defined(pickCommand.shaderProgram)) { - // Destroy the old shader - pickCommand.shaderProgram.destroy(); - } - pickCommand.shaderProgram = ShaderProgram.fromCache({ - context : context, - vertexShaderSource : pickVS, - fragmentShaderSource : pickFS, - attributeLocations : attributeLocations - }); - try { // Check if the shader compiles correctly. If not there is likely a syntax error with the style. drawCommand.shaderProgram._bind(); @@ -1329,8 +1290,6 @@ define([ } } - Matrix4.clone(this._drawCommand.modelMatrix, this._pickCommand.modelMatrix); - var boundingVolume; if (defined(this._tile._contentBoundingVolume)) { boundingVolume = this._mode === SceneMode.SCENE3D ? this._tile._contentBoundingVolume.boundingSphere : this._tile._contentBoundingVolume2D.boundingSphere; @@ -1339,7 +1298,6 @@ define([ } this._drawCommand.boundingVolume = boundingVolume; - this._pickCommand.boundingVolume = boundingVolume; } this._drawCommand.castShadows = ShadowMode.castShadows(tileset.shadows); @@ -1362,12 +1320,9 @@ define([ var commandList = frameState.commandList; var passes = frameState.passes; - if (passes.render) { + if (passes.render || passes.pick) { commandList.push(this._drawCommand); } - if (passes.pick) { - commandList.push(this._pickCommand); - } }; /** @@ -1382,11 +1337,9 @@ define([ */ PointCloud3DTileContent.prototype.destroy = function() { var command = this._drawCommand; - var pickCommand = this._pickCommand; if (defined(command)) { command.vertexArray = command.vertexArray && command.vertexArray.destroy(); command.shaderProgram = command.shaderProgram && command.shaderProgram.destroy(); - pickCommand.shaderProgram = pickCommand.shaderProgram && pickCommand.shaderProgram.destroy(); } this._batchTable = this._batchTable && this._batchTable.destroy(); return destroyObject(this); diff --git a/Source/Scene/PointPrimitiveCollection.js b/Source/Scene/PointPrimitiveCollection.js index 6ef137937a75..c9d5d250aa97 100644 --- a/Source/Scene/PointPrimitiveCollection.js +++ b/Source/Scene/PointPrimitiveCollection.js @@ -121,7 +121,6 @@ define([ this._sp = undefined; this._spTranslucent = undefined; - this._spPick = undefined; this._rsOpaque = undefined; this._rsTranslucent = undefined; this._vaf = undefined; @@ -134,19 +133,15 @@ define([ this._shaderScaleByDistance = false; this._compiledShaderScaleByDistance = false; - this._compiledShaderScaleByDistancePick = false; this._shaderTranslucencyByDistance = false; this._compiledShaderTranslucencyByDistance = false; - this._compiledShaderTranslucencyByDistancePick = false; this._shaderDistanceDisplayCondition = false; this._compiledShaderDistanceDisplayCondition = false; - this._compiledShaderDistanceDisplayConditionPick = false; this._shaderDisableDepthDistance = false; this._compiledShaderDisableDepthDistance = false; - this._compiledShaderDisableDepthDistancePick = false; this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES); @@ -159,7 +154,6 @@ define([ this._boundingVolumeDirty = false; this._colorCommands = []; - this._pickCommands = []; /** * The 4x4 transformation matrix that transforms each point in this collection from model to world coordinates. @@ -982,49 +976,6 @@ define([ this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance; } - if (!defined(this._spPick) || - (this._shaderScaleByDistance && !this._compiledShaderScaleByDistancePick) || - (this._shaderTranslucencyByDistance && !this._compiledShaderTranslucencyByDistancePick) || - (this._shaderDistanceDisplayCondition && !this._compiledShaderDistanceDisplayConditionPick) || - (this._shaderDisableDepthDistance !== this._compiledShaderDisableDepthDistancePick)) { - - vs = new ShaderSource({ - defines : ['RENDER_FOR_PICK'], - sources : [PointPrimitiveCollectionVS] - }); - - if (this._shaderScaleByDistance) { - vs.defines.push('EYE_DISTANCE_SCALING'); - } - if (this._shaderTranslucencyByDistance) { - vs.defines.push('EYE_DISTANCE_TRANSLUCENCY'); - } - if (this._shaderDistanceDisplayCondition) { - vs.defines.push('DISTANCE_DISPLAY_CONDITION'); - } - if (this._shaderDisableDepthDistance) { - vs.defines.push('DISABLE_DEPTH_DISTANCE'); - } - - fs = new ShaderSource({ - defines : ['RENDER_FOR_PICK'], - sources : [PointPrimitiveCollectionFS] - }); - - this._spPick = ShaderProgram.replaceCache({ - context : context, - shaderProgram : this._spPick, - vertexShaderSource : vs, - fragmentShaderSource : fs, - attributeLocations : attributeLocations - }); - - this._compiledShaderScaleByDistancePick = this._shaderScaleByDistance; - this._compiledShaderTranslucencyByDistancePick = this._shaderTranslucencyByDistance; - this._compiledShaderDistanceDisplayConditionPick = this._shaderDistanceDisplayCondition; - this._compiledShaderDisableDepthDistancePick = this._shaderDisableDepthDistance; - } - var va; var vaLength; var command; @@ -1032,7 +983,7 @@ define([ var commandList = frameState.commandList; - if (pass.render) { + if (pass.render || picking) { var colorList = this._colorCommands; var opaque = this._blendOption === BlendOption.OPAQUE; @@ -1063,34 +1014,7 @@ define([ command.vertexArray = va[index].va; command.renderState = opaqueCommand ? this._rsOpaque : this._rsTranslucent; command.debugShowBoundingVolume = this.debugShowBoundingVolume; - - commandList.push(command); - } - } - - if (picking) { - var pickList = this._pickCommands; - - va = this._vaf.va; - vaLength = va.length; - - pickList.length = vaLength; - for (j = 0; j < vaLength; ++j) { - command = pickList[j]; - if (!defined(command)) { - command = pickList[j] = new DrawCommand({ - primitiveType : PrimitiveType.POINTS, - pass : Pass.OPAQUE, - owner : this - }); - } - - command.boundingVolume = boundingVolume; - command.modelMatrix = modelMatrix; - command.shaderProgram = this._spPick; - command.uniformMap = this._uniforms; - command.vertexArray = va[j].va; - command.renderState = this._rsOpaque; + command.pickId = 'v_pickColor'; commandList.push(command); } diff --git a/Source/Scene/PolylineCollection.js b/Source/Scene/PolylineCollection.js index 936744c6ae0b..b117480e1f6b 100644 --- a/Source/Scene/PolylineCollection.js +++ b/Source/Scene/PolylineCollection.js @@ -185,7 +185,6 @@ define([ this._translucentRS = undefined; this._colorCommands = []; - this._pickCommands = []; this._polylinesUpdated = false; this._polylinesRemoved = false; @@ -305,7 +304,6 @@ define([ if (defined(polyline._bucket)) { var bucket = polyline._bucket; bucket.shaderProgram = bucket.shaderProgram && bucket.shaderProgram.destroy(); - bucket.pickShaderProgram = bucket.pickShaderProgram && bucket.pickShaderProgram.destroy(); } polyline._destroy(); return true; @@ -564,21 +562,16 @@ define([ this._batchTable.update(frameState); - if (pass.render) { + if (pass.render || pass.pick) { var colorList = this._colorCommands; - createCommandLists(this, frameState, colorList, modelMatrix, true); - } - - if (pass.pick) { - var pickList = this._pickCommands; - createCommandLists(this, frameState, pickList, modelMatrix, false); + createCommandLists(this, frameState, colorList, modelMatrix); } }; var boundingSphereScratch = new BoundingSphere(); var boundingSphereScratch2 = new BoundingSphere(); - function createCommandLists(polylineCollection, frameState, commands, modelMatrix, renderPass) { + function createCommandLists(polylineCollection, frameState, commands, modelMatrix) { var context = frameState.context; var commandList = frameState.commandList; @@ -602,7 +595,7 @@ define([ var bucketLocator = buckets[n]; var offset = bucketLocator.offset; - var sp = renderPass ? bucketLocator.bucket.shaderProgram : bucketLocator.bucket.pickShaderProgram; + var sp = bucketLocator.bucket.shaderProgram; var polylines = bucketLocator.bucket.polylines; var polylineLength = polylines.length; @@ -638,7 +631,9 @@ define([ command.vertexArray = va.va; command.renderState = translucent ? polylineCollection._translucentRS : polylineCollection._opaqueRS; command.pass = translucent ? Pass.TRANSLUCENT : Pass.OPAQUE; - command.debugShowBoundingVolume = renderPass ? debugShowBoundingVolume : false; + command.debugShowBoundingVolume = debugShowBoundingVolume; + command.pickId = 'v_pickColor'; + command.pickIdDeclarations = 'varying vec4 v_pickColor;'; command.uniformMap = uniformMap; command.count = count; @@ -707,7 +702,9 @@ define([ command.vertexArray = va.va; command.renderState = currentMaterial.isTranslucent() ? polylineCollection._translucentRS : polylineCollection._opaqueRS; command.pass = currentMaterial.isTranslucent() ? Pass.TRANSLUCENT : Pass.OPAQUE; - command.debugShowBoundingVolume = renderPass ? debugShowBoundingVolume : false; + command.debugShowBoundingVolume = debugShowBoundingVolume; + command.pickId = 'v_pickColor'; + command.pickIdDeclarations = 'varying vec4 v_pickColor;'; command.uniformMap = uniformMap; command.count = count; @@ -1152,7 +1149,6 @@ define([ this.lengthOfPositions = 0; this.material = material; this.shaderProgram = undefined; - this.pickShaderProgram = undefined; this.mode = mode; this.modelMatrix = modelMatrix; } @@ -1191,24 +1187,12 @@ define([ sources : [PolylineCommon, vsSource] }); - var fsPick = new ShaderSource({ - sources : fs.sources, - pickColorQualifier : 'varying' - }); - this.shaderProgram = ShaderProgram.fromCache({ context : context, vertexShaderSource : vs, fragmentShaderSource : fs, attributeLocations : attributeLocations }); - - this.pickShaderProgram = ShaderProgram.fromCache({ - context : context, - vertexShaderSource : vs, - fragmentShaderSource : fsPick, - attributeLocations : attributeLocations - }); }; function intersectsIDL(polyline) { diff --git a/Source/Scene/PostProcessStage.js b/Source/Scene/PostProcessStage.js index bac0a1e9fa22..669076007ce6 100644 --- a/Source/Scene/PostProcessStage.js +++ b/Source/Scene/PostProcessStage.js @@ -760,7 +760,7 @@ define([ var commands = feature._nodeCommands; var commandsLength = commands.length; for (var j = 0; j < commandsLength; ++j) { - pickColor = commands[j].command._idUniformMap.czm_pickColor(); + pickColor = commands[j].command.uniformMap.czm_pickColor(); ids[offset] = Color.floatToByte(pickColor.red); ids[offset + 1] = Color.floatToByte(pickColor.green); ids[offset + 2] = Color.floatToByte(pickColor.blue); diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 53f8c09d5ecf..2e4569a52a33 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -2056,6 +2056,24 @@ define([ } } + function executeIdCommand(command, scene, context, passState) { + if (!defined(command.derivedCommands)) { + return; + } + + if (scene._logDepthBuffer && defined(command.derivedCommands.logDepth)) { + command = command.derivedCommands.logDepth.logDepthCommand; + } + + if (defined(command.derivedCommands.picking)) { + command = command.derivedCommands.picking.pickCommand; + command.execute(context, passState); + } else if (defined(command.derivedCommands.depth)) { + command = command.derivedCommands.depth.depthOnlyCommand; + command.execute(context, passState); + } + } + function translucentCompare(a, b, position) { return b.boundingVolume.distanceSquaredTo(position) - a.boundingVolume.distanceSquaredTo(position); } @@ -2422,28 +2440,42 @@ define([ frustum.far = frustumCommands.far; us.updateFrustum(frustum); - for (j = Pass.GLOBE; j < Pass.TRANSLUCENT; ++j) { - us.updatePass(j); - commands = frustumCommands.commands[j]; - length = frustumCommands.indices[j]; - for (var k = 0; k < length; ++k) { - var command = commands[k]; - if (!defined(command.derivedCommands)) { - continue; - } + us.updatePass(Pass.GLOBE); + commands = frustumCommands.commands[Pass.GLOBE]; + length = frustumCommands.indices[Pass.GLOBE]; + for (j = 0; j < length; ++j) { + executeIdCommand(commands[j], scene, context, passState); + } - if (scene._logDepthBuffer && defined(command.derivedCommands.logDepth)) { - command = command.derivedCommands.logDepth.logDepthCommand; - } + if (clearGlobeDepth) { + clearDepth.framebuffer = passState.framebuffer; + clearDepth.execute(context, passState); + clearDepth.framebuffer = undefined; + } - if (defined(command.derivedCommands.picking)) { - command = command.derivedCommands.picking.pickCommand; - command.execute(context, passState); - } else if (defined(command.derivedCommands.depth)) { - command = command.derivedCommands.depth.depthOnlyCommand; - command.execute(context, passState); - } - } + if (clearGlobeDepth && useDepthPlane) { + depthPlane.execute(context, passState); + } + + us.updatePass(Pass.CESIUM_3D_TILE); + commands = frustumCommands.commands[Pass.CESIUM_3D_TILE]; + length = frustumCommands.indices[Pass.CESIUM_3D_TILE]; + for (j = 0; j < length; ++j) { + executeIdCommand(commands[j], scene, context, passState); + } + + us.updatePass(Pass.OPAQUE); + commands = frustumCommands.commands[Pass.OPAQUE]; + length = frustumCommands.indices[Pass.OPAQUE]; + for (j = 0; j < length; ++j) { + executeIdCommand(commands[j], scene, context, passState); + } + + us.updatePass(Pass.TRANSLUCENT); + commands = frustumCommands.commands[Pass.TRANSLUCENT]; + length = frustumCommands.indices[Pass.TRANSLUCENT]; + for (j = 0; j < length; ++j) { + executeIdCommand(commands[j], scene, context, passState); } passState.framebuffer = originalFramebuffer; diff --git a/Source/Scene/SceneFramebuffer.js b/Source/Scene/SceneFramebuffer.js index e95ae9a24a28..520113e8e4b2 100644 --- a/Source/Scene/SceneFramebuffer.js +++ b/Source/Scene/SceneFramebuffer.js @@ -58,6 +58,8 @@ define([ post._idTexture = post._idTexture && post._idTexture.destroy(); post._depthStencilTexture = post._depthStencilTexture && post._depthStencilTexture.destroy(); post._depthStencilRenderbuffer = post._depthStencilRenderbuffer && post._depthStencilRenderbuffer.destroy(); + post._depthStencilIdTexture = post._depthStencilIdTexture && post._depthStencilIdTexture.destroy(); + post._depthStencilIdRenderbuffer = post._depthStencilIdRenderbuffer && post._depthStencilIdRenderbuffer.destroy(); post._framebuffer = undefined; post._idFramebuffer = undefined; @@ -65,6 +67,8 @@ define([ post._idTexture = undefined; post._depthStencilTexture = undefined; post._depthStencilRenderbuffer = undefined; + post._depthStencilIdTexture = undefined; + post._depthStencilIdRenderbuffer = undefined; } SceneFramebuffer.prototype.update = function(context) { @@ -113,6 +117,13 @@ define([ pixelFormat : PixelFormat.DEPTH_STENCIL, pixelDatatype : PixelDatatype.UNSIGNED_INT_24_8 }); + this._depthStencilIdTexture = new Texture({ + context : context, + width : width, + height : height, + pixelFormat : PixelFormat.DEPTH_STENCIL, + pixelDatatype : PixelDatatype.UNSIGNED_INT_24_8 + }); } else { this._depthStencilRenderbuffer = new Renderbuffer({ context : context, @@ -120,6 +131,12 @@ define([ height : height, format : RenderbufferFormat.DEPTH_STENCIL }); + this._depthStencilIdRenderbuffer = new Renderbuffer({ + context : context, + width : width, + height : height, + format : RenderbufferFormat.DEPTH_STENCIL + }); } this._framebuffer = new Framebuffer({ @@ -133,8 +150,8 @@ define([ this._idFramebuffer = new Framebuffer({ context : context, colorTextures : [this._idTexture], - depthStencilTexture : this._depthStencilTexture, - depthStencilRenderbuffer : this._depthStencilRenderbuffer, + depthStencilTexture : this._depthStencilIdTexture, + depthStencilRenderbuffer : this._depthStencilIdRenderbuffer, destroyAttachments : false }); }; diff --git a/Source/Shaders/PointPrimitiveCollectionFS.glsl b/Source/Shaders/PointPrimitiveCollectionFS.glsl index 92a9ee788615..9c3fbb0b58e6 100644 --- a/Source/Shaders/PointPrimitiveCollectionFS.glsl +++ b/Source/Shaders/PointPrimitiveCollectionFS.glsl @@ -2,10 +2,7 @@ varying vec4 v_color; varying vec4 v_outlineColor; varying float v_innerPercent; varying float v_pixelDistance; - -#ifdef RENDER_FOR_PICK varying vec4 v_pickColor; -#endif void main() { @@ -20,7 +17,7 @@ void main() color.a *= wholeAlpha; // Fully transparent parts of the billboard are not pickable. -#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT)) +#if !defined(OPAQUE) && !defined(TRANSLUCENT) if (color.a < 0.005) // matches 0/255 and 1/255 { discard; @@ -41,11 +38,6 @@ void main() #endif #endif -#ifdef RENDER_FOR_PICK - gl_FragColor = v_pickColor; -#else gl_FragColor = color; -#endif - czm_writeLogDepth(); } diff --git a/Source/Shaders/PointPrimitiveCollectionVS.glsl b/Source/Shaders/PointPrimitiveCollectionVS.glsl index 6b23bb152840..2bc8608f5d7e 100644 --- a/Source/Shaders/PointPrimitiveCollectionVS.glsl +++ b/Source/Shaders/PointPrimitiveCollectionVS.glsl @@ -11,10 +11,7 @@ varying vec4 v_color; varying vec4 v_outlineColor; varying float v_innerPercent; varying float v_pixelDistance; - -#ifdef RENDER_FOR_PICK varying vec4 v_pickColor; -#endif const float SHIFT_LEFT8 = 256.0; const float SHIFT_RIGHT8 = 1.0 / 256.0; @@ -52,18 +49,16 @@ void main() vec4 color; vec4 outlineColor; -#ifdef RENDER_FOR_PICK + vec4 pickColor; + // compressedAttribute0.z => pickColor.rgb - color = vec4(0.0); - outlineColor = vec4(0.0); - vec4 pickColor; temp = compressedAttribute0.z * SHIFT_RIGHT8; pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; pickColor.r = floor(temp); -#else + // compressedAttribute0.x => color.rgb temp = compressedAttribute0.x * SHIFT_RIGHT8; @@ -79,15 +74,13 @@ void main() temp = floor(temp) * SHIFT_RIGHT8; outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor.r = floor(temp); -#endif // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a temp = compressedAttribute0.w * SHIFT_RIGHT8; -#ifdef RENDER_FOR_PICK pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; pickColor = pickColor / 255.0; -#endif + temp = floor(temp) * SHIFT_RIGHT8; outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor /= 255.0; @@ -186,7 +179,5 @@ void main() v_pixelDistance = 2.0 / totalSize; gl_PointSize = totalSize; -#ifdef RENDER_FOR_PICK v_pickColor = pickColor; -#endif } diff --git a/Source/Shaders/PolylineVS.glsl b/Source/Shaders/PolylineVS.glsl index a43949d08a21..818272033561 100644 --- a/Source/Shaders/PolylineVS.glsl +++ b/Source/Shaders/PolylineVS.glsl @@ -14,7 +14,7 @@ attribute vec4 texCoordExpandAndBatchIndex; varying vec2 v_st; varying float v_width; -varying vec4 czm_pickColor; +varying vec4 v_pickColor; varying float v_polylineAngle; void main() @@ -95,7 +95,7 @@ void main() v_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0)); v_width = width; - czm_pickColor = pickColor; + v_pickColor = pickColor; #ifdef LOG_DEPTH czm_vertexLogDepth(czm_modelViewProjectionRelativeToEye * p);