ok @Marco13 and @ZhefengJin
but what about preventing clipping that generate artifact ?
test2.glb (7.1 MB)
void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
vec3 positionMC = vsInput.attributes.positionMC;
// 1. Transform position to Eye Coordinates (EC)
vec4 positionEC = czm_modelView * vec4(positionMC, 1.0);
// --- Vertex is valid and not culled, proceed with standard outputs ---
// 3. Store the (potentially modified) Model Coordinates in vsOutput
// This is often used by Cesium for material properties, batchId, etc.
vsOutput.positionMC = positionMC;
// 5. Calculate the final Clip Space position
gl_Position = czm_projection * positionEC;
}
void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
vec4 color = vec4(1.,0.,0.,1.);
material.diffuse = color.rgb;
material.alpha = color.a;
}
const _viewer: Cesium.Viewer = new Cesium.Viewer(cesiumContainer, {
globe: false, // <== DISABLE globe !
contextOptions: {
requestWebgl1: false,
allowTextureFilterAnisotropic: false,
webgl: {
alpha: false,
depth: false,
stencil: false,
antialias: true,
premultipliedAlpha: false,
preserveDrawingBuffer: true
}
},
baseLayer: false,
shadows: false,
terrainShadows: Cesium.ShadowMode.DISABLED,
homeButton: false,
sceneModePicker: false,
baseLayerPicker: false,
geocoder: false,
timeline: false,
animation: false,
fullscreenButton: false,
infoBox: false,
showRenderLoopErrors: true,
navigationHelpButton: false,
automaticallyTrackDataSourceClocks: false,
navigationInstructionsInitiallyVisible: false,
requestRenderMode: requestRenderMode,
maximumRenderTimeChange: requestRenderMode ? Infinity : undefined,
selectionIndicator: false,
skyBox: undefined,
skyAtmosphere: new Cesium.SkyAtmosphere(),
mapProjection: projection,
scene3DOnly: false,
mapMode2D: Cesium.MapMode2D.INFINITE_SCROLL,
sceneMode: Cesium.SceneMode.SCENE3D
})
_viewer.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)
_viewer.scene.skyAtmosphere.show = false
_viewer.scene.fog.enabled = false
if(_viewer.scene.skyBox){
_viewer.scene.skyBox.show = false
}
_viewer.scene.debugShowFramesPerSecond = false
type or paste code here