Skip to content

Commit d17ffb0

Browse files
committed
change terrain shader to use custom bilinear sampling for mapbox elevation textures. standard bilinear sampling errors on certain elevation changes, point sampling causes steps in low tex resolution. solution is this custom bilinear where we sample the point, convert to elevation and only lerp afterwards
1 parent c796879 commit d17ffb0

File tree

5 files changed

+5446
-1506
lines changed

5 files changed

+5446
-1506
lines changed

Runtime/Mapbox/BaseModule/Unity/Visuals/Materials/ElevatedTerrainMaterial.mat

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ MonoBehaviour:
1515
version: 7
1616
--- !u!21 &2100000
1717
Material:
18-
serializedVersion: 6
18+
serializedVersion: 8
1919
m_ObjectHideFlags: 0
2020
m_CorrespondingSourceObject: {fileID: 0}
2121
m_PrefabInstance: {fileID: 0}
2222
m_PrefabAsset: {fileID: 0}
2323
m_Name: ElevatedTerrainMaterial
24-
m_Shader: {fileID: -6465566751694194690, guid: e6f20eca448696e4eb2a244f2914805d, type: 3}
25-
m_ShaderKeywords:
24+
m_Shader: {fileID: -6465566751694194690, guid: e44ed2d518a7c4a20bd9799360a9e7ed, type: 3}
25+
m_Parent: {fileID: 0}
26+
m_ModifiedSerializedProperties: 0
27+
m_ValidKeywords: []
28+
m_InvalidKeywords: []
2629
m_LightmapFlags: 4
2730
m_EnableInstancingVariants: 0
2831
m_DoubleSidedGI: 0
@@ -31,6 +34,7 @@ Material:
3134
MotionVector: User
3235
disabledShaderPasses:
3336
- MOTIONVECTORS
37+
m_LockedProperties:
3438
m_SavedProperties:
3539
serializedVersion: 3
3640
m_TexEnvs:
@@ -78,6 +82,7 @@ Material:
7882
m_Texture: {fileID: 0}
7983
m_Scale: {x: 1, y: 1}
8084
m_Offset: {x: 0, y: 0}
85+
m_Ints: []
8186
m_Floats:
8287
- Boolean_d8ca466cd8bb4fb286885becb29145db: 1
8388
- _AlphaClip: 0
@@ -102,6 +107,7 @@ Material:
102107
- _SrcBlend: 1
103108
- _Surface: 0
104109
- _TileScale: 5
110+
- _UsingLinearColorspace: 1
105111
- _WorkflowMode: 1
106112
- _ZWrite: 1
107113
m_Colors:

0 commit comments

Comments
 (0)