forked from ferram4/Ferram-Aerospace-Research
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from dkavolis/debug_voxels
Debug voxels
- Loading branch information
Showing
15 changed files
with
577 additions
and
215 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
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,78 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!21 &2100000 | ||
Material: | ||
serializedVersion: 6 | ||
m_ObjectHideFlags: 0 | ||
m_PrefabParentObject: {fileID: 0} | ||
m_PrefabInternal: {fileID: 0} | ||
m_Name: FARVoxelMeshMaterial | ||
m_Shader: {fileID: 4800000, guid: 31ef6a8843dfc6f4bbab6ae8daf6cb80, type: 3} | ||
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _GLOSSYREFLECTIONS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A | ||
_SPECULARHIGHLIGHTS_OFF | ||
m_LightmapFlags: 4 | ||
m_EnableInstancingVariants: 0 | ||
m_DoubleSidedGI: 0 | ||
m_CustomRenderQueue: -1 | ||
stringTagMap: {} | ||
disabledShaderPasses: [] | ||
m_SavedProperties: | ||
serializedVersion: 3 | ||
m_TexEnvs: | ||
- _BumpMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailAlbedoMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailMask: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _DetailNormalMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _EmissionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MainTex: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _MetallicGlossMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _OcclusionMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
- _ParallaxMap: | ||
m_Texture: {fileID: 0} | ||
m_Scale: {x: 1, y: 1} | ||
m_Offset: {x: 0, y: 0} | ||
m_Floats: | ||
- PixelSnap: 0 | ||
- _BumpScale: 1 | ||
- _Cutoff: 0.45 | ||
- _DetailNormalMapScale: 1 | ||
- _DstBlend: 10 | ||
- _GlossMapScale: 1 | ||
- _Glossiness: 0 | ||
- _GlossyReflections: 0 | ||
- _Metallic: 0 | ||
- _Mode: 3 | ||
- _OcclusionStrength: 1 | ||
- _Parallax: 0.02 | ||
- _SmoothnessTextureChannel: 1 | ||
- _SpecularHighlights: 0 | ||
- _SrcBlend: 1 | ||
- _UVSec: 0 | ||
- _ZWrite: 0 | ||
m_Colors: | ||
- _Color: {r: 1, g: 1, b: 1, a: 1} | ||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Shader "FerramAerospaceResearch/Debug Voxel Mesh" { | ||
Properties{ | ||
_Color("Color", Color) = (1,1,1,1) | ||
[NoScaleOffset] _MainTex("Albedo (RGB)", 2D) = "white" {} | ||
_Cutoff("Alpha Cutoff", Range(0.01,1)) = 0.5 | ||
} | ||
SubShader | ||
{ | ||
Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane"} | ||
Blend SrcAlpha OneMinusSrcAlpha | ||
LOD 200 | ||
ZWrite Off | ||
Cull Off | ||
|
||
// Simple AlphaTest pass to cut off transparent areas | ||
Pass{ | ||
Tags{ "Queue" = "AlphaTest" "IgnoreProjector" = "True" "RenderType" = "TransparentCutout" } | ||
ColorMask 0 | ||
ZWrite On | ||
|
||
CGPROGRAM | ||
#pragma vertex vert | ||
#pragma fragment frag | ||
|
||
#include "UnityCG.cginc" | ||
|
||
struct v2f { | ||
float4 vertex : SV_POSITION; | ||
float2 texcoord : TEXCOORD0; | ||
}; | ||
|
||
sampler2D _MainTex; | ||
fixed _Cutoff; | ||
|
||
v2f vert(appdata_img v) | ||
{ | ||
v2f o; | ||
o.vertex = UnityObjectToClipPos(v.vertex); | ||
o.texcoord = v.texcoord; | ||
return o; | ||
} | ||
|
||
fixed4 frag(v2f i) : SV_Target | ||
{ | ||
fixed4 col = tex2D(_MainTex, i.texcoord); | ||
clip(col.a - _Cutoff); | ||
return 0; | ||
} | ||
ENDCG | ||
} | ||
|
||
CGPROGRAM | ||
#pragma surface surf Lambert alpha:blend decal:blend | ||
|
||
sampler2D _MainTex; | ||
|
||
struct Input { | ||
float2 uv_MainTex; | ||
}; | ||
|
||
fixed4 _Color; | ||
fixed _Cutoff; | ||
|
||
void surf(Input IN, inout SurfaceOutput o) { | ||
// Albedo comes from a texture tinted by color | ||
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; | ||
o.Albedo = c.rgb; | ||
o.Alpha = c.a; | ||
|
||
// Need to set emmision to faded color for no lighting effect | ||
o.Emission = c.rgb * c.a; | ||
} | ||
ENDCG | ||
} | ||
FallBack "Diffuse" | ||
} |
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
Oops, something went wrong.