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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Threading.Tasks; | |
using UnityEditor; | |
using UnityEditor.PackageManager; | |
using UnityEditor.PackageManager.Requests; | |
using UnityEngine; | |
using static System.Environment; |
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
using UnityEngine; | |
public class MeshBlit : MonoBehaviour | |
{ | |
public RenderTexture rt; | |
public Mesh mesh; | |
public Material material; | |
public Vector3 meshPosition = new Vector3(0.5f, 0.5f, -1); |
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
Shader "Custom/StencilMask" { | |
Properties { | |
_StencilMask("Stencil mask", Int) = 0 | |
} | |
SubShader { | |
Tags { | |
"RenderType" = "Opaque" | |
"Queue" = "Geometry-100" | |
} |
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 script is designed to export a mass amount of MagicaVoxel .vox files | |
to .obj. Unlike Magica's internal exporter, this exporter preserves the | |
voxel vertices for easy manipulating in a 3d modeling program like Blender. | |
Various meshing algorithms are included (or to be included). MagicaVoxel | |
uses monotone triangulation (I think). The algorithms that will (or do) | |
appear in this script will use methods to potentially reduce rendering | |
artifacts that could be introduced by triangulation of this nature. | |