优化渲染帧率
parent
bcb9c769c4
commit
2c5d110ee8
|
@ -2,7 +2,7 @@
|
|||
"name": "global-navigation-satellite-system",
|
||||
"description": "global-navigation-satellite-system",
|
||||
"author": "hwasmart",
|
||||
"version": "5.5.7",
|
||||
"version": "6.0.0",
|
||||
"main": "dist/main/app.js",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
// 加密关键字
|
||||
const keyword = 'BD'
|
||||
export { keyword }
|
|
@ -1,5 +1,6 @@
|
|||
import { app, globalShortcut, BrowserWindow, ipcMain, dialog } from 'electron'
|
||||
import { join } from 'path'
|
||||
import { keyword } from './KeyWord'
|
||||
|
||||
const child_process = require('child_process')
|
||||
const crypto = require('crypto')
|
||||
|
@ -51,7 +52,7 @@ async function checkLaunchEnv() {
|
|||
try {
|
||||
const passResult: any = await queryPass(passPath, passValue)
|
||||
const keyResult: any = await queryKey(keyPath, keyValue)
|
||||
if(cryptMD5(keyResult.stdout.slice(83,119) + 'BD') == passResult.stdout.slice(72,108)){
|
||||
if(cryptMD5(keyResult.stdout.slice(83,119) + keyword) == passResult.stdout.slice(72,108)){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,7 +17,7 @@ import { ref, watch, onMounted } from 'vue'
|
|||
|
||||
const store = useStore()
|
||||
const selected = ref('')
|
||||
watch(selected, (value) => store.dispatch('satelliteSystem/setName', { name: value }))
|
||||
watch(selected, (value) => {store.dispatch('satelliteSystem/setName', { name: value });window.allowUpdate = true;})
|
||||
onMounted(() => selected.value = Object.keys(option_dic)[0])
|
||||
|
||||
const option_dic = {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -67,16 +67,8 @@ const onTrackButtonClicked = (id) => {
|
|||
store.dispatch('satelliteSystem/track', id)
|
||||
}
|
||||
const onShowStateCheckboxChanged = (id) => {
|
||||
// console.log(window.viewer.scene.primitives._primitives[window.viewer.scene.primitives._primitives.length-1])
|
||||
// window.viewer.scene.primitives._primitives[window.viewer.scene.primitives._primitives.length-1]._polylines.forEach(element => {
|
||||
// if(element._id._id == id){
|
||||
// if(element._show){
|
||||
// element._show == false
|
||||
// }else{
|
||||
// element._show == true
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
window.allowUpdate = true;
|
||||
window.toallowUpdate = true;
|
||||
someshow.value = true
|
||||
showarr.value[id] = !showarr.value[id]
|
||||
store.dispatch('satelliteSystem/toggleShow', id)
|
||||
|
|
|
@ -1,134 +0,0 @@
|
|||
PolylineCollection.prototype.update = function (e) {
|
||||
if (removePolylines(this), 0 !== this._polylines.length && this.show) {
|
||||
updateMode$1(this, e);
|
||||
var t,
|
||||
i = e.context,
|
||||
r = e.mapProjection,
|
||||
n = this._propertiesChanged;
|
||||
if (this._createBatchTable) {
|
||||
if (0 === ContextLimits.maximumVertexTextureImageUnits)
|
||||
throw new RuntimeError("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");
|
||||
createBatchTable(this, i),
|
||||
this._createBatchTable = !1
|
||||
}
|
||||
if (this._createVertexArray || computeNewBuffersUsage(this))
|
||||
createVertexArrays(this, i, r);
|
||||
else if (this._polylinesUpdated) {
|
||||
var a = this._polylinesToUpdate;
|
||||
if (this._mode !== SceneMode$1.SCENE3D)
|
||||
for (var o = a.length, s = 0; s < o; ++s)
|
||||
(t = a[s]).update();
|
||||
if (n[POSITION_SIZE_INDEX] || n[MATERIAL_INDEX])
|
||||
createVertexArrays(this, i, r);
|
||||
else for (var l = a.length, c = this._polylineBuckets, u = 0; u < l; ++u) {
|
||||
n = (t = a[u])._propertiesChanged;
|
||||
var d = t._bucket,
|
||||
h = 0;
|
||||
for (var p in c)
|
||||
if (c.hasOwnProperty(p)) {
|
||||
if (c[p] === d) {
|
||||
n[POSITION_INDEX$4] && d.writeUpdate(h, t, this._positionBuffer, r);
|
||||
break
|
||||
}
|
||||
h += c[p].lengthOfPositions
|
||||
}
|
||||
if ((n[SHOW_INDEX$4] || n[WIDTH_INDEX]) && this._batchTable.setBatchedAttribute(t._index, 0, new Cartesian2(t._width, t._show)), this._batchTable.attributes.length > 2) {
|
||||
if (n[POSITION_INDEX$4] || n[POSITION_SIZE_INDEX]) {
|
||||
var f = e.mode === SceneMode$1.SCENE2D ? t._boundingVolume2D : t._boundingVolumeWC,
|
||||
m = EncodedCartesian3.fromCartesian(f.center, scratchUpdatePolylineEncodedCartesian),
|
||||
g = Cartesian4.fromElements(m.low.x, m.low.y, m.low.z, f.radius, scratchUpdatePolylineCartesian4);
|
||||
this._batchTable.setBatchedAttribute(t._index, 2, m.high),
|
||||
this._batchTable.setBatchedAttribute(t._index, 3, g)
|
||||
}
|
||||
if (n[DISTANCE_DISPLAY_CONDITION]) {
|
||||
var _ = scratchNearFarCartesian2;
|
||||
_.x = 0,
|
||||
_.y = Number.MAX_VALUE;
|
||||
var y = t.distanceDisplayCondition;
|
||||
defined(y) && (_.x = y.near, _.y = y.far),
|
||||
this._batchTable.setBatchedAttribute(t._index, 4, _)
|
||||
}
|
||||
} t._clean()
|
||||
}
|
||||
a.length = 0,
|
||||
this._polylinesUpdated = !1
|
||||
}
|
||||
n = this._propertiesChanged;
|
||||
for (var v = 0; v < NUMBER_OF_PROPERTIES$2; ++v)
|
||||
n[v] = 0;
|
||||
var C = Matrix4.IDENTITY;
|
||||
e.mode === SceneMode$1.SCENE3D && (C = this.modelMatrix);
|
||||
var T = e.passes,
|
||||
S = 0 !== e.morphTime;
|
||||
if (defined(this._opaqueRS) && this._opaqueRS.depthTest.enabled === S || (this._opaqueRS = RenderState.fromCache({ depthMask: S, depthTest: { enabled: S } })), defined(this._translucentRS) && this._translucentRS.depthTest.enabled === S || (this._translucentRS = RenderState.fromCache({ blending: BlendingState$1.ALPHA_BLEND, depthMask: !S, depthTest: { enabled: S } })), this._batchTable.update(e), T.render || T.pick)
|
||||
createCommandLists(this, e, this._colorCommands, C)
|
||||
}
|
||||
};
|
||||
var boundingSphereScratch$2 = new BoundingSphere,
|
||||
boundingSphereScratch2 = new BoundingSphere;
|
||||
function createCommandLists(e, t, i, r) {
|
||||
for (var n = t.context, a = t.commandList, o = i.length, s = 0, l = !0, c = e._vertexArrays, u = e.debugShowBoundingVolume, d = e._batchTable.getUniformMapCallback(), h = c.length, p = 0; p < h; ++p)
|
||||
for (var f = c[p], m = f.buckets, g = m.length, _ = 0; _ < g; ++_) {
|
||||
for (var y, v, C, T, S = m[_], A = S.offset, x = S.bucket.shaderProgram, E = S.bucket.polylines, b = E.length, P = 0, D = 0; D < b; ++D) {
|
||||
var w = E[D],
|
||||
M = createMaterialId(w._material);
|
||||
if (M !== y) {
|
||||
if (defined(y) && P > 0) {
|
||||
var I = v.isTranslucent();
|
||||
s >= o ? (C = new DrawCommand({ owner: e }), i.push(C)) : C = i[s],
|
||||
++s,
|
||||
T = combine$2(d(v._uniforms), e._uniformMap),
|
||||
C.boundingVolume = BoundingSphere.clone(boundingSphereScratch$2, C.boundingVolume),
|
||||
C.modelMatrix = r,
|
||||
C.shaderProgram = x,
|
||||
C.vertexArray = f.va,
|
||||
C.renderState = I ? e._translucentRS : e._opaqueRS,
|
||||
C.pass = I ? Pass$1.TRANSLUCENT : Pass$1.OPAQUE,
|
||||
C.debugShowBoundingVolume = u,
|
||||
C.pickId = "v_pickColor",
|
||||
C.uniformMap = T,
|
||||
C.count = P,
|
||||
C.offset = A,
|
||||
A += P,
|
||||
P = 0,
|
||||
l = !0,
|
||||
a.push(C)
|
||||
}
|
||||
(v = w._material).update(n),
|
||||
y = M
|
||||
}
|
||||
for (var R, O = w._locatorBuckets, B = O.length, L = 0; L < B; ++L) {
|
||||
var F = O[L];
|
||||
F.locator === S && (P += F.count)
|
||||
}
|
||||
t.mode === SceneMode$1.SCENE3D ? R = w._boundingVolumeWC : t.mode === SceneMode$1.COLUMBUS_VIEW ? R = w._boundingVolume2D : t.mode === SceneMode$1.SCENE2D ? defined(w._boundingVolume2D) && ((R = BoundingSphere.clone(w._boundingVolume2D, boundingSphereScratch2)).center.x = 0) : defined(w._boundingVolumeWC) && defined(w._boundingVolume2D) && (R = BoundingSphere.union(w._boundingVolumeWC, w._boundingVolume2D, boundingSphereScratch2)),
|
||||
l ? (l = !1, BoundingSphere.clone(R, boundingSphereScratch$2)) : BoundingSphere.union(R, boundingSphereScratch$2, boundingSphereScratch$2)
|
||||
} defined(y) && P > 0 && (
|
||||
s >= o ? (C = new DrawCommand({ owner: e }), i.push(C)) : C = i[s],
|
||||
++s,
|
||||
T = combine$2(d(v._uniforms), e._uniformMap),
|
||||
C.boundingVolume = BoundingSphere.clone(boundingSphereScratch$2, C.boundingVolume),
|
||||
C.modelMatrix = r,
|
||||
C.shaderProgram = x,
|
||||
C.vertexArray = f.va,
|
||||
C.renderState = v.isTranslucent() ? e._translucentRS : e._opaqueRS,
|
||||
C.pass = v.isTranslucent() ? Pass$1.TRANSLUCENT : Pass$1.OPAQUE,
|
||||
C.debugShowBoundingVolume = u,
|
||||
C.pickId = "v_pickColor",
|
||||
C.uniformMap = T,
|
||||
C.count = P,
|
||||
C.offset = A,
|
||||
l = !0,
|
||||
a.push(C)
|
||||
),
|
||||
y = void 0
|
||||
}
|
||||
i.length = s
|
||||
}
|
||||
function computeNewBuffersUsage(e) {
|
||||
var t = !1,
|
||||
i = e._propertiesChanged,
|
||||
r = e._positionBufferUsage;
|
||||
return i[POSITION_INDEX$4] ? r.bufferUsage !== BufferUsage$1.STREAM_DRAW ? (t = !0, r.bufferUsage = BufferUsage$1.STREAM_DRAW, r.frameCount = 100) : r.frameCount = 100 : r.bufferUsage !== BufferUsage$1.STATIC_DRAW && (0 === r.frameCount ? (t = !0, r.bufferUsage = BufferUsage$1.STATIC_DRAW) : r.frameCount--),
|
||||
t
|
||||
}
|
Loading…
Reference in New Issue