diff --git a/package/Assets/Built-in.meta b/package/Assets/Built-in.meta new file mode 100644 index 0000000..311f2ae --- /dev/null +++ b/package/Assets/Built-in.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0ee491f179c377b46a503e7c37964d8f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Materials.meta b/package/Assets/Built-in/Materials.meta new file mode 100644 index 0000000..c464c20 --- /dev/null +++ b/package/Assets/Built-in/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ac0cd2893494bd3448f3c6edb406eac7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Materials/Scenario_Projector Global.mat b/package/Assets/Built-in/Materials/Scenario_Projector Global.mat new file mode 100644 index 0000000..e042829 --- /dev/null +++ b/package/Assets/Built-in/Materials/Scenario_Projector Global.mat @@ -0,0 +1,55 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Scenario_Projector Global + m_Shader: {fileID: 4800000, guid: f658d0c4a8aac0543814f6a7b7704767, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - UV2 + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _Decal: + m_Texture: {fileID: 2800000, guid: 8da06c97000bd3f4fb2de7f0fbec4993, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FalloffTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowTex: + m_Texture: {fileID: 2800000, guid: 1c5a069a0ea942f4a880abbccd241434, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _Angle: -1.38 + - _Float: 6 + - _Offset: 0 + - _OffsetFlat: 1.11 + - _OffsetXFlat: 1 + - _OffsetYFlat: 1 + - _ScaleFlat: 2 + - _Slider: 1 + - _UV2: 1 + - _UVSelector: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Offset: {r: 0, g: 0, b: 0, a: 0} + - _Vector: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/package/Assets/Built-in/Materials/Scenario_Projector Global.mat.meta b/package/Assets/Built-in/Materials/Scenario_Projector Global.mat.meta new file mode 100644 index 0000000..4d871f1 --- /dev/null +++ b/package/Assets/Built-in/Materials/Scenario_Projector Global.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f506eb21541f4b843849b5606b2b20a2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Shaders.meta b/package/Assets/Built-in/Shaders.meta new file mode 100644 index 0000000..39d3499 --- /dev/null +++ b/package/Assets/Built-in/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 694d701585a4a444ea2a0890536c2828 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Shaders/Scenario 2UV.shader b/package/Assets/Built-in/Shaders/Scenario 2UV.shader new file mode 100644 index 0000000..d6cb659 --- /dev/null +++ b/package/Assets/Built-in/Shaders/Scenario 2UV.shader @@ -0,0 +1,59 @@ +Shader "Scenario/Unlit/Scenario 2UV" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + Tags { "RenderType"="Opaque" } + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + float2 uv2 : TEXCOORD2; + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float2 uv2 : TEXCOORD1; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + v2f vert (appdata v) + { + v2f o; + o.uv2 = v.uv2; + + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + float4 finalColor; + // Sample UV2 coordinate to determine face + float2 uv2Coord = i.uv2; + + // sample the texture + finalColor = tex2D(_MainTex, i.uv2); + return finalColor; +} + ENDCG + } + } +} diff --git a/package/Assets/Built-in/Shaders/Scenario 2UV.shader.meta b/package/Assets/Built-in/Shaders/Scenario 2UV.shader.meta new file mode 100644 index 0000000..e4903ae --- /dev/null +++ b/package/Assets/Built-in/Shaders/Scenario 2UV.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 3954c1a3217752d4fac2573ca0a6c936 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Shaders/Scenario Projected Debug.shader b/package/Assets/Built-in/Shaders/Scenario Projected Debug.shader new file mode 100644 index 0000000..30ea094 --- /dev/null +++ b/package/Assets/Built-in/Shaders/Scenario Projected Debug.shader @@ -0,0 +1,126 @@ +Shader "Scenario/Projected Debug" +{ + Properties + { + _MainTexFront ("Front Texture", 2D) = "white" {} + _MainTexBack ("Back Texture", 2D) = "white" {} + _MainTexLeft ("Left Texture", 2D) = "white" {} + _MainTexRight ("Right Texture", 2D) = "white" {} + _MainTexTop ("Top Texture", 2D) = "white" {} + _MainTexBottom ("Bottom Texture", 2D) = "white" {} + _MainTexOther ("Other Texture", 2D) = "white" {} + } + + SubShader + { + Tags { "RenderType"="Opaque" } + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + + struct MeshData + { + float4 vertex : POSITION; + float3 normal : NORMAL; + float2 uv: TEXCOORD0; + float2 uv2 : TEXCOORD2; + }; + + struct v2f + { + float2 uv2 : TEXCOORD11; + float2 uv_MainTexFront : TEXCOORD0; + float2 uv_MainTexBack : TEXCOORD1; + float2 uv_MainTexLeft : TEXCOORD2; + float2 uv_MainTexRight : TEXCOORD3; + float2 uv_MainTexTop : TEXCOORD4; + float2 uv_MainTexBottom : TEXCOORD5; + float2 uv_MainTexOther : TEXCOORD6; + float4 vertex : SV_POSITION; + float3 normal : NORMAL; + }; + + sampler2D _MainTexFront; + float4 _MainTexFront_ST; + + sampler2D _MainTexBack; + float4 _MainTexBack_ST; + + sampler2D _MainTexLeft; + float4 _MainTexLeft_ST; + + sampler2D _MainTexRight; + float4 _MainTexRight_ST; + + sampler2D _MainTexTop; + float4 _MainTexTop_ST; + + sampler2D _MainTexBottom; + float4 _MainTexBottom_ST; + + sampler2D _MainTexOther; + float4 _MainTexOther_ST; + + v2f vert(MeshData v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.normal = v.normal; + o.uv2 = v.uv2; + + o.uv_MainTexFront = TRANSFORM_TEX(v.uv, _MainTexFront); + o.uv_MainTexBack = TRANSFORM_TEX(v.uv, _MainTexBack); + o.uv_MainTexLeft = TRANSFORM_TEX(v.uv, _MainTexLeft); + o.uv_MainTexRight = TRANSFORM_TEX(v.uv, _MainTexRight); + o.uv_MainTexTop = TRANSFORM_TEX(v.uv, _MainTexTop); + o.uv_MainTexBottom = TRANSFORM_TEX(v.uv, _MainTexBottom); + o.uv_MainTexOther = TRANSFORM_TEX(v.uv, _MainTexOther); + return o; + } + + fixed4 frag(v2f i) : SV_Target + { + fixed4 finalColor; + + // Sample UV2 coordinate to determine face + float2 uv2Coord = i.uv2; + + fixed4 front = tex2D(_MainTexFront, i.uv_MainTexFront); + fixed4 back = tex2D(_MainTexBack, i.uv_MainTexBack); + fixed4 left = tex2D(_MainTexLeft, i.uv_MainTexLeft); + fixed4 right = tex2D(_MainTexRight, i.uv_MainTexRight); + fixed4 top = tex2D(_MainTexTop, i.uv_MainTexTop); + fixed4 bottom = tex2D(_MainTexBottom, i.uv_MainTexBottom); + fixed4 other = tex2D(_MainTexOther, i.uv_MainTexOther); + + // Determine which face the fragment belongs to based on UV2 coordinate + if (uv2Coord.x < 0.333 && uv2Coord.y < 0.333) + finalColor = top; + else if (uv2Coord.x < 0.666 && uv2Coord.y < 0.333) + finalColor = front; + else if (uv2Coord.x < 1.0 && uv2Coord.y < 0.333) + finalColor = left; + else if (uv2Coord.x < 0.333 && uv2Coord.y < 0.666) + finalColor = bottom; + else if (uv2Coord.x < 0.666 && uv2Coord.y < 0.666) + finalColor = back; + else if (uv2Coord.x < 1.0 && uv2Coord.y < 0.666) + finalColor = right; + /*else if (uv2Coord.x < 0.333 && uv2Coord.y < 1.0) + finalColor = float4(1, 0, 1, 0); + else if (uv2Coord.x < 0.666 && uv2Coord.y < 1.0) + finalColor = float4(1, 1, 1, 0);*/ + else + finalColor = other; + + return finalColor; +} + ENDCG + } + } + FallBack "Diffuse" +} diff --git a/package/Assets/Built-in/Shaders/Scenario Projected Debug.shader.meta b/package/Assets/Built-in/Shaders/Scenario Projected Debug.shader.meta new file mode 100644 index 0000000..b1d6242 --- /dev/null +++ b/package/Assets/Built-in/Shaders/Scenario Projected Debug.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 02d8e37077af1a544b03a68d556f2827 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Shaders/Scenario Projected.shader b/package/Assets/Built-in/Shaders/Scenario Projected.shader new file mode 100644 index 0000000..599452c --- /dev/null +++ b/package/Assets/Built-in/Shaders/Scenario Projected.shader @@ -0,0 +1,126 @@ +Shader"Scenario/Projected" +{ + Properties + { + _MainTexFront ("Front Texture", 2D) = "white" {} + _MainTexBack ("Back Texture", 2D) = "white" {} + _MainTexLeft ("Left Texture", 2D) = "white" {} + _MainTexRight ("Right Texture", 2D) = "white" {} + _MainTexTop ("Top Texture", 2D) = "white" {} + _MainTexBottom ("Bottom Texture", 2D) = "white" {} + _MainTexOther ("Other Texture", 2D) = "white" {} + } + + SubShader + { + Tags { "RenderType"="Opaque" } + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag +#include "UnityCG.cginc" + +struct MeshData +{ + float4 vertex : POSITION; + float3 normal : NORMAL; + float2 uv : TEXCOORD0; + float2 uv2 : TEXCOORD2; +}; + +struct v2f +{ + float2 uv2 : TEXCOORD11; + float2 uv_MainTexFront : TEXCOORD0; + float2 uv_MainTexBack : TEXCOORD1; + float2 uv_MainTexLeft : TEXCOORD2; + float2 uv_MainTexRight : TEXCOORD3; + float2 uv_MainTexTop : TEXCOORD4; + float2 uv_MainTexBottom : TEXCOORD5; + float2 uv_MainTexOther : TEXCOORD6; + float4 vertex : SV_POSITION; + float3 normal : NORMAL; +}; + +sampler2D _MainTexFront; +float4 _MainTexFront_ST; + +sampler2D _MainTexBack; +float4 _MainTexBack_ST; + +sampler2D _MainTexLeft; +float4 _MainTexLeft_ST; + +sampler2D _MainTexRight; +float4 _MainTexRight_ST; + +sampler2D _MainTexTop; +float4 _MainTexTop_ST; + +sampler2D _MainTexBottom; +float4 _MainTexBottom_ST; + +sampler2D _MainTexOther; +float4 _MainTexOther_ST; + +v2f vert(MeshData v) +{ + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.normal = v.normal; + o.uv2 = v.uv2; + + o.uv_MainTexFront = TRANSFORM_TEX(v.uv, _MainTexFront); + o.uv_MainTexBack = TRANSFORM_TEX(v.uv, _MainTexBack); + o.uv_MainTexLeft = TRANSFORM_TEX(v.uv, _MainTexLeft); + o.uv_MainTexRight = TRANSFORM_TEX(v.uv, _MainTexRight); + o.uv_MainTexTop = TRANSFORM_TEX(v.uv, _MainTexTop); + o.uv_MainTexBottom = TRANSFORM_TEX(v.uv, _MainTexBottom); + o.uv_MainTexOther = TRANSFORM_TEX(v.uv, _MainTexOther); + return o; +} + +fixed4 frag(v2f i) : SV_Target +{ + fixed4 finalColor; + + // Sample UV2 coordinate to determine face + float2 uv2Coord = i.uv2; + + fixed4 front = tex2D(_MainTexFront, i.uv_MainTexFront); + fixed4 back = tex2D(_MainTexBack, i.uv_MainTexBack); + fixed4 left = tex2D(_MainTexLeft, i.uv_MainTexLeft); + fixed4 right = tex2D(_MainTexRight, i.uv_MainTexRight); + fixed4 top = tex2D(_MainTexTop, i.uv_MainTexTop); + fixed4 bottom = tex2D(_MainTexBottom, i.uv_MainTexBottom); + fixed4 other = tex2D(_MainTexOther, i.uv_MainTexOther); + + // Determine which face the fragment belongs to based on UV2 coordinate + if (uv2Coord.x < 0.333 && uv2Coord.y < 0.333) + finalColor = top; + else if (uv2Coord.x < 0.666 && uv2Coord.y < 0.333) + finalColor = front; + else if (uv2Coord.x < 1.0 && uv2Coord.y < 0.333) + finalColor = left; + else if (uv2Coord.x < 0.333 && uv2Coord.y < 0.666) + finalColor = bottom; + else if (uv2Coord.x < 0.666 && uv2Coord.y < 0.666) + finalColor = back; + else if (uv2Coord.x < 1.0 && uv2Coord.y < 0.666) + finalColor = right; + /*else if (uv2Coord.x < 0.333 && uv2Coord.y < 1.0) + finalColor = float4(1, 0, 1, 0); + else if (uv2Coord.x < 0.666 && uv2Coord.y < 1.0) + finalColor = float4(1, 1, 1, 0);*/ + else + finalColor = other; + + return finalColor; +} + ENDCG + } + } +FallBack"Diffuse" +} diff --git a/package/Assets/Built-in/Shaders/Scenario Projected.shader.meta b/package/Assets/Built-in/Shaders/Scenario Projected.shader.meta new file mode 100644 index 0000000..5c3ad5e --- /dev/null +++ b/package/Assets/Built-in/Shaders/Scenario Projected.shader.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 90d4dfaf1cae1734e83a31b2bf85dcba +ShaderImporter: + externalObjects: {} + defaultTextures: + - _MainTexFront: {instanceID: 0} + - _MainTexBack: {instanceID: 0} + - _MainTexLeft: {instanceID: 0} + - _MainTexRight: {instanceID: 0} + - _MainTexTop: {instanceID: 0} + - _MainTexBottom: {instanceID: 0} + - _MainTexOther: {instanceID: 0} + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Shaders/ScenarioProjector Debug.shader b/package/Assets/Built-in/Shaders/ScenarioProjector Debug.shader new file mode 100644 index 0000000..a6ab717 --- /dev/null +++ b/package/Assets/Built-in/Shaders/ScenarioProjector Debug.shader @@ -0,0 +1,106 @@ +// Upgrade NOTE: replaced '_Projector' with 'unity_Projector' +// Upgrade NOTE: replaced '_ProjectorClip' with 'unity_ProjectorClip' + +Shader"Scenario/Projector Debug" { + Properties { + _Color ("Main Color", Color) = (1,1,1,1) + _Decal ("Cookie", 2D) = "" {} + _Slider ("Slider", Range(0,1)) = 0 + _ScaleFlat ("Scale Flat", Range(0,10)) = 2 + _OffsetXFlat ("Offset X Flat", Range(-10,10)) = 0 + _OffsetYFlat ("Offset Y Flat", Range(-10,10)) = 0 + _Angle ("Angle", Float) = 0 + [Toggle(UV2)] _UV2 ("Use Second UV Map?", Float) = 0 + _UVSelector ("UV Selector", Range(1,5))= 1 + _Vector ("Vector", Vector) = (0,0,0,1) + _Offset ("Offset", Vector) = (0,0,0,1) + } + + Subshader { + Tags {"RenderType"="Opaque"} + Pass { + /*ZWrite Off + Cull Front + ColorMask RGBA + Blend SrcAlpha OneMinusSrcAlpha*/ + Offset -1, -1 + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma shader_feature UV2 + #include "UnityCG.cginc" + + struct MeshData{ + float4 vertex : POSITION; // Vertex position + float3 normal : NORMAL; // normal position + float4 tangent : TANGENT; + float4 color : COLOR; + float2 uv0 : TEXCOORD0; // uv0 for diffuse / normal map textures + float2 uv1 : TEXCOORD1; // uv1 coordinates lightmap + float2 uv2 : TEXCOORD2; + }; + + struct v2f { + float4 position : SV_POSITION; + float4 vertexUV : TEXCOORD0; + float4 uvShadow : TEXCOORD1; + float4 normalView: TEXCOORD2; + fixed4 worldPos : TEXCOORD10; + float4 normalRender : TEXCOORD3; + float4 uvShadow3: TEXCOORD4; + }; + + float4x4 unity_Projector; + float4x4 unity_ProjectorClip; + float _Slider; + float4 _Color; + + int _UVSelector; + float _ScaleFlat; + float _OffsetXFlat; + float _OffsetYFlat; + float _Angle; + + float4 _Vector; + float4 _Offset; + + float4 _UvShadow; + + sampler2D _Decal; + + v2f vert (MeshData v) + { + v2f o; + o.position = UnityObjectToClipPos(v.vertex); + float x = v.vertex.x; + float y = v.vertex.y; + + #if UV2 + x = v.uv2.x; + y = v.uv2.y; + #endif + x= x * _ScaleFlat - _OffsetXFlat; + y= y * -_ScaleFlat + _OffsetYFlat; + + o.vertexUV = float4(x, y, 0.1, 1); + o.normalView = UnityObjectToClipPos(v.vertex); + o.position = lerp(o.vertexUV, o.normalView, _Slider); + o.normalRender = (v.normal,0); + o.worldPos = mul(unity_ObjectToWorld, v.vertex); + o.uvShadow = mul(unity_Projector, (v.vertex + _Offset) * _Vector ); + + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + return i.vertexUV; + //fixed4 texS = tex2Dproj(_Decal, i.uvShadow) * _Color; + //return texS; + + } + ENDCG + } + } +} \ No newline at end of file diff --git a/package/Assets/Built-in/Shaders/ScenarioProjector Debug.shader.meta b/package/Assets/Built-in/Shaders/ScenarioProjector Debug.shader.meta new file mode 100644 index 0000000..076d8a4 --- /dev/null +++ b/package/Assets/Built-in/Shaders/ScenarioProjector Debug.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e9ea0af013b0f384e92f78cad8327483 +ShaderImporter: + externalObjects: {} + defaultTextures: + - _Decal: {instanceID: 0} + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Built-in/Shaders/ScenarioProjector.shader b/package/Assets/Built-in/Shaders/ScenarioProjector.shader new file mode 100644 index 0000000..8e997d2 --- /dev/null +++ b/package/Assets/Built-in/Shaders/ScenarioProjector.shader @@ -0,0 +1,130 @@ +// Upgrade NOTE: replaced '_Projector' with 'unity_Projector' +// Upgrade NOTE: replaced '_ProjectorClip' with 'unity_ProjectorClip' + +Shader"Scenario/Projector" { + Properties { + _Color ("Main Color", Color) = (1,1,1,1) + _Decal ("Cookie", 2D) = "" {} + _Slider ("Slider", Range(0,1)) = 0 + _ScaleFlat ("Scale Flat", Range(0,10)) = 2 + _OffsetXFlat ("Offset X Flat", Range(-10,10)) = 0 + _OffsetYFlat ("Offset Y Flat", Range(-10,10)) = 0 + _Angle ("Angle", Float) = 0 + [Toggle(UV2)] _UV2 ("Use Second UV Map?", Float) = 0 + _UVSelector ("UV Selector", Range(1,5))= 1 + _Vector ("Vector", Vector) = (0,0,0,1) + _Offset ("Offset", Vector) = (0,0,0,1) + } + + Subshader { + Tags {"RenderType"="Opaque"} + Pass { + /*ZWrite Off + Cull Front + ColorMask RGBA + Blend SrcAlpha OneMinusSrcAlpha*/ + Offset -1, -1 + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma shader_feature UV2 + #include "UnityCG.cginc" + + struct MeshData{ + float4 vertex : POSITION; // Vertex position + float3 normal : NORMAL; // normal position + float4 tangent : TANGENT; + float4 color : COLOR; + float2 uv0 : TEXCOORD0; // uv0 for diffuse / normal map textures + float2 uv1 : TEXCOORD1; // uv1 coordinates lightmap + float2 uv2 : TEXCOORD2; + }; + + struct v2f { + float4 position : SV_POSITION; + float4 vertexUV : TEXCOORD0; + float4 uvShadow : TEXCOORD1; + float4 normalView: TEXCOORD2; + fixed4 worldPos : TEXCOORD10; + float4 uvShadow2: TEXCOORD3; + float4 uvShadow3: TEXCOORD4; + }; + + float4x4 unity_Projector; + float4x4 unity_ProjectorClip; + float _Slider; + float4 _Color; + + int _UVSelector; + float _ScaleFlat; + float _OffsetXFlat; + float _OffsetYFlat; + float _Angle; + + float4 _Vector; + float4 _Offset; + + float4 _UvShadow; + + sampler2D _Decal; + + v2f vert (MeshData v) + { + v2f o; + o.position = UnityObjectToClipPos(v.vertex); + float x = v.vertex.x; + float y = v.vertex.y; + + #if UV2 + x = v.uv2.x; + y = v.uv2.y; + #endif + x= x * _ScaleFlat - _OffsetXFlat; + y= y * -_ScaleFlat + _OffsetYFlat; + + o.vertexUV = float4(x, y, 0.1, 1); + o.normalView = UnityObjectToClipPos(v.vertex); + o.position = lerp(o.vertexUV, o.normalView, _Slider); + o.worldPos = mul(unity_ObjectToWorld, v.vertex); + + if(_UVSelector == 1) + { + o.uvShadow = mul(unity_Projector, (v.vertex + _Offset) * _Vector ); + } + else if(_UVSelector == 2) + { + o.uvShadow2 = mul(unity_Projector, (v.vertex + _Offset) * _Vector); + } + else + { + o.uvShadow3 = mul(unity_Projector, (v.vertex + _Offset) * _Vector); + } + + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + //return i.uvShadow; + if(_UVSelector == 1) + { + fixed4 texS = tex2Dproj (_Decal, i.uvShadow) * _Color ; + return texS; + } + else if(_UVSelector == 2) + { + fixed4 texS = tex2Dproj (_Decal, i.uvShadow2 + _Angle); + return texS; + } + else + { + fixed4 texS = tex2Dproj (_Decal, i.uvShadow3); + return texS; + } + + } + ENDCG + } + } +} \ No newline at end of file diff --git a/package/Assets/Built-in/Shaders/ScenarioProjector.shader.meta b/package/Assets/Built-in/Shaders/ScenarioProjector.shader.meta new file mode 100644 index 0000000..e0514dd --- /dev/null +++ b/package/Assets/Built-in/Shaders/ScenarioProjector.shader.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f658d0c4a8aac0543814f6a7b7704767 +ShaderImporter: + externalObjects: {} + defaultTextures: + - _Decal: {instanceID: 0} + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Recorder.meta b/package/Assets/Recorder.meta new file mode 100644 index 0000000..b3b2b54 --- /dev/null +++ b/package/Assets/Recorder.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3055b5fc4bfdd8d49a9b4edf3e94c7cb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package/Assets/Recorder/RecorderSettingPreset.asset b/package/Assets/Recorder/RecorderSettingPreset.asset new file mode 100644 index 0000000..0c4febd --- /dev/null +++ b/package/Assets/Recorder/RecorderSettingPreset.asset @@ -0,0 +1,459 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5537212fe2c4414c9a0cdd7ba0728908, type: 3} + m_Name: RecorderSettingPreset + m_EditorClassIdentifier: + m_Model: {fileID: 2066056468080413454} + m_RecorderPresets: + - {fileID: 2391650939217954612} +--- !u!181963792 &2066056468080413454 +Preset: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Global Settings + m_TargetType: + m_NativeTypeID: 114 + m_ManagedTypePPtr: {fileID: 11500000, guid: a0888db1d9f84d6da3b0d5de41f42c2d, type: 3} + m_ManagedTypeFallback: + m_Properties: + - target: {fileID: 0} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_EditorHideFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_EditorClassIdentifier + value: + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_RecordMode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_FrameRatePlayback + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_FrameRateType + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_CustomFrameRateValue + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_StartFrame + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_EndFrame + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_StartTime + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_EndTime + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_CapFrameRate + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_ExitPlayMode + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_RecorderSettings.Array.size + value: 0 + objectReference: {fileID: 0} + m_ExcludedProperties: [] +--- !u!181963792 &2391650939217954612 +Preset: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Scenario Sequence + m_TargetType: + m_NativeTypeID: 114 + m_ManagedTypePPtr: {fileID: 11500000, guid: 06397f605c749fe4dbe2df4bbd1ef4a1, type: 3} + m_ManagedTypeFallback: + m_Properties: + - target: {fileID: 0} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_EditorHideFlags + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_EditorClassIdentifier + value: + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: take + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: captureEveryNthFrame + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: fileNameGenerator.m_Path.m_Root + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: fileNameGenerator.m_Path.m_Leaf + value: Recordings + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: fileNameGenerator.m_Path.m_ForceAssetFolder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: fileNameGenerator.m_Path.m_AbsolutePath + value: + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: fileNameGenerator.m_FileName + value: __