port flesh cube to libgarbage, update bocs, create glitch sphere
This commit is contained in:
parent
e3bf2e7770
commit
59f8cdd8dd
12 changed files with 782 additions and 67 deletions
|
@ -122,6 +122,162 @@ NavMeshSettings:
|
|||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &34125273
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 34125280}
|
||||
- component: {fileID: 34125279}
|
||||
- component: {fileID: 34125278}
|
||||
- component: {fileID: 34125277}
|
||||
- component: {fileID: 34125276}
|
||||
- component: {fileID: 34125275}
|
||||
- component: {fileID: 34125274}
|
||||
m_Layer: 0
|
||||
m_Name: GlitchSphere
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &34125274
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34125273}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 990f6f4efb7f4ec98ad99f6dff1bc6f6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
type: 3
|
||||
objectId: 94d9cfa6-b350-4290-abeb-7b1692bf2c6e
|
||||
randomNum: 60695246
|
||||
unityVersion: 2021.3.41f1
|
||||
cckVersion: 3.10:132
|
||||
--- !u!114 &34125275
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34125273}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a37fd8d654d5c2840a0ab3a5ad65a5ae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spawnHeight: 0.55
|
||||
useAdditionalValues: 0
|
||||
syncValues: []
|
||||
propPrivacy: 1
|
||||
subSyncs: []
|
||||
spawnableType: 0
|
||||
preGeneratedInstanceId:
|
||||
--- !u!114 &34125276
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34125273}
|
||||
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
|
||||
updateWithPhysics: 1
|
||||
ikReference: {fileID: 0}
|
||||
--- !u!65 &34125277
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34125273}
|
||||
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 &34125278
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34125273}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: eae55803092aaf7e1801b72b6663512b, 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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &34125279
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34125273}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &34125280
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 34125273}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -1, y: 0, z: -2}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 13
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &244150317
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1459,7 +1615,7 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
type: 3
|
||||
objectId: e51ea4c1-d42c-4790-91a1-78d2bf6fef59
|
||||
randomNum: 81522144
|
||||
randomNum: 42815474
|
||||
unityVersion: 2021.3.41f1
|
||||
cckVersion: 3.10:132
|
||||
--- !u!114 &853608961
|
||||
|
@ -1572,7 +1728,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 853608959}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -2}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
|
@ -2570,7 +2726,7 @@ Camera:
|
|||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_BackGroundColor: {r: 0.1792453, g: 0.1792453, b: 0.1792453, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
|
@ -2611,7 +2767,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1500710831}
|
||||
m_LocalRotation: {x: 0.30261943, y: 0, z: 0, w: 0.95311147}
|
||||
m_LocalPosition: {x: 0, y: 0.52, z: -0.92}
|
||||
m_LocalPosition: {x: 0, y: 0.8, z: -1.2}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
|
@ -2917,6 +3073,162 @@ MonoBehaviour:
|
|||
maxValue: 1
|
||||
updateMethod: 1
|
||||
sampleDirection: 4
|
||||
--- !u!1 &2089314929
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2089314936}
|
||||
- component: {fileID: 2089314935}
|
||||
- component: {fileID: 2089314934}
|
||||
- component: {fileID: 2089314933}
|
||||
- component: {fileID: 2089314932}
|
||||
- component: {fileID: 2089314931}
|
||||
- component: {fileID: 2089314930}
|
||||
m_Layer: 0
|
||||
m_Name: FleshCube
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &2089314930
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2089314929}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 990f6f4efb7f4ec98ad99f6dff1bc6f6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
type: 3
|
||||
objectId: 4e7f3dcf-e925-473a-89e2-dfe6cfe7eac5
|
||||
randomNum: 77268264
|
||||
unityVersion: 2021.3.41f1
|
||||
cckVersion: 3.10:132
|
||||
--- !u!114 &2089314931
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2089314929}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a37fd8d654d5c2840a0ab3a5ad65a5ae, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
spawnHeight: 0.55
|
||||
useAdditionalValues: 0
|
||||
syncValues: []
|
||||
propPrivacy: 1
|
||||
subSyncs: []
|
||||
spawnableType: 0
|
||||
preGeneratedInstanceId:
|
||||
--- !u!114 &2089314932
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2089314929}
|
||||
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
|
||||
updateWithPhysics: 1
|
||||
ikReference: {fileID: 0}
|
||||
--- !u!65 &2089314933
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2089314929}
|
||||
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 &2089314934
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2089314929}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a58263543abc75cc7a798853827cd868, 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
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &2089314935
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2089314929}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!4 &2089314936
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2089314929}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -0.005, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 14
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2089960365
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -47,11 +47,18 @@ Shader "CrispyPin/Bocs"
|
|||
return s * a + (1 - s) * b;
|
||||
}
|
||||
|
||||
SurfacePoint Boc(float3 p, float t) {
|
||||
Material gridtexture(float3 p) {
|
||||
return mat(checkers(p + BOX_SIZE/2 , 0.35, 0.45, BOX_SIZE));
|
||||
}
|
||||
|
||||
SurfacePoint Boc(float3 p, float t, float3 grid_transform = float3(1,1,1)) {
|
||||
float x = smoothstep(0, .5, fmod(t, 4) - .5) * RADIUS;
|
||||
float z = smoothstep(1, .5, fmod(t, 4) - 2) * RADIUS;
|
||||
float y = smoothstep(.25, .75, abs(fmod(t - .75, 2) - 1)) * BOX_SIZE * 2 - BOX_SIZE / 2;
|
||||
return mBox(p - float3(x,y,z), BOX_SIZE, mat(.05, .8, .8));
|
||||
return mBox(p - float3(x,y,z), BOX_SIZE,
|
||||
// mat(.05, .8, .8)
|
||||
gridtexture((p - float3(x,y,z)) * grid_transform)
|
||||
);
|
||||
}
|
||||
|
||||
SurfacePoint main(float3 p) {
|
||||
|
@ -59,7 +66,7 @@ Shader "CrispyPin/Bocs"
|
|||
|
||||
// base
|
||||
const float base_width = BOX_SIZE * 6 - 0.01;
|
||||
d = mBox(p - float3(0,-.15,0), float3(base_width, .3, base_width), mat(checkers(p + BOX_SIZE/2 , 0.35, 0.45, BOX_SIZE )));
|
||||
d = mBox(p - float3(0,-.15,0), float3(base_width, .3, base_width), gridtexture(p));
|
||||
float t = _Time.y * SPEED;
|
||||
|
||||
// holes
|
||||
|
@ -74,12 +81,14 @@ Shader "CrispyPin/Bocs"
|
|||
float3 p2 = p * float3(-1,1,-1);
|
||||
d = qUnion(d, Boc(p2, t));
|
||||
d = qUnion(d, Boc(p2, t + 2));
|
||||
float3 p3 = p.zyx * float3(-1,1,1);
|
||||
d = qUnion(d, Boc(p3, t));
|
||||
d = qUnion(d, Boc(p3, t + 2));
|
||||
float3 p4 = p.zyx * float3(1,1,-1);
|
||||
d = qUnion(d, Boc(p4, t));
|
||||
d = qUnion(d, Boc(p4, t + 2));
|
||||
const float3 flip_x = float3(-1,1,1);
|
||||
const float3 flip_z = float3(1,1,-1);
|
||||
float3 p3 = p.zyx * flip_x;
|
||||
d = qUnion(d, Boc(p3, t, flip_x));
|
||||
d = qUnion(d, Boc(p3, t + 2, flip_x));
|
||||
float3 p4 = p.zyx * flip_z;
|
||||
d = qUnion(d, Boc(p4, t, flip_x));
|
||||
d = qUnion(d, Boc(p4, t + 2, flip_x));
|
||||
|
||||
return d;
|
||||
}
|
||||
|
|
84
Assets/raymarched/flesh_cube.mat
Normal file
84
Assets/raymarched/flesh_cube.mat
Normal file
|
@ -0,0 +1,84 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: flesh_cube
|
||||
m_Shader: {fileID: 4800000, guid: 39dabd8653500dc208f1e8018c20dbce, type: 3}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
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_Ints:
|
||||
- _MaxSteps: 128
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _MaxDist: 128
|
||||
- _MaxSteps: 128
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SurfDist: 0.01
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_BuildTextureStacks: []
|
8
Assets/raymarched/flesh_cube.mat.meta
Normal file
8
Assets/raymarched/flesh_cube.mat.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a58263543abc75cc7a798853827cd868
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
67
Assets/raymarched/flesh_cube.shader
Normal file
67
Assets/raymarched/flesh_cube.shader
Normal file
|
@ -0,0 +1,67 @@
|
|||
Shader "CrispyPin/FleshCube2"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Header(Raymarcher Properties)]
|
||||
_MaxSteps ("Max steps", Integer) = 128
|
||||
_MaxDist ("Max distance", Float) = 128
|
||||
_SurfDist ("Surface distance threshold", Range(.0001, .05)) = .001
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Cull Front
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
int _MaxSteps;
|
||||
float _MaxDist;
|
||||
float _SurfDist;
|
||||
#define MAX_STEPS _MaxSteps
|
||||
#define MAX_DIST _MaxDist
|
||||
#define SURF_DIST _SurfDist
|
||||
|
||||
|
||||
#define SCENE_FN main
|
||||
//#define LIGHT_FN lighting
|
||||
|
||||
#define SCENE_SCALE 0.04
|
||||
#define REFLECTIONS 2
|
||||
|
||||
#define DISCARD_ON_MISS
|
||||
|
||||
#include "lib/libgarbage.cginc"
|
||||
|
||||
#define SPEED 1.5
|
||||
|
||||
SurfacePoint main(float3 p) {
|
||||
Material mRed = mat(.95, 0.1, 0.1, 0.4);
|
||||
Material mCut = mat(.7, 0.2, 0.1, 0.4);
|
||||
|
||||
SurfacePoint d;
|
||||
|
||||
// base
|
||||
float3 bias = -pow(sin(_Time*60 + p.y*0.1), 8)*.5+1.3;
|
||||
d = mGyroid(p, .5, bias, 0.2, mCut);
|
||||
|
||||
float3 gp = p + sin(_Time + p*0.1);
|
||||
d.dist -= sdGyroid(gp, 1.63, .5, 0.2) * 0.3;
|
||||
d.dist += sdGyroid(gp, 3.327, 0, 0.2) * 0.1;
|
||||
d.dist += sdGyroid(gp, 7.351, .5, 0.2) * 0.1;
|
||||
d.dist -= sdGyroid(gp, 17.351, .5, 0.2) * 0.05;
|
||||
d.dist -= sdGyroid(gp, 23.521, .2, 0.2) * 0.05;
|
||||
d = qUnion(d, mSphere(p, 6 + bias*3, mRed), 5);
|
||||
|
||||
d = qIntersect(d, mBox(p, 25, mRed));
|
||||
|
||||
return d;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
9
Assets/raymarched/flesh_cube.shader.meta
Normal file
9
Assets/raymarched/flesh_cube.shader.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 39dabd8653500dc208f1e8018c20dbce
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
84
Assets/raymarched/glitch_sphere.mat
Normal file
84
Assets/raymarched/glitch_sphere.mat
Normal file
|
@ -0,0 +1,84 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: glitch_sphere
|
||||
m_Shader: {fileID: 4800000, guid: b7dfe294c2ddc5bc59d1744ba8ffc3f7, type: 3}
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
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_Ints:
|
||||
- _MaxSteps: 128
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _MaxDist: 32
|
||||
- _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}
|
||||
m_BuildTextureStacks: []
|
8
Assets/raymarched/glitch_sphere.mat.meta
Normal file
8
Assets/raymarched/glitch_sphere.mat.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eae55803092aaf7e1801b72b6663512b
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
91
Assets/raymarched/glitch_sphere.shader
Normal file
91
Assets/raymarched/glitch_sphere.shader
Normal file
|
@ -0,0 +1,91 @@
|
|||
Shader "CrispyPin/Spheres"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Header(Raymarcher Properties)]
|
||||
_MaxSteps ("Max steps", Integer) = 128
|
||||
_MaxDist ("Max distance", Float) = 128
|
||||
_SurfDist ("Surface distance threshold", Range(.0001, .05)) = .001
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Cull Front
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
int _MaxSteps;
|
||||
float _MaxDist;
|
||||
float _SurfDist;
|
||||
#define MAX_STEPS _MaxSteps
|
||||
#define MAX_DIST _MaxDist
|
||||
#define SURF_DIST _SurfDist
|
||||
|
||||
|
||||
#define SCENE_FN main
|
||||
#define LIGHT_FN lighting
|
||||
|
||||
// #define SCENE_SCALE 1
|
||||
|
||||
#define DISCARD_ON_MISS
|
||||
|
||||
#include "lib/libgarbage.cginc"
|
||||
|
||||
#define SPEED 1.5
|
||||
#define BOX_SIZE .15
|
||||
#define RADIUS BOX_SIZE*2
|
||||
|
||||
float3 checkers(float3 p, float3 a, float3 b, float2 size) {
|
||||
float2 q = p.xz / size;
|
||||
q = int2(abs(q) + .5);
|
||||
int s = ((q.x + q.y) % 2);
|
||||
return s * a + (1 - s) * b;
|
||||
}
|
||||
|
||||
SurfacePoint main(float3 p) {
|
||||
SurfacePoint d;
|
||||
const float COUNT_Y = 20;
|
||||
const float COUNT_R = 20;
|
||||
|
||||
float lat = asin(p.y) * COUNT_Y;
|
||||
float long = atan2(p.z, p.x) * COUNT_R + _Time.y * 16;
|
||||
float r = length(p);
|
||||
// float grid = (1-abs(smoothstep(0, 0.5, sin(long))-0.5))*2 - 1;
|
||||
float grid = (1-abs(smoothstep(0, 0.5, sin(lat))-0.5))*2 - 1;
|
||||
d = mSphere(p, 0.21,
|
||||
mat(abs(rotY(p, _Time.y*-4)/0.21))
|
||||
// mat(lat, long, grid)
|
||||
);
|
||||
|
||||
// float long
|
||||
lat = floor(lat+0.5)-0.5;
|
||||
long = floor(long+0.5)-0.5;
|
||||
float sx = sin(long);
|
||||
float sz = cos(long);
|
||||
float sy = sin(lat);
|
||||
d = qUnion(d, mSphere(p - normalize(float3(sx, sy, sz))*r, 0.1));
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
float3 lighting(Ray ray) {
|
||||
float3 sun_dir = normalize(float3(2, 1, -1));
|
||||
if (ray.missed) {
|
||||
return lRenderSky(ray.dir, sun_dir);
|
||||
}
|
||||
float3 light = lSun(ray.normal, sun_dir);
|
||||
// light *= lShadow(ray.hit_pos + ray.normal * SURF_DIST, sun_dir, 50);
|
||||
light += lSky(ray.normal)*5;
|
||||
return 1;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
9
Assets/raymarched/glitch_sphere.shader.meta
Normal file
9
Assets/raymarched/glitch_sphere.shader.meta
Normal file
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b7dfe294c2ddc5bc59d1744ba8ffc3f7
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -104,7 +104,7 @@ struct Material {
|
|||
};
|
||||
|
||||
#define DEFAULT_MAT {float3(1, 1, 1), 0}
|
||||
Material mat(float3 col = float3(1, 1,1 ), float gloss = 0) {
|
||||
Material mat(float3 col = float3(1, 1, 1), float gloss = 0) {
|
||||
Material m;
|
||||
m.col = col;
|
||||
m.gloss = gloss;
|
||||
|
@ -113,6 +113,9 @@ Material mat(float3 col = float3(1, 1,1 ), float gloss = 0) {
|
|||
Material mat(float r, float g, float b) {
|
||||
return mat(float3(r, g, b));
|
||||
}
|
||||
Material mat(float r, float g, float b, float gloss) {
|
||||
return mat(float3(r, g, b), gloss);
|
||||
}
|
||||
|
||||
struct SurfacePoint {
|
||||
float dist;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue