You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several systems that batch features together into a single draw call and hide individual features in the vertex shader by accessing their show property in the batch table and forcing them to be clipped. All these systems have a slightly different way of doing this.
b3dm/i3dm uses gl_Position *= show; in Cesium3DTileBatchTable.js
For small eye distance scales and eye distance translucency it uses positionEC.xyz = vec3(0.0);.
BillboardCollection uses positionEC.xyz = vec3(0.0); for small eye distance scales and eye distance translucency.
There may be more I haven't noticed
The gl_Position.w *= show approach is probably the easiest to use everywhere and is the easiest one to implement as a built-in function. Another thing to look at is how log depth affects all this, especially anything in DerivedCommand.createLogDepthCommand.
The text was updated successfully, but these errors were encountered:
I wish I had seen this sooner, for ModelExperimental we've been doing yet a different way: positionMC *= 0.0 (see CPUStylingStageVS.glsl). This makes an assumption that WebGL won't render zero-area triangles as a single pixel. We'd have to refactor the shader a bit. If we just switched to gl_Position, the value is likely to get clobbered by later shader stages.
But also, in this forum thread I saw a use case where a user wanted to hide a specific building in a vertex shader so something else could be rendered in its place. We'd need another variable in custom shaders to hide a vertex, as positionMC doesn't have a w component.
There are several systems that batch features together into a single draw call and hide individual features in the vertex shader by accessing their show property in the batch table and forcing them to be clipped. All these systems have a slightly different way of doing this.
gl_Position *= show;
inCesium3DTileBatchTable.js
PointCloud.js
(for 3D Tiles) usesgl_Position.w *= float(show);
(see 8479 - Fix grey screen on Other/Unclassified toggle #8538) andgl_PointSize *= float(show);
Primitive.js
distance display condition usesgl_Position *= show;
PointPrimitiveCollection
gl_PointSize = totalSize * show;
andgl_Position *= show;
and sets alpha to 0.0 (see Fixed Hidden Point Primitive Bug #8054).positionEC.xyz = vec3(0.0, 0.0, 1.0);
(see Clip point in PointPrimitiveCollection properly #8542).positionEC.xyz = vec3(0.0);
.BillboardCollection
usespositionEC.xyz = vec3(0.0);
for small eye distance scales and eye distance translucency.The
gl_Position.w *= show
approach is probably the easiest to use everywhere and is the easiest one to implement as a built-in function. Another thing to look at is how log depth affects all this, especially anything inDerivedCommand.createLogDepthCommand
.The text was updated successfully, but these errors were encountered: