-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
100 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Unity.Mathematics; | ||
#if UNITY_EDITOR | ||
using UnityEditor; | ||
using UnityEditor.AssetImporters; | ||
#endif | ||
using UnityEngine; | ||
|
||
// The monobehaviour that will actually compile the transpiled code into a shader in the editor and automatically apply it | ||
[ExecuteInEditMode] | ||
public class VoxelGraphCompiler: MonoBehaviour { | ||
// Takes in the voxel graph, transpiles it, and compiles it to a proper compute shader | ||
public void Compile(VoxelGraph graph) { | ||
#if UNITY_EDITOR | ||
string source = graph.Transpile(); | ||
//AssetImportContext ctx = new AssetImportContext(); | ||
//ShaderUtil.CreateComputeShaderAsset(, source); | ||
#else | ||
Debug.LogError("Cannot transpile code at runtime"); | ||
#endif | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
Runtime/Generation/Test.cs.meta → Runtime/Generation/Compiler.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#if UNITY_EDITOR | ||
using UnityEngine; | ||
using UnityEditor.AssetImporters; | ||
using System.IO; | ||
|
||
[ScriptedImporter(1, "customtahini")] | ||
public class Importer : ScriptedImporter { | ||
public override void OnImportAsset(AssetImportContext ctx) { | ||
|
||
} | ||
} | ||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters