Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/3dtiles mobile support #142

Merged
merged 9 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Assets/3dTiles/Materials/cubemat.mat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Material:
m_PrefabAsset: {fileID: 0}
m_Name: cubemat
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
Expand All @@ -18,6 +20,7 @@ Material:
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
Expand Down Expand Up @@ -125,4 +128,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
version: 7
2 changes: 0 additions & 2 deletions Assets/3dTiles/tileset/Read3DTileset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ public void SetTilePrioritiser(TilePrioritiser tilePrioritiser)
usingPrioritiser = (tilePrioritiser);
}



private void RelativeCenterChanged(Vector3 cameraOffset)
{
//Point set up from new origin
Expand Down
11 changes: 9 additions & 2 deletions Assets/3dTiles/tileset/WebTilePrioritiser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ public class WebTilePrioritiser : TilePrioritiser
private int downloadAvailable = 0;

private Camera currentCamera;


private bool pauseNewDownloads = false;

public void PauseDownloads(bool paused)
{
pauseNewDownloads = paused;
}

/// <summary>
/// If a tile completed loading, recalcule priorities
/// </summary>
Expand Down Expand Up @@ -180,7 +187,7 @@ private void Apply()
if (downloadAvailable <= 0) break;

var tile = PrioritisedTiles[i];
if (tile.content && tile.content.State == Content.ContentLoadState.NOTLOADING)
if (!pauseNewDownloads && tile.content && tile.content.State == Content.ContentLoadState.NOTLOADING)
{
downloadAvailable--;
tile.content.Load();
Expand Down
8 changes: 8 additions & 0 deletions Assets/KadasterViewer/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/KadasterViewer/Editor/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Assets/KadasterViewer/Editor/Scripts/MultithreadingWebGL.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace Netherlands3D
{
[InitializeOnLoad]
public class MultithreadingWebGL : MonoBehaviour
{
static MultithreadingWebGL()
{
PlayerSettings.WebGL.threadsSupport = false;
}
}
}
11 changes: 11 additions & 0 deletions Assets/KadasterViewer/Editor/Scripts/MultithreadingWebGL.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Material:
m_PrefabAsset: {fileID: 0}
m_Name: netherlands_backdrop
m_Shader: {fileID: 4800000, guid: 0406db5a14f94604a8c57ccfbc9f3b46, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords:
- _ALPHATEST_ON
m_InvalidKeywords:
Expand All @@ -20,6 +22,7 @@ Material:
stringTagMap:
RenderType: TransparentCutout
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
Expand Down Expand Up @@ -82,6 +85,7 @@ Material:
m_Ints: []
m_Floats:
- _AlphaClip: 1
- _AlphaToMask: 1
- _Blend: 0
- _BlendOp: 0
- _BumpScale: 1
Expand All @@ -100,6 +104,7 @@ Material:
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0.1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _FlipbookBlending: 0
- _FlipbookMode: 0
Expand All @@ -119,6 +124,7 @@ Material:
- _SoftParticlesNearFadeDistance: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
Expand All @@ -143,4 +149,4 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5
version: 7
38 changes: 37 additions & 1 deletion Assets/KadasterViewer/Runtime/Prefabs/ConfigLoader.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 6826521633573672048}
- component: {fileID: 6826521633573672049}
- component: {fileID: 4428085048782309644}
- component: {fileID: 5590578820280158205}
m_Layer: 0
m_Name: ConfigLoader
m_TagString: Untagged
Expand Down Expand Up @@ -60,7 +61,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fff92e6a69b9d234cbb60c523eaff631, type: 3}
m_Name:
m_EditorClassIdentifier:
overrideResolutionSSE: 1024
maxScreenHeightInPixels: 1080
maxScreenHeightInPixelsMobile: 1080
mobileModeEnabled:
m_PersistentCalls:
m_Calls:
Expand Down Expand Up @@ -105,3 +107,37 @@ MonoBehaviour:
m_PostInfinity: 2
m_RotationOrder: 4
showPriorityNumbers: 0
--- !u!114 &5590578820280158205
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6826521633573672050}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bda199de660f4334b8a50d8e350bdf29, type: 3}
m_Name:
m_EditorClassIdentifier:
onEvent: {fileID: 11400000, guid: 8e2a533380abfec4dbcc38a827eac488, type: 2}
onTriggered:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 4428085048782309644}
m_TargetAssemblyTypeName: Netherlands3D.Core.Tiles.WebTilePrioritiser, Assembly-CSharp
m_MethodName: PauseDownloads
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
onTrue:
m_PersistentCalls:
m_Calls: []
onFalse:
m_PersistentCalls:
m_Calls: []
21 changes: 15 additions & 6 deletions Assets/KadasterViewer/Runtime/Renderers/KadasterRenderer.asset
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3}
m_Name: KadasterRenderer
m_EditorClassIdentifier:
k_AssetVersion: 9
k_AssetPreviousVersion: 9
k_AssetVersion: 11
k_AssetPreviousVersion: 11
m_RendererType: 1
m_RendererData: {fileID: 0}
m_RendererDataList:
Expand All @@ -23,16 +23,18 @@ MonoBehaviour:
m_RequireOpaqueTexture: 0
m_OpaqueDownsampling: 1
m_SupportsTerrainHoles: 0
m_StoreActionsOptimization: 0
m_SupportsHDR: 0
m_HDRColorBufferPrecision: 0
m_MSAA: 1
m_RenderScale: 1
m_UpscalingFilter: 0
m_FsrOverrideSharpness: 0
m_FsrSharpness: 0.92
m_EnableLODCrossFade: 1
m_LODCrossFadeDitheringType: 1
m_MainLightRenderingMode: 1
m_MainLightShadowsSupported: 1
m_MainLightShadowmapResolution: 2048
m_MainLightShadowmapResolution: 1024
m_AdditionalLightsRenderingMode: 1
m_AdditionalLightsPerObjectLimit: 0
m_AdditionalLightShadowsSupported: 0
Expand All @@ -42,7 +44,7 @@ MonoBehaviour:
m_AdditionalLightsShadowResolutionTierHigh: 1024
m_ReflectionProbeBlending: 0
m_ReflectionProbeBoxProjection: 0
m_ShadowDistance: 1000
m_ShadowDistance: 1963.1964
m_ShadowCascadeCount: 1
m_Cascade2Split: 0.25
m_Cascade3Split: {x: 0.1, y: 0.3}
Expand All @@ -54,13 +56,17 @@ MonoBehaviour:
m_SoftShadowsSupported: 0
m_ConservativeEnclosingSphere: 1
m_NumIterationsEnclosingSphere: 64
m_SoftShadowQuality: 2
m_AdditionalLightsCookieResolution: 4096
m_AdditionalLightsCookieFormat: 3
m_UseSRPBatcher: 1
m_SupportsDynamicBatching: 0
m_MixedLightingSupported: 0
m_SupportsLightCookies: 1
m_SupportsLightLayers: 0
m_DebugLevel: 0
m_StoreActionsOptimization: 0
m_EnableRenderGraph: 0
m_UseAdaptivePerformance: 1
m_ColorGradingMode: 0
m_ColorGradingLutSize: 32
Expand All @@ -70,6 +76,9 @@ MonoBehaviour:
m_LocalShadowsAtlasResolution: 256
m_MaxPixelLights: 0
m_ShadowAtlasResolution: 256
m_ShaderVariantLogLevel: 0
m_VolumeFrameworkUpdateMode: 0
m_Textures:
blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3}
bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3}
m_ShaderVariantLogLevel: 0
m_ShadowCascades: 0
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ MonoBehaviour:
samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3}
stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3}
fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3}
fallbackLoadingPS: {fileID: 4800000, guid: 7f888aff2ac86494babad1c2c5daeee2, type: 3}
materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3}
coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3}
coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3}
Expand All @@ -50,6 +51,4 @@ MonoBehaviour:
m_DepthPrimingMode: 0
m_CopyDepthMode: 0
m_AccurateGbufferNormals: 0
m_ClusteredRendering: 0
m_TileSize: 32
m_IntermediateTextureMode: 1
Loading