Skip to content

Commit 2599356

Browse files
author
KEVIN-ALIEN\kevin
committed
-Added Example Scenes
-Improved Projection visualisation by reordering submeshes
1 parent 312454e commit 2599356

19 files changed

+110975
-162
lines changed

Framework/Assets/Content/DonutSphere.prefab

Lines changed: 16109 additions & 0 deletions
Large diffs are not rendered by default.

Framework/Assets/Content/DonutSphere.prefab.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.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInternal: {fileID: 0}
8+
m_GameObject: {fileID: 0}
9+
m_Enabled: 1
10+
m_EditorHideFlags: 0
11+
m_Script: {fileID: 11500000, guid: f1b452c89b327224e8d9b2578f4ad393, type: 3}
12+
m_Name: Placer_Sphere_WeightedCollection
13+
m_EditorClassIdentifier:
14+
_elements:
15+
- _objects:
16+
- Object: {fileID: 1112730076457278, guid: 764d774b409a42f47bcc15dbf208ece8, type: 2}
17+
Weight: 1
18+
- Object: {fileID: 1480393257502300, guid: 1d22bc580c62e7444ac61d9bb9ec5607, type: 2}
19+
Weight: 1
20+
_totalWeight: 2
21+
_allowNull: 0
22+
_names:
23+
- Weighted Gameobjects

Framework/Assets/Content/Placer_Sphere_WeightedCollection.asset.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.

Framework/Assets/Content/SmallSphere_WeightedCollection.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ MonoBehaviour:
1313
m_EditorClassIdentifier:
1414
_elements:
1515
- _objects:
16-
- Object: {fileID: 1480393257502300, guid: 1d22bc580c62e7444ac61d9bb9ec5607, type: 2}
16+
- Object: {fileID: 1046169861554080, guid: a1541aa148a7a474ead2106666420a7e, type: 2}
1717
Weight: 1
1818
_totalWeight: 1
1919
_allowNull: 1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInternal: {fileID: 0}
8+
m_GameObject: {fileID: 0}
9+
m_Enabled: 1
10+
m_EditorHideFlags: 0
11+
m_Script: {fileID: 11500000, guid: f1b452c89b327224e8d9b2578f4ad393, type: 3}
12+
m_Name: Sphere_WeightedCollection
13+
m_EditorClassIdentifier:
14+
_elements:
15+
- _objects:
16+
- Object: {fileID: 1480393257502300, guid: 1d22bc580c62e7444ac61d9bb9ec5607, type: 2}
17+
Weight: 1
18+
_totalWeight: 1
19+
_allowNull: 0
20+
_names:
21+
- Weighted Gameobjects

Framework/Assets/Content/Sphere_WeightedCollection.asset.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.

Framework/Assets/Content/small_sphere.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Transform:
6666
m_GameObject: {fileID: 1246832042700710}
6767
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
6868
m_LocalPosition: {x: 0, y: 0, z: 0}
69-
m_LocalScale: {x: 0.25, y: 0.25, z: 0.25}
69+
m_LocalScale: {x: 0.6, y: 0.6, z: 0.6}
7070
m_Children: []
7171
m_Father: {fileID: 4583839352784326}
7272
m_RootOrder: 0

Framework/Assets/Helpers_KevinLoddewykx/PoissonDiskSampling/Data/PoissonInternalEditorData.Visual.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public partial class PoissonInternalEditorData
88
{
99
public void InitVisual(PoissonModeData modeData, PoissonData data, PoissonPlacer placer, bool isWindow, bool refreshTopMaterial)
1010
{
11-
if(!isWindow && HelperVisual && refreshTopMaterial)
11+
if (!isWindow && HelperVisual && refreshTopMaterial)
1212
{
1313
// Always create new TopMaterial, because when we copy the placer, we don't want the TopMaterial shared
1414
TopMaterial = new Material(TopMaterial);
@@ -42,7 +42,7 @@ public void InitVisual(PoissonModeData modeData, PoissonData data, PoissonPlacer
4242
}
4343

4444
HelperVisual = new GameObject();
45-
45+
4646

4747
HelperVisual.transform.parent = parentObj.transform;
4848

@@ -56,7 +56,7 @@ public void InitVisual(PoissonModeData modeData, PoissonData data, PoissonPlacer
5656
{
5757
DeleteHelper = HelperVisual.AddComponent<PoissonDeleteHelper>();
5858
}
59-
59+
6060
RefreshVisual(modeData, data, isWindow);
6161
}
6262
if (placer && !isWindow)
@@ -174,8 +174,8 @@ private void CreateCylinderMesh()
174174

175175
CylinderMesh.subMeshCount = 2;
176176

177-
CylinderMesh.SetIndices(indicesTop, MeshTopology.Triangles, 0);
178-
CylinderMesh.SetIndices(indicesSideBotom, MeshTopology.Triangles, 1);
177+
CylinderMesh.SetIndices(indicesSideBotom, MeshTopology.Triangles, 0);
178+
CylinderMesh.SetIndices(indicesTop, MeshTopology.Triangles, 1);
179179

180180
EllipseMesh.vertices = vertices;
181181
EllipseMesh.normals = normals;
@@ -387,7 +387,7 @@ private void CreateBoxMesh()
387387
PlaneMesh.uv = BoxMesh.uv;
388388

389389
BoxMesh.subMeshCount = 2;
390-
BoxMesh.SetIndices(new int[] { 0, 1, 2, 3, 27, 26, 25, 24 }, MeshTopology.Quads, 0);
390+
391391
BoxMesh.SetIndices(new int[] {
392392
4, 5, 6, 7,
393393
8, 9, 10, 11,
@@ -398,7 +398,8 @@ private void CreateBoxMesh()
398398
35, 34, 33, 32,
399399
39, 38, 37, 36,
400400
43, 42, 41, 40,
401-
47, 46, 45, 44 }, MeshTopology.Quads, 1);
401+
47, 46, 45, 44 }, MeshTopology.Quads, 0);
402+
BoxMesh.SetIndices(new int[] { 0, 1, 2, 3, 27, 26, 25, 24 }, MeshTopology.Quads, 1);
402403

403404
PlaneMesh.subMeshCount = 1;
404405
PlaneMesh.SetIndices(BoxMesh.GetIndices(0), MeshTopology.Quads, 0);
@@ -465,7 +466,7 @@ public void UpdateVisualTexture(PoissonModeData modeData, PoissonData data)
465466

466467
public void UpdateVisualMode(PoissonModeData modeData)
467468
{
468-
if(!HelperVisual)
469+
if (!HelperVisual)
469470
{
470471
return;
471472
}
@@ -484,7 +485,7 @@ public void UpdateVisualMode(PoissonModeData modeData)
484485
break;
485486
case DistributionMode.ProjectionPlane:
486487
MeshFilter.sharedMesh = BoxMesh;
487-
Renderer.sharedMaterials = new Material[] { TopMaterial, FaceMaterial };
488+
Renderer.sharedMaterials = new Material[] { FaceMaterial, TopMaterial };
488489
TopMaterial.SetInt("_IsEllipse", 0);
489490
break;
490491
case DistributionMode.Ellipse:
@@ -494,15 +495,15 @@ public void UpdateVisualMode(PoissonModeData modeData)
494495
break;
495496
case DistributionMode.ProjectionEllipse:
496497
MeshFilter.sharedMesh = CylinderMesh;
497-
Renderer.sharedMaterials = new Material[] { TopMaterial, FaceMaterial };
498+
Renderer.sharedMaterials = new Material[] { FaceMaterial, TopMaterial };
498499
TopMaterial.SetInt("_IsEllipse", 1);
499500
break;
500501
}
501502
}
502503

503504
public void UpdateAllowVisualTransformChanges(bool isWindow)
504505
{
505-
if(!HelperVisual)
506+
if (!HelperVisual)
506507
{
507508
return;
508509
}
@@ -516,11 +517,11 @@ public void UpdateAllowVisualTransformChanges(bool isWindow)
516517
}
517518
else
518519
{
519-
HelperVisual.hideFlags = HideFlags.DontSave &~HideFlags.NotEditable;
520+
HelperVisual.hideFlags = HideFlags.DontSave & ~HideFlags.NotEditable;
520521
// Set transform to none, otherwise inspector won't update the values
521522
HelperVisual.transform.hideFlags = HideFlags.None;
522523
}
523-
524+
524525
MeshFilter.hideFlags = HideFlags.HideInInspector | HideFlags.DontSave | HideFlags.NotEditable;
525526
Renderer.hideFlags = HideFlags.HideInInspector | HideFlags.DontSave | HideFlags.NotEditable;
526527
if (!isWindow)

Framework/Assets/Helpers_KevinLoddewykx/PoissonDiskSampling/PoissonHelperShader.shader

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
Cull Back
2020
ZWrite Off
21-
BlendOp Add
2221

2322
CGPROGRAM
2423
// Physically based Standard lighting model, and enable shadows on all light types
@@ -75,7 +74,7 @@
7574
if (_UseMap)
7675
{
7776
c.rgb = tex2D(_MainTex, IN.uv_MainTex).rgb;
78-
c.a = _OuterColor.a;
77+
c.a = 0.925f;
7978
}
8079
else
8180
{

0 commit comments

Comments
 (0)