Commit a072752f authored by Chae Ho Shin's avatar Chae Ho Shin

working model(sucessful intersection/cross section shader)

parent 249733ca
fileFormatVersion: 2
guid: 867860d8741228a4ca6f327e9bfc6a47
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2812c4f6c8546c644b67a679f02bdd8b
folderAsset: yes
timeCreated: 1474289161
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: e27434b86ff6a4540b1b312d5de6f467
timeCreated: 1474289632
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: 79ca8e8ec17a95047971744665076ea1
timeCreated: 1474312009
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: dc56c1e75f6d5f946936c2369f93dc1b
folderAsset: yes
timeCreated: 1474289352
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
%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: B
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: 2400
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 0, g: 0, b: 0.78431374, a: 1}
fileFormatVersion: 2
guid: 28169edc7bcf37640b8c627811d5d7a3
timeCreated: 1474289181
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DoubleFaceTransparent
m_Shader: {fileID: 4800000, guid: d977badb8d897414181f5093d079766c, type: 3}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 3
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 0.084}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: e1f5e546b3878d0469b1bc14be42baf5
timeCreated: 1474299302
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: G
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
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:
- _BumpScale: 1
- _Cutoff: 0
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0, g: 0.78431374, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: fe10db9a758c54940b20534595745db1
timeCreated: 1474289181
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: OnePlaneCrossSection
m_Shader: {fileID: 4800000, guid: dfb2ef60de11e934f9e7571d2eb7bf08, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 2000
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SrcBlend: 1
- _StencilMask: 255
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0, b: 0, a: 1}
- _CrossColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _PlaneNormal: {r: 0, g: 1, b: 0, a: 0}
- _PlanePosition: {r: 0, g: 0.98, b: 0, a: 1}
fileFormatVersion: 2
guid: 20fb938f954d7a94a939b71d6351efb5
timeCreated: 1474289444
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: R
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
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:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.78431374, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 5c48c2321d1002142b56e1e3a105c7db
timeCreated: 1474289181
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%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: StencilledUnlit
m_Shader: {fileID: 4800000, guid: 88b9999b87b4fd146a176b8e5bccc481, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: 3000
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 1926d72aee6ebef42b5e5b0b3c715026, type: 3}
m_Scale: {x: 0.25, y: 0.25}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
data:
first:
name: _StencilMask
second: 255
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
fileFormatVersion: 2
guid: 6730943d219e0b644a77e48c751f8df6
timeCreated: 1474300129
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%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: ThreeAAPlanesCrossSection
m_Shader: {fileID: 4800000, guid: b42f1ab5d8353214ab7616620a82e483, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: 2000
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 0.6838235, g: 0.030168673, b: 0.0675203, a: 1}
data:
first:
name: _CrossColor
second: {r: 0.875, g: 0.59945494, b: 0.0064338297, a: 1}
data:
first:
name: _Plane1Position
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Plane2Position
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Plane3Position
second: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 3820e99f5057dbf4f831f0f72d72a0b8
timeCreated: 1474312439
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%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: defaultMat
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Cutoff
second: 0.5
data:
first:
name: _Parallax
second: 0.02
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: 0.5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Color
second: {r: 0.8, g: 0.8, b: 0.8, a: 1}
fileFormatVersion: 2
guid: eb322bc5933761d4fb98f8561eadae28
timeCreated: 1474289352
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bbe8e06dc4e486e48aea6a787e6f54bd
folderAsset: yes
timeCreated: 1474310926
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
This source diff could not be displayed because it is too large. You can view the blob instead.
fileFormatVersion: 2
guid: 014df7c191886b54c8c91d354fb65643
timeCreated: 1474289352
licenseType: Store
ModelImporter:
serializedVersion: 19
fileIDToRecycleName:
100000: default
100002: default_MeshPart0
100004: default_MeshPart1
100006: //RootNode
400000: default
400002: default_MeshPart0
400004: default_MeshPart1
400006: //RootNode
2300000: default_MeshPart0
2300002: default_MeshPart1
3300000: default_MeshPart0
3300002: default_MeshPart1
4300000: default_MeshPart0
4300002: default_MeshPart1
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleRotations: 1
optimizeGameObjects: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 0.1
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
importAnimation: 1
copyAvatar: 0
humanDescription:
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 410cd86fcc3fb6e44936a339c0d1855d
folderAsset: yes
timeCreated: 1474316427
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &120022
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 491278}
- 33: {fileID: 3366136}
- 23: {fileID: 2382470}
m_Layer: 0
m_Name: Y
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &140038
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 430850}
m_Layer: 0
m_Name: Axis
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &193922
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 408796}
- 33: {fileID: 3359376}
- 23: {fileID: 2392292}
m_Layer: 0
m_Name: Z
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &195708
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 493050}
- 33: {fileID: 3319710}
- 23: {fileID: 2381122}
m_Layer: 0
m_Name: X
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &408796
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193922}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067}
m_LocalPosition: {x: 0, y: 0, z: 1}
m_LocalScale: {x: 0.1, y: 1, z: 0.10000001}
m_Children: []
m_Father: {fileID: 430850}
m_RootOrder: 1
--- !u!4 &430850
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 140038}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 491278}
- {fileID: 408796}
- {fileID: 493050}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!4 &491278
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 120022}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 0.1, y: 1, z: 0.1}
m_Children: []
m_Father: {fileID: 430850}
m_RootOrder: 0
--- !u!4 &493050
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 195708}
m_LocalRotation: {x: 0, y: 0, z: 0.7071066, w: -0.70710695}
m_LocalPosition: {x: 1, y: 0, z: 0}
m_LocalScale: {x: 0.10000001, y: 1, z: 0.1}
m_Children: []
m_Father: {fileID: 430850}
m_RootOrder: 2
--- !u!23 &2381122
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 195708}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_Materials:
- {fileID: 2100000, guid: 5c48c2321d1002142b56e1e3a105c7db, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2382470
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 120022}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_Materials:
- {fileID: 2100000, guid: fe10db9a758c54940b20534595745db1, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2392292
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193922}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_Materials:
- {fileID: 2100000, guid: 28169edc7bcf37640b8c627811d5d7a3, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &3319710
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 195708}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3359376
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193922}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3366136
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 120022}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 140038}
m_IsPrefabParent: 1
fileFormatVersion: 2
guid: 937d3d656fb0f784ab5b65e0ba66e93b
timeCreated: 1474313213
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &103704
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 401552}
- 33: {fileID: 3372472}
- 64: {fileID: 6494254}
- 23: {fileID: 2367036}
m_Layer: 0
m_Name: StencilledPlane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &147288
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 405066}
- 33: {fileID: 3379406}
- 64: {fileID: 6439656}
- 23: {fileID: 2333140}
m_Layer: 0
m_Name: Quad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &401552
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 103704}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 405066}
m_RootOrder: 0
--- !u!4 &405066
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147288}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071067}
m_LocalPosition: {x: 0, y: 0.5, z: 0}
m_LocalScale: {x: 4, y: 10, z: 1}
m_Children:
- {fileID: 401552}
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!23 &2333140
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147288}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: e1f5e546b3878d0469b1bc14be42baf5, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2367036
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 103704}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 6730943d219e0b644a77e48c751f8df6, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!33 &3372472
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 103704}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3379406
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147288}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!64 &6439656
MeshCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147288}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!64 &6494254
MeshCollider:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 103704}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 147288}
m_IsPrefabParent: 1
fileFormatVersion: 2
guid: 5c91c43b47f624a449843f4b1586d4ad
timeCreated: 1474313189
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e76184f9f556c424fa9c861c9dd1a0cd
folderAsset: yes
timeCreated: 1474310906
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class PositionController : MonoBehaviour {
public Slider XPos;
public Slider YPos;
public Slider ZPos;
//public Transform ControlledObject;
public void UpdateObjectPosition(Transform ControlledObject)
{
Vector3 newPosition = new Vector3(XPos?XPos.value:0, YPos?YPos.value:0, ZPos?ZPos.value:0);
ControlledObject.localPosition = newPosition;
}
}
fileFormatVersion: 2
guid: 24ba1d84c4fafaf4aaeefea7926033b1
timeCreated: 1474289151
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class RotationController : MonoBehaviour {
public Slider XRot;
public Slider YRot;
public Slider ZRot;
//public Transform ControlledObject;
public void UpdateObjectPosition(Transform ControlledObject)
{
Vector3 newRotation = new Vector3(XRot.value, YRot.value, ZRot.value);
ControlledObject.rotation = Quaternion.Euler(newRotation);
}
}
fileFormatVersion: 2
guid: babfc89bbd223dd4397124f0450e145b
timeCreated: 1474289151
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class SliderValueToText : MonoBehaviour {
Text text;
void Awake()
{
text = GetComponent<Text>();
}
public void SetText(Slider slider)
{
text.text = System.Math.Round(slider.value, 2).ToString();
}
}
fileFormatVersion: 2
guid: ac995b6e69d633848ac7d5ff9afc36a3
timeCreated: 1474289151
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 719bb0eb8a6f7134a872db1d640c979f
folderAsset: yes
timeCreated: 1474310918
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1926d72aee6ebef42b5e5b0b3c715026
timeCreated: 1474300152
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 114b7918e2e2bc6409faede0b496ecf4
timeCreated: 1474476643
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b7e2928839232b74281ba4eae672e730
folderAsset: yes
timeCreated: 1474274065
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
//Source : http://pastebin.com/dcQYCvxG
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class ArcBall : MonoBehaviour
{
public float radius = 5.0f,
minRadius = 1.5f,
maxRadius = 10.0f,
scale = 0.002f;
public GameObject target;
private float targetRadius = 8.0f,
mouseX = 0.0f,
mouseZ = 0.0f;
private Vector3 up = new Vector3(0.0f, 1.0f, 0.0f),
right = new Vector3(0.0f, 0.0f, 1.0f),
newPosition = Vector3.zero;
// Use this for initialization
void Start()
{
this.transform.position = new Vector3(radius, 0.0f, 0.0f);
}
// Update is called once per frame
void Update()
{
newPosition = transform.position;
if (Input.GetMouseButton(0))
{
mouseX = Input.GetAxis("Mouse X");
mouseZ = Input.GetAxis("Mouse Y");
}
else {
mouseX = Mathf.Lerp(mouseX, 0.0f, 0.2f);
mouseZ = Mathf.Lerp(mouseZ, 0.0f, 0.2f);
}
newPosition += right * mouseX * radius / 4.0f
+ up * mouseZ * -radius / 4.0f;
newPosition.Normalize();
right = Vector3.Cross(up, newPosition);
up = Vector3.Cross(newPosition, right);
right.Normalize();
up.Normalize();
if (Input.GetAxis("Mouse ScrollWheel") > 0.0f)
{
targetRadius = Mathf.Max(targetRadius / 1.1f, minRadius);
}
else if (Input.GetAxis("Mouse ScrollWheel") < 0.0f)
{
targetRadius = Mathf.Min(targetRadius * 1.1f, maxRadius);
}
radius = Mathf.Lerp(radius, targetRadius, 0.1f);
newPosition.Normalize();
transform.position = newPosition * radius;
transform.LookAt(new Vector3(0.0f, 0.0f, 0.0f), up);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: fa05a4e0cda1f9e4a9f50e02ebbc5e4a
timeCreated: 1474289151
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class GenericThreePlanesCuttingController : MonoBehaviour {
public GameObject plane1;
public GameObject plane2;
public GameObject plane3;
Material mat;
public Vector3 normal1;
public Vector3 position1;
public Vector3 normal2;
public Vector3 position2;
public Vector3 normal3;
public Vector3 position3;
public Renderer rend;
// Use this for initialization
void Start()
{
rend = GetComponent<Renderer>();
UpdateShaderProperties();
}
void Update()
{
UpdateShaderProperties();
}
private void UpdateShaderProperties()
{
normal1 = plane1.transform.TransformVector(new Vector3(0, 0, -1));
normal2 = plane2.transform.TransformVector(new Vector3(0, 0, -1));
normal3 = plane3.transform.TransformVector(new Vector3(0, 0, -1));
position1 = plane1.transform.position;
position2 = plane2.transform.position;
position3 = plane3.transform.position;
rend.material.SetVector("_Plane1Normal", normal1);
rend.material.SetVector("_Plane1Position", position1);
rend.material.SetVector("_Plane2Normal", normal2);
rend.material.SetVector("_Plane2Position", position2);
rend.material.SetVector("_Plane3Normal", normal3);
rend.material.SetVector("_Plane3Position", position3);
}
}
fileFormatVersion: 2
guid: f4d42a2315cc8584885222992847edd5
timeCreated: 1474317417
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
//[ExecuteInEditMode]
public class OnePlaneCuttingController : MonoBehaviour {
public GameObject plane;
Material mat;
public Vector3 normal;
public Vector3 position;
public Renderer rend;
// Use this for initialization
void Start () {
rend = GetComponent<Renderer>();
normal = plane.transform.TransformVector(new Vector3(0,0,-1));
position = plane.transform.position;
UpdateShaderProperties();
}
void Update ()
{
UpdateShaderProperties();
}
private void UpdateShaderProperties()
{
normal = plane.transform.TransformVector(new Vector3(0, 0, -1));
position = plane.transform.position;
rend.material.SetVector("_PlaneNormal", normal);
rend.material.SetVector("_PlanePosition", position);
}
}
fileFormatVersion: 2
guid: c677c933585d0ee4dbfe7483ac9f8c84
timeCreated: 1474289151
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
public class ThreeAAPlanesCuttingController : MonoBehaviour {
public GameObject planeYZ;
public GameObject planeXZ;
public GameObject planeXY;
Material mat;
public Vector3 positionYZ;
public Vector3 positionXZ;
public Vector3 positionXY;
public Renderer rend;
// Use this for initialization
void Start()
{
rend = GetComponent<Renderer>();
UpdateShaderProperties();
}
void Update()
{
UpdateShaderProperties();
}
private void UpdateShaderProperties()
{
positionYZ = planeYZ.transform.position;
positionXZ = planeXZ.transform.position;
positionXY = planeXY.transform.position;
rend.material.SetVector("_Plane1Position", positionYZ);
rend.material.SetVector("_Plane2Position", positionXZ);
rend.material.SetVector("_Plane3Position", positionXY);
}
}
fileFormatVersion: 2
guid: 456cce9074a27954684af5a9a11c125b
timeCreated: 1474314105
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f8c721223158e8840a071773b19542fb
folderAsset: yes
timeCreated: 1474274055
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "CrossSection/Others/DoubleFaceUnlit"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "Queue"="Transparent"}
LOD 100
Cull Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
// apply fog
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}
fileFormatVersion: 2
guid: 54e980e744076634680e4ef4930a2873
timeCreated: 1474313812
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
Shader "CrossSection/GenericThreePlanesBSP" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_CrossColor("Cross Section Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_Plane1Normal("Plane1Normal",Vector) = (0,1,0,0)
_Plane1Position("Plane1Position",Vector) = (0,0,0,1)
_Plane2Normal("Plane2Normal",Vector) = (1,0,0,0)
_Plane2Position("Plane2Position",Vector) = (0,0,0,1)
_Plane3Normal("Plane3Normal",Vector) = (0,0,-1,0)
_Plane3Position("Plane3Position",Vector) = (0,0,0,1)
}
SubShader{
Tags{ "RenderType" = "Transparent" }
//LOD 200
Cull Back
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float3 worldPos;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
fixed4 _CrossColor;
fixed3 _Plane1Normal;
fixed3 _Plane1Position;
fixed3 _Plane2Normal;
fixed3 _Plane2Position;
fixed3 _Plane3Normal;
fixed3 _Plane3Position;
bool checkVisability(fixed3 worldPos)
{
float dotProd1 = dot(worldPos - _Plane1Position, _Plane1Normal);
float dotProd2 = dot(worldPos - _Plane2Position, _Plane2Normal);
float dotProd3 = dot(worldPos - _Plane3Position, _Plane3Normal);
return dotProd1 > 0 && dotProd2 > 0 && dotProd3 > 0;
}
void surf(Input IN, inout SurfaceOutputStandard o) {
if (checkVisability(IN.worldPos))discard;
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = c.a;
}
ENDCG
Cull Front
CGPROGRAM
#pragma surface surf NoLighting noambient
struct Input {
half2 uv_MainTex;
float3 worldPos;
};
sampler2D _MainTex;
fixed4 _Color;
fixed4 _CrossColor;
fixed3 _Plane1Normal;
fixed3 _Plane1Position;
fixed3 _Plane2Normal;
fixed3 _Plane2Position;
fixed3 _Plane3Normal;
fixed3 _Plane3Position;
bool checkVisability(fixed3 worldPos)
{
float dotProd1 = dot(worldPos - _Plane1Position, _Plane1Normal);
float dotProd2 = dot(worldPos - _Plane2Position, _Plane2Normal);
float dotProd3 = dot(worldPos - _Plane3Position, _Plane3Normal);
return dotProd1 > 0 && dotProd2 > 0 && dotProd3 > 0;
}
fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten)
{
fixed4 c;
c.rgb = s.Albedo;
c.a = s.Alpha;
return c;
}
void surf(Input IN, inout SurfaceOutput o)
{
if (checkVisability(IN.worldPos))discard;
o.Albedo = _CrossColor;
}
ENDCG
}
//FallBack "Diffuse"
}
fileFormatVersion: 2
guid: d148d5478e6a24341b40da3c6a0f9ffa
timeCreated: 1474288750
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
Shader "CrossSection/OnePlaneBSP" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_CrossColor("Cross Section Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_PlaneNormal("PlaneNormal",Vector) = (0,1,0,0)
_PlanePosition("PlanePosition",Vector) = (0,0,0,1)
_StencilMask("Stencil Mask", Range(0, 255)) = 255
}
SubShader {
Tags { "RenderType"="Opaque" }
//LOD 200
Stencil
{
Ref [_StencilMask]
CompBack Always
PassBack Replace
CompFront Always
PassFront Zero
}
Cull Back
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float3 worldPos;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
fixed4 _CrossColor;
fixed3 _PlaneNormal;
fixed3 _PlanePosition;
bool checkVisability(fixed3 worldPos)
{
//float3 tmp1 = (worldPos.x, worldPos.y - 0.05, worldPos.z);
//float3 tmp2 = (0, worldPos.y - 0.05, 0);
float x1 = abs(worldPos.x - _PlanePosition.x);
float z1 = abs(worldPos.z - _PlanePosition.z);
float y1 = abs(_PlanePosition.y - worldPos.y);
bool wow = ((x1 * x1) + (z1 * z1)) < (y1 * y1);
//float dotProd1 = tmp.y;
return (worldPos.y > _PlanePosition.y) || !wow;
//float dotProd1 = dot(worldPos - _PlanePosition, _PlaneNormal);
//return dotProd1 > 0 ;
}
void surf(Input IN, inout SurfaceOutputStandard o) {
if (checkVisability(IN.worldPos))discard;
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = c.a;
}
ENDCG
Cull Front
CGPROGRAM
#pragma surface surf NoLighting noambient
struct Input {
half2 uv_MainTex;
float3 worldPos;
};
sampler2D _MainTex;
fixed4 _Color;
fixed4 _CrossColor;
fixed3 _PlaneNormal;
fixed3 _PlanePosition;
bool checkVisability(fixed3 worldPos)
{
//float3 tmp1 = { worldPos.x, worldPos.y - 0.05, worldPos.z };
//float3 tmp2 = { 0.0, worldPos.y - 0.05, 0.0 };
float x1 = abs(worldPos.x - _PlanePosition.x);
float z1 = abs(worldPos.z - _PlanePosition.z);
float y1 = abs(_PlanePosition.y - worldPos.y + 0.05);
bool wow = ((x1 * x1) + (z1 * z1)) < (y1 * y1);
//float dotProd1 = tmp.y;
return (worldPos.y > _PlanePosition.y) || !wow;
//float dotProd1 = dot(worldPos - _PlanePosition, _PlaneNormal);
//return dotProd1 >0 ;
}
fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten)
{
fixed4 c;
c.rgb = s.Albedo;
c.a = s.Alpha;
return c;
}
void surf(Input IN, inout SurfaceOutput o)
{
if (checkVisability(IN.worldPos))discard;
o.Albedo = _CrossColor;
}
ENDCG
}
//FallBack "Diffuse"
}
fileFormatVersion: 2
guid: dfb2ef60de11e934f9e7571d2eb7bf08
timeCreated: 1474288750
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
Shader "CrossSection/Others/StandardDoubleFace"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
[Enum(Metallic Alpha,0,Albedo Alpha,1)] _SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
_MetallicGlossMap("Metallic", 2D) = "white" {}
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
[ToggleOff] _GlossyReflections("Glossy Reflections", Float) = 1.0
_BumpScale("Scale", Float) = 1.0
_BumpMap("Normal Map", 2D) = "bump" {}
_Parallax("Height Scale", Range(0.005, 0.08)) = 0.02
_ParallaxMap("Height Map", 2D) = "black" {}
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
_OcclusionMap("Occlusion", 2D) = "white" {}
_EmissionColor("Color", Color) = (0,0,0)
_EmissionMap("Emission", 2D) = "white" {}
_DetailMask("Detail Mask", 2D) = "white" {}
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
_DetailNormalMapScale("Scale", Float) = 1.0
_DetailNormalMap("Normal Map", 2D) = "bump" {}
[Enum(UV0,0,UV1,1)] _UVSec("UV Set for secondary textures", Float) = 0
// Blending state
[HideInInspector] _Mode("__mode", Float) = 0.0
[HideInInspector] _SrcBlend("__src", Float) = 1.0
[HideInInspector] _DstBlend("__dst", Float) = 0.0
[HideInInspector] _ZWrite("__zw", Float) = 1.0
}
CGINCLUDE
#define UNITY_SETUP_BRDF_INPUT MetallicSetup
ENDCG
SubShader
{
Tags{ "RenderType" = "Opaque" "PerformanceChecks" = "False" }
LOD 300
// ------------------------------------------------------------------
// Base forward pass (directional light, emission, lightmaps, ...)
Pass
{
Name "FORWARD"
Tags{ "LightMode" = "ForwardBase" }
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
Cull Off
CGPROGRAM
#pragma target 3.0
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
#pragma vertex vertBase
#pragma fragment fragBase
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Additive forward pass (one light per pass)
Pass
{
Name "FORWARD_DELTA"
Tags{ "LightMode" = "ForwardAdd" }
Blend[_SrcBlend] One
Fog{ Color(0,0,0,0) } // in additive pass fog should be black
ZWrite Off
ZTest LEqual
Cull Off
CGPROGRAM
#pragma target 3.0
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile_fwdadd_fullshadows
#pragma multi_compile_fog
#pragma vertex vertAdd
#pragma fragment fragAdd
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Shadow rendering pass
Pass{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On ZTest LEqual
Cull Off
CGPROGRAM
#pragma target 3.0
// -------------------------------------
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma multi_compile_shadowcaster
#pragma vertex vertShadowCaster
#pragma fragment fragShadowCaster
#include "UnityStandardShadow.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Deferred pass
Pass
{
Name "DEFERRED"
Tags{ "LightMode" = "Deferred" }
Cull Off
CGPROGRAM
#pragma target 3.0
#pragma exclude_renderers nomrt
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile ___ UNITY_HDR_ON
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
#pragma multi_compile ___ DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
#pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
#pragma vertex vertDeferred
#pragma fragment fragDeferred
#include "UnityStandardCore.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Extracts information for lightmapping, GI (emission, albedo, ...)
// This pass it not used during regular rendering.
Pass
{
Name "META"
Tags{ "LightMode" = "Meta" }
Cull Off
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature ___ _DETAIL_MULX2
#include "UnityStandardMeta.cginc"
ENDCG
}
}
SubShader
{
Tags{ "RenderType" = "Opaque" "PerformanceChecks" = "False" }
LOD 150
// ------------------------------------------------------------------
// Base forward pass (directional light, emission, lightmaps, ...)
Pass
{
Name "FORWARD"
Tags{ "LightMode" = "ForwardBase" }
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature _ _GLOSSYREFLECTIONS_OFF
// SM2.0: NOT SUPPORTED shader_feature ___ _DETAIL_MULX2
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
#pragma skip_variants SHADOWS_SOFT DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
#pragma vertex vertBase
#pragma fragment fragBase
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Additive forward pass (one light per pass)
Pass
{
Name "FORWARD_DELTA"
Tags{ "LightMode" = "ForwardAdd" }
Blend[_SrcBlend] One
Fog{ Color(0,0,0,0) } // in additive pass fog should be black
ZWrite Off
ZTest LEqual
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature _ _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature ___ _DETAIL_MULX2
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
#pragma skip_variants SHADOWS_SOFT
#pragma multi_compile_fwdadd_fullshadows
#pragma multi_compile_fog
#pragma vertex vertAdd
#pragma fragment fragAdd
#include "UnityStandardCoreForward.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Shadow rendering pass
Pass{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On ZTest LEqual
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma skip_variants SHADOWS_SOFT
#pragma multi_compile_shadowcaster
#pragma vertex vertShadowCaster
#pragma fragment fragShadowCaster
#include "UnityStandardShadow.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Extracts information for lightmapping, GI (emission, albedo, ...)
// This pass it not used during regular rendering.
Pass
{
Name "META"
Tags{ "LightMode" = "Meta" }
Cull Off
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature ___ _DETAIL_MULX2
#include "UnityStandardMeta.cginc"
ENDCG
}
}
FallBack "VertexLit"
CustomEditor "StandardShaderGUI"
}
fileFormatVersion: 2
guid: d977badb8d897414181f5093d079766c
timeCreated: 1474299356
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "CrossSection/Others/StencilledUnlitTexture"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_StencilMask("Stencil Mask", Range(0, 255)) = 255
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue" = "Transparent" }
LOD 100
ZTest On
//Cull Off
Stencil{
Ref [_StencilMask]
Comp Equal
}
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
// apply fog
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}
fileFormatVersion: 2
guid: 88b9999b87b4fd146a176b8e5bccc481
timeCreated: 1474299940
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
Shader "CrossSection/ThreeAAPlanesBSP" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_CrossColor("Cross Section Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_Plane1Position("Plane1Position",Vector) = (0,0,0,1)
_Plane2Position("Plane2Position",Vector) = (0,0,0,1)
_Plane3Position("Plane3Position",Vector) = (0,0,0,1)
}
SubShader{
Tags{ "RenderType" = "Transparent" }
//LOD 200
Cull Back
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float3 worldPos;
};
half _Glossiness;
half _Metallic;
fixed4 _Color;
fixed4 _CrossColor;
fixed3 _Plane1Position;
fixed3 _Plane2Position;
fixed3 _Plane3Position;
bool checkVisability(fixed3 worldPos)
{
float dotProd1 = dot(worldPos - _Plane1Position, fixed3(1,0,0));
float dotProd2 = dot(worldPos - _Plane2Position, fixed3(0, 1, 0));
float dotProd3 = dot(worldPos - _Plane3Position, fixed3(0, 0, 1));
return dotProd1 > 0 && dotProd2 > 0 && dotProd3 > 0;
}
void surf(Input IN, inout SurfaceOutputStandard o) {
if (checkVisability(IN.worldPos))discard;
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
o.Alpha = c.a;
}
ENDCG
Cull Front
CGPROGRAM
#pragma surface surf NoLighting noambient
struct Input {
half2 uv_MainTex;
float3 worldPos;
};
sampler2D _MainTex;
fixed4 _Color;
fixed4 _CrossColor;
fixed3 _Plane1Position;
fixed3 _Plane2Position;
fixed3 _Plane3Position;
bool checkVisability(fixed3 worldPos)
{
float dotProd1 = dot(worldPos - _Plane1Position, fixed3(1, 0, 0));
float dotProd2 = dot(worldPos - _Plane2Position, fixed3(0, 1, 0));
float dotProd3 = dot(worldPos - _Plane3Position, fixed3(0, 0, 1));
return dotProd1 > 0 && dotProd2 > 0 && dotProd3 > 0;
}
fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten)
{
fixed4 c;
c.rgb = s.Albedo;
c.a = s.Alpha;
return c;
}
void surf(Input IN, inout SurfaceOutput o)
{
if (checkVisability(IN.worldPos))discard;
o.Albedo = _CrossColor;
}
ENDCG
}
//FallBack "Diffuse"
}
fileFormatVersion: 2
guid: b42f1ab5d8353214ab7616620a82e483
timeCreated: 1474288749
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8512aab84fc730041aa4a5dc0cfced11
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b143154fb00c68241b72bae20481fe12
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
using System.Linq;
//[ExecuteInEditMode]
public class ClippableObject : MonoBehaviour {
public void OnEnable() {
//let's just create a new material instance.
GetComponent<MeshRenderer>().sharedMaterial = new Material(Shader.Find("Custom/StandardClippable")) {
hideFlags = HideFlags.HideAndDontSave
};
}
//only 3 clip planes for now, will need to modify the shader for more.
[Range(0, 3)]
public int clipPlanes = 0;
//preview size for the planes. Shown when the object is selected.
public float planePreviewSize = 5.0f;
//Positions and rotations for the planes. The rotations will be converted into normals to be used by the shaders.
public GameObject PastLightCone;
public Vector3 plane1Position = Vector3.zero;
public Quaternion plane1Rotation;// = new Vector3(0, 0, 0);
public Vector3 plane2Position = Vector3.zero;
public Vector3 plane2Rotation = new Vector3(0, 90, 90);
public Vector3 plane3Position = Vector3.zero;
public Vector3 plane3Rotation = new Vector3(0, 0, 90);
public void Start()
{
PastLightCone = GameObject.Find("Cone");
plane1Position = PastLightCone.transform.position;
plane1Rotation = PastLightCone.transform.rotation;
}
//Only used for previewing a plane. Draws diagonals and edges of a limited flat plane.
private void DrawPlane(Vector3 position, Vector3 euler) {
var forward = Quaternion.Euler(euler) * Vector3.forward;
var left = Quaternion.Euler(euler) * Vector3.left;
var forwardLeft = position + forward * planePreviewSize * 0.5f + left * planePreviewSize * 0.5f;
var forwardRight = forwardLeft - left * planePreviewSize;
var backRight = forwardRight - forward * planePreviewSize;
var backLeft = forwardLeft - forward * planePreviewSize;
Gizmos.DrawLine(position, forwardLeft);
Gizmos.DrawLine(position, forwardRight);
Gizmos.DrawLine(position, backRight);
Gizmos.DrawLine(position, backLeft);
Gizmos.DrawLine(forwardLeft, forwardRight);
Gizmos.DrawLine(forwardRight, backRight);
Gizmos.DrawLine(backRight, backLeft);
Gizmos.DrawLine(backLeft, forwardLeft);
}
/*
private void OnDrawGizmosSelected() {
if (clipPlanes >= 1) {
DrawPlane(plane1Position, plane1Rotation);
}
if (clipPlanes >= 2) {
DrawPlane(plane2Position, plane2Rotation);
}
if (clipPlanes >= 3) {
DrawPlane(plane3Position, plane3Rotation);
}
}*/
//Ideally the planes do not need to be updated every frame, but we'll just keep the logic here for simplicity purposes.
public void Update()
{
var sharedMaterial = GetComponent<MeshRenderer>().sharedMaterial;
//Only should enable one keyword. If you want to enable any one of them, you actually need to disable the others.
//This may be a bug...
switch (clipPlanes) {
case 0:
sharedMaterial.DisableKeyword("CLIP_ONE");
sharedMaterial.DisableKeyword("CLIP_TWO");
sharedMaterial.DisableKeyword("CLIP_THREE");
break;
case 1:
sharedMaterial.EnableKeyword("CLIP_ONE");
sharedMaterial.DisableKeyword("CLIP_TWO");
sharedMaterial.DisableKeyword("CLIP_THREE");
break;
case 2:
sharedMaterial.DisableKeyword("CLIP_ONE");
sharedMaterial.EnableKeyword("CLIP_TWO");
sharedMaterial.DisableKeyword("CLIP_THREE");
break;
case 3:
sharedMaterial.DisableKeyword("CLIP_ONE");
sharedMaterial.DisableKeyword("CLIP_TWO");
sharedMaterial.EnableKeyword("CLIP_THREE");
break;
}
//pass the planes to the shader if necessary.
if (clipPlanes >= 1)
{
sharedMaterial.SetVector("_planePos", plane1Position);
//plane normal vector is the rotated 'up' vector.
sharedMaterial.SetVector("_planeNorm", plane1Rotation * Vector3.up);
}
if (clipPlanes >= 2)
{
sharedMaterial.SetVector("_planePos2", plane2Position);
sharedMaterial.SetVector("_planeNorm2", Quaternion.Euler(plane2Rotation) * Vector3.up);
}
if (clipPlanes >= 3)
{
sharedMaterial.SetVector("_planePos3", plane3Position);
sharedMaterial.SetVector("_planeNorm3", Quaternion.Euler(plane3Rotation) * Vector3.up);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 224b92563824cb94799c72b68696ec38
timeCreated: 1426331050
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9a89452d529d18b43bc5e11d364a27df
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Shader "Custom/StandardClippable" {
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
_MetallicGlossMap("Metallic", 2D) = "white" {}
_BumpScale("Scale", Float) = 1.0
_BumpMap("Normal Map", 2D) = "bump" {}
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
_ParallaxMap ("Height Map", 2D) = "black" {}
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
_OcclusionMap("Occlusion", 2D) = "white" {}
_EmissionColor("Color", Color) = (0,0,0)
_EmissionMap("Emission", 2D) = "white" {}
_DetailMask("Detail Mask", 2D) = "white" {}
_DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {}
_DetailNormalMapScale("Scale", Float) = 1.0
_DetailNormalMap("Normal Map", 2D) = "bump" {}
[Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0
// UI-only data
[HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0
[HideInInspector] _EmissionColorUI("Color", Color) = (1,1,1)
// Blending state
[HideInInspector] _Mode ("__mode", Float) = 0.0
[HideInInspector] _SrcBlend ("__src", Float) = 1.0
[HideInInspector] _DstBlend ("__dst", Float) = 0.0
[HideInInspector] _ZWrite ("__zw", Float) = 1.0
_planePos ("Clipping Plane Position", Vector) = ( 0, 0, 0, 1 )
_planePos2 ("Clipping Plane Position 2", Vector) = ( 0, 0, 0, 1 )
_planePos3 ("Clipping Plane Position 3", Vector) = ( 0, 0, 0, 1 )
_planeNorm ("Clipping Plane Normal", Vector) = ( 0, 1, 0, 1 )
_planeNorm2 ("Clipping Plane Normal 2", Vector) = ( 0, 1, 0, 1 )
_planeNorm3 ("Clipping Plane Normal 3", Vector) = ( 0, 1, 0, 1 )
}
CGINCLUDE
#define UNITY_SETUP_BRDF_INPUT MetallicSetup
ENDCG
SubShader
{
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
LOD 300
Cull off
// ------------------------------------------------------------------
// Base forward pass (directional light, emission, lightmaps, ...)
Pass
{
Name "FORWARD"
Tags { "LightMode" = "ForwardBase" }
Blend [_SrcBlend] [_DstBlend]
ZWrite [_ZWrite]
CGPROGRAM
#pragma target 3.0
// TEMPORARY: GLES2.0 temporarily disabled to prevent errors spam on devices without textureCubeLodEXT
#pragma exclude_renderers gles
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
#pragma vertex vertForwardBase
#pragma fragment fragForwardBase
#pragma multi_compile __ CLIP_ONE CLIP_TWO CLIP_THREE
#include "standard_clipped.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Additive forward pass (one light per pass)
Pass
{
Name "FORWARD_DELTA"
Tags { "LightMode" = "ForwardAdd" }
Blend [_SrcBlend] One
Fog { Color (0,0,0,0) } // in additive pass fog should be black
ZWrite Off
ZTest LEqual
CGPROGRAM
#pragma target 3.0
// GLES2.0 temporarily disabled to prevent errors spam on devices without textureCubeLodEXT
#pragma exclude_renderers gles
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile_fwdadd_fullshadows
#pragma multi_compile_fog
#pragma vertex vertForwardAdd
#pragma fragment fragForwardAdd
#pragma multi_compile __ CLIP_ONE CLIP_TWO CLIP_THREE
#include "standard_clipped.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Shadow rendering pass
Pass {
Name "ShadowCaster"
Tags { "LightMode" = "ShadowCaster" }
ZWrite On ZTest LEqual
CGPROGRAM
#pragma target 3.0
// TEMPORARY: GLES2.0 temporarily disabled to prevent errors spam on devices without textureCubeLodEXT
#pragma exclude_renderers gles
// -------------------------------------
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma multi_compile_shadowcaster
#pragma vertex vertShadowCaster
#pragma fragment fragShadowCaster
#pragma multi_compile __ CLIP_ONE CLIP_TWO CLIP_THREE
#include "standard_shadow_clipped.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Deferred pass
Pass
{
Name "DEFERRED"
Tags { "LightMode" = "Deferred" }
CGPROGRAM
#pragma target 3.0
// TEMPORARY: GLES2.0 temporarily disabled to prevent errors spam on devices without textureCubeLodEXT
#pragma exclude_renderers nomrt gles
// -------------------------------------
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
#pragma shader_feature _PARALLAXMAP
#pragma multi_compile ___ UNITY_HDR_ON
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
#pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
#pragma vertex vertDeferred
#pragma fragment fragDeferred
#pragma multi_compile __ CLIP_ONE CLIP_TWO CLIP_THREE
#include "standard_clipped.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Extracts information for lightmapping, GI (emission, albedo, ...)
// This pass it not used during regular rendering.
Pass
{
Name "META"
Tags { "LightMode"="Meta" }
Cull Off
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
#include "UnityStandardMeta.cginc"
ENDCG
}
}
SubShader
{
Tags { "RenderType"="Opaque" "PerformanceChecks"="False" }
LOD 150
// ------------------------------------------------------------------
// Base forward pass (directional light, emission, lightmaps, ...)
Pass
{
Name "FORWARD"
Tags { "LightMode" = "ForwardBase" }
Blend [_SrcBlend] [_DstBlend]
ZWrite [_ZWrite]
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
#pragma skip_variants SHADOWS_SOFT DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
#pragma multi_compile_fwdbase
#pragma multi_compile_fog
#pragma vertex vertForwardBase
#pragma fragment fragForwardBase
#pragma multi_compile __ CLIP_ONE CLIP_TWO CLIP_THREE
#include "standard_clipped.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Additive forward pass (one light per pass)
Pass
{
Name "FORWARD_DELTA"
Tags { "LightMode" = "ForwardAdd" }
Blend [_SrcBlend] One
Fog { Color (0,0,0,0) } // in additive pass fog should be black
ZWrite Off
ZTest LEqual
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
// SM2.0: NOT SUPPORTED shader_feature _PARALLAXMAP
#pragma skip_variants SHADOWS_SOFT
#pragma multi_compile_fwdadd_fullshadows
#pragma multi_compile_fog
#pragma vertex vertForwardAdd
#pragma fragment fragForwardAdd
#pragma multi_compile __ CLIP_ONE CLIP_TWO CLIP_THREE
#include "standard_clipped.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Shadow rendering pass
Pass {
Name "ShadowCaster"
Tags { "LightMode" = "ShadowCaster" }
ZWrite On ZTest LEqual
CGPROGRAM
#pragma target 2.0
#pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
#pragma skip_variants SHADOWS_SOFT
#pragma multi_compile_shadowcaster
#pragma vertex vertShadowCaster
#pragma fragment fragShadowCaster
#pragma multi_compile __ CLIP_ONE CLIP_TWO CLIP_THREE
#include "standard_shadow_clipped.cginc"
ENDCG
}
// ------------------------------------------------------------------
// Extracts information for lightmapping, GI (emission, albedo, ...)
// This pass it not used during regular rendering.
Pass
{
Name "META"
Tags { "LightMode"="Meta" }
Cull Off
CGPROGRAM
#pragma vertex vert_meta
#pragma fragment frag_meta
#pragma shader_feature _EMISSION
#pragma shader_feature _METALLICGLOSSMAP
#pragma shader_feature ___ _DETAIL_MULX2
#include "UnityStandardMeta.cginc"
ENDCG
}
}
FallBack "VertexLit"
CustomEditor "StandardShaderGUI"
}
\ No newline at end of file
fileFormatVersion: 2
guid: 8598de9abb44179428d49988d78151c7
timeCreated: 1426341407
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
#ifndef PLANE_CLIPPING_INCLUDED
#define PLANE_CLIPPING_INCLUDED
//Plane clipping definitions. Uses three planes for clipping, but this can be increased if necessary.
#if CLIP_ONE || CLIP_TWO || CLIP_THREE
//If we have 1, 2 or 3 clipping planes, PLANE_CLIPPING_ENABLED will be defined.
//This makes it easier to check if this feature is available or not.
#define PLANE_CLIPPING_ENABLED 1
//http://mathworld.wolfram.com/Point-PlaneDistance.html
float distanceToPlane(float3 planePosition, float3 planeNormal, float3 pointInWorld)
{
//w = vector from plane to point
float3 w = - ( planePosition - pointInWorld );
float res = ( planeNormal.x * w.x +
planeNormal.y * w.y +
planeNormal.z * w.z )
/ sqrt( planeNormal.x * planeNormal.x +
planeNormal.y * planeNormal.y +
planeNormal.z * planeNormal.z );
return res;
}
//we will have at least one plane.
float4 _planePos;
float4 _planeNorm;
//at least two planes.
#if (CLIP_TWO || CLIP_THREE)
float4 _planePos2;
float4 _planeNorm2;
#endif
//at least three planes.
#if (CLIP_THREE)
float4 _planePos3;
float4 _planeNorm3;
#endif
//discard drawing of a point in the world if it is behind any one of the planes.
void PlaneClip(float3 posWorld) {
#if CLIP_THREE
clip(float3(
distanceToPlane(_planePos.xyz, _planeNorm.xyz, posWorld),
distanceToPlane(_planePos2.xyz, _planeNorm2.xyz, posWorld),
distanceToPlane(_planePos3.xyz, _planeNorm3.xyz, posWorld)
));
#else //CLIP_THREE
#if CLIP_TWO
clip(float2(
distanceToPlane(_planePos.xyz, _planeNorm.xyz, posWorld),
distanceToPlane(_planePos2.xyz, _planeNorm2.xyz, posWorld)
));
#else //CLIP_TWO
clip(distanceToPlane(_planePos.xyz, _planeNorm.xyz, posWorld));
#endif //CLIP_TWO
#endif //CLIP_THREE
}
//preprocessor macro that will produce an empty block if no clipping planes are used.
#define PLANE_CLIP(posWorld) PlaneClip(posWorld);
#else
//empty definition
#define PLANE_CLIP(s)
#endif
#endif // PLANE_CLIPPING_INCLUDED
\ No newline at end of file
fileFormatVersion: 2
guid: 731099f7a77d10947a663d392a5d30f3
timeCreated: 1426348023
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
#ifndef UNITY_STANDARD_CORE_INCLUDED
#define UNITY_STANDARD_CORE_INCLUDED
#include "UnityCG.cginc"
#include "UnityShaderVariables.cginc"
#include "UnityStandardConfig.cginc"
#include "UnityStandardInput.cginc"
#include "UnityPBSLighting.cginc"
#include "UnityStandardUtils.cginc"
#include "UnityStandardBRDF.cginc"
#include "AutoLight.cginc"
#include "plane_clipping.cginc"
//-------------------------------------------------------------------------------------
// counterpart for NormalizePerPixelNormal
// skips normalization per-vertex and expects normalization to happen per-pixel
half3 NormalizePerVertexNormal (half3 n)
{
#if (SHADER_TARGET < 30)
return normalize(n);
#else
return n; // will normalize per-pixel instead
#endif
}
half3 NormalizePerPixelNormal (half3 n)
{
#if (SHADER_TARGET < 30)
return n;
#else
return normalize(n);
#endif
}
//-------------------------------------------------------------------------------------
UnityLight MainLight (half3 normalWorld)
{
UnityLight l;
#ifdef LIGHTMAP_OFF
l.color = _LightColor0.rgb;
l.dir = _WorldSpaceLightPos0.xyz;
l.ndotl = LambertTerm (normalWorld, l.dir);
#else
// no light specified by the engine
// analytical light might be extracted from Lightmap data later on in the shader depending on the Lightmap type
l.color = half3(0.f, 0.f, 0.f);
l.ndotl = 0.f;
l.dir = half3(0.f, 0.f, 0.f);
#endif
return l;
}
UnityLight AdditiveLight (half3 normalWorld, half3 lightDir, half atten)
{
UnityLight l;
l.color = _LightColor0.rgb;
l.dir = lightDir;
#ifndef USING_DIRECTIONAL_LIGHT
l.dir = NormalizePerPixelNormal(l.dir);
#endif
l.ndotl = LambertTerm (normalWorld, l.dir);
// shadow the light
l.color *= atten;
return l;
}
UnityLight DummyLight (half3 normalWorld)
{
UnityLight l;
l.color = 0;
l.dir = half3 (0,1,0);
l.ndotl = LambertTerm (normalWorld, l.dir);
return l;
}
UnityIndirect ZeroIndirect ()
{
UnityIndirect ind;
ind.diffuse = 0;
ind.specular = 0;
return ind;
}
//-------------------------------------------------------------------------------------
// Common fragment setup
half3 WorldNormal(half4 tan2world[3])
{
return normalize(tan2world[2].xyz);
}
#ifdef _TANGENT_TO_WORLD
half3x3 ExtractTangentToWorldPerPixel(half4 tan2world[3])
{
half3 t = tan2world[0].xyz;
half3 b = tan2world[1].xyz;
half3 n = tan2world[2].xyz;
#if UNITY_TANGENT_ORTHONORMALIZE
n = NormalizePerPixelNormal(n);
// ortho-normalize Tangent
t = normalize (t - n * dot(t, n));
// recalculate Binormal
half3 newB = cross(n, t);
b = newB * sign (dot (newB, b));
#endif
return half3x3(t, b, n);
}
#else
half3x3 ExtractTangentToWorldPerPixel(half4 tan2world[3])
{
return half3x3(0,0,0,0,0,0,0,0,0);
}
#endif
#ifdef _PARALLAXMAP
#define IN_VIEWDIR4PARALLAX(i) NormalizePerPixelNormal(half3(i.tangentToWorldAndParallax[0].w,i.tangentToWorldAndParallax[1].w,i.tangentToWorldAndParallax[2].w))
#define IN_VIEWDIR4PARALLAX_FWDADD(i) NormalizePerPixelNormal(i.viewDirForParallax.xyz)
#else
#define IN_VIEWDIR4PARALLAX(i) half3(0,0,0)
#define IN_VIEWDIR4PARALLAX_FWDADD(i) half3(0,0,0)
#endif
#if UNITY_SPECCUBE_BOX_PROJECTION || PLANE_CLIPPING_ENABLED
#define IN_WORLDPOS(i) i.posWorld
#else
#define IN_WORLDPOS(i) half3(0,0,0)
#endif
#define IN_LIGHTDIR_FWDADD(i) half3(i.tangentToWorldAndLightDir[0].w, i.tangentToWorldAndLightDir[1].w, i.tangentToWorldAndLightDir[2].w)
#define FRAGMENT_SETUP(x) FragmentCommonData x = \
FragmentSetup(i.tex, i.eyeVec, WorldNormal(i.tangentToWorldAndParallax), IN_VIEWDIR4PARALLAX(i), ExtractTangentToWorldPerPixel(i.tangentToWorldAndParallax), IN_WORLDPOS(i));
#if PLANE_CLIPPING_ENABLED
#define IN_WORLDPOS_FWDADD(i) i.posWorld
#else
#define IN_WORLDPOS_FWDADD(i) half3(0,0,0)
#endif
#define FRAGMENT_SETUP_FWDADD(x) FragmentCommonData x = \
FragmentSetup(i.tex, i.eyeVec, WorldNormal(i.tangentToWorldAndLightDir), IN_VIEWDIR4PARALLAX_FWDADD(i), ExtractTangentToWorldPerPixel(i.tangentToWorldAndLightDir), IN_WORLDPOS_FWDADD(i));
struct FragmentCommonData
{
half3 diffColor, specColor;
// Note: oneMinusRoughness & oneMinusReflectivity for optimization purposes, mostly for DX9 SM2.0 level.
// Most of the math is being done on these (1-x) values, and that saves a few precious ALU slots.
half oneMinusReflectivity, oneMinusRoughness;
half3 normalWorld, eyeVec, posWorld;
half alpha;
};
#ifndef UNITY_SETUP_BRDF_INPUT
#define UNITY_SETUP_BRDF_INPUT SpecularSetup
#endif
inline FragmentCommonData SpecularSetup (float4 i_tex)
{
half4 specGloss = SpecularGloss(i_tex.xy);
half3 specColor = specGloss.rgb;
half oneMinusRoughness = specGloss.a;
half oneMinusReflectivity;
half3 diffColor = EnergyConservationBetweenDiffuseAndSpecular (Albedo(i_tex), specColor, /*out*/ oneMinusReflectivity);
FragmentCommonData o = (FragmentCommonData)0;
o.diffColor = diffColor;
o.specColor = specColor;
o.oneMinusReflectivity = oneMinusReflectivity;
o.oneMinusRoughness = oneMinusRoughness;
return o;
}
inline FragmentCommonData MetallicSetup (float4 i_tex)
{
half2 metallicGloss = MetallicGloss(i_tex.xy);
half metallic = metallicGloss.x;
half oneMinusRoughness = metallicGloss.y;
half oneMinusReflectivity;
half3 specColor;
half3 diffColor = DiffuseAndSpecularFromMetallic (Albedo(i_tex), metallic, /*out*/ specColor, /*out*/ oneMinusReflectivity);
FragmentCommonData o = (FragmentCommonData)0;
o.diffColor = diffColor;
o.specColor = specColor;
o.oneMinusReflectivity = oneMinusReflectivity;
o.oneMinusRoughness = oneMinusRoughness;
return o;
}
inline FragmentCommonData FragmentSetup (float4 i_tex, half3 i_eyeVec, half3 i_normalWorld, half3 i_viewDirForParallax, half3x3 i_tanToWorld, half3 i_posWorld)
{
i_tex = Parallax(i_tex, i_viewDirForParallax);
half alpha = Alpha(i_tex.xy);
#if defined(_ALPHATEST_ON)
clip (alpha - _Cutoff);
#endif
#ifdef _NORMALMAP
half3 normalWorld = NormalizePerPixelNormal(mul(NormalInTangentSpace(i_tex), i_tanToWorld)); // @TODO: see if we can squeeze this normalize on SM2.0 as well
#else
// Should get compiled out, isn't being used in the end.
half3 normalWorld = i_normalWorld;
#endif
half3 eyeVec = i_eyeVec;
eyeVec = NormalizePerPixelNormal(eyeVec);
FragmentCommonData o = UNITY_SETUP_BRDF_INPUT (i_tex);
o.normalWorld = normalWorld;
o.eyeVec = eyeVec;
o.posWorld = i_posWorld;
// NOTE: shader relies on pre-multiply alpha-blend (_SrcBlend = One, _DstBlend = OneMinusSrcAlpha)
o.diffColor = PreMultiplyAlpha (o.diffColor, alpha, o.oneMinusReflectivity, /*out*/ o.alpha);
return o;
}
inline UnityGI FragmentGI (
float3 posWorld,
half occlusion, half4 i_ambientOrLightmapUV, half atten, half oneMinusRoughness, half3 normalWorld, half3 eyeVec,
UnityLight light)
{
UnityGIInput d;
UNITY_INITIALIZE_OUTPUT(UnityGIInput, d);
d.light = light;
d.worldPos = posWorld;
d.worldViewDir = -eyeVec;
d.atten = atten;
#if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON)
d.ambient = 0;
d.lightmapUV = i_ambientOrLightmapUV;
#else
d.ambient = i_ambientOrLightmapUV.rgb;
d.lightmapUV = 0;
#endif
d.boxMax[0] = unity_SpecCube0_BoxMax;
d.boxMin[0] = unity_SpecCube0_BoxMin;
d.probePosition[0] = unity_SpecCube0_ProbePosition;
d.probeHDR[0] = unity_SpecCube0_HDR;
d.boxMax[1] = unity_SpecCube1_BoxMax;
d.boxMin[1] = unity_SpecCube1_BoxMin;
d.probePosition[1] = unity_SpecCube1_ProbePosition;
d.probeHDR[1] = unity_SpecCube1_HDR;
return UnityGlobalIllumination (
d, occlusion, oneMinusRoughness, normalWorld);
}
//-------------------------------------------------------------------------------------
half4 OutputForward (half4 output, half alphaFromSurface)
{
#if defined(_ALPHABLEND_ON) || defined(_ALPHAPREMULTIPLY_ON)
output.a = alphaFromSurface;
#else
UNITY_OPAQUE_ALPHA(output.a);
#endif
return output;
}
// ------------------------------------------------------------------
// Base forward pass (directional light, emission, lightmaps, ...)
struct VertexOutputForwardBase
{
float4 pos : SV_POSITION;
float4 tex : TEXCOORD0;
half3 eyeVec : TEXCOORD1;
half4 tangentToWorldAndParallax[3] : TEXCOORD2; // [3x3:tangentToWorld | 1x3:viewDirForParallax]
half4 ambientOrLightmapUV : TEXCOORD5; // SH or Lightmap UV
SHADOW_COORDS(6)
UNITY_FOG_COORDS(7)
// next ones would not fit into SM2.0 limits, but they are always for SM3.0+
#if UNITY_SPECCUBE_BOX_PROJECTION || PLANE_CLIPPING_ENABLED
float3 posWorld : TEXCOORD8;
#endif
};
VertexOutputForwardBase vertForwardBase (VertexInput v)
{
VertexOutputForwardBase o;
UNITY_INITIALIZE_OUTPUT(VertexOutputForwardBase, o);
float4 posWorld = mul(unity_ObjectToWorld, v.vertex);
#if UNITY_SPECCUBE_BOX_PROJECTION || PLANE_CLIPPING_ENABLED
o.posWorld = posWorld.xyz;
#endif
o.pos = UnityObjectToClipPos(v.vertex);
o.tex = TexCoords(v);
o.eyeVec = NormalizePerVertexNormal(posWorld.xyz - _WorldSpaceCameraPos);
float3 normalWorld = UnityObjectToWorldNormal(v.normal);
#ifdef _TANGENT_TO_WORLD
float4 tangentWorld = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w);
float3x3 tangentToWorld = CreateTangentToWorldPerVertex(normalWorld, tangentWorld.xyz, tangentWorld.w);
o.tangentToWorldAndParallax[0].xyz = tangentToWorld[0];
o.tangentToWorldAndParallax[1].xyz = tangentToWorld[1];
o.tangentToWorldAndParallax[2].xyz = tangentToWorld[2];
#else
o.tangentToWorldAndParallax[0].xyz = 0;
o.tangentToWorldAndParallax[1].xyz = 0;
o.tangentToWorldAndParallax[2].xyz = normalWorld;
#endif
//We need this for shadow receving
TRANSFER_SHADOW(o);
// Static lightmaps
#ifndef LIGHTMAP_OFF
o.ambientOrLightmapUV.xy = v.uv1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
o.ambientOrLightmapUV.zw = 0;
// Sample light probe for Dynamic objects only (no static or dynamic lightmaps)
#elif UNITY_SHOULD_SAMPLE_SH
#if UNITY_SAMPLE_FULL_SH_PER_PIXEL
o.ambientOrLightmapUV.rgb = 0;
#elif (SHADER_TARGET < 30)
o.ambientOrLightmapUV.rgb = ShadeSH9(half4(normalWorld, 1.0));
#else
// Optimization: L2 per-vertex, L0..L1 per-pixel
o.ambientOrLightmapUV.rgb = ShadeSH3Order(half4(normalWorld, 1.0));
#endif
// Add approximated illumination from non-important point lights
#ifdef VERTEXLIGHT_ON
o.ambientOrLightmapUV.rgb += Shade4PointLights (
unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0,
unity_LightColor[0].rgb, unity_LightColor[1].rgb, unity_LightColor[2].rgb, unity_LightColor[3].rgb,
unity_4LightAtten0, posWorld, normalWorld);
#endif
#endif
#ifdef DYNAMICLIGHTMAP_ON
o.ambientOrLightmapUV.zw = v.uv2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
#endif
#ifdef _PARALLAXMAP
TANGENT_SPACE_ROTATION;
half3 viewDirForParallax = mul (rotation, ObjSpaceViewDir(v.vertex));
o.tangentToWorldAndParallax[0].w = viewDirForParallax.x;
o.tangentToWorldAndParallax[1].w = viewDirForParallax.y;
o.tangentToWorldAndParallax[2].w = viewDirForParallax.z;
#endif
UNITY_TRANSFER_FOG(o,o.pos);
return o;
}
half4 fragForwardBase (VertexOutputForwardBase i) : SV_Target
{
FRAGMENT_SETUP(s)
PLANE_CLIP(s.posWorld)
UnityLight mainLight = MainLight (s.normalWorld);
half atten = SHADOW_ATTENUATION(i);
half occlusion = Occlusion(i.tex.xy);
UnityGI gi = FragmentGI (
s.posWorld, occlusion, i.ambientOrLightmapUV, atten, s.oneMinusRoughness, s.normalWorld, s.eyeVec, mainLight);
half4 c = UNITY_BRDF_PBS (s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, -s.eyeVec, gi.light, gi.indirect);
c.rgb += UNITY_BRDF_GI (s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, -s.eyeVec, occlusion, gi);
c.rgb += Emission(i.tex.xy);
UNITY_APPLY_FOG(i.fogCoord, c.rgb);
return OutputForward (c, s.alpha);
}
// ------------------------------------------------------------------
// Additive forward pass (one light per pass)
struct VertexOutputForwardAdd
{
float4 pos : SV_POSITION;
float4 tex : TEXCOORD0;
half3 eyeVec : TEXCOORD1;
half4 tangentToWorldAndLightDir[3] : TEXCOORD2; // [3x3:tangentToWorld | 1x3:lightDir]
LIGHTING_COORDS(5,6)
UNITY_FOG_COORDS(7)
// next ones would not fit into SM2.0 limits, but they are always for SM3.0+
#if defined(_PARALLAXMAP)
half3 viewDirForParallax : TEXCOORD8;
#endif
#if PLANE_CLIPPING_ENABLED
float3 posWorld : TEXCOORD9;
#endif
};
VertexOutputForwardAdd vertForwardAdd (VertexInput v)
{
VertexOutputForwardAdd o;
UNITY_INITIALIZE_OUTPUT(VertexOutputForwardAdd, o);
float4 posWorld = mul(unity_ObjectToWorld, v.vertex);
#if PLANE_CLIPPING_ENABLED
o.posWorld = posWorld.xyz;
#endif
o.pos = UnityObjectToClipPos(v.vertex);
o.tex = TexCoords(v);
o.eyeVec = NormalizePerVertexNormal(posWorld.xyz - _WorldSpaceCameraPos);
float3 normalWorld = UnityObjectToWorldNormal(v.normal);
#ifdef _TANGENT_TO_WORLD
float4 tangentWorld = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w);
float3x3 tangentToWorld = CreateTangentToWorldPerVertex(normalWorld, tangentWorld.xyz, tangentWorld.w);
o.tangentToWorldAndLightDir[0].xyz = tangentToWorld[0];
o.tangentToWorldAndLightDir[1].xyz = tangentToWorld[1];
o.tangentToWorldAndLightDir[2].xyz = tangentToWorld[2];
#else
o.tangentToWorldAndLightDir[0].xyz = 0;
o.tangentToWorldAndLightDir[1].xyz = 0;
o.tangentToWorldAndLightDir[2].xyz = normalWorld;
#endif
//We need this for shadow receving
TRANSFER_VERTEX_TO_FRAGMENT(o);
float3 lightDir = _WorldSpaceLightPos0.xyz - posWorld.xyz * _WorldSpaceLightPos0.w;
#ifndef USING_DIRECTIONAL_LIGHT
lightDir = NormalizePerVertexNormal(lightDir);
#endif
o.tangentToWorldAndLightDir[0].w = lightDir.x;
o.tangentToWorldAndLightDir[1].w = lightDir.y;
o.tangentToWorldAndLightDir[2].w = lightDir.z;
#ifdef _PARALLAXMAP
TANGENT_SPACE_ROTATION;
o.viewDirForParallax = mul (rotation, ObjSpaceViewDir(v.vertex));
#endif
UNITY_TRANSFER_FOG(o,o.pos);
return o;
}
half4 fragForwardAdd (VertexOutputForwardAdd i) : SV_Target
{
FRAGMENT_SETUP_FWDADD(s)
PLANE_CLIP(s.posWorld)
UnityLight light = AdditiveLight (s.normalWorld, IN_LIGHTDIR_FWDADD(i), LIGHT_ATTENUATION(i));
UnityIndirect noIndirect = ZeroIndirect ();
half4 c = UNITY_BRDF_PBS (s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, -s.eyeVec, light, noIndirect);
UNITY_APPLY_FOG_COLOR(i.fogCoord, c.rgb, half4(0,0,0,0)); // fog towards black in additive pass
return OutputForward (c, s.alpha);
}
// ------------------------------------------------------------------
// Deferred pass
struct VertexOutputDeferred
{
float4 pos : SV_POSITION;
float4 tex : TEXCOORD0;
half3 eyeVec : TEXCOORD1;
half4 tangentToWorldAndParallax[3] : TEXCOORD2; // [3x3:tangentToWorld | 1x3:viewDirForParallax]
half4 ambientOrLightmapUV : TEXCOORD5; // SH or Lightmap UVs
#if UNITY_SPECCUBE_BOX_PROJECTION || PLANE_CLIPPING_ENABLED
float3 posWorld : TEXCOORD6;
#endif
};
VertexOutputDeferred vertDeferred (VertexInput v)
{
VertexOutputDeferred o;
UNITY_INITIALIZE_OUTPUT(VertexOutputDeferred, o);
float4 posWorld = mul(unity_ObjectToWorld, v.vertex);
#if UNITY_SPECCUBE_BOX_PROJECTION || PLANE_CLIPPING_ENABLED
o.posWorld = posWorld;
#endif
o.pos = UnityObjectToClipPos(v.vertex);
o.tex = TexCoords(v);
o.eyeVec = NormalizePerVertexNormal(posWorld.xyz - _WorldSpaceCameraPos);
float3 normalWorld = UnityObjectToWorldNormal(v.normal);
#ifdef _TANGENT_TO_WORLD
float4 tangentWorld = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w);
float3x3 tangentToWorld = CreateTangentToWorldPerVertex(normalWorld, tangentWorld.xyz, tangentWorld.w);
o.tangentToWorldAndParallax[0].xyz = tangentToWorld[0];
o.tangentToWorldAndParallax[1].xyz = tangentToWorld[1];
o.tangentToWorldAndParallax[2].xyz = tangentToWorld[2];
#else
o.tangentToWorldAndParallax[0].xyz = 0;
o.tangentToWorldAndParallax[1].xyz = 0;
o.tangentToWorldAndParallax[2].xyz = normalWorld;
#endif
#ifndef LIGHTMAP_OFF
o.ambientOrLightmapUV.xy = v.uv1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
o.ambientOrLightmapUV.zw = 0;
#elif UNITY_SHOULD_SAMPLE_SH
#if (SHADER_TARGET < 30)
o.ambientOrLightmapUV.rgb = ShadeSH9(half4(normalWorld, 1.0));
#else
// Optimization: L2 per-vertex, L0..L1 per-pixel
o.ambientOrLightmapUV.rgb = ShadeSH3Order(half4(normalWorld, 1.0));
#endif
#endif
#ifdef DYNAMICLIGHTMAP_ON
o.ambientOrLightmapUV.zw = v.uv2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
#endif
#ifdef _PARALLAXMAP
TANGENT_SPACE_ROTATION;
half3 viewDirForParallax = mul (rotation, ObjSpaceViewDir(v.vertex));
o.tangentToWorldAndParallax[0].w = viewDirForParallax.x;
o.tangentToWorldAndParallax[1].w = viewDirForParallax.y;
o.tangentToWorldAndParallax[2].w = viewDirForParallax.z;
#endif
return o;
}
void fragDeferred (
VertexOutputDeferred i,
out half4 outDiffuse : SV_Target0, // RT0: diffuse color (rgb), occlusion (a)
out half4 outSpecSmoothness : SV_Target1, // RT1: spec color (rgb), smoothness (a)
out half4 outNormal : SV_Target2, // RT2: normal (rgb), --unused, very low precision-- (a)
out half4 outEmission : SV_Target3 // RT3: emission (rgb), --unused-- (a)
)
{
#if (SHADER_TARGET < 30)
outDiffuse = 1;
outSpecSmoothness = 1;
outNormal = 0;
outEmission = 0;
return;
#endif
FRAGMENT_SETUP(s)
PLANE_CLIP(s.posWorld)
// no analytic lights in this pass
UnityLight dummyLight = DummyLight (s.normalWorld);
half atten = 1;
// only GI
half occlusion = Occlusion(i.tex.xy);
UnityGI gi = FragmentGI (
s.posWorld, occlusion, i.ambientOrLightmapUV, atten, s.oneMinusRoughness, s.normalWorld, s.eyeVec, dummyLight);
half3 color = UNITY_BRDF_PBS (s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, -s.eyeVec, gi.light, gi.indirect).rgb;
color += UNITY_BRDF_GI (s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, -s.eyeVec, occlusion, gi);
#ifdef _EMISSION
color += Emission (i.tex.xy);
#endif
#ifndef UNITY_HDR_ON
color.rgb = exp2(-color.rgb);
#endif
outDiffuse = half4(s.diffColor, occlusion);
outSpecSmoothness = half4(s.specColor, s.oneMinusRoughness);
outNormal = half4(s.normalWorld*0.5+0.5,1);
outEmission = half4(color, 1);
}
#endif // UNITY_STANDARD_CORE_INCLUDED
fileFormatVersion: 2
guid: 3f43f06d301411b4fa09ab37ec614e79
timeCreated: 1426341334
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
#ifndef UNITY_STANDARD_SHADOW_INCLUDED
#define UNITY_STANDARD_SHADOW_INCLUDED
// NOTE: had to split shadow functions into separate file,
// otherwise compiler gives trouble with LIGHTING_COORDS macro (in UnityStandardCore.cginc)
#include "plane_clipping.cginc"
#include "UnityCG.cginc"
#include "UnityShaderVariables.cginc"
#include "UnityStandardConfig.cginc"
// Do dithering for alpha blended shadows on SM3+/desktop;
// on lesser systems do simple alpha-tested shadows
#if defined(_ALPHABLEND_ON) || defined(_ALPHAPREMULTIPLY_ON)
#if !((SHADER_TARGET < 30) || defined (SHADER_API_MOBILE) || defined(SHADER_API_D3D11_9X) || defined (SHADER_API_PSP2) || defined (SHADER_API_PSM))
#define UNITY_STANDARD_USE_DITHER_MASK 1
#endif
#endif
// Need to output UVs in shadow caster, since we need to sample texture and do clip/dithering based on it
#if defined(_ALPHATEST_ON) || defined(_ALPHABLEND_ON) || defined(_ALPHAPREMULTIPLY_ON)
#define UNITY_STANDARD_USE_SHADOW_UVS 1
#endif
// Has a non-empty shadow caster output struct (it's an error to have empty structs on some platforms...)
#if PLANE_CLIPPING_ENABLED || !defined(V2F_SHADOW_CASTER_NOPOS_IS_EMPTY) || defined(UNITY_STANDARD_USE_SHADOW_UVS)
#define UNITY_STANDARD_USE_SHADOW_OUTPUT_STRUCT 1
#endif
half4 _Color;
half _Cutoff;
sampler2D _MainTex;
float4 _MainTex_ST;
#ifdef UNITY_STANDARD_USE_DITHER_MASK
sampler3D _DitherMaskLOD;
#endif
struct VertexInput
{
float4 vertex : POSITION;
float3 normal : NORMAL;
float2 uv0 : TEXCOORD0;
};
#ifdef UNITY_STANDARD_USE_SHADOW_OUTPUT_STRUCT
struct VertexOutputShadowCaster
{
V2F_SHADOW_CASTER_NOPOS
#if defined(UNITY_STANDARD_USE_SHADOW_UVS)
float2 tex : TEXCOORD1;
#endif
#if PLANE_CLIPPING_ENABLED
float3 posWorld : TEXCOORD2;
#endif
};
#endif
// We have to do these dances of outputting SV_POSITION separately from the vertex shader,
// and inputting VPOS in the pixel shader, since they both map to "POSITION" semantic on
// some platforms, and then things don't go well.
void vertShadowCaster (VertexInput v,
#ifdef UNITY_STANDARD_USE_SHADOW_OUTPUT_STRUCT
out VertexOutputShadowCaster o,
#endif
out float4 opos : SV_POSITION)
{
#if PLANE_CLIPPING_ENABLED
float4 posWorld = mul(unity_ObjectToWorld, v.vertex);
o.posWorld = posWorld.xyz;
#endif
TRANSFER_SHADOW_CASTER_NOPOS(o,opos)
#if defined(UNITY_STANDARD_USE_SHADOW_UVS)
o.tex = TRANSFORM_TEX(v.uv0, _MainTex);
#endif
}
half4 fragShadowCaster (
#ifdef UNITY_STANDARD_USE_SHADOW_OUTPUT_STRUCT
VertexOutputShadowCaster i
#endif
#ifdef UNITY_STANDARD_USE_DITHER_MASK
, UNITY_VPOS_TYPE vpos : VPOS
#endif
) : SV_Target
{
PLANE_CLIP(i.posWorld)
#if defined(UNITY_STANDARD_USE_SHADOW_UVS)
half alpha = tex2D(_MainTex, i.tex).a * _Color.a;
#if defined(_ALPHATEST_ON)
clip (alpha - _Cutoff);
#endif
#if defined(_ALPHABLEND_ON) || defined(_ALPHAPREMULTIPLY_ON)
#if defined(UNITY_STANDARD_USE_DITHER_MASK)
// Use dither mask for alpha blended shadows, based on pixel position xy
// and alpha level. Our dither texture is 4x4x16.
half alphaRef = tex3D(_DitherMaskLOD, float3(vpos.xy*0.25,alpha*0.9375)).a;
clip (alphaRef - 0.01);
#else
clip (alpha - _Cutoff);
#endif
#endif
#endif // #if defined(UNITY_STANDARD_USE_SHADOW_UVS)
SHADOW_CASTER_FRAGMENT(i)
}
#endif // UNITY_STANDARD_SHADOW_INCLUDED
fileFormatVersion: 2
guid: 54e874aa84234704a8f95dd1936907d5
timeCreated: 1426342387
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
......@@ -7,6 +7,7 @@ public class RuntimeCSGFlatlandObject : MonoBehaviour
{
public GameObject PastLightCone;
public GameObject crosssection;
public Mesh m;
int cnt = 0;
......@@ -14,12 +15,12 @@ public class RuntimeCSGFlatlandObject : MonoBehaviour
// Start is called before the first frame update
void Start()
{
CSG.EPSILON = 1e-5f; // Adjustable epsilon value
csg = new CSG();
csg.Target = transform.gameObject;
//CSG.EPSILON = 1e-5f; // Adjustable epsilon value
//csg = new CSG();
//csg.Target = transform.gameObject;
PastLightCone = GameObject.Find("Cone");
csg.Brush = PastLightCone;
csg.OperationType = CSG.Operation.Intersection;
//csg.Brush = PastLightCone;
//csg.OperationType = CSG.Operation.Intersection;
//Destroy(crosssection);
//GameObject tmp = csg.PerformCSG();
......@@ -27,6 +28,9 @@ public class RuntimeCSGFlatlandObject : MonoBehaviour
crosssection = new GameObject();
crosssection.name = "Thecrosssection";
Physics.IgnoreLayerCollision(8, 8);
m = new Mesh();
}
// Update is called once per frame
......@@ -42,13 +46,48 @@ public class RuntimeCSGFlatlandObject : MonoBehaviour
cnt++;*/
}
public void OnTriggerEnter(Collider other)
public void OnCollisionStay(Collision collision)
{
Debug.Log( "Trigger hit!");
if(other.gameObject == PastLightCone)
//Debug.Log("Wow!");
if (collision.collider.gameObject == PastLightCone)
{
crosssection.name = "hit!";
/*Debug.Log("Contact count : " + collision.contactCount);
int vertexCount = collision.contactCount;
Vector3[] vertices = new Vector3[vertexCount];
int[] indices = new int[vertexCount];
for (int i = 0; i < vertexCount; i++)
{
vertices[i] = collision.GetContact(i).point;
indices[i] = i;
}
m.Clear();
m.vertices = vertices;
m.SetIndices(indices, MeshTopology.Points, 0);
m.RecalculateBounds();
m.RecalculateNormals();
MeshFilter mf = GetComponent<MeshFilter>();
mf.mesh = m;
Debug.Log(m.bounds);*/
}
}
public void OnTriggerEnter(Collider other)
{
//Debug.Log( "Trigger hit!");
//if(other.gameObject == PastLightCone)
//{
//crosssection.name = "hit!";
//GameObject tmp = csg.PerformCSG();
//tmp.name = "wow!";
//crosssection = tmp;
//}
//crosssection = csg.PerformCSG();
//GameObject tmp = csg.PerformCSG();
//crosssection = tmp;
......
......@@ -134,6 +134,7 @@ GameObject:
- component: {fileID: 839664889}
- component: {fileID: 839664887}
- component: {fileID: 839664888}
- component: {fileID: 839664893}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
......@@ -153,6 +154,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d99664edeab700d4ca972d282f99515b, type: 3}
m_Name:
m_EditorClassIdentifier:
time: 0.2
leaveworldline: 1
--- !u!54 &839664888
Rigidbody:
m_ObjectHideFlags: 0
......@@ -167,7 +170,7 @@ Rigidbody:
m_UseGravity: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_Constraints: 126
m_CollisionDetection: 0
--- !u!64 &839664889
MeshCollider:
......@@ -177,10 +180,10 @@ MeshCollider:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 839664886}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &839664890
......@@ -192,7 +195,7 @@ MeshRenderer:
m_GameObject: {fileID: 839664886}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
......@@ -200,7 +203,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c5298fefcfd9aa945b24d682f943ffdd, type: 2}
- {fileID: 2100000, guid: 20fb938f954d7a94a939b71d6351efb5, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
......@@ -242,6 +245,22 @@ Transform:
m_Father: {fileID: 1094934750}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &839664893
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 839664886}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c677c933585d0ee4dbfe7483ac9f8c84, type: 3}
m_Name:
m_EditorClassIdentifier:
plane: {fileID: 1756789504}
normal: {x: 0, y: 0, z: 0}
position: {x: 0, y: 0, z: 0}
rend: {fileID: 0}
--- !u!1 &1092288291
GameObject:
m_ObjectHideFlags: 0
......@@ -371,12 +390,12 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1094934748}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -26.549408, y: 0, z: 11.67}
m_LocalPosition: {x: -6, y: 0, z: -1.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 839664892}
m_Father: {fileID: 0}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1661408487
GameObject:
......@@ -457,12 +476,11 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1661408487}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: -21.5, y: 5, z: 12.8}
m_LocalPosition: {x: 0, y: 5, z: 0}
m_LocalScale: {x: 1, y: 0.10000006, z: 10}
m_Children:
- {fileID: 1756789505}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!114 &1661408491
MonoBehaviour:
......@@ -501,6 +519,8 @@ GameObject:
- component: {fileID: 1756789507}
- component: {fileID: 1756789506}
- component: {fileID: 1756789509}
- component: {fileID: 1756789510}
- component: {fileID: 1756789511}
m_Layer: 0
m_Name: Cone
m_TagString: Untagged
......@@ -515,12 +535,12 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1756789504}
m_LocalRotation: {x: -0, y: 0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.5}
m_LocalScale: {x: 1, y: 10, z: 0.10000005}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1661408490}
m_RootOrder: 0
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!64 &1756789506
MeshCollider:
......@@ -530,10 +550,10 @@ MeshCollider:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1756789504}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 1
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: ad5e268098f7fc745acab47fc446ad82, type: 2}
--- !u!23 &1756789507
......@@ -597,3 +617,29 @@ Rigidbody:
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &1756789510
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1756789504}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d99664edeab700d4ca972d282f99515b, type: 3}
m_Name:
m_EditorClassIdentifier:
time: 0.1
leaveworldline: 0
--- !u!114 &1756789511
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1756789504}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cbe88b4b9f484734bb13537c3b8f454b, type: 3}
m_Name:
m_EditorClassIdentifier:
......@@ -17,8 +17,9 @@ public class ExtrudedMesh : MonoBehaviour
// Generates an extrusion trail from the attached mesh
// Uses the MeshExtrusion algorithm in MeshExtrusion.cs to generate and preprocess the mesh.
double time = 1.0f;
public double time = 1.0f;
double prevtime;
public bool leaveworldline = true;
bool autoCalculateOrientation = true;
double minDistance = 0.05f;
bool invertFaces = false;
......@@ -38,7 +39,7 @@ public class ExtrudedMesh : MonoBehaviour
{
srcMesh = GetComponent<MeshFilter>().sharedMesh;
precomputedEdges = MeshExtrusion.BuildManifoldEdges(srcMesh);
//GetComponent<MeshCollider>().sharedMesh = GetComponent<MeshFilter>().mesh;
GetComponent<MeshCollider>().sharedMesh = GetComponent<MeshFilter>().mesh;
prevtime = Time.time;
}
......@@ -48,20 +49,21 @@ public class ExtrudedMesh : MonoBehaviour
{
var position = transform.position;
var rotation = transform.rotation;
var now = Time.time + 0.9f;
var now = Time.time + 0.5f * (float)time;
// Remove old sections
while (sections.Count > 0 && now > sections[sections.Count - 1].time + time)
{
if(sections[sections.Count - 1].time - prevtime > 0.9f)
if(sections[sections.Count - 1].time - prevtime > 0.5f * time && leaveworldline)
{
var clone = Instantiate(transform.parent.gameObject, transform.parent.position, transform.parent.rotation);
clone.GetComponentInChildren<MeshFilter>().sharedMesh = clone.GetComponentInChildren<MeshFilter>().mesh;
DestroyImmediate(clone.GetComponent<Planemovement>());
DestroyImmediate(clone.GetComponentInChildren<ExtrudedMesh>());
DestroyImmediate(clone.GetComponentInChildren<RuntimeCSGFlatlandObject>());
clone.GetComponentInChildren<MeshCollider>().sharedMesh = clone.GetComponentInChildren<MeshFilter>().mesh;
clone.GetComponentInChildren<MeshFilter>().sharedMesh = clone.GetComponentInChildren<MeshFilter>().mesh;
clone.transform.GetChild(0).gameObject.AddComponent<RuntimeCSGFlatlandObject>();
clone.layer = 8;
clone.transform.GetChild(0).gameObject.layer = 8;
Destroy(clone, 100);
prevtime = sections[sections.Count - 1].time;
}
......@@ -134,6 +136,19 @@ public class ExtrudedMesh : MonoBehaviour
// Rebuild the extrusion mesh
MeshExtrusion.ExtrudeMesh(srcMesh, GetComponent<MeshFilter>().mesh, finalSections, precomputedEdges, invertFaces);
/*Mesh m = new Mesh();
MeshExtrusion.ExtrudeMesh(srcMesh, m, finalSections, precomputedEdges, !invertFaces);
CombineInstance[] combine = new CombineInstance[2];
combine[0].mesh = GetComponent<MeshFilter>().mesh;
//combine[0].transform = transform.worldToLocalMatrix;
combine[1].mesh = m;
//combine[0].transform = transform.worldToLocalMatrix;
transform.GetComponent<MeshFilter>().mesh = new Mesh();
transform.GetComponent<MeshFilter>().mesh.CombineMeshes(combine);*/
}
}
......@@ -64,7 +64,7 @@ Material:
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _HighlightThresholdMax: 1
- _HighlightThresholdMax: 0.1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
......
......@@ -85,7 +85,7 @@ Material:
- _EdgeColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _GlowColor: {r: 1, g: 0, b: 0, a: 1}
- _HighlightColor: {r: 1, g: 1, b: 1, a: 0.5}
- _HighlightColor: {r: 1, g: 0, b: 0, a: 1}
- _IntersectionColor: {r: 1, g: 0, b: 0, a: 1}
- _MainColor: {r: 0, g: 0, b: 0, a: 1}
- _PlaneNormal: {r: 0, g: 1, b: 0, a: 0}
......
Shader "Custom/PastLightConeShader" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_GlowColor("Glow Color", Color) = (1, 1, 1, 1)
_FadeLength("Fade Length", Range(0, 5)) = 1
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Custom/PastLightConeShader"
{
Properties
{
_RegularColor("Main Color", Color) = (1, 1, 1, 0) //Color when not intersecting
_HighlightColor("Highlight Color", Color) = (0, 0, 0, 1) //Color when intersecting
_HighlightThresholdMax("Highlight Threshold Max", Float) = 1 //Max difference for intersections
//_ZBias("Highlight Z Bias", Float) = 2.5 //Balance out the Z-axis fading
}
SubShader{
SubShader
{
Tags { "Queue" = "Overlay" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
Pass
{
Blend SrcAlpha OneMinusSrcAlpha
ZWrite On
Tags
{
"RenderType" = "Transparent"
"Queue" = "Transparent"
}
ZWrite Off
Cull Off
CGPROGRAM
#pragma surface surf Standard fullforwardshadows alpha:fade vertex:vert
#pragma target 4.0
sampler2D _MainTex;
struct Input {
float2 uv_MainTex;
float4 screenPos;
float eyeDepth;
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
uniform sampler2D _CameraDepthTexture; //Depth Texture
uniform float4 _RegularColor;
uniform float4 _HighlightColor;
uniform float _HighlightThresholdMax;
//uniform float _ZBias;
struct v2f
{
float4 pos : SV_POSITION;
float4 projPos : TEXCOORD1; //Screen position of pos
};
half _Glossiness;
half _Metallic;
sampler2D _CameraDepthTexture;
fixed4 _Color;
fixed4 _GlowColor;
float _FadeLength;
void vert(inout appdata_full v, out Input o)
v2f vert(appdata_base v)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
COMPUTE_EYEDEPTH(o.eyeDepth);
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.projPos = ComputeScreenPos(o.pos);
return o;
}
half4 frag(v2f i) : COLOR
{
float4 finalColor = _RegularColor;
//Get the distance to the camera from the depth buffer for this point
float sceneZ = tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)).r * 400;
//Actual distance to the camera
float partY = i.projPos.y;// +(i.projPos.y / _ZBias);
void surf(Input IN, inout SurfaceOutputStandard o) {
float rawZ = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(IN.screenPos));
float sceneZ = rawZ;
float partZ = IN.eyeDepth;
float diff = (sceneZ - partZ);
float intersect = 1 - saturate(diff / _FadeLength);
//If the two are similar, then there is an object intersecting with our object
float diff = (abs(sceneZ - partY)) / _HighlightThresholdMax;
if (diff <= 1)
{
finalColor = _HighlightColor;
}
fixed4 col = fixed4(lerp(tex2D(_MainTex, IN.uv_MainTex) * _Color, _GlowColor, pow(intersect, 4)));
o.Albedo = col.rgb;
o.Alpha = col.a;
o.Metallic = _Metallic;
o.Smoothness = _Glossiness;
half4 c;
c.r = finalColor.r;
c.g = finalColor.g;
c.b = finalColor.b;
c.a = (diff<=1)? 1.0f:0.0f;
return c;
}
ENDCG
}
FallBack "Diffuse"
}
FallBack "VertexLit"
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ public class Planemovement : MonoBehaviour
{
Renderer r = theobject.GetComponent<Renderer>();
//Color materialColor = r.material.color;
r.material.color = Color.blue;
//r.material.color = Color.clear;
v = new Vector3(0.0f, 0.0f, 0.0f);
}
......@@ -39,11 +39,11 @@ public class Planemovement : MonoBehaviour
//transform.Translate(0.5f*Vector3.forward * Mathf.Cos(2*Mathf.PI*cnt/480) * Time.fixedDeltaTime, Space.World);
//transform.Translate(0.5f*Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480) * Time.fixedDeltaTime, Space.World);
//var v = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
//v = (float)beta * Vector3.forward * Mathf.Cos(2 * Mathf.PI * cnt / 480) + (float)beta * Vector3.left * Mathf.Sin(2 * Mathf.PI * cnt / 480);
v = alpha.normalized * (alpha.magnitude * Time.time / Mathf.Sqrt(1.0f+(alpha.magnitude * Time.time)*(alpha.magnitude * Time.time)));
Debug.Log(v.ToString("F6"));
//v = new Vector3(0, 0, 0);
beta = v.magnitude / 1.0f;
......@@ -59,11 +59,6 @@ public class Planemovement : MonoBehaviour
vt.Normalize();
//transform.up = vt;
//theobject.transform.up = vt;
//Quaternion rotation = Quaternion.LookRotation(Vector3.forward, vt);
//transform.rotation = rotation;
transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); // release child to change x'-axis scale
theobject.transform.up = vt;
......@@ -73,11 +68,7 @@ public class Planemovement : MonoBehaviour
Vector3 newforward = new Vector3(vt.y * (v.x/v.magnitude),Mathf.Sqrt(vt.x * vt.x + vt.z *vt.z), vt.y * (v.z / v.magnitude));
transform.rotation = Quaternion.LookRotation(newforward, vt);
//Quaternion forwardrotation = Quaternion.FromToRotation(prevfor, newforward);
//transform.forward = newforward;
theobject.transform.parent = transform;
transform.localScale = new Vector3(1.0f, 1.0f, (float)gamma); // scale x' axis
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Linq;
public class Square : FlatLandObject
{
public List<Vector3> pathList = new List<Vector3>();
public List<float> pathVelocity = new List<float>();
private float _zPosition => transform.position.z;
private float PlayerVelocity;
public Vector3 GetNthPath(int n) // Get a path from (n)th destination to (n+1)th destination.
{
return pathList[n + 1] - pathList[n];
}
public float GetTangent(Vector3 v)
{
return v.y / v.x;
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Linq;
public class Square : FlatLandObject
{
public List<Vector3> pathList = new List<Vector3>();
public List<float> pathVelocity = new List<float>();
private float _zPosition => transform.position.z;
private float PlayerVelocity;
public Vector3 GetNthPath(int n) // Get a path from (n)th destination to (n+1)th destination.
{
return pathList[n + 1] - pathList[n];
}
public float GetTangent(Vector3 v)
{
return v.y / v.x;
}
public Vector3 GetMiddlePoint(int st, int en)
{
return (pathList[en] - pathList[st]) / 2;
}
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
--- !u!55 &1
PhysicsManager:
m_ObjectHideFlags: 0
serializedVersion: 7
serializedVersion: 13
m_Gravity: {x: 0, y: -9.81, z: 0}
m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2
......@@ -22,9 +22,14 @@ PhysicsManager:
m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1
m_ClothInterCollisionSettingsToggle: 0
m_ContactPairsMode: 0
m_ClothGravity: {x: 0, y: -9.81, z: 0}
m_ContactPairsMode: 3
m_BroadphaseType: 0
m_WorldBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 250, y: 250, z: 250}
m_WorldSubdivisions: 8
m_FrictionType: 0
m_EnableEnhancedDeterminism: 0
m_EnableUnifiedHeightmaps: 1
m_DefaultMaxAngularSpeed: 7
......@@ -39,7 +39,58 @@ GraphicsSettings:
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings: []
m_TierSettings:
- serializedVersion: 5
m_BuildTarget: 1
m_Tier: 0
m_Settings:
standardShaderQuality: 2
renderingPath: 1
hdrMode: 1
realtimeGICPUUsage: 25
useReflectionProbeBoxProjection: 1
useReflectionProbeBlending: 1
useHDR: 0
useDetailNormalMap: 1
useCascadedShadowMaps: 1
prefer32BitShadowMaps: 0
enableLPPV: 1
useDitherMaskForAlphaBlendedShadows: 1
m_Automatic: 0
- serializedVersion: 5
m_BuildTarget: 1
m_Tier: 1
m_Settings:
standardShaderQuality: 2
renderingPath: 1
hdrMode: 1
realtimeGICPUUsage: 25
useReflectionProbeBoxProjection: 1
useReflectionProbeBlending: 1
useHDR: 0
useDetailNormalMap: 1
useCascadedShadowMaps: 1
prefer32BitShadowMaps: 0
enableLPPV: 1
useDitherMaskForAlphaBlendedShadows: 1
m_Automatic: 0
- serializedVersion: 5
m_BuildTarget: 1
m_Tier: 2
m_Settings:
standardShaderQuality: 2
renderingPath: 1
hdrMode: 1
realtimeGICPUUsage: 50
useReflectionProbeBoxProjection: 1
useReflectionProbeBlending: 1
useHDR: 0
useDetailNormalMap: 1
useCascadedShadowMaps: 1
prefer32BitShadowMaps: 0
enableLPPV: 1
useDitherMaskForAlphaBlendedShadows: 1
m_Automatic: 0
m_LightmapStripping: 0
m_FogStripping: 0
m_InstancingStripping: 0
......
......@@ -15,7 +15,7 @@ TagManager:
- UI
-
-
-
- Flatlandlayer
-
-
-
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment