Skip to content

Instantly share code, notes, and snippets.

View LukasFratzl's full-sized avatar
🌱
Loves Healthy Food

flow____ LukasFratzl

🌱
Loves Healthy Food
View GitHub Profile
@LukasFratzl
LukasFratzl / MeshApplyJob.cs
Last active November 14, 2022 17:20
Apply a Unity Mesh with the Jobs System 2022
/*
LICENCE -> MIT License
AUTHOR -> Lukas Fratzl
GIT -> https://github.com/LukasFratzl
DESCRIPTION -> My implementation of "Marching Cubes" in Unity with Burst and Multithreaded with c# Jobs
the algorithm is smart enough to generate every "Grid Size" with every wanted "Resolution"
as extra with a "Smooth" or "Flat" normal generation
USAGE -> Assign all field and allocate the Native Containers, Schedule the Job and Complete it
When you don't know how the mesh is created just watch this Gist -> https://gist.github.com/LukasFratzl/988f1c9736b43684deb319880ac6c6fc
@LukasFratzl
LukasFratzl / MarchingCubesJob.cs
Last active June 2, 2025 13:06
Marching Cubes in Unity with Burst and C# Jobs
/*
LICENCE -> MIT License
AUTHOR -> Lukas Fratzl
GIT -> https://github.com/LukasFratzl
DESCRIPTION -> My implementation of "Marching Cubes" in Unity with Burst and Multithreaded with c# Jobs
the algorithm is smart enough to generate every "Grid Size" with every wanted "Resolution"
as extra with a "Smooth" or "Flat" normal generation
USAGE -> Assign all field and allocate the Native Containers, Schedule the Job and Complete it
-> SEE EXAMPLE JOB DOWN BELOW!
GENERATE SPEED -> RESOLUTION 32 -> 26.9 ms | 27 024 Vertices | 1 CHUNK
@LukasFratzl
LukasFratzl / AllocatingNativeArrayWithReflection.cs
Created December 3, 2021 09:23
A example of Allocating and resizing NativeArrays generic with Reflection in Unity c# Jobs | DOTS
public class AllocatingNativeArrayWithReflection : MonoBehaviour
{
protected virtual void AllocateCharacters(ref CharacterMotorJobs job, int length)
{
HandleArraysAll(ref job._motorJob, ArrayAction.ADD, length, new int[0]);
}
protected virtual void DisposeCharacters(ref CharacterMotorJobs job, int[] indexesToRemove)