Skip to content

Commit f520278

Browse files
committed
Changed how pillar scatter is cleared
1 parent d43fab2 commit f520278

13 files changed

Lines changed: 4726 additions & 4560 deletions

PointPillars/Display/BBoxes/BBox.mat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Material:
2828
m_Scale: {x: 1, y: 1}
2929
m_Offset: {x: 0, y: 0}
3030
- _DataTex:
31-
m_Texture: {fileID: 8400000, guid: c635da8c29c26e045ba6f2e5f016ed31, type: 2}
31+
m_Texture: {fileID: 8400000, guid: c5f046f8971bed949abc8abb8290cda5, type: 2}
3232
m_Scale: {x: 1, y: 1}
3333
m_Offset: {x: 0, y: 0}
3434
- _DetailAlbedoMap:
@@ -84,5 +84,6 @@ Material:
8484
- _ZWrite: 1
8585
m_Colors:
8686
- _BBoxOffset: {r: 0, g: 0.5, b: 5, a: 0}
87+
- _BBoxScale: {r: 100, g: 100, b: 100, a: 1}
8788
- _Color: {r: 1, g: 1, b: 1, a: 1}
8889
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

PointPillars/Display/BBoxes/BBoxDraw.shader

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
{
55
_ControllerTex ("Controller", 2D) = "black" {}
66
_DataTex ("Data Texture", 2D) = "black"
7-
_BBoxOffset ("Box Position Offset", Vector) = (0, 0, 0, 0)
7+
_BBoxOffset ("Undo Root Position", Vector) = (0, 0, 0, 0)
8+
_BBoxScale ("Undo Root Scale", Vector) = (1, 1, 1, 1)
89
}
910
SubShader
1011
{
@@ -43,6 +44,7 @@
4344
Texture2D<float> _ControllerTex;
4445
Texture2D<float> _DataTex;
4546
float3 _BBoxOffset;
47+
float3 _BBoxScale;
4648

4749
void pR(inout float2 p, float a) {
4850
p = cos(a)*p + sin(a) * float2(p.y, -p.x);
@@ -62,7 +64,7 @@
6264
#ifdef UNITY_INSTANCING_ENABLED
6365

6466
uint count = getCount(_ControllerTex);
65-
uint id = UNITY_GET_INSTANCE_ID(v);
67+
uint id = UNITY_GET_INSTANCE_ID(v) % 33;
6668

6769
if (id < count)
6870
{
@@ -81,7 +83,7 @@
8183

8284
float3 pos = getPredictionPosition(_DataTex, id);
8385
newVert += pos - _BBoxOffset;
84-
o.vertex = UnityObjectToClipPos(float4(newVert, 1.0));
86+
o.vertex = UnityObjectToClipPos(float4(newVert / _BBoxScale, 1.0));
8587

8688
}
8789
#endif
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!21 &2100000
4+
Material:
5+
serializedVersion: 6
6+
m_ObjectHideFlags: 0
7+
m_CorrespondingSourceObject: {fileID: 0}
8+
m_PrefabInstance: {fileID: 0}
9+
m_PrefabAsset: {fileID: 0}
10+
m_Name: ClearScatter
11+
m_Shader: {fileID: 4800000, guid: 06d92c5894a28594e9a6d34487f1625b, type: 3}
12+
m_ShaderKeywords:
13+
m_LightmapFlags: 4
14+
m_EnableInstancingVariants: 0
15+
m_DoubleSidedGI: 0
16+
m_CustomRenderQueue: -1
17+
stringTagMap: {}
18+
disabledShaderPasses: []
19+
m_SavedProperties:
20+
serializedVersion: 3
21+
m_TexEnvs:
22+
- _BumpMap:
23+
m_Texture: {fileID: 0}
24+
m_Scale: {x: 1, y: 1}
25+
m_Offset: {x: 0, y: 0}
26+
- _ControllerTex:
27+
m_Texture: {fileID: 8400000, guid: b705c37cf22c17d4085ddc103e75c5fc, type: 2}
28+
m_Scale: {x: 1, y: 1}
29+
m_Offset: {x: 0, y: 0}
30+
- _DetailAlbedoMap:
31+
m_Texture: {fileID: 0}
32+
m_Scale: {x: 1, y: 1}
33+
m_Offset: {x: 0, y: 0}
34+
- _DetailMask:
35+
m_Texture: {fileID: 0}
36+
m_Scale: {x: 1, y: 1}
37+
m_Offset: {x: 0, y: 0}
38+
- _DetailNormalMap:
39+
m_Texture: {fileID: 0}
40+
m_Scale: {x: 1, y: 1}
41+
m_Offset: {x: 0, y: 0}
42+
- _EmissionMap:
43+
m_Texture: {fileID: 0}
44+
m_Scale: {x: 1, y: 1}
45+
m_Offset: {x: 0, y: 0}
46+
- _LayersTex:
47+
m_Texture: {fileID: 8400000, guid: c635da8c29c26e045ba6f2e5f016ed31, type: 2}
48+
m_Scale: {x: 1, y: 1}
49+
m_Offset: {x: 0, y: 0}
50+
- _MainTex:
51+
m_Texture: {fileID: 8400000, guid: c5f046f8971bed949abc8abb8290cda5, type: 2}
52+
m_Scale: {x: 1, y: 1}
53+
m_Offset: {x: 0, y: 0}
54+
- _MetallicGlossMap:
55+
m_Texture: {fileID: 0}
56+
m_Scale: {x: 1, y: 1}
57+
m_Offset: {x: 0, y: 0}
58+
- _OcclusionMap:
59+
m_Texture: {fileID: 0}
60+
m_Scale: {x: 1, y: 1}
61+
m_Offset: {x: 0, y: 0}
62+
- _ParallaxMap:
63+
m_Texture: {fileID: 0}
64+
m_Scale: {x: 1, y: 1}
65+
m_Offset: {x: 0, y: 0}
66+
m_Floats:
67+
- _BumpScale: 1
68+
- _ClearArea: 0
69+
- _ClearIndex: 0
70+
- _Cutoff: 0.5
71+
- _DetailNormalMapScale: 1
72+
- _DstBlend: 0
73+
- _GlossMapScale: 1
74+
- _Glossiness: 0.5
75+
- _GlossyReflections: 1
76+
- _MaxDist: 0.02
77+
- _Metallic: 0
78+
- _Mode: 0
79+
- _OcclusionStrength: 1
80+
- _Parallax: 0.02
81+
- _SmoothnessTextureChannel: 0
82+
- _SpecularHighlights: 1
83+
- _SrcBlend: 1
84+
- _UVSec: 0
85+
- _ZWrite: 1
86+
m_Colors:
87+
- _Color: {r: 1, g: 1, b: 1, a: 1}
88+
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

PointPillars/Materials/ClearScatter.mat.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PointPillars/Materials/Output3Buffer.mat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Material:
88
m_PrefabInstance: {fileID: 0}
99
m_PrefabAsset: {fileID: 0}
1010
m_Name: Output3Buffer
11-
m_Shader: {fileID: 4800000, guid: 8f7f004f37cdb0742b913966484c765e, type: 3}
11+
m_Shader: {fileID: 4800000, guid: b527f10110aa5c54682239d6f370b8ea, type: 3}
1212
m_ShaderKeywords:
1313
m_LightmapFlags: 4
1414
m_EnableInstancingVariants: 0
@@ -62,7 +62,7 @@ Material:
6262
m_Floats:
6363
- _BumpScale: 1
6464
- _ClearArea: 0
65-
- _ClearIndex: 2
65+
- _ClearIndex: 0
6666
- _Cutoff: 0.5
6767
- _DetailNormalMapScale: 1
6868
- _DstBlend: 0

0 commit comments

Comments
 (0)