From 9034d9e2a27040163c7f0bc5b2899bbcf8d3b4d3 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sun, 23 Jul 2023 00:29:51 +0200 Subject: [PATCH 1/3] sunset box: lock rotation of sun --- Assets/sunset_box/sunset_env_dynamic.shader | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Assets/sunset_box/sunset_env_dynamic.shader b/Assets/sunset_box/sunset_env_dynamic.shader index 4befe74..ca0d9f5 100644 --- a/Assets/sunset_box/sunset_env_dynamic.shader +++ b/Assets/sunset_box/sunset_env_dynamic.shader @@ -7,6 +7,7 @@ _HorizonTint ("Horizon tint", Range(0, 1)) = 0.1 [Header(Sun)] _SunCol ("Sun color", Color) = (1.0, 0.65, 0.05, 1.0) + _SunAngle ("Sun angle", Range(0, 6.28)) = 0 _SunRadius ("Sun radius", Range(0, 0.3)) = 0.06 _SunCutoff ("Sun cutoff", Range(0, 0.5)) = 0.08 [Header(Star Layout)] @@ -228,10 +229,7 @@ { // float3 horizon_col = lerp(_SkyCol, _SunCol, _HorizonTint); float3 origin = mul(unity_ObjectToWorld, float4(0, 0, 0, 1)); - float3 sun_dir = (mul(unity_ObjectToWorld, float4(0, 0, -1, 1)) - origin) * float3(1, 0, 1); - // sun_dir.y = sin(_Time.x * 10) * 0.05; - sun_dir.y = 0.01; - sun_dir = normalize(sun_dir); + float3 sun_dir = float3(sin(_SunAngle), 0.0, cos(_SunAngle)); float3 dir = normalize(i.hit_pos - i.cam_pos); From 4695be0423fa2ac4773ef72216c3ddcfcb6d5d0b Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sun, 23 Jul 2023 12:41:47 +0200 Subject: [PATCH 2/3] fix raymarching depth; add old rm shaders --- Assets/pen/Pen.unity | 2 +- Assets/raymarched/Interactive.meta | 8 + .../raymarched/Interactive/Raymarch_multi.mat | 81 ++ .../Interactive/Raymarch_multi.mat.meta | 8 + .../{ => Interactive}/Raymarch_origin.mat | 0 .../Raymarch_origin.mat.meta | 0 .../{ => Interactive}/Raymarch_secondary.mat | 2 +- .../Raymarch_secondary.mat.meta | 0 .../{ => Interactive}/raymarch_origin.shader | 0 .../raymarch_origin.shader.meta | 0 .../raymarch_secondary.shader | 0 .../raymarch_secondary.shader.meta | 0 .../{ => Interactive}/raymarcher.cginc | 8 +- .../{ => Interactive}/raymarcher.cginc.meta | 0 .../raymarched/Interactive/rm_combined.shader | 192 +++ .../Interactive/rm_combined.shader.meta | 9 + Assets/raymarched/Raymarching.unity | 363 +++++- Assets/test/Demo3.shader | 92 ++ Assets/test/Demo3.shader.meta | 9 + Assets/test/Demo4.shader | 79 ++ Assets/test/Demo4.shader.meta | 9 + Assets/test/RayMarchLib.cginc | 1044 +++++++++++++++++ Assets/test/RayMarchLib.cginc.meta | 9 + .../test/{TestProp.unity => TestProps.unity} | 148 +++ ...stProp.unity.meta => TestProps.unity.meta} | 0 Assets/test/large_box.fbx | Bin 0 -> 14812 bytes Assets/test/large_box.fbx.meta | 97 ++ Assets/test/spinny.mat | 81 ++ Assets/test/spinny.mat.meta | 8 + 29 files changed, 2242 insertions(+), 7 deletions(-) create mode 100644 Assets/raymarched/Interactive.meta create mode 100644 Assets/raymarched/Interactive/Raymarch_multi.mat create mode 100644 Assets/raymarched/Interactive/Raymarch_multi.mat.meta rename Assets/raymarched/{ => Interactive}/Raymarch_origin.mat (100%) rename Assets/raymarched/{ => Interactive}/Raymarch_origin.mat.meta (100%) rename Assets/raymarched/{ => Interactive}/Raymarch_secondary.mat (98%) rename Assets/raymarched/{ => Interactive}/Raymarch_secondary.mat.meta (100%) rename Assets/raymarched/{ => Interactive}/raymarch_origin.shader (100%) rename Assets/raymarched/{ => Interactive}/raymarch_origin.shader.meta (100%) rename Assets/raymarched/{ => Interactive}/raymarch_secondary.shader (100%) rename Assets/raymarched/{ => Interactive}/raymarch_secondary.shader.meta (100%) rename Assets/raymarched/{ => Interactive}/raymarcher.cginc (94%) rename Assets/raymarched/{ => Interactive}/raymarcher.cginc.meta (100%) create mode 100644 Assets/raymarched/Interactive/rm_combined.shader create mode 100644 Assets/raymarched/Interactive/rm_combined.shader.meta create mode 100644 Assets/test/Demo3.shader create mode 100644 Assets/test/Demo3.shader.meta create mode 100644 Assets/test/Demo4.shader create mode 100644 Assets/test/Demo4.shader.meta create mode 100644 Assets/test/RayMarchLib.cginc create mode 100644 Assets/test/RayMarchLib.cginc.meta rename Assets/test/{TestProp.unity => TestProps.unity} (87%) rename Assets/test/{TestProp.unity.meta => TestProps.unity.meta} (100%) create mode 100644 Assets/test/large_box.fbx create mode 100644 Assets/test/large_box.fbx.meta create mode 100644 Assets/test/spinny.mat create mode 100644 Assets/test/spinny.mat.meta diff --git a/Assets/pen/Pen.unity b/Assets/pen/Pen.unity index 8b29eef..26e65cd 100644 --- a/Assets/pen/Pen.unity +++ b/Assets/pen/Pen.unity @@ -246,7 +246,7 @@ TrailRenderer: textureMode: 0 shadowBias: 0.5 generateLightingData: 0 - m_MinVertexDistance: 0.001 + m_MinVertexDistance: 0.003 m_Autodestruct: 0 m_Emitting: 0 --- !u!1 &217324300 diff --git a/Assets/raymarched/Interactive.meta b/Assets/raymarched/Interactive.meta new file mode 100644 index 0000000..8d86b8e --- /dev/null +++ b/Assets/raymarched/Interactive.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6417ef9aa4572bf43b276704a8d3b794 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/Raymarch_multi.mat b/Assets/raymarched/Interactive/Raymarch_multi.mat new file mode 100644 index 0000000..7491234 --- /dev/null +++ b/Assets/raymarched/Interactive/Raymarch_multi.mat @@ -0,0 +1,81 @@ +%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: Raymarch_multi + m_Shader: {fileID: 4800000, guid: d9b470f9858f75d04aa12fe1b15b6ccb, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _MaxDist: 100 + - _MaxSteps: 256 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SurfDist: 0.001 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _ObjectA: {r: -0.07, g: 0, b: 0, a: 1} diff --git a/Assets/raymarched/Interactive/Raymarch_multi.mat.meta b/Assets/raymarched/Interactive/Raymarch_multi.mat.meta new file mode 100644 index 0000000..9025667 --- /dev/null +++ b/Assets/raymarched/Interactive/Raymarch_multi.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 035a99d20f5635cd7a7cbba57b7068bc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Raymarch_origin.mat b/Assets/raymarched/Interactive/Raymarch_origin.mat similarity index 100% rename from Assets/raymarched/Raymarch_origin.mat rename to Assets/raymarched/Interactive/Raymarch_origin.mat diff --git a/Assets/raymarched/Raymarch_origin.mat.meta b/Assets/raymarched/Interactive/Raymarch_origin.mat.meta similarity index 100% rename from Assets/raymarched/Raymarch_origin.mat.meta rename to Assets/raymarched/Interactive/Raymarch_origin.mat.meta diff --git a/Assets/raymarched/Raymarch_secondary.mat b/Assets/raymarched/Interactive/Raymarch_secondary.mat similarity index 98% rename from Assets/raymarched/Raymarch_secondary.mat rename to Assets/raymarched/Interactive/Raymarch_secondary.mat index 1f52bc5..8dbb8ae 100644 --- a/Assets/raymarched/Raymarch_secondary.mat +++ b/Assets/raymarched/Interactive/Raymarch_secondary.mat @@ -13,7 +13,7 @@ Material: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 + m_CustomRenderQueue: 3000 stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: diff --git a/Assets/raymarched/Raymarch_secondary.mat.meta b/Assets/raymarched/Interactive/Raymarch_secondary.mat.meta similarity index 100% rename from Assets/raymarched/Raymarch_secondary.mat.meta rename to Assets/raymarched/Interactive/Raymarch_secondary.mat.meta diff --git a/Assets/raymarched/raymarch_origin.shader b/Assets/raymarched/Interactive/raymarch_origin.shader similarity index 100% rename from Assets/raymarched/raymarch_origin.shader rename to Assets/raymarched/Interactive/raymarch_origin.shader diff --git a/Assets/raymarched/raymarch_origin.shader.meta b/Assets/raymarched/Interactive/raymarch_origin.shader.meta similarity index 100% rename from Assets/raymarched/raymarch_origin.shader.meta rename to Assets/raymarched/Interactive/raymarch_origin.shader.meta diff --git a/Assets/raymarched/raymarch_secondary.shader b/Assets/raymarched/Interactive/raymarch_secondary.shader similarity index 100% rename from Assets/raymarched/raymarch_secondary.shader rename to Assets/raymarched/Interactive/raymarch_secondary.shader diff --git a/Assets/raymarched/raymarch_secondary.shader.meta b/Assets/raymarched/Interactive/raymarch_secondary.shader.meta similarity index 100% rename from Assets/raymarched/raymarch_secondary.shader.meta rename to Assets/raymarched/Interactive/raymarch_secondary.shader.meta diff --git a/Assets/raymarched/raymarcher.cginc b/Assets/raymarched/Interactive/raymarcher.cginc similarity index 94% rename from Assets/raymarched/raymarcher.cginc rename to Assets/raymarched/Interactive/raymarcher.cginc index 08201b6..dc6776f 100644 --- a/Assets/raymarched/raymarcher.cginc +++ b/Assets/raymarched/Interactive/raymarcher.cginc @@ -171,14 +171,18 @@ fragOut frag (v2f i) { // col.rgb = max(dot(n, normalize(float3(1,0.5,1))), 0.05f); - col.rgb = lerp(0, float3(0,1,1), pow(1 - dot(-rd, n), 2)); + col.rgb = lerp(0, float3(0,1,1), pow(1 - dot(-rd, n), 3)); // col *= float4(d, 1, 1, 1); fragOut o; o.col = col; // o.col = _LightColor0; float4 vClipPos = mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, float4(p, 1))); - o.depth = (vClipPos.z / vClipPos.w + 1.0) * 0.5; + float zDepth = vClipPos.z / vClipPos.w; + #if !defined(UNITY_REVERSED_Z) // basically only OpenGL (unity editor on linux) + zDepth = zDepth * 0.5 + 0.5; // remap -1 to 1 range to 0.0 to 1.0 + #endif + o.depth = zDepth; return o; } diff --git a/Assets/raymarched/raymarcher.cginc.meta b/Assets/raymarched/Interactive/raymarcher.cginc.meta similarity index 100% rename from Assets/raymarched/raymarcher.cginc.meta rename to Assets/raymarched/Interactive/raymarcher.cginc.meta diff --git a/Assets/raymarched/Interactive/rm_combined.shader b/Assets/raymarched/Interactive/rm_combined.shader new file mode 100644 index 0000000..a9a39cf --- /dev/null +++ b/Assets/raymarched/Interactive/rm_combined.shader @@ -0,0 +1,192 @@ +Shader "CrispyPin/RaymarchMultiObject" +{ + Properties + { + [Header(Object positions)] + _ObjectA ("Object A", Vector) = (0, 0, 0) + [Header(Raymarcher Properties)] + _MaxSteps ("Max steps", Int) = 256 + _MaxDist ("Max distance", Float) = 100 + _SurfDist ("Surface distance threshold", Range(0.00001, 0.05)) = 0.001 + } + SubShader + { + Tags { "RenderType"="Opaque" } + Cull Off + LOD 100 + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + + #include "UnityCG.cginc" + #include "UnityLightingCommon.cginc" + + struct appdata + { + float4 vertex : POSITION; + }; + + struct v2f + { + float4 vertex : SV_POSITION; + float3 ro : TEXCOORD1; + float3 hitPos : TEXCOORD2; + }; + + struct fragOut + { + fixed4 col : SV_Target; + float depth : SV_Depth; + }; + + int _MaxSteps; + float _MaxDist; + float _SurfDist; + float3 _ObjectA; + + v2f vert (appdata v) { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + //object space + o.ro = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos, 1)); + o.hitPos = v.vertex; + //world space + //o.ro = _WorldSpaceCameraPos; + //o.hitPos = mul(unity_ObjectToWorld, v.vertex); + return o; + } + + float smin(float a, float b, float k) { + return min(a, b) - pow(max(k - abs(a-b), 0), 3)/(6*k*k); + } + + float sdSphere(float3 p, float3 o, float r) { + return length(p - o) - r; + } + + float sdBox(float3 p, float3 dim) { + return length(float3( + max(abs(p.x) - dim.x/2.0, 0), + max(abs(p.y) - dim.y/2.0, 0), + max(abs(p.z) - dim.z/2.0, 0))); + } + + float sdLine(float3 p, float3 a, float3 b, float r) { + float3 pa = p - a; + float3 ba = b - a; + float h = clamp(dot(pa, ba) / dot(ba, ba), 0, 1); + return length(pa - ba * h) - r; + } + + float sdCappedTorus( float3 p, float2 sc, float ra, float rb) { + p.x = abs(p.x); + float k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy,sc) : length(p.xy); + return sqrt( dot(p,p) + ra*ra - 2.0*ra*k ) - rb; + } + + float3 RotateY(float3 p, float a) { + return mul(float3x3(cos(a), 0, sin(a), 0, 1, 0, -sin(a), 0, cos(a)), p); + } + + float Kijetesantakalu(float3 p, float r) { + float d = sdSphere(p, float3(0, 0, 0.2f), r);// left eye + d = min(d, sdSphere(p, float3(0.15f, 0, 0.2f), r)); // right eye + d = min(d, sdLine(p, float3(0, 0, -0.4f), float3(-0.35f, 0, -0.4f), r)); // bottom line + d = smin(d, sdLine(p, float3(0, 0, -0.4f), float3(-0.1f, 0, -0.15f), r), 0.003f); // leg hook + d = min(d, sdLine(p, float3(0.15f, 0, -0.4f), float3(0.15f, 0, -0.1f), r)); // middle leg + d = min(d, sdLine(p, float3(0.3f, 0, -0.4f), float3(0.3f, 0, 0), r)); // front leg + d = smin(d, sdLine(p, float3(0.45f, 0, 0.1f), float3(0.3f, 0, 0), r), 0.003f); // lower snout + d = smin(d, sdLine(p, float3(0.45f, 0, 0.1f), float3(0.2f, 0, 0.35f), r), 0.003f); // upper snout + d = smin(d, sdLine(p, float3(0.2f, 0, 0.45f), float3(0.2f, 0, 0.35f), r), 0.003f); // ear + float an = 0.9; + d = smin(d, sdCappedTorus((RotateY(p, 0.8f) - float3(0.15f, 0, -0.05f)).xzy, float2(sin(an),cos(an)), 0.4, r), 0.003f); // ear + d = smin(d, sdLine(p, float3(-0.25f, 0, 0), float3(-0.25f, 0, -0.4f), r), 0.003f); // back + d = smin(d, sdLine(p, float3(-0.25f, 0, -0.1f), float3(-0.35f, 0, -0.1f), r), 0.003f); // tail top + d = smin(d, sdLine(p, float3(-0.35f, 0, -0.1f), float3(-0.35f, 0, -0.4f), r), 0.003f); // stripe + an = 3.1415f*0.5; + d = smin(d, sdCappedTorus((RotateY(p, an) - float3(-0.25f, 0, 0.35f)).xzy, float2(sin(an),cos(an)), 0.15f, r), 0.003f); // tail + + return d; + } + + float FirstShape(float3 p) { + return Kijetesantakalu(p, 0.05f); + } + + float SecondShape(float3 p) { + // return sdBox(p, 0.3f) - 0.01f; + // return Kijetesantakalu(p, 0.04f) - 0.01f; + return sdSphere(p, 0, 0.3f); + } + + + float GetDist(float3 p) { + + float first = FirstShape(p); + // float3 second_pos = mul(unity_WorldToObject, _WorldSpaceLightPos0); + float second = SecondShape(p - _ObjectA); + return smin(first, second, 0.15f); + + } + + //marches a ray through the scene + float Raymarch(float3 ro, float3 rd) { + float rayLen = 0;// total distance marched / distance from origin + float dist; // distance from the raymarched scene + for ( int i = 0; i < _MaxSteps; i++) + { + //position = origin + distance * direction + float3 p = ro + rayLen * rd; + dist = GetDist(p); + rayLen += dist;// move forward + if (dist < _SurfDist || rayLen > _MaxDist) { + break; + } + } + + return rayLen; + } + + float3 GetNormal(float3 p) { + float2 e = float2(0.001, 0); + float3 n = GetDist(p) - float3( + GetDist(p-e.xyy), + GetDist(p-e.yxy), + GetDist(p-e.yyx)); + return normalize(n); + } + + fragOut frag (v2f i) { + float3 ro = i.ro; + float3 rd = normalize(i.hitPos - ro); + + float d = Raymarch(ro, rd); + fixed4 col = 1; + + if (d >= _MaxDist) + { + discard; + } + float3 p = ro + rd * d; + float3 n = GetNormal(p); + + // col.rgb = max(dot(n, normalize(float3(1,0.5,1))), 0.05f); + + col.rgb = lerp(0, float3(0,1,1), pow(1 - dot(-rd, n), 2)); + + // col *= float4(d, 1, 1, 1); + fragOut o; + o.col = col; + // o.col = _LightColor0; + float4 vClipPos = mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, float4(p, 1))); + o.depth = (vClipPos.z / vClipPos.w + 1.0) * 0.5; + return o; + } + + ENDCG + } + } +} \ No newline at end of file diff --git a/Assets/raymarched/Interactive/rm_combined.shader.meta b/Assets/raymarched/Interactive/rm_combined.shader.meta new file mode 100644 index 0000000..ac9dea8 --- /dev/null +++ b/Assets/raymarched/Interactive/rm_combined.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d9b470f9858f75d04aa12fe1b15b6ccb +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Raymarching.unity b/Assets/raymarched/Raymarching.unity index 9e839ce..e3fe342 100644 --- a/Assets/raymarched/Raymarching.unity +++ b/Assets/raymarched/Raymarching.unity @@ -121,6 +121,133 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &453749071 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 453749072} + - component: {fileID: 453749075} + - component: {fileID: 453749074} + - component: {fileID: 453749073} + - component: {fileID: 453749077} + - component: {fileID: 453749076} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &453749072 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453749071} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.623, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 779234489} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!65 &453749073 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453749071} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &453749074 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453749071} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &453749075 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453749071} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &453749076 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453749071} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39d87b8783794dfd81ce396483019cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + type: RaymarcherObjectA +--- !u!114 &453749077 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453749071} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 12974925555b471580cacf5d2d5fa9e3, type: 3} + m_Name: + m_EditorClassIdentifier: + gripType: 1 + gripOrigin: {fileID: 0} + disallowTheft: 0 + maximumGrabDistance: 0 + snappingReferences: [] + autoHold: 0 + ikReference: {fileID: 0} --- !u!1 &695617482 GameObject: m_ObjectHideFlags: 0 @@ -213,6 +340,84 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &779234488 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 779234489} + - component: {fileID: 779234491} + - component: {fileID: 779234490} + m_Layer: 0 + m_Name: MultiObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &779234489 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779234488} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.044, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 453749072} + - {fileID: 884043982} + - {fileID: 2089960366} + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &779234490 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779234488} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 990f6f4efb7f4ec98ad99f6dff1bc6f6, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 3 + objectId: d51b36f3-30c8-4e23-9277-34168a3024b4 +--- !u!114 &779234491 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779234488} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a37fd8d654d5c2840a0ab3a5ad65a5ae, type: 3} + m_Name: + m_EditorClassIdentifier: + spawnHeight: 0 + useAdditionalValues: 1 + syncValues: + - name: + startValue: 0 + updatedBy: 0 + updateMethod: 1 + animator: {fileID: 0} + animatorParameterName: -none- + propPrivacy: 1 + subSyncs: + - transform: {fileID: 453749072} + syncedValues: 0 + precision: 4 + syncBoundary: 0.5 + spawnableType: 0 + preGeneratedInstanceId: --- !u!1 &845829380 GameObject: m_ObjectHideFlags: 0 @@ -305,6 +510,99 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 124.6, y: -30, z: 0} +--- !u!1 &884043981 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 884043982} + - component: {fileID: 884043985} + - component: {fileID: 884043984} + - component: {fileID: 884043983} + m_Layer: 0 + m_Name: Main + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &884043982 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884043981} + 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: 779234489} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &884043983 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884043981} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &884043984 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884043981} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 035a99d20f5635cd7a7cbba57b7068bc, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &884043985 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 884043981} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1450495540 GameObject: m_ObjectHideFlags: 0 @@ -449,7 +747,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1450495540} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.844, y: -0.907, z: 0.117} + m_LocalPosition: {x: 0.844, y: 0.389, z: 0.117} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -602,7 +900,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1485771011} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.452, y: 0.221, z: -0.124} + m_LocalPosition: {x: -0.452, y: 0.221, z: -0.984} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -833,9 +1131,68 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1651833084} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.265, y: -0.757, z: 0} + m_LocalPosition: {x: 0.525, y: 0.463, z: -0.326} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2089960365 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2089960366} + - component: {fileID: 2089960367} + m_Layer: 0 + m_Name: GameObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2089960366 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089960365} + 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: 779234489} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2089960367 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2089960365} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81194749cc874e87b95c7b486517c3a9, type: 3} + m_Name: + m_EditorClassIdentifier: + areaSize: {x: 10, y: 0.05, z: 0} + areaOffset: {x: 0, y: 0, z: 0} + settingIndex: -1 + settingValue: 0 + useAdvancedTrigger: 1 + allowedTypes: + - RaymarcherObjectA + allowParticleInteraction: 0 + enterTasks: [] + exitTasks: [] + stayTasks: + - settingIndex: -1 + minValue: 0 + maxValue: 1 + updateMethod: 1 + sampleDirection: 0 diff --git a/Assets/test/Demo3.shader b/Assets/test/Demo3.shader new file mode 100644 index 0000000..5c78b28 --- /dev/null +++ b/Assets/test/Demo3.shader @@ -0,0 +1,92 @@ +Shader "Demo/pulsating" +{ + Properties + { + [Header(Lighting)] + _SunPos ("Sun position", Vector) = (8, 4, 2) + + [Header(Raymarcher Properties)] + _MaxSteps ("Max steps", Int) = 256 + _MaxDist ("Max distance", Float) = 256 + _SurfDist ("Surface distance threshold", Range(0.00001, 0.05)) = 0.001 + + } + SubShader + { + Tags { "RenderType"="Opaque" } + Cull Off + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + // #define USE_WORLD_SPACE + #define DYNAMIC_QUALITY + #define USE_REFLECTIONS + // #define CONSTRAIN_TO_MESH + #define MAX_REFLECTIONS 1 + #include "RayMarchLib.cginc" + + float3 _SunPos; + + sdfData gyroid(float3 p, float scale, float bias, material mat = DEFMAT) + { + sdfData o; + o.dist = abs(dot(sin(p * scale), cos(p.zxy * scale))+bias) - 0.2; + o.dist *= .75 / scale; + o.mat = mat; + return o; + } + + + sdfData scene(float3 p) + { + sdfData o; + material mRed = mat(.12, 0.01, 0.01, sin(_Time*100)*0.1+0.6); + float3 bias = -pow(sin(_Time*60 + p.y*0.1), 8)*.5+1.3; + o = gyroid(p, .5, bias, mRed); + //o = sdfTorus(p, 10 + pow(sin(_Time*50), 4)*5, bias+sin(100*_Time + .1*p.x)*0.5+.5, cRed); + float3 gp = p + sin(_Time + p*0.1); + o.dist -= gyroid(gp, 1.63, .5).dist * 0.3; + o.dist += gyroid(gp, 3.327, 0).dist * 0.1; + o.dist += gyroid(gp, 7.351, .5).dist * 0.1; + o.dist -= gyroid(gp, 17.351, .5).dist * 0.05; + o.dist -= gyroid(gp, 23.521, .2).dist * 0.05; + o = sdfAdd(p, o, sdfSphere(p, 6 + bias*3, mRed), 5); + + // o = sdfInter(p, o, sdfSphere(p, 50, mat(0.04, 0.005, 0.035)), 1.1); + o = sdfInter(p, o, sdfBox(p, 20, mRed)); + //sdfData bobby = sdfSphere(p, 51, col(0.5, 0.25, 0.001)); + //bobby = sdfAdd(p, bobby, sdfSphere(p, 50.5, col(.5,.01,.01))); + //bobby = sdfSub(p, bobby, sdfSphere(p, 50)); + //o = sdfAdd(p, o, bobby); + //o = sdfAdd(p, o, sdfPlane(p, -50)); + return o; + } + + fixed4 lightPoint(rayData ray) + { + float3 vSunDir = normalize(_SunPos); + + if (ray.bMissed) + { + return 0.1; + } + + fixed4 col = 0; + + col = ray.mat.col * lightSun(ray.vNorm, vSunDir, col(5, 2, 0.1)); + col += ray.mat.col * lightSky(ray.vNorm, 1); + col *= lightAO(ray.vHit, ray.vNorm, 0.05); + + col = pow(col, 0.7); + //col = lightFog(col, col(0.3, .17, 0.001), ray.dist, 0, 48); + return col; + } + ENDCG + } + } +} diff --git a/Assets/test/Demo3.shader.meta b/Assets/test/Demo3.shader.meta new file mode 100644 index 0000000..2e91cf8 --- /dev/null +++ b/Assets/test/Demo3.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 26b714026d4c6e2dc8fefdbcf28344fd +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/test/Demo4.shader b/Assets/test/Demo4.shader new file mode 100644 index 0000000..a5e4c30 --- /dev/null +++ b/Assets/test/Demo4.shader @@ -0,0 +1,79 @@ +Shader "Demo/Spinny thing" +{ + Properties + { + [Header(Lighting)] + _SunPos ("Sun position", Vector) = (8, 4, 2) + + [Header(Raymarcher Properties)] + _MaxSteps ("Max steps", Int) = 256 + _MaxDist ("Max distance", Float) = 256 + _SurfDist ("Surface distance threshold", Range(0.00001, 0.05)) = 0.001 + + } + SubShader + { + Tags { "RenderType"="Opaque" } + Cull Off + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #define USE_DYNAMIC_QUALITY + // #define USE_WORLD_SPACE + #define USE_REFLECTIONS + #define MAX_REFLECTIONS 5 + #define DISCARD_ON_MISS + //#define CONSTRAIN_TO_MESH + #include "RayMarchLib.cginc" + + float3 _SunPos; + + sdfData scene(float3 p) + { + sdfData o; + const material mGrass = mat(0.001, 0.1, 0.001, 0.7); + o = sdfPlane(p, 0, mGrass); + material mDirt = mat(0.1, 0.04, 0.01, 1); + o = sdfInter(p, o, sdfSphere(p, 9, mDirt), 0.5); + + const material mMetal = mat(0.1, 0); + + o = sdfAdd(p, o, sdfSphere(p - V_Y*2, 2, mMetal)); + material m = mat(0.05, 0.1, 0.2, 1); + o = sdfAdd(p, o, sdfTorus(rotX(p, _Time* 40+UNITY_PI/2), 5, 0.5, m), 0.5); + o = sdfAdd(p, o, sdfTorus(rotZ(p, _Time* 40+UNITY_PI/2), 5, 0.5, m), 0.5); + o = sdfAdd(p, o, sdfTorus(rotX(p, _Time* 40), 5, 0.5, m), 0.5); + o = sdfAdd(p, o, sdfTorus(rotZ(p, _Time* 40), 5, 0.5, m), 0.5); + + o = sdfAdd(p, o, sdfSphere(abs(rotY(p, -20 * _Time)) - float3(1.5,2,1.5), 1, mMetal), 0.2); + return o; + } + + fixed4 lightPoint(rayData ray) + { + float3 vSunDir = normalize(_SunPos); + + if (ray.bMissed) + { + return sky(ray.vRayDir); + } + + fixed4 col = 0; + + col = ray.mat.col * lightSun(ray.vNorm, vSunDir); + col *= lightShadow(ray.vHit, vSunDir, 50); + col += ray.mat.col * lightSky(ray.vNorm, 1); + col *= lightAO(ray.vHit, ray.vNorm); + + col = pow(col, 0.5); + return col; + } + ENDCG + } + } +} diff --git a/Assets/test/Demo4.shader.meta b/Assets/test/Demo4.shader.meta new file mode 100644 index 0000000..9f8b6a5 --- /dev/null +++ b/Assets/test/Demo4.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d83b23d955f9dc5739d0827cd507a63e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/test/RayMarchLib.cginc b/Assets/test/RayMarchLib.cginc new file mode 100644 index 0000000..b6a37af --- /dev/null +++ b/Assets/test/RayMarchLib.cginc @@ -0,0 +1,1044 @@ +//double include guard +#ifndef RAY_MARCH_LIB_INCLUDED +#define RAY_MARCH_LIB_INCLUDED + +#include "UnityCG.cginc" + +// Multi compile stuff + +#define V_X float3(1, 0, 0) +#define V_Y float3(0, 1, 0) +#define V_Z float3(0, 0, 1) +#define V_XZ float3(1, 0, 1) +#define V_XY float3(1, 1, 0) +#define V_YZ float3(0, 1, 1) + +//ambient occlusion quality +#ifndef AO_STEPS +#define AO_STEPS 5 +#endif + +//normals for lighting +#ifndef NORMAL_DELTA +#define NORMAL_DELTA 0.001 +#endif +//normals for reflection angles +#ifndef REFL_NORMAL_DELTA +#define REFL_NORMAL_DELTA 0.001 +#endif + +#ifndef MAX_REFLECTIONS +#define MAX_REFLECTIONS 2 +#endif + +#ifdef USE_DYNAMIC_QUALITY//quality settings as unity material properties +int _MaxSteps = 100; +float _MaxDist = 100; +float _SurfDist = 0.00001; +#else//pre compile quality settings +#ifndef MAX_STEPS +#define MAX_STEPS 256 +//256 +#endif +#ifndef MAX_DIST +#define MAX_DIST 128 +#endif +#ifndef SURF_DIST +#define SURF_DIST 0.0001 +//#define SURF_DIST 0.00001 +#endif +#endif + + +#define col(r, g, b) fixed4(r, g, b, 1) + +struct appdata +{ + float4 vertex : POSITION; +}; + +struct v2f +{ + float4 vertex : SV_POSITION; + float3 vCamPos : TEXCOORD1; + float3 vHitPos : TEXCOORD2; +}; + +struct fragOut +{ + fixed4 col : SV_Target; + float depth : SV_Depth; +}; + +typedef struct material +{ + fixed4 col; + fixed fRough; +} material_t; + +#define DEFMAT {fixed4(.2,.2,.2,1), 1} + +#define M_RED {fixed4(0.2, 0.001, 0.001, 1), 1} +#define M_ORANGE {fixed4(0.2, 0.1, 0.001, 1), 1} +#define M_YELLOW {fixed4(0.2, 0.2, 0.001, 1), 1} +#define M_GREEN {fixed4(0.001, 0.2, 0.001, 1), 1} +#define M_BLUE {fixed4(0.001, 0.001, 0.2, 1), 1} +#define M_LIGHT_BLUE{fixed4(0.001, 0.05, 0.2, 1), 1} +#define M_MAGENTA {fixed4(0.2, 0.001, 0.2, 1), 1} +#define M_PURPLE {fixed4(0.05, 0.001, 0.2, 1), 1} +#define M_WHITE {fixed4(0.5, 0.5, 0.5, 1), 1} +#define M_MIRROR {fixed4(0.1, 0.1, 0.1, 1), 0} + +inline material mat(float r, float g, float b, float fRough = 1) +{ + material m = {fixed4(r, g, b, 1), fRough}; + return m; +} + +inline material mat(float3 rgb, float fRough = 1) +{ + material m = {fixed4(rgb, 1), fRough}; + return m; +} + +//used for lighting a point +struct rayData +{ + float dist; + int iSteps; + material mat; + float3 vRayStart; + float3 vRayDir; + float3 vHit; + fixed3 vNorm; + bool bMissed; + float minDist; + float distToMinDist; +}; + +//returned from distance functions, including main scene +struct sdfData +{ + float dist; + material mat; +}; + + +sdfData scene(float3 p); +fixed4 lightPoint(rayData r); +fixed4 rayMarch(float3 p, float3 d); +rayData castRay(float3 p, float3 d, float startDist = 0); + + +v2f vert (appdata v) +{ + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); +#ifdef USE_WORLD_SPACE + o.vCamPos = _WorldSpaceCameraPos; + o.vHitPos = mul(unity_ObjectToWorld, v.vertex); +#else + o.vCamPos = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos, 1)); + o.vHitPos = v.vertex; +#endif + return o; +} + + +#ifdef USE_REFLECTIONS +#define CALC_NORM +fragOut frag (v2f i) +{ + + float fRayLen = 0;//since last bounce + + #ifdef CONSTRAIN_TO_MESH + float3 vLastBounce = i.vHitPos; + fRayLen += length(i.vHitPos - i.vCamPos); + #else + float3 vLastBounce = i.vCamPos; + #endif + float3 vRayDir = normalize(i.vHitPos - i.vCamPos);//current direction + sdfData point_data; + rayData ray; + + fixed4 col; + float colUsed = 0;// what amount of the final colour has been calculated + float prevRough = 0; + + float3 vFirstHit; + + for (int i = 0; i < MAX_REFLECTIONS+1; i++) + { + ray = castRay(vLastBounce, vRayDir); + if (i == 0) + {//before any bounces + col = lightPoint(ray); + vFirstHit = ray.vHit; + } + else + { + float colAmt = colUsed + (prevRough * (1-colUsed)); + col = lerp(lightPoint(ray), col, colAmt); + colUsed = colAmt; + } + if (ray.bMissed || ray.mat.fRough > 0.99) + { + break; + } + prevRough = ray.mat.fRough; + vRayDir = reflect(vRayDir, ray.vNorm); + vLastBounce = ray.vHit + vRayDir * 0.01; + } + #ifdef DISCARD_ON_MISS + if (ray.bMissed && i == 0) discard; + #endif + fragOut o; + o.col = col; + + #ifdef USE_WORLD_SPACE + float4 vClipPos = mul(UNITY_MATRIX_VP, float4(vFirstHit, 1)); + #else + float4 vClipPos = mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, float4(vFirstHit, 1))); + #endif + + o.depth = vClipPos.z / vClipPos.w; + #if !defined(UNITY_REVERSED_Z) // basically only OpenGL (unity editor on linux) + o.depth = o.depth * 0.5 + 0.5; // remap -1 to 1 range to 0.0 to 1.0 + #endif + return o; +} +#else +fragOut frag (v2f i) +{ + float3 vRayDir = normalize(i.vHitPos - i.vCamPos); + #ifdef CONSTRAIN_TO_MESH + //rayData ray = castRay(i.vHitPos, vRayDir, length(i.vHitPos-i.vCamPos)); + rayData ray = castRay(i.vCamPos, vRayDir, length(i.vHitPos-i.vCamPos)); + //rayData ray = castRay(i.vCamPos, vRayDir, 1); + //rayData ray = castRay(i.vCamPos, vRayDir, 0); + + #else + rayData ray = castRay(i.vCamPos, vRayDir); + #endif + #ifdef DISCARD_ON_MISS + if (ray.bMissed) discard; + #endif + fragOut o; + o.col = lightPoint(ray); + + // writing to depth buffer costs about 1-2 frames at 4k + #ifdef USE_WORLD_SPACE + float4 vClipPos = mul(UNITY_MATRIX_VP, float4(ray.vHit, 1)); + #else + float4 vClipPos = mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, float4(ray.vHit, 1))); + #endif + + o.depth = (vClipPos.z / vClipPos.w + 1.0) * 0.5; + return o; +} +#endif + +//gets normal of a point +inline float3 getNormFull(float3 vPos, float fEpsilon = 0.001) +{ + //if epsilon is smaller than 0.001, there are often artifacts + const float2 e = float2(fEpsilon, 0); + float3 n = scene(vPos).dist - float3( + scene(vPos - e.xyy).dist, + scene(vPos - e.yxy).dist, + scene(vPos - e.yyx).dist); + return normalize(n); +} +//gets normal, provided you have the distance for pos (1 less call to scene()) +inline float3 getNorm(float3 vPos, float fPointDist, float fEpsilon = 0.001) +{ + ////if epilon is smaller than 0.001, there are often artifacts + const float2 e = float2(fEpsilon, 0); + float3 n = fPointDist - float3( + scene(vPos - e.xyy).dist, + scene(vPos - e.yxy).dist, + scene(vPos - e.yyx).dist); + return normalize(n); +} + +//marches a ray through the scene once +rayData castRay(float3 vRayStart, float3 vRayDir, float startDist) +{ + float fRayLen = startDist;//startDist;// total distance marched / distance from camera + + float3 vPos; + sdfData sdf_data; + + rayData ray; + ray.vRayDir = vRayDir; + ray.vRayStart = vRayStart; + ray.minDist = 30000.0;// budget "infinity" + ray.distToMinDist = 0; + + #ifdef USE_DYNAMIC_QUALITY + for (int i = 0; i < _MaxSteps; i++) + #else + for (int i = 0; i < MAX_STEPS; i++) + #endif + { + vPos = vRayStart + fRayLen * vRayDir; + sdf_data = scene(vPos); + + #ifdef USE_DYNAMIC_QUALITY + if (abs(sdf_data.dist) < _SurfDist) break; + #else + if (abs(sdf_data.dist) < SURF_DIST) break; + #endif + + fRayLen += sdf_data.dist;// move forward + + if (ray.minDist>sdf_data.dist) + { + ray.minDist = sdf_data.dist; + ray.distToMinDist = fRayLen; + } + + #ifdef USE_DYNAMIC_QUALITY + if (fRayLen > _MaxDist) {ray.bMissed = true; break;}//flag this as transparent/sky + #else + if (fRayLen > MAX_DIST) {ray.bMissed = true; break;}//flag this as transparent/sky + #endif + } + + ray.dist = fRayLen; + ray.iSteps = i; + ray.mat = sdf_data.mat; + ray.vHit = vPos; + #ifdef CALC_NORM + ray.vNorm = getNorm(vPos, sdf_data.dist); + #endif + return ray; +} + + +////////////////////////////////////////////////////////////////////// +// +// Lighting +// +////////////////////////////////////////////////////////////////////// + + +//generates a skybox, use when ray didn't hit anything (ray_data.bMissed) +inline fixed4 sky(float3 vRayDir) +{ + float4 cRenderedSun = max(0, pow(dot(vRayDir, normalize(float3(8,4,2))) + 0.4, 10)-28) * float4(.8,.4,0,1); + return fixed4(0.7, 0.75, 0.8, 1) - abs(vRayDir.y) * 0.5 + cRenderedSun; +} + +//calculate sun light based on normal +fixed4 lightSun(float3 vNorm, float3 vSunDir = float3(8, 4, 2), fixed4 cSunCol = fixed4(7.0, 5.5, 3.0, 1)) +{ + float fSunLight = max(dot(vNorm, vSunDir), 0); + return fSunLight * cSunCol; +} + +//calculate shadow from sun +float lightShadow(float3 vPos, float3 vSunDir, float fSharpness = 8) +{ + float fShadow = 1; + #ifdef USE_DYNAMIC_QUALITY + for (float fRayLen = 0.001; fRayLen < _MaxDist/2.0;) + #else + for (float fRayLen = 0.001; fRayLen < MAX_DIST/2.0;) + #endif + { + float dist = scene(vPos + vSunDir * fRayLen).dist; + + #ifdef USE_DYNAMIC_QUALITY + if (dist < _SurfDist) return 0; + #else + if (dist < SURF_DIST) return 0; + #endif + + fShadow = min(fShadow, fSharpness * dist/fRayLen); + fRayLen += dist; + } + return fShadow; +} + +//calculate sky light +inline fixed4 lightSky(float3 vNorm, fixed4 cSkyCol = fixed4(0.5, 0.8, 0.9, 1)) +{ + return cSkyCol * (0.5 + 0.5 * vNorm.y); +} + +//bad ambient occlusion (screen space) based on steps +float lightSSAO(rayData ray_data, float fDarkenFactor = 2) +{ + #ifdef USE_DYNAMIC_QUALITY + return pow(1 - float(ray_data.iSteps) / _MaxSteps, fDarkenFactor); + #else + return pow(1 - float(ray_data.iSteps) / MAX_STEPS, fDarkenFactor); + #endif +} + +//ambient occlusion +float lightAO(float3 vPos, float3 vNorm, float fEpsilon = 0.05) +{ + float ao = 0; + for (int i = 0; i < AO_STEPS; i++) + { + float fOffset = i * fEpsilon; + float fDist = scene(vPos + vNorm * fOffset).dist; + ao += 1/pow(2, i) * (fOffset - fDist); + } + ao = 1 - AO_STEPS * ao; + return ao; +} + +inline fixed4 lightFog(fixed4 col, fixed4 cFog, float fDist, float fStart=16, float fFull=32) +{ + if (fDist < 0) return cFog; + return lerp(col, cFog, smoothstep(fStart, fFull, fDist)); +} + +//a light pass for debugging +fixed4 lightOnly(float3 vPos, float3 vNorm, float3 vSunDir) +{ + float fLight = lightSun(vNorm, vSunDir, 1); + float fAO = lightAO(vPos, vNorm); + float fShadow = lightShadow(vPos, vSunDir); + return fLight * fAO * fShadow; +} + + +////////////////////////////////////////////////////////////////////// +// +// Interpolation and Math +// +////////////////////////////////////////////////////////////////////// + + +//soft min of a and b with smoothing factor k +inline float smin(float a, float b, float k) +{ + float h = max(k - abs(a-b), 0) / k; + return min(a, b) - h*h*h*k * 1/6.0; +} + +//soft max of a and b with smoothing factor k +inline float smax(float a, float b, float k) +{ + float h = max(k - abs(a - b), 0) / k; + return max(a, b) + h*h*h*k * 1/6.0; +} + +//interpolate between the colours of 2 SDFs +inline material mixMat(sdfData sdfA, sdfData sdfB) +{ + material m; + float fac = clamp(sdfA.dist/(sdfA.dist + sdfB.dist), 0, 1); + m.col = lerp(sdfA.mat.col, sdfB.mat.col, fac); + m.fRough = lerp(sdfA.mat.fRough, sdfB.mat.fRough, fac); + return m; +} + +//interpolate between the colours of 2 SDFs +inline material mixMat(material a, material b, float fac) +{ + material m; + m.col = lerp(a.col, b.col, fac); + m.fRough = lerp(a.fRough, b.fRough, fac); + return m; +} + +// from: https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h +// modified to be more "optimized" (WAY worse approximations) +static const float fsl_PI = 3.1415926535897932384626433f; +static const float fsl_PI_half = fsl_PI/2; +inline float acosFast4(float inX) +{ + return 1.57-inX; + float x1 = abs(inX); + //float x2 = x1 * x1; + //float x3 = x2 * x1; + float s; + + s = -0.2121144f * x1 + 1.5707288f; + //s = 0.0742610f * x2 + s; + //s = -0.0187293f * x3 + s; + s = sqrt(1.0f - x1) * s; + + // acos function mirroring + // check per platform if compiles to a selector - no branch neeeded + return s; + //return inX >= 0.0f ? s : fsl_PI - s; +} + +// polynomial degree 2 +// Tune for positive input [0, infinity] and provide output [0, PI/2] +inline float ATanPos(float x) +{ + const float C1 = 1.01991; + const float C2 = -0.218891; + float t0 = (x < 1.0f) ? x : 1.0f / x; + float t1 = (C2 * t0 + C1) * t0; // p(x) + return t1;//return (x < 1.0f) ? t1: fsl_PI_half - t1; // undo range reduction +} +// Common function, ATanPos is implemented below +// input [-infinity, infinity] and output [-PI/2, PI/2] +inline float ATan(float x) +{ + float t0 = ATanPos(abs(x)); + return t0;//(x < 0.0f) ? -t0: t0; // undo range reduction +} + +inline float atanFast4(float inX) +{ + //return atan(inX); + return ATan(inX); + float x = inX; + return x*(-0.1784f * abs(x) - 0.0663f * x * x + 1.0301f); +} + +// https://en.wikipedia.org/wiki/Atan2#Definition_and_computation +inline float atanFast4_2(float y, float x) +{ + //return sign(x)*sign(x)*atanFast4(y/x)+((1-sign(x))/2)*(1-sign(y)-sign(y)*sign(y))*fsl_PI; + return atanFast4(y/x)+(1-sign(x))*(sign(y))*fsl_PI/2; + +} + + + + + + +////////////////////////////////////////////////////////////////////// +// +// SDF operations +// +////////////////////////////////////////////////////////////////////// + + +//union of SDF A and B +sdfData sdfAdd(float3 p, sdfData sA, sdfData sB) +{ + sdfData sC; + sC.dist = min(sA.dist, sB.dist); + sC.mat = mixMat(sA, sB); + return sC; +} + +//union of SDF A and B, with smoothing +sdfData sdfAdd(float3 p, sdfData sA, sdfData sB, float fSmooth) +{ + sdfData sC; + sC.dist = smin(sA.dist, sB.dist, fSmooth); + sC.mat = mixMat(sA, sB); + return sC; +} + +//remove the SDF B from A (colour is from A) +sdfData sdfSub(float3 p, sdfData sA, sdfData sB) +{ + sdfData sC; + sC.dist = max(sA.dist, -sB.dist); + sC.mat = sA.mat; + return sC; +} + +//remove the SDF B from A (colour is from A), with smoothing +sdfData sdfSub(float3 p, sdfData sA, sdfData sB, float fSmooth) +{ + sdfData sC; + sC.dist = smax(sA.dist, -sB.dist, fSmooth); + sC.mat = sA.mat; + return sC; +} + +//intersection of SDF A and B +sdfData sdfInter(float3 p, sdfData sA, sdfData sB) +{ + sdfData sC; + sC.dist = max(sA.dist, sB.dist); + sC.mat = mixMat(sA, sB); + return sC; +} + +//intersection of SDF A and B, with smoothing +sdfData sdfInter(float3 p, sdfData sA, sdfData sB, float fSmooth) +{ + sdfData sC; + sC.dist = smax(sA.dist, sB.dist, fSmooth); + sC.mat = mixMat(sA, sB); + return sC; +} + +//round edges of an SDF +sdfData sdfRound(float3 p, sdfData sdfIn, float fRadius) +{ + sdfData sdfOut = sdfIn; + sdfOut.dist -= fRadius; + return sdfOut; +} + + + +////////////////////////////////////////////////////////////////////// +// +// SDF shapes +// +////////////////////////////////////////////////////////////////////// + + +//create sphere +sdfData sdfSphere(float3 p, float fRadius, material mat = DEFMAT) +{ + sdfData sdf; + sdf.dist = length(p) - fRadius; + sdf.mat = mat; + return sdf; +} + +//create plane pointing to positive Y +sdfData sdfPlane(float3 p, float fHeight, material mat = DEFMAT) +{ + sdfData sdf; + sdf.dist = p.y - fHeight; + sdf.mat = mat; + return sdf; +} + +//create plane with normal +sdfData sdfPlane(float3 p, float3 vNorm, float fHeight, material mat = DEFMAT) +{ + sdfData sdf; + sdf.dist = dot(p, normalize(vNorm)) - fHeight; + sdf.mat = mat; + return sdf; +} + +//create cuboid +sdfData sdfBox(float3 p, float3 vDim, material mat = DEFMAT) +{ + sdfData sdf; + float3 q = abs(p) - vDim/2.0; + sdf.dist = length(max(q, 0)) + min(max(q.x, max(q.y, q.z)), 0); + sdf.mat = mat; + return sdf; +} + +//create cuboid +sdfData sdfBox(float3 p, float3 vDim, float fRound, material mat = DEFMAT) +{ + sdfData sdf; + float3 q = abs(p) - vDim/2.0; + sdf.dist = length(max(q, 0)) + min(max(q.x, max(q.y, q.z)), 0) - fRound; + sdf.mat = mat; + return sdf; +} + +//create line segment +sdfData sdfLine(float3 p, float3 vStart, float3 vEnd, float fRadius, material mat = DEFMAT) +{ + sdfData sdf; + float h = min(1, max(0, dot(p-vStart, vEnd-vStart) / dot(vEnd-vStart, vEnd-vStart))); + sdf.dist = length(p-vStart-(vEnd-vStart)*h)-fRadius; + sdf.mat = mat; + return sdf; +} + +//create cylinder +sdfData sdfCylinder(float3 p, float fRadius, float fHeight, material mat = DEFMAT) +{ + sdfData sdf; + sdf.dist = max(abs(p.y) - fHeight/2.0, length(p.xz) - fRadius); + sdf.mat = mat; + return sdf; +} + +//create cylinder +sdfData sdfCylinder(float3 p, float fRadius, float fHeight, float fRound, material mat = DEFMAT) +{ + sdfData sdf; + sdf.dist = max(abs(p.y) - fHeight/2.0, length(p.xz) - fRadius) - fRound; + sdf.mat = mat; + return sdf; +} + +//create torus +sdfData sdfTorus(float3 p, float fRadius, float fThickness, material mat = DEFMAT) +{ + sdfData sdf; + float2 q = float2(length(p.xz) - fRadius, p.y); + sdf.dist = length(q) - fThickness; + sdf.mat = mat; + return sdf; +} + +//triangular prism (BOUND) +sdfData sdfTriPrism(float3 p, float fSide, float fDepth, material mat = DEFMAT) +{ + float3 q = abs(p); + sdfData sdf; + sdf.dist = max(q.z - fDepth, max(q.x * 0.866025 + p.y * 0.5, -p.y) - fSide * 0.5); + sdf.mat = mat; + return sdf; +} + + +////////////////////////////////////////////////////////////////////// +// +// Fractals, complex shapes and scenes (frac prefix) +// +////////////////////////////////////////////////////////////////////// + +//TODO: +// complex :julia, +// simple sierpinsky, menger + +// Mandelbolb - OPTIMIZED AF, still a fractal but visually diffrent. +sdfData fracMandelbolb(float3 p, material mat = DEFMAT) +{ + // http://blog.hvidtfeldts.net/index.php/2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations/ + float3 pos; + pos.x = p.x; + pos.y = p.y; + pos.z = p.z; + + float dr = 1.0; + float r = 0; + + const int iterations = 4; + + const float maxRThreshold = 2;//2; + + const float Power = 16; + for (int i = 0; i < iterations; i++) + { + r = length(p); + if (r>maxRThreshold) break; + + // xyz -> polar + //float theta = acos( p.z / r ); + float theta = acosFast4( p.z / r ); + //float phi = atan2( p.y, p.x ); + float phi = atanFast4_2( p.y, p.x ); + dr = pow( r, Power-1.0)*Power*dr + 1.0; + + // transform point + float zr = pow( r, Power ); + theta = theta * Power; + phi = phi * Power; + + // polar -> xyz + p = zr*float3(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta)); + p += pos; + } + + sdfData sdf; + sdf.mat = mat; + sdf.dist = 0.5*log(r)*r/dr; + return sdf; +} + +// Mandelbulb +sdfData fracMandelbulb(float3 p, material mat = DEFMAT) +{ + // http://blog.hvidtfeldts.net/index.php/2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations/ + float3 pos; + pos.x = p.x; + pos.y = p.y; + pos.z = p.z; + + float dr = 1.0; + float r = 0; + + // Lowest number of iterations without loosing a significant amount of detail + // Depends on maxRThreshold + //int iterations = 1; + //int iterations = 8; + const int iterations = 5; + + //float maxRThreshold = 2; + const float maxRThreshold = 2; + + // Z_(n+1) = Z(n)^? + // float Power = 8 + 6 * sin(_Time.x); + float Power = 8; + for (int i = 0; i < iterations; i++) + { + r = length(p); + if (r>maxRThreshold) break; + + // xyz -> polar + float theta = acos( p.z / r ); + float phi = atan2( p.y, p.x ); + dr = pow( r, Power-1.0)*Power*dr + 1.0; + + // transform point + float zr = pow( r, Power ); + theta = theta * Power; + phi = phi * Power; + + // polar -> xyz + p = zr*float3(sin(theta)*cos(phi), sin(phi)*sin(theta), cos(theta)); + p += pos; + + + } + + sdfData sdf; + sdf.mat = mat; + //sdf.mat.col.y = sin(p.x); + //sdf.dist = sdfSphere(pos, 10).dist; + //sdf.mat = mat; + sdf.dist = 0.5*log(r)*r/dr; + //sdf.mat = mat; + + return sdf; +} + +void sphereFold(inout float3 p, inout float dz, float minRadius, float fixedRadius); +void boxFold(inout float3 p, float dz, float foldingLimit); + +// Mandelbox +sdfData fracMandelbox(float3 p, float scaleFactor, material mat = DEFMAT) +{ + // http://blog.hvidtfeldts.net/index.php/2011/11/distance-estimated-3d-fractals-vi-the-mandelbox/ + + float3 offset = p; + float dr = 0; + + // Parameters + int iterations = 8;//20;//14; + //scaleFactor = -2 + (_SinTime.x*4+2); + float fixedRadius = 1.0; + float minRadius = 0.5; + /*float foldingLimit = 0.2 + _SinTime.x/4 + 0.25; + float minRadius = 0.07; + float fixedRadius = 0.2;*/ + + //float scaleFactor = -0.8; + + + /*float foldingLimit = _FoldingLimit; + float minRadius = _MinRadius; + float fixedRadius = _FixedRadius;*/ + + + for(int i=0; i 1.0) + p.x = 2.0 - p.x; + else if (p.x < -1.0) p.x = -2.0 - p.x; + if (p.y > 1.0) + p.y = 2.0 - p.y; + else if (p.y < -1.0) p.y = -2.0 - p.y; + if (p.z > 1.0) + p.z = 2.0 - p.z; + else if (p.z < -1.0) p.z = -2.0 - p.z; + + // radius squared + float r2 = dot(p,p); + + if (r2 < mR2) + { + p*=(fR2/mR2); + DEfactor*=(fR2/mR2); + } + else if (r2 < fR2) + { + p*=(fR2/r2); + DEfactor*=(fR2/r2); + } + p=p*scale+1; + DEfactor*=scale; + } + + sdfData sdf; + sdf.mat = mat; + sdf.dist = length(p)/abs(DEfactor); + return sdf; +} + +// Feather +sdfData fracFeather(float3 p, float cx = 2.0, float cy = 2.7, float cz = 1.4, material mat=DEFMAT) +{ + // https://fractalforums.org/index.php?action=gallery;sa=view;id=5732 + int iterations = 5; + //float cx = 2.0; + //float cy = 2.7; + //float cz = 1.4; + float cw = 0.1; + float dx = 1.5;// + _FoldingLimit-0.5; + + float lp,r2,s = 1; + + float icy = 1.0 / cy; + float3 p2,cy3 = float3(cy,cy,cy); + + for (int i=0; i=5R5=kCVZo!QLJ zN_zxk1eFRdyZi{jQBo-7GJf#*11MMF6ixtfA;x72NDze`3Sx|n<=`YTv0@dLocw;> zJ-f5FJF}zHAMVm<9^K!szgK_#b@$$GeI~6tdV62jE$v;Vr8_h2?b@Z2{_ja6Wn1aQRrv1u zzPApTnT(m2l@AfkUyi7jpTNf^A*k&n3DK1?EaYA;+A;z|9ELLByP0u+owZ)N0$%oFeq&Lf@C- z=26@k&*d^^N(`-WI2-irmk2F2iL(Mvo;&stUXUD8$U~?F^2NB-LLSsHXlvtgym`2D z-26QS-YLO95&*8oegHn@7K0^@C%z0wG!BjutMFZ86oKVWb`FdR9eN+iI!uz$*rtv6 zw`uE^SbHq?N%5~E7K?peK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OwK^M;5DnhfA|lNEq?XIqmxhW``x`OfBW$RUJL$h;~%P=y!8v8dHckV5B%zvZSNMo Iw6^vC0sX$^hyVZp literal 0 HcmV?d00001 diff --git a/Assets/test/large_box.fbx.meta b/Assets/test/large_box.fbx.meta new file mode 100644 index 0000000..d2166c3 --- /dev/null +++ b/Assets/test/large_box.fbx.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: 85702488cb92b9182a44437d143f9fc4 +ModelImporter: + serializedVersion: 19301 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/test/spinny.mat b/Assets/test/spinny.mat new file mode 100644 index 0000000..357b633 --- /dev/null +++ b/Assets/test/spinny.mat @@ -0,0 +1,81 @@ +%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: spinny + m_Shader: {fileID: 4800000, guid: 26b714026d4c6e2dc8fefdbcf28344fd, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _MaxDist: 256 + - _MaxSteps: 219.31 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SurfDist: 0.001 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SunPos: {r: 8, g: 4, b: 2, a: 1} diff --git a/Assets/test/spinny.mat.meta b/Assets/test/spinny.mat.meta new file mode 100644 index 0000000..0232fe7 --- /dev/null +++ b/Assets/test/spinny.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c6c9534ef89e9c77cb3f6307bc66dde4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: From fdfa51a5310da73cfdf1d3c8dd1e0feabe7b2691 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sun, 23 Jul 2023 18:31:33 +0200 Subject: [PATCH 3/3] so much raymarcing garbage --- .../Interactive/MultiObject.controller | 468 +++++++++ .../Interactive/MultiObject.controller.meta | 8 + Assets/raymarched/Interactive/ObjectA_X.anim | 116 +++ .../Interactive/ObjectA_X.anim.meta | 8 + Assets/raymarched/Interactive/ObjectA_Y.anim | 116 +++ .../Interactive/ObjectA_Y.anim.meta | 8 + Assets/raymarched/Interactive/ObjectA_Z.anim | 116 +++ .../Interactive/ObjectA_Z.anim.meta | 8 + Assets/raymarched/Interactive/ObjectB_X.anim | 116 +++ .../Interactive/ObjectB_X.anim.meta | 8 + Assets/raymarched/Interactive/ObjectB_Y.anim | 116 +++ .../Interactive/ObjectB_Y.anim.meta | 8 + Assets/raymarched/Interactive/ObjectB_Z.anim | 116 +++ .../Interactive/ObjectB_Z.anim.meta | 8 + .../raymarched/Interactive/Raymarch_multi.mat | 3 +- .../raymarched/Interactive/rm_combined.shader | 300 +++--- Assets/raymarched/Raymarching.unity | 919 +++++++++++++++++- Assets/raymarched/lib.meta | 8 + Assets/raymarched/lib/GarbageExample.mat | 80 ++ Assets/raymarched/lib/GarbageExample.mat.meta | 8 + Assets/raymarched/lib/libgarbage.cginc | 61 ++ Assets/raymarched/lib/libgarbage.cginc.meta | 9 + Assets/raymarched/lib/libgarbage_end.cginc | 1 + .../raymarched/lib/libgarbage_end.cginc.meta | 9 + .../raymarched/lib/libgarbage_example.shader | 44 + .../lib/libgarbage_example.shader.meta | 9 + Assets/raymarched/sphere_0.2m.fbx | Bin 0 -> 29772 bytes Assets/raymarched/sphere_0.2m.fbx.meta | 97 ++ Assets/raymarched/sphere_2m.fbx | Bin 0 -> 29772 bytes Assets/raymarched/sphere_2m.fbx.meta | 97 ++ Assets/test/Demo4.shader | 12 +- Assets/test/{spinny.mat => FleshCube.mat} | 8 +- .../{spinny.mat.meta => FleshCube.mat.meta} | 0 .../test/{Demo3.shader => FleshCube.shader} | 20 +- ...emo3.shader.meta => FleshCube.shader.meta} | 0 Assets/test/Spinny.mat | 81 ++ Assets/test/Spinny.mat.meta | 8 + Assets/test/TestProps.unity | 150 ++- 38 files changed, 2939 insertions(+), 205 deletions(-) create mode 100644 Assets/raymarched/Interactive/MultiObject.controller create mode 100644 Assets/raymarched/Interactive/MultiObject.controller.meta create mode 100644 Assets/raymarched/Interactive/ObjectA_X.anim create mode 100644 Assets/raymarched/Interactive/ObjectA_X.anim.meta create mode 100644 Assets/raymarched/Interactive/ObjectA_Y.anim create mode 100644 Assets/raymarched/Interactive/ObjectA_Y.anim.meta create mode 100644 Assets/raymarched/Interactive/ObjectA_Z.anim create mode 100644 Assets/raymarched/Interactive/ObjectA_Z.anim.meta create mode 100644 Assets/raymarched/Interactive/ObjectB_X.anim create mode 100644 Assets/raymarched/Interactive/ObjectB_X.anim.meta create mode 100644 Assets/raymarched/Interactive/ObjectB_Y.anim create mode 100644 Assets/raymarched/Interactive/ObjectB_Y.anim.meta create mode 100644 Assets/raymarched/Interactive/ObjectB_Z.anim create mode 100644 Assets/raymarched/Interactive/ObjectB_Z.anim.meta create mode 100644 Assets/raymarched/lib.meta create mode 100644 Assets/raymarched/lib/GarbageExample.mat create mode 100644 Assets/raymarched/lib/GarbageExample.mat.meta create mode 100644 Assets/raymarched/lib/libgarbage.cginc create mode 100644 Assets/raymarched/lib/libgarbage.cginc.meta create mode 100644 Assets/raymarched/lib/libgarbage_end.cginc create mode 100644 Assets/raymarched/lib/libgarbage_end.cginc.meta create mode 100644 Assets/raymarched/lib/libgarbage_example.shader create mode 100644 Assets/raymarched/lib/libgarbage_example.shader.meta create mode 100644 Assets/raymarched/sphere_0.2m.fbx create mode 100644 Assets/raymarched/sphere_0.2m.fbx.meta create mode 100644 Assets/raymarched/sphere_2m.fbx create mode 100644 Assets/raymarched/sphere_2m.fbx.meta rename Assets/test/{spinny.mat => FleshCube.mat} (96%) rename Assets/test/{spinny.mat.meta => FleshCube.mat.meta} (100%) rename Assets/test/{Demo3.shader => FleshCube.shader} (82%) rename Assets/test/{Demo3.shader.meta => FleshCube.shader.meta} (100%) create mode 100644 Assets/test/Spinny.mat create mode 100644 Assets/test/Spinny.mat.meta diff --git a/Assets/raymarched/Interactive/MultiObject.controller b/Assets/raymarched/Interactive/MultiObject.controller new file mode 100644 index 0000000..add7167 --- /dev/null +++ b/Assets/raymarched/Interactive/MultiObject.controller @@ -0,0 +1,468 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-8465147991303884772 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_Z + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -778598287410787253} + m_Position: {x: 380, y: 120, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -778598287410787253} +--- !u!1102 &-6509306727967814378 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_Z + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 1 + m_Motion: {fileID: 7400000, guid: 8a337aa4eb616aa798c89f46909f63e5, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: ObjectB_Z +--- !u!1107 &-5992346665410383487 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_Z + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -6509306727967814378} + m_Position: {x: 329, y: 109, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -6509306727967814378} +--- !u!1102 &-5684512436488358267 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_X + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 1 + m_Motion: {fileID: 7400000, guid: 5344abea9c8901c848f67a9d30b922b9, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: ObjectB_X +--- !u!1107 &-5096165749562391104 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_Y + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1660559658912344997} + m_Position: {x: 284, y: 126, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1660559658912344997} +--- !u!1107 &-4195430008742610051 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_X + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -3176514367915262987} + m_Position: {x: 415, y: 105, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -3176514367915262987} +--- !u!1102 &-3176514367915262987 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_X + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 1 + m_Motion: {fileID: 7400000, guid: a5571ae7d5c209812a40c8f41b6a6851, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: ObjectA_X +--- !u!1107 &-2261036627937079202 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_X + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -5684512436488358267} + m_Position: {x: 391, y: 92, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -5684512436488358267} +--- !u!1102 &-778598287410787253 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_Z + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 1 + m_Motion: {fileID: 7400000, guid: c34c55c9c7ed1f610951f9850dc0c865, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: ObjectA_Z +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MultiObject + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: ObjectA_X + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: ObjectA_Y + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: ObjectA_Z + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: ObjectB_X + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: ObjectB_Y + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + - m_Name: ObjectB_Z + m_Type: 1 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 1873914384603339509} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: ObjectA_X + m_StateMachine: {fileID: -4195430008742610051} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: ObjectA_Y + m_StateMachine: {fileID: 8920307797793888464} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: ObjectA_Z + m_StateMachine: {fileID: -8465147991303884772} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: ObjectB_X + m_StateMachine: {fileID: -2261036627937079202} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: ObjectB_Y + m_StateMachine: {fileID: -5096165749562391104} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} + - serializedVersion: 5 + m_Name: ObjectB_Z + m_StateMachine: {fileID: -5992346665410383487} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 1 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &847829751511545519 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_X + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a5571ae7d5c209812a40c8f41b6a6851, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1660559658912344997 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_Y + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 1 + m_Motion: {fileID: 7400000, guid: ebff5c7ef55eb1fe7bc622d035417528, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: ObjectB_Y +--- !u!1107 &1873914384603339509 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 847829751511545519} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 847829751511545519} +--- !u!1102 &8417450941949904896 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_Y + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 1 + m_Motion: {fileID: 7400000, guid: 42aaa2b5056e60bbe88027e8ed332747, type: 2} + m_Tag: + m_SpeedParameter: ObjectA_Y + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: ObjectA_Y +--- !u!1107 &8920307797793888464 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_Y + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 8417450941949904896} + m_Position: {x: 370, y: 120, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 8417450941949904896} diff --git a/Assets/raymarched/Interactive/MultiObject.controller.meta b/Assets/raymarched/Interactive/MultiObject.controller.meta new file mode 100644 index 0000000..f83cd9f --- /dev/null +++ b/Assets/raymarched/Interactive/MultiObject.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5a951e59572a58b05b49eb62effc41f7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/ObjectA_X.anim b/Assets/raymarched/Interactive/ObjectA_X.anim new file mode 100644 index 0000000..6f41edc --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectA_X.anim @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_X + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectA.x + path: Main + classID: 23 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 521822810 + attribute: 20465042 + script: {fileID: 0} + typeID: 23 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectA.x + path: Main + classID: 23 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/raymarched/Interactive/ObjectA_X.anim.meta b/Assets/raymarched/Interactive/ObjectA_X.anim.meta new file mode 100644 index 0000000..bd5d76b --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectA_X.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5571ae7d5c209812a40c8f41b6a6851 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/ObjectA_Y.anim b/Assets/raymarched/Interactive/ObjectA_Y.anim new file mode 100644 index 0000000..702642c --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectA_Y.anim @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_Y + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectA.y + path: Main + classID: 23 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 521822810 + attribute: 288900498 + script: {fileID: 0} + typeID: 23 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectA.y + path: Main + classID: 23 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/raymarched/Interactive/ObjectA_Y.anim.meta b/Assets/raymarched/Interactive/ObjectA_Y.anim.meta new file mode 100644 index 0000000..890268e --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectA_Y.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42aaa2b5056e60bbe88027e8ed332747 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/ObjectA_Z.anim b/Assets/raymarched/Interactive/ObjectA_Z.anim new file mode 100644 index 0000000..6da8acb --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectA_Z.anim @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectA_Z + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectA.z + path: Main + classID: 23 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 521822810 + attribute: 557335954 + script: {fileID: 0} + typeID: 23 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectA.z + path: Main + classID: 23 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/raymarched/Interactive/ObjectA_Z.anim.meta b/Assets/raymarched/Interactive/ObjectA_Z.anim.meta new file mode 100644 index 0000000..d7d0d4d --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectA_Z.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c34c55c9c7ed1f610951f9850dc0c865 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/ObjectB_X.anim b/Assets/raymarched/Interactive/ObjectB_X.anim new file mode 100644 index 0000000..8234c50 --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectB_X.anim @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_X + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectB.x + path: Main + classID: 23 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 521822810 + attribute: 137434152 + script: {fileID: 0} + typeID: 23 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectB.x + path: Main + classID: 23 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/raymarched/Interactive/ObjectB_X.anim.meta b/Assets/raymarched/Interactive/ObjectB_X.anim.meta new file mode 100644 index 0000000..04c8a1e --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectB_X.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5344abea9c8901c848f67a9d30b922b9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/ObjectB_Y.anim b/Assets/raymarched/Interactive/ObjectB_Y.anim new file mode 100644 index 0000000..42d093f --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectB_Y.anim @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_Y + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectB.y + path: Main + classID: 23 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 521822810 + attribute: 405869608 + script: {fileID: 0} + typeID: 23 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectB.y + path: Main + classID: 23 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/raymarched/Interactive/ObjectB_Y.anim.meta b/Assets/raymarched/Interactive/ObjectB_Y.anim.meta new file mode 100644 index 0000000..9c43d12 --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectB_Y.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ebff5c7ef55eb1fe7bc622d035417528 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/ObjectB_Z.anim b/Assets/raymarched/Interactive/ObjectB_Z.anim new file mode 100644 index 0000000..fbc83a7 --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectB_Z.anim @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ObjectB_Z + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectB.z + path: Main + classID: 23 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 521822810 + attribute: 674305064 + script: {fileID: 0} + typeID: 23 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 2 + outSlope: 2 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ObjectB.z + path: Main + classID: 23 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/raymarched/Interactive/ObjectB_Z.anim.meta b/Assets/raymarched/Interactive/ObjectB_Z.anim.meta new file mode 100644 index 0000000..0d6cc6f --- /dev/null +++ b/Assets/raymarched/Interactive/ObjectB_Z.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8a337aa4eb616aa798c89f46909f63e5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/Interactive/Raymarch_multi.mat b/Assets/raymarched/Interactive/Raymarch_multi.mat index 7491234..483d7b9 100644 --- a/Assets/raymarched/Interactive/Raymarch_multi.mat +++ b/Assets/raymarched/Interactive/Raymarch_multi.mat @@ -78,4 +78,5 @@ Material: m_Colors: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _ObjectA: {r: -0.07, g: 0, b: 0, a: 1} + - _ObjectA: {r: 0.5, g: 0.4, b: 0, a: 1} + - _ObjectB: {r: -0.05, g: 0.13, b: 0, a: 1} diff --git a/Assets/raymarched/Interactive/rm_combined.shader b/Assets/raymarched/Interactive/rm_combined.shader index a9a39cf..43af9c4 100644 --- a/Assets/raymarched/Interactive/rm_combined.shader +++ b/Assets/raymarched/Interactive/rm_combined.shader @@ -2,8 +2,9 @@ { Properties { - [Header(Object positions)] - _ObjectA ("Object A", Vector) = (0, 0, 0) + [Header(Object positions)] + _ObjectA ("Object A", Vector) = (0, 0, 0) + _ObjectB ("Object B", Vector) = (0, 0, 0) [Header(Raymarcher Properties)] _MaxSteps ("Max steps", Int) = 256 _MaxDist ("Max distance", Float) = 100 @@ -21,172 +22,193 @@ #pragma fragment frag - #include "UnityCG.cginc" - #include "UnityLightingCommon.cginc" + #include "UnityCG.cginc" + #include "UnityLightingCommon.cginc" - struct appdata - { - float4 vertex : POSITION; - }; + struct appdata + { + float4 vertex : POSITION; + }; - struct v2f - { - float4 vertex : SV_POSITION; - float3 ro : TEXCOORD1; - float3 hitPos : TEXCOORD2; - }; + struct v2f + { + float4 vertex : SV_POSITION; + float3 ro : TEXCOORD1; + float3 hitPos : TEXCOORD2; + }; - struct fragOut - { - fixed4 col : SV_Target; - float depth : SV_Depth; - }; + struct fragOut + { + fixed4 col : SV_Target; + float depth : SV_Depth; + }; - int _MaxSteps; - float _MaxDist; - float _SurfDist; - float3 _ObjectA; + int _MaxSteps; + float _MaxDist; + float _SurfDist; + float3 _ObjectA; + float3 _ObjectB; - v2f vert (appdata v) { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - //object space - o.ro = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos, 1)); - o.hitPos = v.vertex; - //world space - //o.ro = _WorldSpaceCameraPos; - //o.hitPos = mul(unity_ObjectToWorld, v.vertex); - return o; - } + v2f vert (appdata v) { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + //object space + o.ro = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos, 1)); + o.hitPos = v.vertex; + //world space + //o.ro = _WorldSpaceCameraPos; + //o.hitPos = mul(unity_ObjectToWorld, v.vertex); + return o; + } - float smin(float a, float b, float k) { - return min(a, b) - pow(max(k - abs(a-b), 0), 3)/(6*k*k); - } + float smin(float a, float b, float k) { + return min(a, b) - pow(max(k - abs(a-b), 0), 3)/(6*k*k); + } - float sdSphere(float3 p, float3 o, float r) { - return length(p - o) - r; - } + float sdSphere(float3 p, float3 o, float r) { + return length(p - o) - r; + } - float sdBox(float3 p, float3 dim) { - return length(float3( - max(abs(p.x) - dim.x/2.0, 0), - max(abs(p.y) - dim.y/2.0, 0), - max(abs(p.z) - dim.z/2.0, 0))); - } + float sdBox(float3 p, float3 dim) { + return length(float3( + max(abs(p.x) - dim.x/2.0, 0), + max(abs(p.y) - dim.y/2.0, 0), + max(abs(p.z) - dim.z/2.0, 0))); + } - float sdLine(float3 p, float3 a, float3 b, float r) { - float3 pa = p - a; - float3 ba = b - a; - float h = clamp(dot(pa, ba) / dot(ba, ba), 0, 1); - return length(pa - ba * h) - r; - } + float sdLine(float3 p, float3 a, float3 b, float r) { + float3 pa = p - a; + float3 ba = b - a; + float h = clamp(dot(pa, ba) / dot(ba, ba), 0, 1); + return length(p- a - (b-a) * h) - r; + } - float sdCappedTorus( float3 p, float2 sc, float ra, float rb) { - p.x = abs(p.x); - float k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy,sc) : length(p.xy); - return sqrt( dot(p,p) + ra*ra - 2.0*ra*k ) - rb; - } + float sdCappedTorus( float3 p, float2 sc, float ra, float rb) { + p.x = abs(p.x); + float k = (sc.y*p.x>sc.x*p.y) ? dot(p.xy,sc) : length(p.xy); + return sqrt( dot(p,p) + ra*ra - 2.0*ra*k ) - rb; + } - float3 RotateY(float3 p, float a) { - return mul(float3x3(cos(a), 0, sin(a), 0, 1, 0, -sin(a), 0, cos(a)), p); - } + float sdTorus( float3 p, float2 t) { + float2 q = float2(length(p.xz) - t.x, p.y); + return length(q) - t.y; + } - float Kijetesantakalu(float3 p, float r) { - float d = sdSphere(p, float3(0, 0, 0.2f), r);// left eye - d = min(d, sdSphere(p, float3(0.15f, 0, 0.2f), r)); // right eye - d = min(d, sdLine(p, float3(0, 0, -0.4f), float3(-0.35f, 0, -0.4f), r)); // bottom line - d = smin(d, sdLine(p, float3(0, 0, -0.4f), float3(-0.1f, 0, -0.15f), r), 0.003f); // leg hook - d = min(d, sdLine(p, float3(0.15f, 0, -0.4f), float3(0.15f, 0, -0.1f), r)); // middle leg - d = min(d, sdLine(p, float3(0.3f, 0, -0.4f), float3(0.3f, 0, 0), r)); // front leg - d = smin(d, sdLine(p, float3(0.45f, 0, 0.1f), float3(0.3f, 0, 0), r), 0.003f); // lower snout - d = smin(d, sdLine(p, float3(0.45f, 0, 0.1f), float3(0.2f, 0, 0.35f), r), 0.003f); // upper snout - d = smin(d, sdLine(p, float3(0.2f, 0, 0.45f), float3(0.2f, 0, 0.35f), r), 0.003f); // ear - float an = 0.9; - d = smin(d, sdCappedTorus((RotateY(p, 0.8f) - float3(0.15f, 0, -0.05f)).xzy, float2(sin(an),cos(an)), 0.4, r), 0.003f); // ear - d = smin(d, sdLine(p, float3(-0.25f, 0, 0), float3(-0.25f, 0, -0.4f), r), 0.003f); // back - d = smin(d, sdLine(p, float3(-0.25f, 0, -0.1f), float3(-0.35f, 0, -0.1f), r), 0.003f); // tail top - d = smin(d, sdLine(p, float3(-0.35f, 0, -0.1f), float3(-0.35f, 0, -0.4f), r), 0.003f); // stripe - an = 3.1415f*0.5; - d = smin(d, sdCappedTorus((RotateY(p, an) - float3(-0.25f, 0, 0.35f)).xzy, float2(sin(an),cos(an)), 0.15f, r), 0.003f); // tail + float3 RotateY(float3 p, float a) { + return mul(float3x3(cos(a), 0, sin(a), 0, 1, 0, -sin(a), 0, cos(a)), p); + } - return d; - } + float Kijetesantakalu(float3 p, float r) { + float d = sdSphere(p, float3(0, 0, 0.2f), r);// left eye + d = min(d, sdSphere(p, float3(0.15f, 0, 0.2f), r)); // right eye + d = min(d, sdLine(p, float3(0, 0, -0.4f), float3(-0.35f, 0, -0.4f), r)); // bottom line + d = smin(d, sdLine(p, float3(0, 0, -0.4f), float3(-0.1f, 0, -0.15f), r), 0.003f); // leg hook + d = min(d, sdLine(p, float3(0.15f, 0, -0.4f), float3(0.15f, 0, -0.1f), r)); // middle leg + d = min(d, sdLine(p, float3(0.3f, 0, -0.4f), float3(0.3f, 0, 0), r)); // front leg + d = smin(d, sdLine(p, float3(0.45f, 0, 0.1f), float3(0.3f, 0, 0), r), 0.003f); // lower snout + d = smin(d, sdLine(p, float3(0.45f, 0, 0.1f), float3(0.2f, 0, 0.35f), r), 0.003f); // upper snout + d = smin(d, sdLine(p, float3(0.2f, 0, 0.45f), float3(0.2f, 0, 0.35f), r), 0.003f); // ear + float an = 0.9; + d = smin(d, sdCappedTorus((RotateY(p, 0.8f) - float3(0.15f, 0, -0.05f)).xzy, float2(sin(an),cos(an)), 0.4, r), 0.003f); // ear + d = smin(d, sdLine(p, float3(-0.25f, 0, 0), float3(-0.25f, 0, -0.4f), r), 0.003f); // back + d = smin(d, sdLine(p, float3(-0.25f, 0, -0.1f), float3(-0.35f, 0, -0.1f), r), 0.003f); // tail top + d = smin(d, sdLine(p, float3(-0.35f, 0, -0.1f), float3(-0.35f, 0, -0.4f), r), 0.003f); // stripe + an = 3.1415f*0.5; + d = smin(d, sdCappedTorus((RotateY(p, an) - float3(-0.25f, 0, 0.35f)).xzy, float2(sin(an),cos(an)), 0.15f, r), 0.003f); // tail - float FirstShape(float3 p) { - return Kijetesantakalu(p, 0.05f); - } + return d; + } - float SecondShape(float3 p) { - // return sdBox(p, 0.3f) - 0.01f; - // return Kijetesantakalu(p, 0.04f) - 0.01f; - return sdSphere(p, 0, 0.3f); - } + float FirstShape(float3 p) { + return Kijetesantakalu(p, 0.05f); + } + + float SecondShape(float3 p) { + // return sdBox(p, 0.3f) - 0.01f; + // return Kijetesantakalu(p, 0.04f) - 0.01f; + // return sdSphere(p, 0, 0.3f); + + float3 a =_ObjectA; + float3 b =_ObjectB; + + float o = sdLine(p, a, b, 0.1); + o = smin(o, sdSphere(p, a, 0.2), 0.05); + o = smin(o, sdSphere(p, b, 0.2), 0.05); + return o; + // return sdTorus(p - _ObjectA, float2(, 0.2f)); + } - float GetDist(float3 p) { + float GetDist(float3 p) { - float first = FirstShape(p); - // float3 second_pos = mul(unity_WorldToObject, _WorldSpaceLightPos0); - float second = SecondShape(p - _ObjectA); - return smin(first, second, 0.15f); + float first = FirstShape(p); + // float3 second_pos = mul(unity_WorldToObject, _WorldSpaceLightPos0); + float second = SecondShape(p); + return smin(first, second, 0.15f); - } + } - //marches a ray through the scene - float Raymarch(float3 ro, float3 rd) { - float rayLen = 0;// total distance marched / distance from origin - float dist; // distance from the raymarched scene - for ( int i = 0; i < _MaxSteps; i++) - { - //position = origin + distance * direction - float3 p = ro + rayLen * rd; - dist = GetDist(p); - rayLen += dist;// move forward - if (dist < _SurfDist || rayLen > _MaxDist) { - break; - } - } + //marches a ray through the scene + float Raymarch(float3 ro, float3 rd) { + float rayLen = 0;// total distance marched / distance from origin + float dist; // distance from the raymarched scene + for ( int i = 0; i < _MaxSteps; i++) + { + //position = origin + distance * direction + float3 p = ro + rayLen * rd; + dist = GetDist(p); + rayLen += dist;// move forward + if (dist < _SurfDist || rayLen > _MaxDist) { + break; + } + } - return rayLen; - } + return rayLen; + } - float3 GetNormal(float3 p) { - float2 e = float2(0.001, 0); - float3 n = GetDist(p) - float3( - GetDist(p-e.xyy), - GetDist(p-e.yxy), - GetDist(p-e.yyx)); - return normalize(n); - } + float3 GetNormal(float3 p) { + float2 e = float2(0.001, 0); + float3 n = GetDist(p) - float3( + GetDist(p-e.xyy), + GetDist(p-e.yxy), + GetDist(p-e.yyx)); + return normalize(n); + } - fragOut frag (v2f i) { - float3 ro = i.ro; - float3 rd = normalize(i.hitPos - ro); + fragOut frag (v2f i) { + float3 ro = i.ro; + float3 rd = normalize(i.hitPos - ro); - float d = Raymarch(ro, rd); - fixed4 col = 1; + float d = Raymarch(ro, rd); + fixed4 col = 1; - if (d >= _MaxDist) - { - discard; - } - float3 p = ro + rd * d; - float3 n = GetNormal(p); + if (d >= _MaxDist) + { + discard; + } + float3 p = ro + rd * d; + float3 n = GetNormal(p); - // col.rgb = max(dot(n, normalize(float3(1,0.5,1))), 0.05f); + // col.rgb = max(dot(n, normalize(float3(1,0.5,1))), 0.05f); - col.rgb = lerp(0, float3(0,1,1), pow(1 - dot(-rd, n), 2)); + // float3 edgeCol = float3(0,1,1); + float3 edgeCol = abs(p); + col.rgb = lerp(0.001, edgeCol, pow(1 - dot(-rd, n), 2)); - // col *= float4(d, 1, 1, 1); - fragOut o; - o.col = col; - // o.col = _LightColor0; - float4 vClipPos = mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, float4(p, 1))); - o.depth = (vClipPos.z / vClipPos.w + 1.0) * 0.5; - return o; - } + // col *= float4(d, 1, 1, 1); + fragOut o; + o.col = col; + // o.col = _LightColor0; + float4 vClipPos = mul(UNITY_MATRIX_VP, mul(unity_ObjectToWorld, float4(p, 1))); + float zDepth = vClipPos.z / vClipPos.w; + #if !defined(UNITY_REVERSED_Z) // basically only OpenGL (unity editor on linux) + zDepth = zDepth * 0.5 + 0.5; // remap -1 to 1 range to 0.0 to 1.0 + #endif + o.depth = zDepth; + return o; + } ENDCG } - } + } } \ No newline at end of file diff --git a/Assets/raymarched/Raymarching.unity b/Assets/raymarched/Raymarching.unity index e3fe342..86442c1 100644 --- a/Assets/raymarched/Raymarching.unity +++ b/Assets/raymarched/Raymarching.unity @@ -121,6 +121,262 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &244150317 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 244150318} + - component: {fileID: 244150319} + m_Layer: 0 + m_Name: TriggerA_Y + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &244150318 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 244150317} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 779234489} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &244150319 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 244150317} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81194749cc874e87b95c7b486517c3a9, type: 3} + m_Name: + m_EditorClassIdentifier: + areaSize: {x: 2, y: 2, z: 2} + areaOffset: {x: 0, y: 0, z: 0} + settingIndex: -1 + settingValue: 0 + useAdvancedTrigger: 1 + allowedTypes: + - RaymarcherObjectA + allowParticleInteraction: 0 + enterTasks: [] + exitTasks: [] + stayTasks: + - settingIndex: 1 + minValue: 0 + maxValue: 1 + updateMethod: 1 + sampleDirection: 2 +--- !u!1 &249645324 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 249645325} + - component: {fileID: 249645328} + - component: {fileID: 249645327} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &249645325 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249645324} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 1, z: 0.1} + m_Children: [] + m_Father: {fileID: 831474226} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &249645327 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249645324} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &249645328 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 249645324} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &307897118 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 307897119} + - component: {fileID: 307897120} + m_Layer: 0 + m_Name: TriggerB_Z + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &307897119 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 307897118} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 779234489} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &307897120 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 307897118} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81194749cc874e87b95c7b486517c3a9, type: 3} + m_Name: + m_EditorClassIdentifier: + areaSize: {x: 2, y: 2, z: 2} + areaOffset: {x: 0, y: 0, z: 0} + settingIndex: -1 + settingValue: 0 + useAdvancedTrigger: 1 + allowedTypes: + - RaymarcherObjectB + allowParticleInteraction: 0 + enterTasks: [] + exitTasks: [] + stayTasks: + - settingIndex: 5 + minValue: 0 + maxValue: 1 + updateMethod: 1 + sampleDirection: 4 +--- !u!1 &393448822 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 393448823} + - component: {fileID: 393448824} + m_Layer: 0 + m_Name: TriggerB_Y + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &393448823 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 393448822} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 779234489} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &393448824 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 393448822} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81194749cc874e87b95c7b486517c3a9, type: 3} + m_Name: + m_EditorClassIdentifier: + areaSize: {x: 2, y: 2, z: 2} + areaOffset: {x: 0, y: 0, z: 0} + settingIndex: -1 + settingValue: 0 + useAdvancedTrigger: 1 + allowedTypes: + - RaymarcherObjectB + allowParticleInteraction: 0 + enterTasks: [] + exitTasks: [] + stayTasks: + - settingIndex: 4 + minValue: 0 + maxValue: 1 + updateMethod: 1 + sampleDirection: 2 --- !u!1 &453749071 GameObject: m_ObjectHideFlags: 0 @@ -132,11 +388,11 @@ GameObject: - component: {fileID: 453749072} - component: {fileID: 453749075} - component: {fileID: 453749074} - - component: {fileID: 453749073} - component: {fileID: 453749077} - component: {fileID: 453749076} + - component: {fileID: 453749073} m_Layer: 0 - m_Name: Cube (1) + m_Name: ObjectA m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -150,14 +406,15 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 453749071} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.623, y: 0, z: 0} + m_LocalPosition: {x: 0.5, y: 0.4, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 831474226} m_Father: {fileID: 779234489} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!65 &453749073 -BoxCollider: +--- !u!135 &453749073 +SphereCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} @@ -167,7 +424,7 @@ BoxCollider: m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 1} + m_Radius: 0.2 m_Center: {x: 0, y: 0, z: 0} --- !u!23 &453749074 MeshRenderer: @@ -215,20 +472,26 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 453749071} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!114 &453749076 -MonoBehaviour: + m_Mesh: {fileID: 4393975565123819156, guid: 955b9c52fc0be3217a2074e1e2169b9d, type: 3} +--- !u!1818360609 &453749076 +RotationConstraint: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 453749071} m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 39d87b8783794dfd81ce396483019cbb, type: 3} - m_Name: - m_EditorClassIdentifier: - type: RaymarcherObjectA + m_Weight: 1 + m_RotationAtRest: {x: 0, y: 0, z: 0} + m_RotationOffset: {x: 0, y: 0, z: 0} + m_AffectRotationX: 1 + m_AffectRotationY: 1 + m_AffectRotationZ: 1 + m_IsContraintActive: 1 + m_IsLocked: 1 + m_Sources: + - sourceTransform: {fileID: 779234489} + weight: 1 --- !u!114 &453749077 MonoBehaviour: m_ObjectHideFlags: 0 @@ -248,6 +511,99 @@ MonoBehaviour: snappingReferences: [] autoHold: 0 ikReference: {fileID: 0} +--- !u!1 &683266143 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 683266147} + - component: {fileID: 683266146} + - component: {fileID: 683266145} + - component: {fileID: 683266144} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!65 &683266144 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683266143} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &683266145 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683266143} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 162568fe26f57e5c5acca748512ee245, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &683266146 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683266143} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &683266147 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 683266143} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.754, y: -0.24626623, z: 0.587} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &695617482 GameObject: m_ObjectHideFlags: 0 @@ -340,6 +696,65 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &703968045 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 703968046} + - component: {fileID: 703968047} + m_Layer: 0 + m_Name: TriggerB_X + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &703968046 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 703968045} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 779234489} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &703968047 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 703968045} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81194749cc874e87b95c7b486517c3a9, type: 3} + m_Name: + m_EditorClassIdentifier: + areaSize: {x: 2, y: 2, z: 2} + areaOffset: {x: 0, y: 0, z: 0} + settingIndex: -1 + settingValue: 0 + useAdvancedTrigger: 1 + allowedTypes: + - RaymarcherObjectB + allowParticleInteraction: 0 + enterTasks: [] + exitTasks: [] + stayTasks: + - settingIndex: 3 + minValue: 0 + maxValue: 1 + updateMethod: 1 + sampleDirection: 0 --- !u!1 &779234488 GameObject: m_ObjectHideFlags: 0 @@ -351,13 +766,14 @@ GameObject: - component: {fileID: 779234489} - component: {fileID: 779234491} - component: {fileID: 779234490} + - component: {fileID: 779234492} m_Layer: 0 m_Name: MultiObject m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!4 &779234489 Transform: m_ObjectHideFlags: 0 @@ -366,12 +782,18 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 779234488} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.044, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - - {fileID: 453749072} - {fileID: 884043982} + - {fileID: 453749072} + - {fileID: 950930977} - {fileID: 2089960366} + - {fileID: 244150318} + - {fileID: 1960976045} + - {fileID: 703968046} + - {fileID: 393448823} + - {fileID: 307897119} m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -401,23 +823,121 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a37fd8d654d5c2840a0ab3a5ad65a5ae, type: 3} m_Name: m_EditorClassIdentifier: - spawnHeight: 0 + spawnHeight: 0.5 useAdditionalValues: 1 syncValues: - - name: + - name: A_X startValue: 0 updatedBy: 0 updateMethod: 1 - animator: {fileID: 0} - animatorParameterName: -none- + animator: {fileID: 779234492} + animatorParameterName: ObjectA_X + - name: A_Y + startValue: 0 + updatedBy: 0 + updateMethod: 1 + animator: {fileID: 779234492} + animatorParameterName: ObjectA_Y + - name: A_Z + startValue: 0 + updatedBy: 0 + updateMethod: 1 + animator: {fileID: 779234492} + animatorParameterName: ObjectA_Z + - name: B_X + startValue: 0 + updatedBy: 0 + updateMethod: 1 + animator: {fileID: 779234492} + animatorParameterName: ObjectB_X + - name: B_Y + startValue: 0 + updatedBy: 0 + updateMethod: 1 + animator: {fileID: 779234492} + animatorParameterName: ObjectB_Y + - name: B_Z + startValue: 0 + updatedBy: 0 + updateMethod: 1 + animator: {fileID: 779234492} + animatorParameterName: ObjectB_Z propPrivacy: 1 subSyncs: - transform: {fileID: 453749072} - syncedValues: 0 + syncedValues: 14 + precision: 4 + syncBoundary: 0.5 + - transform: {fileID: 950930977} + syncedValues: 14 precision: 4 syncBoundary: 0.5 spawnableType: 0 preGeneratedInstanceId: +--- !u!95 &779234492 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 779234488} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 5a951e59572a58b05b49eb62effc41f7, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &831474225 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 831474226} + - component: {fileID: 831474227} + m_Layer: 0 + m_Name: Pointer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &831474226 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831474225} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 249645325} + m_Father: {fileID: 453749072} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &831474227 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831474225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39d87b8783794dfd81ce396483019cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + type: RaymarcherObjectA --- !u!1 &845829380 GameObject: m_ObjectHideFlags: 0 @@ -510,6 +1030,51 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 124.6, y: -30, z: 0} +--- !u!1 &849578981 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 849578982} + - component: {fileID: 849578983} + m_Layer: 0 + m_Name: Pointer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &849578982 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849578981} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1764646628} + m_Father: {fileID: 950930977} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &849578983 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849578981} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 39d87b8783794dfd81ce396483019cbb, type: 3} + m_Name: + m_EditorClassIdentifier: + type: RaymarcherObjectB --- !u!1 &884043981 GameObject: m_ObjectHideFlags: 0 @@ -521,7 +1086,6 @@ GameObject: - component: {fileID: 884043982} - component: {fileID: 884043985} - component: {fileID: 884043984} - - component: {fileID: 884043983} m_Layer: 0 m_Name: Main m_TagString: Untagged @@ -541,21 +1105,8 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 779234489} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!135 &884043983 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 884043981} - m_Material: {fileID: 0} - m_IsTrigger: 1 - m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} --- !u!23 &884043984 MeshRenderer: m_ObjectHideFlags: 0 @@ -602,7 +1153,141 @@ MeshFilter: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 884043981} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} + m_Mesh: {fileID: 4393975565123819156, guid: ef0474244602536ba83b1af50ff39b9a, type: 3} +--- !u!1 &950930976 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 950930977} + - component: {fileID: 950930982} + - component: {fileID: 950930981} + - component: {fileID: 950930980} + - component: {fileID: 950930979} + - component: {fileID: 950930978} + m_Layer: 0 + m_Name: ObjectB + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &950930977 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950930976} + 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: 849578982} + m_Father: {fileID: 779234489} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!135 &950930978 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950930976} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.2 + m_Center: {x: 0, y: 0, z: 0} +--- !u!1818360609 &950930979 +RotationConstraint: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950930976} + m_Enabled: 1 + m_Weight: 1 + m_RotationAtRest: {x: 0, y: 0, z: 0} + m_RotationOffset: {x: 0, y: 0, z: 0} + m_AffectRotationX: 1 + m_AffectRotationY: 1 + m_AffectRotationZ: 1 + m_IsContraintActive: 1 + m_IsLocked: 1 + m_Sources: + - sourceTransform: {fileID: 779234489} + weight: 1 +--- !u!114 &950930980 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950930976} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 12974925555b471580cacf5d2d5fa9e3, type: 3} + m_Name: + m_EditorClassIdentifier: + gripType: 1 + gripOrigin: {fileID: 0} + disallowTheft: 0 + maximumGrabDistance: 0 + snappingReferences: [] + autoHold: 0 + ikReference: {fileID: 0} +--- !u!23 &950930981 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950930976} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &950930982 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950930976} + m_Mesh: {fileID: 4393975565123819156, guid: 955b9c52fc0be3217a2074e1e2169b9d, type: 3} --- !u!1 &1450495540 GameObject: m_ObjectHideFlags: 0 @@ -625,7 +1310,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &1450495541 MonoBehaviour: m_ObjectHideFlags: 0 @@ -831,7 +1516,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!65 &1485771012 BoxCollider: m_ObjectHideFlags: 0 @@ -1010,7 +1695,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!114 &1651833085 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1137,6 +1822,144 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1764646627 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1764646628} + - component: {fileID: 1764646630} + - component: {fileID: 1764646629} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1764646628 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1764646627} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.1, y: 1, z: 0.1} + m_Children: [] + m_Father: {fileID: 849578982} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1764646629 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1764646627} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1764646630 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1764646627} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1960976044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1960976045} + - component: {fileID: 1960976046} + m_Layer: 0 + m_Name: TriggerA_Z + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1960976045 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1960976044} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -10, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 779234489} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1960976046 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1960976044} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81194749cc874e87b95c7b486517c3a9, type: 3} + m_Name: + m_EditorClassIdentifier: + areaSize: {x: 2, y: 2, z: 2} + areaOffset: {x: 0, y: 0, z: 0} + settingIndex: -1 + settingValue: 0 + useAdvancedTrigger: 1 + allowedTypes: + - RaymarcherObjectA + allowParticleInteraction: 0 + enterTasks: [] + exitTasks: [] + stayTasks: + - settingIndex: 2 + minValue: 0 + maxValue: 1 + updateMethod: 1 + sampleDirection: 4 --- !u!1 &2089960365 GameObject: m_ObjectHideFlags: 0 @@ -1148,7 +1971,7 @@ GameObject: - component: {fileID: 2089960366} - component: {fileID: 2089960367} m_Layer: 0 - m_Name: GameObject + m_Name: TriggerA_X m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1162,11 +1985,11 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2089960365} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: -10, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 779234489} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &2089960367 MonoBehaviour: @@ -1180,7 +2003,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 81194749cc874e87b95c7b486517c3a9, type: 3} m_Name: m_EditorClassIdentifier: - areaSize: {x: 10, y: 0.05, z: 0} + areaSize: {x: 2, y: 2, z: 2} areaOffset: {x: 0, y: 0, z: 0} settingIndex: -1 settingValue: 0 @@ -1191,7 +2014,7 @@ MonoBehaviour: enterTasks: [] exitTasks: [] stayTasks: - - settingIndex: -1 + - settingIndex: 0 minValue: 0 maxValue: 1 updateMethod: 1 diff --git a/Assets/raymarched/lib.meta b/Assets/raymarched/lib.meta new file mode 100644 index 0000000..4a3c4cd --- /dev/null +++ b/Assets/raymarched/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9d363cc3e7dc48602b2b2a482eaba095 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/lib/GarbageExample.mat b/Assets/raymarched/lib/GarbageExample.mat new file mode 100644 index 0000000..27e3981 --- /dev/null +++ b/Assets/raymarched/lib/GarbageExample.mat @@ -0,0 +1,80 @@ +%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: GarbageExample + m_Shader: {fileID: 4800000, guid: 7d4f97b3ee7613d9ba63c8ab411721a1, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _MaxDist: 256 + - _MaxSteps: 256 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SurfDist: 0.001 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/raymarched/lib/GarbageExample.mat.meta b/Assets/raymarched/lib/GarbageExample.mat.meta new file mode 100644 index 0000000..8548752 --- /dev/null +++ b/Assets/raymarched/lib/GarbageExample.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 162568fe26f57e5c5acca748512ee245 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/lib/libgarbage.cginc b/Assets/raymarched/lib/libgarbage.cginc new file mode 100644 index 0000000..17ba790 --- /dev/null +++ b/Assets/raymarched/lib/libgarbage.cginc @@ -0,0 +1,61 @@ +struct appdata +{ + float4 vertex : POSITION; +}; + +struct v2f +{ + float4 vertex : SV_POSITION; + float3 vCamPos : TEXCOORD1; + float3 vHitPos : TEXCOORD2; +}; + +struct fragOut +{ + fixed4 col : SV_Target; + // float depth : SV_Depth; +}; + +v2f vert (appdata v) +{ + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); +#ifdef USE_WORLD_SPACE + o.vCamPos = _WorldSpaceCameraPos; + o.vHitPos = mul(unity_ObjectToWorld, v.vertex); +#else + o.vCamPos = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos, 1)); + o.vHitPos = v.vertex; +#endif + return o; +} + +fragOut frag (v2f i) +{ + fragOut o; + o.col = 1; + o.col.r = 0; + return o; +} + +// #define SOME_MAGIC(main_fn) float3 main1()\ +// main_fn \ + +#define SOME_MAGIC(PASS, function_definition) float3 main##PASS() function_definition + +#define DO_MAGIC MAIN_FN(1) + +// #define SECOND_PASS 1 +// #define AA MAIN_FN +// #define BB MAIN_FN + + +// float3 main2() \ +// main_fn + +// \ +// float3 main2() \ +// main_fn\ + + +// #define SECOND_PASS \ diff --git a/Assets/raymarched/lib/libgarbage.cginc.meta b/Assets/raymarched/lib/libgarbage.cginc.meta new file mode 100644 index 0000000..a3595e9 --- /dev/null +++ b/Assets/raymarched/lib/libgarbage.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1b7c0fe7c2a1f3e5bb00d9fc04e6c43c +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/lib/libgarbage_end.cginc b/Assets/raymarched/lib/libgarbage_end.cginc new file mode 100644 index 0000000..ee953f0 --- /dev/null +++ b/Assets/raymarched/lib/libgarbage_end.cginc @@ -0,0 +1 @@ +#define DO_MAGIC(p) MAIN_FN(p) \ No newline at end of file diff --git a/Assets/raymarched/lib/libgarbage_end.cginc.meta b/Assets/raymarched/lib/libgarbage_end.cginc.meta new file mode 100644 index 0000000..549f561 --- /dev/null +++ b/Assets/raymarched/lib/libgarbage_end.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 26203816190e7e521a12959d895d68a3 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/lib/libgarbage_example.shader b/Assets/raymarched/lib/libgarbage_example.shader new file mode 100644 index 0000000..84e10d7 --- /dev/null +++ b/Assets/raymarched/lib/libgarbage_example.shader @@ -0,0 +1,44 @@ +Shader "CrispyPin/LibGarbageExample" +{ + Properties + { + + [Header(Raymarcher Properties)] + _MaxSteps ("Max steps", Int) = 256 + _MaxDist ("Max distance", Float) = 256 + _SurfDist ("Surface distance threshold", Range(0.00001, 0.05)) = 0.001 + + } + SubShader + { + Tags { "RenderType"="Opaque" } + Cull Off + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "libgarbage.cginc" + + // #define MAIN_FN(PASS) float3 main##PASS ()\ + + #define MAIN_FN(PASS) SOME_MAGIC(PASS,\ + {\ + return float3(1,0,0);\ + }\ + ) + // #include "libgarbage_end.cginc" + // #define DO_MAGIC(p) MAIN_FN(p) + DO_MAGIC + + // {return 0;} + // MAIN_FN(1) {return 0;} + + + ENDCG + } + } +} diff --git a/Assets/raymarched/lib/libgarbage_example.shader.meta b/Assets/raymarched/lib/libgarbage_example.shader.meta new file mode 100644 index 0000000..c8902e7 --- /dev/null +++ b/Assets/raymarched/lib/libgarbage_example.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7d4f97b3ee7613d9ba63c8ab411721a1 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/sphere_0.2m.fbx b/Assets/raymarched/sphere_0.2m.fbx new file mode 100644 index 0000000000000000000000000000000000000000..615b70350bfcc822305365364b7e0ef5e7da2e41 GIT binary patch literal 29772 zcmbq530zFu|IvFw=#gY;L5NTi+NK5}qy|Z%8ZA>oO*Ji3GtIn&R1`v}W*#AFlTc}y zXxB1G`!Y2x(>_g8%{1%(+{$~s_j|ne|NZW#`@Q#`bH3kmzWeu{naRY?&(Y4)ZuNn^ zr&jNEakKOETfJIhr9_W{gv325iQkVUp#LDs&JpFgAM1s3!?>W`tU>22aQ+O=Uw-dC ziSmRx5A{n*NML7-m=8vL>w}2jpV7Byzng=npSu^pJK^V!It02T0wL1V$6_N-l-*>n ziz~|9%g)uE3VOcHE%iHDFlE<_j-RYhcAkeAfD6Hl)}Kw$ZeHgO%>hk|0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6<;-faFe3UcDa@pBoC9AsBvYhNM`8*pk8v7i^jb-yyx^#SEuo~`(#wY zD)T$Rq#VTMo&$63`B_0h%SUVJ5=2+#j7q@JS!eyc70@KlJLoo1YfU z(TZ%~ou#r5y~Av2YjnaEBE1$Ph0%A@aaeDY+EuJ(vO{i<*#u5rf6r{jAhIVlje2koqfm4nZ*}oERCphM%^_hi&r~j}VIRW6p*iLMCDbsY(`#E2WHHULd48}Q&Y@RC%bj&?uKC(dYShbB zAa71x`V(YkiI$Oo+3%a)?3g->=Dk~PIs%I;!t#6Q&w;6ZSZd(4!e2X}F<%{8ZDPd6 zqLp@Fp%Yg)kJ=i-D!=jOrX8rnfPk6i_MLuc_wU{|9fxk_{^{GzzgK1z`4*}hGY!s6 zn*(YP4`E7wXH~-2GBMsRp8LJ*NBRwxDQW4b18?dgT1)f)wf(k-AK5vK@pQe`T}RT^ GSp6GYBKvRv literal 0 HcmV?d00001 diff --git a/Assets/raymarched/sphere_0.2m.fbx.meta b/Assets/raymarched/sphere_0.2m.fbx.meta new file mode 100644 index 0000000..e434572 --- /dev/null +++ b/Assets/raymarched/sphere_0.2m.fbx.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: 955b9c52fc0be3217a2074e1e2169b9d +ModelImporter: + serializedVersion: 19301 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 0.1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 0.1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/raymarched/sphere_2m.fbx b/Assets/raymarched/sphere_2m.fbx new file mode 100644 index 0000000000000000000000000000000000000000..615b70350bfcc822305365364b7e0ef5e7da2e41 GIT binary patch literal 29772 zcmbq530zFu|IvFw=#gY;L5NTi+NK5}qy|Z%8ZA>oO*Ji3GtIn&R1`v}W*#AFlTc}y zXxB1G`!Y2x(>_g8%{1%(+{$~s_j|ne|NZW#`@Q#`bH3kmzWeu{naRY?&(Y4)ZuNn^ zr&jNEakKOETfJ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s zyn`pL9a~0uI4{YIAa0L`q(7Y_T*q0>cHu|Yckjnxz7h@;{f_!=JZBx-k+17h<%~RV zk!hOLei8`%hH=x&f|8q-eG|kt@l_QWBM;K#gxk8@ytOHm6?bk*TA{7IY=+WU{JGnKT4%dQ9r(I);I5T_OH5rn>VTCXA++y- z4uyM3x`e{o6<;-faFe3UcDa@pBoC9AsBvYhNM`8*pk8v7i^jb-yyx^#SEuo~`(#wY zD)T$Rq#VTMo&$63`B_0h%SUVJ5=2+#j7q@JS!eyc70@KlJLoo1YfU z(TZ%~ou#r5y~Av2YjnaEBE1$Ph0%A@aaeDY+EuJ(vO{i<*#u5rf6r{jAhIVlje2koqfm4nZ*}oERCphM%^_hi&r~j}VIRW6p*iLMCDbsY(`#E2WHHULd48}Q&Y@RC%bj&?uKC(dYShbB zAa71x`V(YkiI$Oo+3%a)?3g->=Dk~PIs%I;!t#6Q&w;6ZSZd(4!e2X}F<%{8ZDPd6 zqLp@Fp%Yg)kJ=i-D!=jOrX8rnfPk6i_MLuc_wU{|9fxk_{^{GzzgK1z`4*}hGY!s6 zn*(YP4`E7wXH~-2GBMsRp8LJ*NBRwxDQW4b18?dgT1)f)wf(k-AK5vK@pQe`T}RT^ GSp6GYBKvRv literal 0 HcmV?d00001 diff --git a/Assets/raymarched/sphere_2m.fbx.meta b/Assets/raymarched/sphere_2m.fbx.meta new file mode 100644 index 0000000..cb5b061 --- /dev/null +++ b/Assets/raymarched/sphere_2m.fbx.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: ef0474244602536ba83b1af50ff39b9a +ModelImporter: + serializedVersion: 19301 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 2 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 2 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/test/Demo4.shader b/Assets/test/Demo4.shader index a5e4c30..fe9f76c 100644 --- a/Assets/test/Demo4.shader +++ b/Assets/test/Demo4.shader @@ -14,7 +14,7 @@ SubShader { Tags { "RenderType"="Opaque" } - Cull Off + Cull Front LOD 100 Pass @@ -26,7 +26,7 @@ #define USE_DYNAMIC_QUALITY // #define USE_WORLD_SPACE #define USE_REFLECTIONS - #define MAX_REFLECTIONS 5 + #define MAX_REFLECTIONS 3 #define DISCARD_ON_MISS //#define CONSTRAIN_TO_MESH #include "RayMarchLib.cginc" @@ -50,7 +50,7 @@ o = sdfAdd(p, o, sdfTorus(rotX(p, _Time* 40), 5, 0.5, m), 0.5); o = sdfAdd(p, o, sdfTorus(rotZ(p, _Time* 40), 5, 0.5, m), 0.5); - o = sdfAdd(p, o, sdfSphere(abs(rotY(p, -20 * _Time)) - float3(1.5,2,1.5), 1, mMetal), 0.2); + o = sdfAdd(p, o, sdfSphere(abs(rotY(p, -20 * _Time)) - float3(1.5, sin(_Time.y*5) +1,1.5), 0.7, mMetal), 0.2); return o; } @@ -66,11 +66,11 @@ fixed4 col = 0; col = ray.mat.col * lightSun(ray.vNorm, vSunDir); - col *= lightShadow(ray.vHit, vSunDir, 50); + col *= lightShadow(ray.vHit + ray.vNorm * _SurfDist, vSunDir, 50); col += ray.mat.col * lightSky(ray.vNorm, 1); - col *= lightAO(ray.vHit, ray.vNorm); + // col *= lightAO(ray.vHit, ray.vNorm); - col = pow(col, 0.5); + // col = pow(col, 0.5); return col; } ENDCG diff --git a/Assets/test/spinny.mat b/Assets/test/FleshCube.mat similarity index 96% rename from Assets/test/spinny.mat rename to Assets/test/FleshCube.mat index 357b633..5a20c9f 100644 --- a/Assets/test/spinny.mat +++ b/Assets/test/FleshCube.mat @@ -7,7 +7,7 @@ Material: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: spinny + m_Name: FleshCube m_Shader: {fileID: 4800000, guid: 26b714026d4c6e2dc8fefdbcf28344fd, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 @@ -63,8 +63,8 @@ Material: - _GlossMapScale: 1 - _Glossiness: 0.5 - _GlossyReflections: 1 - - _MaxDist: 256 - - _MaxSteps: 219.31 + - _MaxDist: 40 + - _MaxSteps: 128 - _Metallic: 0 - _Mode: 0 - _OcclusionStrength: 1 @@ -72,7 +72,7 @@ Material: - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _SurfDist: 0.001 + - _SurfDist: 0.01 - _UVSec: 0 - _ZWrite: 1 m_Colors: diff --git a/Assets/test/spinny.mat.meta b/Assets/test/FleshCube.mat.meta similarity index 100% rename from Assets/test/spinny.mat.meta rename to Assets/test/FleshCube.mat.meta diff --git a/Assets/test/Demo3.shader b/Assets/test/FleshCube.shader similarity index 82% rename from Assets/test/Demo3.shader rename to Assets/test/FleshCube.shader index 5c78b28..65c2f1c 100644 --- a/Assets/test/Demo3.shader +++ b/Assets/test/FleshCube.shader @@ -1,4 +1,4 @@ -Shader "Demo/pulsating" +Shader "RayMarching/FleshCube" { Properties { @@ -26,7 +26,7 @@ // #define USE_WORLD_SPACE #define DYNAMIC_QUALITY #define USE_REFLECTIONS - // #define CONSTRAIN_TO_MESH + #define CONSTRAIN_TO_MESH #define MAX_REFLECTIONS 1 #include "RayMarchLib.cginc" @@ -58,7 +58,12 @@ o = sdfAdd(p, o, sdfSphere(p, 6 + bias*3, mRed), 5); // o = sdfInter(p, o, sdfSphere(p, 50, mat(0.04, 0.005, 0.035)), 1.1); - o = sdfInter(p, o, sdfBox(p, 20, mRed)); + sdfData gyroid = o; + o = sdfAdd(p, + sdfInter(p, gyroid, sdfBox(p, 30, mRed)), + sdfSub(p, gyroid, sdfBox(p, 30, mRed)) + ); + // o = p, o, sdfBox(p, 20, mRed)); //sdfData bobby = sdfSphere(p, 51, col(0.5, 0.25, 0.001)); //bobby = sdfAdd(p, bobby, sdfSphere(p, 50.5, col(.5,.01,.01))); //bobby = sdfSub(p, bobby, sdfSphere(p, 50)); @@ -71,19 +76,22 @@ { float3 vSunDir = normalize(_SunPos); + float4 fogCol = col(0.2, .05, 0.001); + if (ray.bMissed) { - return 0.1; + // discard; + return fogCol; } fixed4 col = 0; - col = ray.mat.col * lightSun(ray.vNorm, vSunDir, col(5, 2, 0.1)); + col += ray.mat.col * lightSun(ray.vNorm, vSunDir, col(5, 2, 0.1)); col += ray.mat.col * lightSky(ray.vNorm, 1); col *= lightAO(ray.vHit, ray.vNorm, 0.05); col = pow(col, 0.7); - //col = lightFog(col, col(0.3, .17, 0.001), ray.dist, 0, 48); + col = lightFog(col, fogCol, ray.dist, 0.5, 16); return col; } ENDCG diff --git a/Assets/test/Demo3.shader.meta b/Assets/test/FleshCube.shader.meta similarity index 100% rename from Assets/test/Demo3.shader.meta rename to Assets/test/FleshCube.shader.meta diff --git a/Assets/test/Spinny.mat b/Assets/test/Spinny.mat new file mode 100644 index 0000000..70ec8ce --- /dev/null +++ b/Assets/test/Spinny.mat @@ -0,0 +1,81 @@ +%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: Spinny + m_Shader: {fileID: 4800000, guid: d83b23d955f9dc5739d0827cd507a63e, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _MaxDist: 400 + - _MaxSteps: 128 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SurfDist: 0.001 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SunPos: {r: 8, g: 4, b: 2, a: 1} diff --git a/Assets/test/Spinny.mat.meta b/Assets/test/Spinny.mat.meta new file mode 100644 index 0000000..7277249 --- /dev/null +++ b/Assets/test/Spinny.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c5afce7a29c155681939e1ad4f96dc18 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/test/TestProps.unity b/Assets/test/TestProps.unity index 91e5136..ac6d800 100644 --- a/Assets/test/TestProps.unity +++ b/Assets/test/TestProps.unity @@ -417,6 +417,154 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &627535768 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 627535775} + - component: {fileID: 627535774} + - component: {fileID: 627535773} + - component: {fileID: 627535772} + - component: {fileID: 627535771} + - component: {fileID: 627535770} + - component: {fileID: 627535769} + m_Layer: 0 + m_Name: Spinny + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &627535769 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627535768} + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 20, y: 20, z: 20} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &627535770 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627535768} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 990f6f4efb7f4ec98ad99f6dff1bc6f6, type: 3} + m_Name: + m_EditorClassIdentifier: + type: 3 + objectId: 267a3820-e773-4d80-aa35-8f7551bc813a +--- !u!114 &627535771 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627535768} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a37fd8d654d5c2840a0ab3a5ad65a5ae, type: 3} + m_Name: + m_EditorClassIdentifier: + spawnHeight: 0 + useAdditionalValues: 0 + syncValues: [] + propPrivacy: 1 + subSyncs: [] + spawnableType: 0 + preGeneratedInstanceId: +--- !u!114 &627535772 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627535768} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 12974925555b471580cacf5d2d5fa9e3, type: 3} + m_Name: + m_EditorClassIdentifier: + gripType: 1 + gripOrigin: {fileID: 0} + disallowTheft: 0 + maximumGrabDistance: 0 + snappingReferences: [] + autoHold: 0 + ikReference: {fileID: 0} +--- !u!23 &627535773 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627535768} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c5afce7a29c155681939e1ad4f96dc18, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &627535774 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627535768} + m_Mesh: {fileID: -5495902117074765545, guid: 85702488cb92b9182a44437d143f9fc4, type: 3} +--- !u!4 &627535775 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 627535768} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1, y: 0, z: -3} + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &766214507 GameObject: m_ObjectHideFlags: 0 @@ -673,7 +821,7 @@ GameObject: - component: {fileID: 889393502} - component: {fileID: 889393505} m_Layer: 0 - m_Name: Sphere (1) + m_Name: FleshCube m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0