Initial Compute Shader for Plate Generation.
This commit is contained in:
parent
9d2dd0ca82
commit
47ca1265e6
8 changed files with 214 additions and 29 deletions
40
src/Main.cs
40
src/Main.cs
|
|
@ -1,10 +1,13 @@
|
|||
#nullable enable
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Godot.Collections;
|
||||
using Array = System.Array;
|
||||
|
||||
public partial class Main : Control
|
||||
{
|
||||
|
|
@ -39,6 +42,43 @@ public partial class Main : Control
|
|||
Projector.GatherPoints(_planetHelper, int.Parse(GetNode<LineEdit>("%Resolution").Text));
|
||||
AxialTiltChanged(GetNode<LineEdit>("%AxialTilt").Text);
|
||||
UpdateTime();
|
||||
|
||||
_planetHelper.InitializeGeneration();
|
||||
_planetHelper.Plates[0].Color = _planetHelper.GetInitialColor(true);
|
||||
//_planetHelper.Plates[1].Color = _planetHelper.GetInitialColor(true);
|
||||
//_planetHelper.Plates[2].Color = _planetHelper.GetInitialColor(false);
|
||||
//_planetHelper.Plates[3].Color = _planetHelper.GetInitialColor(false);
|
||||
|
||||
// for (int i = 0; i < 1; i++)
|
||||
// {
|
||||
// for (int point = 0; point < points.Length; point++)
|
||||
// {
|
||||
// for (int neighbor = 0; neighbor < 6; neighbor++)
|
||||
// {
|
||||
// if (neighbors[point * 6 + neighbor] == -1)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// int x = plateids[point];
|
||||
// int y = neighbors[point * 6 + neighbor];
|
||||
// int z = plateids[y];
|
||||
// if (x != -1 && z == -1)
|
||||
// {
|
||||
// // Neighbor unclaimed, and we can claim it.
|
||||
// plateids[neighbors[point * 6 +neighbor]] = plateids[point];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// int index = 0;
|
||||
// foreach (int plate in plateids)
|
||||
// {
|
||||
// if (plate != -1)
|
||||
// _planetHelper.Mdt.SetVertexColor(index, _planetHelper.Plates[plate].Color);
|
||||
// index++;
|
||||
// }
|
||||
// _planetHelper.UpdateMesh();
|
||||
}
|
||||
|
||||
Vector3 _pointerPosition = Vector3.Zero;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue