[bug and fix] shadow volumes broken at near distances for 3dtiles vector

Hi I think I found a bug about 3d tiles vector and … temporal fix.

  1. A concise explanation of the problem you’re experiencing.

  2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

Shadow volumes seem to be broken at distances close to the camera. It is almost the same problem with issue6461(https://github.com/AnalyticalGraphicsInc/cesium/issues/6461) except it is about 3d tiles vector.

launch the 3D Tiles Terrain Classification Sandcastle([https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=3D Tiles Terrain Classification.html](http://3D Tiles Terrain Classification))

go to a corner and zoom in to a view something like this:

… and Setting viewer.scene.logarithmicDepthBuffer = false; gets rid of the problem like issue6461.

  1. Temporal solution:

So I tried to test some code

insert "DISABLE_GL_POSITION_LOG_DEPTH " define for all vertexShader for 3d tiles(3d tilesPrimitive at Scene/Vector3DTilePrimitive.js) like issue6461

var vs = new ShaderSource({

defines : ['DISABLE_GL_POSITION_LOG_DEPTH '],

sources : [vsSource]

});

vs = new ShaderSource({

defines : ['DISABLE_GL_POSITION_LOG_DEPTH '],

sources : [VectorTileVS]

});

var pickVS = new ShaderSource({

defines : ['DISABLE_GL_POSITION_LOG_DEPTH '],

sources : [vsSource]

});

It works for me.

I hope this is reviewed and applied.

Thanks cesium team

shyoo.

Thanks for bringing this up shyoo. It is similar to the issue you mentioned, but I think is slightly closer to #6573 so I bumped that with this report.

If you’d like to submit your fix, see our Contributing Guide. We would appreciate the step towards getting this fixed!

Thanks,

Gabby