react-native-cesium 1.0.6 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -11
- package/ReactNativeCesium.podspec +1 -1
- package/android/CMakeLists.txt +5 -3
- package/android/src/main/cpp/CesiumBridgeAndroid.cpp +197 -227
- package/android/src/main/cpp/CesiumBridgeAndroid.h +48 -49
- package/android/src/main/cpp/cpp-adapter.cpp +2 -2
- package/android/src/main/cpp/vulkan/VulkanBackend.cpp +1010 -569
- package/android/src/main/cpp/vulkan/VulkanBackend.h +121 -12
- package/android/src/main/cpp/vulkan/shaders/sky.frag +20 -10
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/CesiumBridgeJNI.kt +28 -0
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/HybridCesiumView.kt +295 -58
- package/cpp/engine/CameraSmoother.cpp +99 -0
- package/cpp/engine/CameraSmoother.hpp +29 -0
- package/cpp/engine/CameraTargetState.cpp +49 -0
- package/cpp/engine/CameraTargetState.hpp +121 -0
- package/cpp/engine/CesiumEngine.cpp +206 -60
- package/cpp/engine/CesiumEngine.hpp +77 -10
- package/cpp/engine/EngineTunables.hpp +79 -0
- package/cpp/engine/GeoidConverter.cpp +36 -0
- package/cpp/engine/GeoidConverter.hpp +10 -0
- package/cpp/engine/GlobeCamera.cpp +7 -2
- package/cpp/engine/MetricsAggregator.cpp +71 -0
- package/cpp/engine/MetricsAggregator.hpp +54 -0
- package/cpp/engine/TileLifecycleManager.cpp +0 -12
- package/cpp/engine/TileLifecycleManager.hpp +0 -3
- package/cpp/third_party/egm96/EGM96.c +289 -0
- package/cpp/third_party/egm96/EGM96.h +45 -0
- package/cpp/third_party/egm96/EGM96_data.h +65372 -0
- package/ios/CesiumBridge.h +24 -5
- package/ios/CesiumBridge.mm +149 -271
- package/ios/HybridCesiumView.swift +197 -40
- package/ios/metal/MetalBackend.mm +72 -23
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts +26 -0
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JCesiumMetrics.hpp +5 -1
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.cpp +109 -1
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.hpp +24 -0
- package/nitrogen/generated/android/c++/views/JHybridCesiumViewStateUpdater.cpp +48 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CameraState.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CesiumMetrics.kt +32 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/HybridCesiumViewSpec.kt +72 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Quaternion.kt +19 -0
- package/nitrogen/generated/ios/ReactNativeCesium-Swift-Cxx-Bridge.hpp +30 -0
- package/nitrogen/generated/ios/c++/HybridCesiumViewSpecSwift.hpp +85 -1
- package/nitrogen/generated/ios/c++/views/HybridCesiumViewComponent.mm +60 -0
- package/nitrogen/generated/ios/swift/CesiumMetrics.swift +7 -2
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec.swift +12 -0
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec_cxx.swift +288 -0
- package/nitrogen/generated/shared/c++/CesiumMetrics.hpp +5 -1
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.hpp +25 -1
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.cpp +132 -0
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.hpp +13 -1
- package/nitrogen/generated/shared/json/CesiumViewConfig.json +12 -0
- package/package.json +4 -4
- package/scripts/cesium/clone.mjs +1 -1
- package/src/specs/cesium-view.nitro.ts +29 -0
- package/cpp/engine/DeletionQueue.cpp +0 -28
- package/cpp/engine/DeletionQueue.hpp +0 -28
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
|
+
#include "engine/EngineTunables.hpp"
|
|
3
4
|
#include "renderer/IGPUBackend.hpp"
|
|
4
5
|
|
|
5
6
|
#define VK_USE_PLATFORM_ANDROID_KHR
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
#include <cstdint>
|
|
10
11
|
#include <deque>
|
|
11
12
|
#include <mutex>
|
|
13
|
+
#include <string>
|
|
12
14
|
#include <vector>
|
|
13
15
|
|
|
14
16
|
namespace reactnativecesium {
|
|
@@ -19,6 +21,13 @@ struct VulkanTexture {
|
|
|
19
21
|
VkImageView imageView = VK_NULL_HANDLE;
|
|
20
22
|
VkSampler sampler = VK_NULL_HANDLE;
|
|
21
23
|
VkDescriptorSet descriptorSet = VK_NULL_HANDLE;
|
|
24
|
+
uint32_t width = 0;
|
|
25
|
+
uint32_t height = 0;
|
|
26
|
+
uint32_t mipLevels = 1;
|
|
27
|
+
// True until the deferred upload command for this texture has been submitted.
|
|
28
|
+
// Bound textures with `pendingUpload == true` are skipped (the fallback is
|
|
29
|
+
// used instead) — prevents reading from a still-uninitialised image.
|
|
30
|
+
bool pendingUpload = false;
|
|
22
31
|
};
|
|
23
32
|
|
|
24
33
|
class VulkanBackend : public IGPUBackend {
|
|
@@ -34,6 +43,11 @@ public:
|
|
|
34
43
|
void drawScene(const FrameResult& frame) override;
|
|
35
44
|
void endFrame() override;
|
|
36
45
|
|
|
46
|
+
// Cache directory used to persist the VkPipelineCache between sessions and
|
|
47
|
+
// (in future) any other on-disk Vulkan artefacts. Must be called before
|
|
48
|
+
// `initialize` to take effect on cold start.
|
|
49
|
+
void setCacheDir(const std::string& cacheDir) { cacheDir_ = cacheDir; }
|
|
50
|
+
|
|
37
51
|
void* createRasterTexture(const uint8_t* pixels, int32_t width, int32_t height);
|
|
38
52
|
void freeRasterTexture(void* tex);
|
|
39
53
|
|
|
@@ -45,12 +59,14 @@ public:
|
|
|
45
59
|
void setMsaaSampleCount(int sampleCount);
|
|
46
60
|
|
|
47
61
|
private:
|
|
62
|
+
// ── Init helpers ─────────────────────────────────────────────────────────
|
|
48
63
|
void createInstance();
|
|
49
64
|
void pickPhysicalDevice();
|
|
50
65
|
void createDevice();
|
|
51
66
|
void createSwapchain();
|
|
52
67
|
void createRenderPass();
|
|
53
68
|
void createDepthResources();
|
|
69
|
+
void createMsaaResources();
|
|
54
70
|
void createFramebuffers();
|
|
55
71
|
void createCommandPool();
|
|
56
72
|
void createCommandBuffers();
|
|
@@ -59,6 +75,10 @@ private:
|
|
|
59
75
|
void createPipelineLayout();
|
|
60
76
|
void createSkyPipeline();
|
|
61
77
|
void createTerrainPipeline();
|
|
78
|
+
void createGraphicsPipelinesAll();
|
|
79
|
+
void destroyGraphicsPipelinesAll();
|
|
80
|
+
void createPipelineCache();
|
|
81
|
+
void persistPipelineCache();
|
|
62
82
|
void createFallbackTexture();
|
|
63
83
|
void createDescriptorPool();
|
|
64
84
|
void createWaterMaskPool();
|
|
@@ -67,22 +87,72 @@ private:
|
|
|
67
87
|
void cleanupSwapchain();
|
|
68
88
|
void recreateSwapchain();
|
|
69
89
|
|
|
90
|
+
// Pick the best supported MSAA count <= `requested` (1, 2, 4, or 8).
|
|
91
|
+
// `requested` of 0 or 1 disables MSAA.
|
|
92
|
+
VkSampleCountFlagBits resolveMsaaSamples(int requested) const;
|
|
93
|
+
|
|
70
94
|
VkFormat pickDepthFormat() const;
|
|
71
95
|
|
|
72
|
-
|
|
73
|
-
|
|
96
|
+
// Picks a present mode: prefer MAILBOX (if `wantLowLatency`), then FIFO_RELAXED,
|
|
97
|
+
// then the default FIFO (always available per spec).
|
|
98
|
+
VkPresentModeKHR pickPresentMode() const;
|
|
99
|
+
|
|
100
|
+
uint32_t findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags props,
|
|
101
|
+
bool* outFound = nullptr);
|
|
102
|
+
|
|
103
|
+
// Creates a HOST_VISIBLE | HOST_COHERENT or DEVICE_LOCAL buffer.
|
|
104
|
+
bool createBuffer(VkDeviceSize size, VkBufferUsageFlags usage,
|
|
74
105
|
VkMemoryPropertyFlags props, VkBuffer& buffer,
|
|
75
106
|
VkDeviceMemory& memory);
|
|
76
107
|
void ensureBuffer(VkBuffer& buffer, VkDeviceMemory& memory, size_t& capacity,
|
|
77
108
|
size_t needed, const void* data, VkBufferUsageFlags usage);
|
|
78
|
-
VkCommandBuffer beginSingleTimeCommands();
|
|
79
|
-
void endSingleTimeCommands(VkCommandBuffer commandBuffer);
|
|
80
109
|
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
|
|
110
|
+
// ── Deferred upload pipeline ─────────────────────────────────────────────
|
|
111
|
+
// Each call to createRasterTexture / createWaterMaskTexture allocates a slice
|
|
112
|
+
// of the persistent staging ring, copies the pixels in, and queues a
|
|
113
|
+
// PendingUpload entry. The next beginFrame() submits all pending uploads in
|
|
114
|
+
// one command buffer with a single batched pipeline barrier, no
|
|
115
|
+
// vkQueueWaitIdle, no per-tile staging buffer churn.
|
|
116
|
+
struct PendingUpload {
|
|
117
|
+
VulkanTexture* tex;
|
|
118
|
+
VkDeviceSize stagingOffset;
|
|
119
|
+
uint32_t width;
|
|
120
|
+
uint32_t height;
|
|
121
|
+
uint64_t enqueueFrame;
|
|
122
|
+
};
|
|
123
|
+
void initStagingRing(VkDeviceSize bytes);
|
|
124
|
+
// Reserve `size` bytes from the staging ring; returns the offset and updates
|
|
125
|
+
// the head. Returns SIZE_MAX if the ring is full this frame (the call site
|
|
126
|
+
// falls back to an unbatched synchronous upload for that one tile).
|
|
127
|
+
VkDeviceSize allocateStagingSlice(VkDeviceSize size);
|
|
128
|
+
// Submit all queued uploads on the graphics queue (no wait). The submit's
|
|
129
|
+
// signal fence is one of `uploadFences_`; in N frames' time we know the GPU
|
|
130
|
+
// is done with the staging slices and can free their offsets.
|
|
131
|
+
void flushPendingUploads();
|
|
132
|
+
|
|
133
|
+
// Synchronous fallback used during init (fallback texture) and as the
|
|
134
|
+
// last-resort path when the staging ring is exhausted for a frame.
|
|
135
|
+
VkCommandBuffer beginSingleTimeCommands();
|
|
136
|
+
bool endSingleTimeCommands(VkCommandBuffer commandBuffer);
|
|
137
|
+
|
|
138
|
+
// Generic image creator (replaces createRasterTexture / createWaterMaskTexture
|
|
139
|
+
// duplication). Allocates the image, image view, sampler, descriptor set, and
|
|
140
|
+
// either enqueues a deferred upload (preferred) or runs the synchronous path.
|
|
141
|
+
VulkanTexture* createImageFromPixels(const uint8_t* pixels,
|
|
142
|
+
int32_t width, int32_t height,
|
|
143
|
+
VkDescriptorPool pool,
|
|
144
|
+
VkSampleCountFlagBits samples,
|
|
145
|
+
bool wantMipmaps);
|
|
146
|
+
|
|
147
|
+
// Generates mipmap chain via blit (assumes the image has TRANSFER_SRC bit
|
|
148
|
+
// and was allocated with mipLevels > 1). Records into `cmd`, leaves the
|
|
149
|
+
// image in SHADER_READ_ONLY_OPTIMAL.
|
|
150
|
+
void recordGenerateMipmaps(VkCommandBuffer cmd, VkImage image,
|
|
151
|
+
uint32_t width, uint32_t height,
|
|
152
|
+
uint32_t mipLevels);
|
|
84
153
|
|
|
85
154
|
void* window_ = nullptr; // ANativeWindow*
|
|
155
|
+
std::string cacheDir_;
|
|
86
156
|
|
|
87
157
|
VkInstance instance_ = VK_NULL_HANDLE;
|
|
88
158
|
VkPhysicalDevice physicalDevice_ = VK_NULL_HANDLE;
|
|
@@ -98,15 +168,30 @@ private:
|
|
|
98
168
|
std::vector<VkImage> swapchainImages_;
|
|
99
169
|
std::vector<VkImageView> swapchainImageViews_;
|
|
100
170
|
|
|
171
|
+
// Anisotropy / MSAA support cached at device-pick time.
|
|
172
|
+
bool supportsAnisotropy_ = false;
|
|
173
|
+
float maxAnisotropy_ = 1.0f;
|
|
174
|
+
VkSampleCountFlagBits supportedMsaaMask_ = VK_SAMPLE_COUNT_1_BIT;
|
|
175
|
+
VkSampleCountFlagBits sampleCount_ = VK_SAMPLE_COUNT_1_BIT;
|
|
176
|
+
|
|
101
177
|
VkRenderPass renderPass_ = VK_NULL_HANDLE;
|
|
102
178
|
std::vector<VkFramebuffer> framebuffers_;
|
|
103
179
|
|
|
180
|
+
// Single-sample depth (always present).
|
|
104
181
|
VkImage depthImage_ = VK_NULL_HANDLE;
|
|
105
182
|
VkDeviceMemory depthMemory_ = VK_NULL_HANDLE;
|
|
106
183
|
VkImageView depthImageView_ = VK_NULL_HANDLE;
|
|
107
184
|
|
|
108
|
-
|
|
185
|
+
// Multi-sample colour resolve target (present iff sampleCount_ > 1).
|
|
186
|
+
VkImage msaaColorImage_ = VK_NULL_HANDLE;
|
|
187
|
+
VkDeviceMemory msaaColorMemory_ = VK_NULL_HANDLE;
|
|
188
|
+
VkImageView msaaColorView_ = VK_NULL_HANDLE;
|
|
189
|
+
|
|
190
|
+
VkCommandPool commandPool_ = VK_NULL_HANDLE;
|
|
109
191
|
std::vector<VkCommandBuffer> commandBuffers_;
|
|
192
|
+
std::vector<VkCommandBuffer> uploadCommandBuffers_; // one per frame-in-flight
|
|
193
|
+
|
|
194
|
+
VkPipelineCache pipelineCache_ = VK_NULL_HANDLE;
|
|
110
195
|
|
|
111
196
|
VkDescriptorSetLayout terrainDescSetLayout_ = VK_NULL_HANDLE; // set 0: UBO
|
|
112
197
|
VkDescriptorSetLayout terrainTexLayout_ = VK_NULL_HANDLE; // set 1: texture
|
|
@@ -120,8 +205,10 @@ private:
|
|
|
120
205
|
VkDescriptorPool waterMaskPool_ = VK_NULL_HANDLE;
|
|
121
206
|
|
|
122
207
|
VulkanTexture fallbackTexture_;
|
|
208
|
+
VulkanTexture* fallbackTexturePtr_ = nullptr; // Heap pointer kept alive for pending upload
|
|
123
209
|
VkDescriptorSet fallbackTexDescSet_ = VK_NULL_HANDLE;
|
|
124
210
|
VulkanTexture fallbackWaterMaskTex_;
|
|
211
|
+
VulkanTexture* fallbackWaterMaskTexPtr_ = nullptr; // Heap pointer kept alive for pending upload
|
|
125
212
|
VkDescriptorSet fallbackWaterMaskDescSet_ = VK_NULL_HANDLE;
|
|
126
213
|
|
|
127
214
|
// Sky UBO — persistently mapped
|
|
@@ -130,12 +217,17 @@ private:
|
|
|
130
217
|
void* skyUboMapped_ = nullptr;
|
|
131
218
|
VkDescriptorSet skyDescSet_ = VK_NULL_HANDLE;
|
|
132
219
|
|
|
133
|
-
static constexpr int kMaxFramesInFlight =
|
|
134
|
-
|
|
135
|
-
// Cesium can cache many hundreds of tiles at high zoom; 2048 gives headroom.
|
|
136
|
-
static constexpr int kMaxRasterTextures = 2048;
|
|
220
|
+
static constexpr int kMaxFramesInFlight = tunables::kMaxFramesInFlight;
|
|
221
|
+
static constexpr int kMaxRasterTextures = tunables::kMaxRasterTextures;
|
|
137
222
|
|
|
223
|
+
// Per-frame-in-flight semaphores: signalled by acquire and waited on by the
|
|
224
|
+
// frame's command-buffer submit. Sized by kMaxFramesInFlight.
|
|
138
225
|
std::vector<VkSemaphore> imageAvailableSemaphores_;
|
|
226
|
+
// Per-swapchain-image semaphores: signalled by the frame's submit and waited
|
|
227
|
+
// on by present. Sized by swapchainImages_.size() — keyed on imageIndex_,
|
|
228
|
+
// not frameIndex_. This avoids the well-known 3-image swapchain race where
|
|
229
|
+
// the same per-frame semaphore can be signalled twice for two in-flight
|
|
230
|
+
// images (Khronos sample VulkanGuide chapter 1).
|
|
139
231
|
std::vector<VkSemaphore> renderFinishedSemaphores_;
|
|
140
232
|
std::vector<VkFence> inFlightFences_;
|
|
141
233
|
int frameIndex_ = 0;
|
|
@@ -169,6 +261,23 @@ private:
|
|
|
169
261
|
int viewportWidth_ = 0;
|
|
170
262
|
int viewportHeight_ = 0;
|
|
171
263
|
bool needsSwapchainRecreate_ = false;
|
|
264
|
+
int pendingMsaaRequest_ = 0; // applied between frames
|
|
265
|
+
|
|
266
|
+
// ── Persistent staging ring (P0-vk-uploads) ──────────────────────────────
|
|
267
|
+
// Single host-visible buffer, persistently mapped. Each upload allocates a
|
|
268
|
+
// 256-byte aligned slice; the head wraps every kStagingSize bytes. Slices
|
|
269
|
+
// are kept alive for kMaxFramesInFlight frames after submit (free in
|
|
270
|
+
// beginFrame when the matching upload fence is signalled).
|
|
271
|
+
static constexpr VkDeviceSize kStagingSize = 64ULL * 1024ULL * 1024ULL;
|
|
272
|
+
static constexpr VkDeviceSize kStagingAlignment = 256;
|
|
273
|
+
VkBuffer stagingBuffer_ = VK_NULL_HANDLE;
|
|
274
|
+
VkDeviceMemory stagingMemory_ = VK_NULL_HANDLE;
|
|
275
|
+
uint8_t* stagingMapped_ = nullptr;
|
|
276
|
+
VkDeviceSize stagingHead_ = 0;
|
|
277
|
+
VkFence uploadFences_[kMaxFramesInFlight] = {};
|
|
278
|
+
std::vector<PendingUpload> pendingUploadsCurrent_; // queued, not yet submitted
|
|
279
|
+
std::vector<PendingUpload> uploadsInFlight_[kMaxFramesInFlight]; // submitted
|
|
280
|
+
std::mutex stagingMutex_;
|
|
172
281
|
|
|
173
282
|
// Deferred texture deletion — freeRasterTexture enqueues here so no GPU stall
|
|
174
283
|
// on eviction; beginFrame flushes entries old enough to be safe.
|
|
@@ -29,13 +29,20 @@ void main() {
|
|
|
29
29
|
vec2 at = rsi(org, rd, AR);
|
|
30
30
|
if (at.y < 0.0) { outColor = vec4(0, 0, 0, 1); return; }
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
// No earth-surface tmax clamp — that creates a visible band discontinuity
|
|
33
|
+
// at the geometric horizon (rays below horizon get short atmospheric path,
|
|
34
|
+
// showing as lighter sky between the orange horizon glow and terrain).
|
|
35
|
+
// Instead integrate full atmospheric path and clamp underground sample
|
|
36
|
+
// heights to zero so they contribute ground-level density.
|
|
33
37
|
float tmax = at.y;
|
|
34
|
-
if (er.x > 0.0) tmax = min(tmax, er.x);
|
|
35
38
|
float tmin = max(at.x, 0.0);
|
|
36
39
|
if (tmin >= tmax) { outColor = vec4(0, 0, 0, 1); return; }
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
// Sample counts halved from 16/4 to 8/2 — visually negligible at typical
|
|
42
|
+
// phone DPI / viewport sizes (a 24-bit screen can't resolve the difference
|
|
43
|
+
// in atmospheric scattering past ~6 primary samples), saves ~half the
|
|
44
|
+
// expensive `exp` calls per pixel.
|
|
45
|
+
const int S = 8, L = 2;
|
|
39
46
|
float ss = (tmax - tmin) / float(S);
|
|
40
47
|
vec3 rayl = vec3(0), miel = vec3(0);
|
|
41
48
|
float oR = 0.0, oM = 0.0;
|
|
@@ -43,7 +50,7 @@ void main() {
|
|
|
43
50
|
for (int i = 0; i < S; ++i) {
|
|
44
51
|
float t = tmin + (float(i) + 0.5) * ss;
|
|
45
52
|
vec3 sp = org + rd * t;
|
|
46
|
-
float h = length(sp) - ER;
|
|
53
|
+
float h = max(0.0, length(sp) - ER);
|
|
47
54
|
float hr = exp(-h / 10000.0) * ss, hm = exp(-h / 3200.0) * ss;
|
|
48
55
|
oR += hr; oM += hm;
|
|
49
56
|
|
|
@@ -74,13 +81,16 @@ void main() {
|
|
|
74
81
|
float mPh = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cos2) / pow(1.0 + g2 - 2.0 * MG * cosT, 1.5);
|
|
75
82
|
vec3 col = LINT * (rayl * RAY * rPh + miel * MIE3 * mPh);
|
|
76
83
|
col = 1.0 - exp(-col * 1.1);
|
|
77
|
-
col *= vec3(0.
|
|
84
|
+
col *= vec3(0.30, 0.55, 1.0);
|
|
78
85
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
// Single-scatter atmosphere produces sunset-like yellow at horizons with
|
|
87
|
+
// long path lengths (because blue out-scatters faster). Real daytime sky
|
|
88
|
+
// appears whitish-blue at horizon thanks to multiple scattering, which we
|
|
89
|
+
// approximate here by blending toward a natural blue based on the
|
|
90
|
+
// total atmospheric path length traversed by the view ray.
|
|
91
|
+
float pathLen = tmax - tmin;
|
|
92
|
+
float hazeFactor = smoothstep(100000.0, 600000.0, pathLen);
|
|
93
|
+
col = mix(col, vec3(0.35, 0.58, 0.90), hazeFactor * 0.65);
|
|
84
94
|
|
|
85
95
|
outColor = vec4(col, 1.0);
|
|
86
96
|
}
|
|
@@ -67,8 +67,22 @@ class CesiumBridgeJNI {
|
|
|
67
67
|
fun getMetricsTilesVisited(): Int = nativeGetMetricsTilesVisited(nativePtr)
|
|
68
68
|
fun getMetricsIonTokenConfigured(): Boolean = nativeGetMetricsIonTokenConfigured(nativePtr)
|
|
69
69
|
fun getMetricsTilesetReady(): Boolean = nativeGetMetricsTilesetReady(nativePtr)
|
|
70
|
+
fun getMetricsTlsConfigured(): Boolean = nativeGetMetricsTlsConfigured(nativePtr)
|
|
70
71
|
fun getMetricsCreditsPlainText(): String = nativeGetMetricsCreditsPlainText(nativePtr)
|
|
71
72
|
|
|
73
|
+
fun setMaximumCachedMiB(v: Int) = nativeSetMaximumCachedMiB(nativePtr, v)
|
|
74
|
+
fun setPreloadAncestors(v: Boolean) = nativeSetPreloadAncestors(nativePtr, v)
|
|
75
|
+
fun setPreloadSiblings(v: Boolean) = nativeSetPreloadSiblings(nativePtr, v)
|
|
76
|
+
fun setForbidHoles(v: Boolean) = nativeSetForbidHoles(nativePtr, v)
|
|
77
|
+
fun setEnableWaterMask(v: Boolean) = nativeSetEnableWaterMask(nativePtr, v)
|
|
78
|
+
fun setEnableFogCulling(v: Boolean) = nativeSetEnableFogCulling(nativePtr, v)
|
|
79
|
+
fun setEnforceCulledScreenSpaceError(v: Boolean) = nativeSetEnforceCulledScreenSpaceError(nativePtr, v)
|
|
80
|
+
fun setCulledScreenSpaceError(v: Double) = nativeSetCulledScreenSpaceError(nativePtr, v)
|
|
81
|
+
fun setEnableLodTransitionPeriod(v: Boolean) = nativeSetEnableLodTransitionPeriod(nativePtr, v)
|
|
82
|
+
fun setLodTransitionLength(v: Double) = nativeSetLodTransitionLength(nativePtr, v)
|
|
83
|
+
fun setSqliteCacheMaxRows(v: Int) = nativeSetSqliteCacheMaxRows(nativePtr, v)
|
|
84
|
+
fun setTaskProcessorThreads(v: Int) = nativeSetTaskProcessorThreads(nativePtr, v)
|
|
85
|
+
|
|
72
86
|
private external fun nativeCreate(): Long
|
|
73
87
|
private external fun nativeInit(ptr: Long, surface: Surface, w: Int, h: Int, cacheDir: String, cacertPath: String)
|
|
74
88
|
private external fun nativeShutdown(ptr: Long)
|
|
@@ -115,5 +129,19 @@ class CesiumBridgeJNI {
|
|
|
115
129
|
private external fun nativeGetMetricsTilesVisited(ptr: Long): Int
|
|
116
130
|
private external fun nativeGetMetricsIonTokenConfigured(ptr: Long): Boolean
|
|
117
131
|
private external fun nativeGetMetricsTilesetReady(ptr: Long): Boolean
|
|
132
|
+
private external fun nativeGetMetricsTlsConfigured(ptr: Long): Boolean
|
|
118
133
|
private external fun nativeGetMetricsCreditsPlainText(ptr: Long): String
|
|
134
|
+
|
|
135
|
+
private external fun nativeSetMaximumCachedMiB(ptr: Long, v: Int)
|
|
136
|
+
private external fun nativeSetPreloadAncestors(ptr: Long, v: Boolean)
|
|
137
|
+
private external fun nativeSetPreloadSiblings(ptr: Long, v: Boolean)
|
|
138
|
+
private external fun nativeSetForbidHoles(ptr: Long, v: Boolean)
|
|
139
|
+
private external fun nativeSetEnableWaterMask(ptr: Long, v: Boolean)
|
|
140
|
+
private external fun nativeSetEnableFogCulling(ptr: Long, v: Boolean)
|
|
141
|
+
private external fun nativeSetEnforceCulledScreenSpaceError(ptr: Long, v: Boolean)
|
|
142
|
+
private external fun nativeSetCulledScreenSpaceError(ptr: Long, v: Double)
|
|
143
|
+
private external fun nativeSetEnableLodTransitionPeriod(ptr: Long, v: Boolean)
|
|
144
|
+
private external fun nativeSetLodTransitionLength(ptr: Long, v: Double)
|
|
145
|
+
private external fun nativeSetSqliteCacheMaxRows(ptr: Long, v: Int)
|
|
146
|
+
private external fun nativeSetTaskProcessorThreads(ptr: Long, v: Int)
|
|
119
147
|
}
|