diff --git a/Assets/Samples/CubeWorld.meta b/Assets/Samples/CubeWorld.meta new file mode 100644 index 00000000..1ed6e378 --- /dev/null +++ b/Assets/Samples/CubeWorld.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd8804523cb9e5f4796d4a3c92e0af18 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art.meta b/Assets/Samples/CubeWorld/Art.meta new file mode 100644 index 00000000..91d8ffeb --- /dev/null +++ b/Assets/Samples/CubeWorld/Art.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2cfcae6c371ae8b449018defbe9b747a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Character_Male_01.controller b/Assets/Samples/CubeWorld/Art/Character_Male_01.controller new file mode 100644 index 00000000..dd3de79d --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Character_Male_01.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-9147745103464217777 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CharacterArmature|Run + m_Speed: 0.75 + 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: 1395189703230314720, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Character_Male_01 + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 2497091716291060345} + 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} +--- !u!1107 &2497091716291060345 +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: -9147745103464217777} + m_Position: {x: 340, y: 90, 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: -9147745103464217777} diff --git a/Assets/Samples/CubeWorld/Art/Character_Male_01.controller.meta b/Assets/Samples/CubeWorld/Art/Character_Male_01.controller.meta new file mode 100644 index 00000000..fb717daa --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Character_Male_01.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 99f7b1c02b721284dbf2c5ae2aebacb1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Cube World.meta b/Assets/Samples/CubeWorld/Art/Cube World.meta new file mode 100644 index 00000000..9f84afb0 --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a475307dff912a74eb603d1c33948fcb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Atlas.mat b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.mat new file mode 100644 index 00000000..84775944 --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.mat @@ -0,0 +1,86 @@ +%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: Atlas + m_Shader: {fileID: 4800000, guid: 66d261cceb43446dbdd99389a7ed8411, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTexture: + m_Texture: {fileID: 2800000, guid: bfa3e04c6ca3b664b9af8916c46396f7, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatcapTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClipThreshold: 0.5 + - _AlphaClipping: 0 + - _BlendDst: 0 + - _BlendMode: 0 + - _BlendSrc: 1 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _ForwardStencilComp: 0 + - _ForwardStencilPass: 0 + - _ForwardStencilRef: 0 + - _ForwardStencilWriteMask: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _MatcapBlend: 1 + - _MatcapMode: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OutlinesStencilLayer: 0 + - _OverrideRamp: 0 + - _OverrideRamp_RimSmoothness: 0.1 + - _OverrideRamp_RimThreshold: 0.5 + - _OverrideRamp_Smoothness: 0.083 + - _OverrideRamp_SpecularSmoothness: 0.005 + - _OverrideRamp_SpecularThreshold: 0.995 + - _OverrideRamp_Threshold: 0 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _ReceiveBlobShadows: 0 + - _RenderFace: 2 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SpecularSizeOffset: 0 + - _SrcBlend: 1 + - _SurfaceType: 0 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MatcapTint: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 0.75} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Atlas.mat.meta b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.mat.meta new file mode 100644 index 00000000..47615387 --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f9df993833a4c3a439c1830f2db9f8e1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Atlas.png b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.png new file mode 100644 index 00000000..1ba36d43 Binary files /dev/null and b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.png differ diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Atlas.png.meta b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.png.meta new file mode 100644 index 00000000..9a1a519e --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World/Atlas.png.meta @@ -0,0 +1,159 @@ +fileFormatVersion: 2 +guid: bfa3e04c6ca3b664b9af8916c46396f7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Character_Male_1.fbx b/Assets/Samples/CubeWorld/Art/Cube World/Character_Male_1.fbx new file mode 100644 index 00000000..3cb9674f Binary files /dev/null and b/Assets/Samples/CubeWorld/Art/Cube World/Character_Male_1.fbx differ diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Character_Male_1.fbx.meta b/Assets/Samples/CubeWorld/Art/Cube World/Character_Male_1.fbx.meta new file mode 100644 index 00000000..06bfc8a7 --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World/Character_Male_1.fbx.meta @@ -0,0 +1,808 @@ +fileFormatVersion: 2 +guid: 584d77aca4a74a1459d29d9114c6861e +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Atlas + second: {fileID: 2100000, guid: f9df993833a4c3a439c1830f2db9f8e1, type: 2} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 1 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 3 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: CharacterArmature|Death + takeName: CharacterArmature|Death + internalID: 4447012609936615250 + firstFrame: 0 + lastFrame: 23 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Duck + takeName: CharacterArmature|Duck + internalID: -5094259538617418458 + firstFrame: 0 + lastFrame: 50 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|HitReact + takeName: CharacterArmature|HitReact + internalID: -3663672522963054737 + firstFrame: 0 + lastFrame: 18 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Idle + takeName: CharacterArmature|Idle + internalID: 9061338213343248790 + firstFrame: 0 + lastFrame: 50 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Idle_Attack + takeName: CharacterArmature|Idle_Attack + internalID: 5380677193788713916 + firstFrame: 0 + lastFrame: 15 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Idle_Hold + takeName: CharacterArmature|Idle_Hold + internalID: -4849695793933187767 + firstFrame: 0 + lastFrame: 50 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Jump + takeName: CharacterArmature|Jump + internalID: 140615187318258251 + firstFrame: 0 + lastFrame: 11 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Jump_Idle + takeName: CharacterArmature|Jump_Idle + internalID: 2988316107456685593 + firstFrame: 0 + lastFrame: 15 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Jump_Land + takeName: CharacterArmature|Jump_Land + internalID: -7326212992105015716 + firstFrame: 0 + lastFrame: 11 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|No + takeName: CharacterArmature|No + internalID: 380537578229758779 + firstFrame: 0 + lastFrame: 50 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Punch + takeName: CharacterArmature|Punch + internalID: -4592842328519117816 + firstFrame: 0 + lastFrame: 26 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Run + takeName: CharacterArmature|Run + internalID: 1395189703230314720 + firstFrame: 0 + lastFrame: 17 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Run_Attack + takeName: CharacterArmature|Run_Attack + internalID: -950862550323916170 + firstFrame: 0 + lastFrame: 17 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Run_Hold + takeName: CharacterArmature|Run_Hold + internalID: -8386403743654666343 + firstFrame: 0 + lastFrame: 17 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Walk + takeName: CharacterArmature|Walk + internalID: -5599002979973759676 + firstFrame: 0 + lastFrame: 30 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Walk_Hold + takeName: CharacterArmature|Walk_Hold + internalID: 6952535952849614664 + firstFrame: 0 + lastFrame: 30 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Wave + takeName: CharacterArmature|Wave + internalID: -9021793991225143758 + firstFrame: 0 + lastFrame: 50 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: CharacterArmature|Yes + takeName: CharacterArmature|Yes + internalID: -8174297497461417188 + firstFrame: 0 + lastFrame: 50 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 180 + normalImportMode: 1 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 2 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: + - name: Character_Male_1(Clone) + parentName: + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CharacterArmature + parentName: Character_Male_1(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + scale: {x: 100, y: 100, z: 100} + - name: Root + parentName: CharacterArmature + position: {x: 0.000013114691, y: 0.0000011468419, z: -0.000024153696} + rotation: {x: 0.7071068, y: -0.00000016858745, z: -0.00000016858745, w: 0.7071068} + scale: {x: 1, y: 0.99999976, z: 0.99999976} + - name: Foot.L + parentName: Root + position: {x: -0.0025258611, y: 0.00024662883, z: -0.0010843163} + rotation: {x: -0.000011782727, y: 0.70295185, z: 0.7112375, w: -0.000012036241} + scale: {x: 0.99999976, y: 0.99999994, z: 0.99999994} + - name: Foot.L_end + parentName: Foot.L + position: {x: -0, y: 0.0010722862, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Body + parentName: Root + position: {x: -0.00002153011, y: 0.007293054, z: 0.0010147978} + rotation: {x: -0, y: -0.00000011920923, z: 1.4210855e-14, w: 1} + scale: {x: 1, y: 1.0000002, z: 1.0000002} + - name: Hips + parentName: Body + position: {x: 0.000014798753, y: -0.0011367106, z: -0.0012841139} + rotation: {x: -0.055439644, y: 0.00000026726389, z: 0.000000024844816, w: 0.998462} + scale: {x: 1, y: 0.9999998, z: 0.9999999} + - name: Abdomen + parentName: Hips + position: {x: 4.1466385e-13, y: 0.002879264, z: -7.56543e-11} + rotation: {x: 0.12596491, y: -0.00000043454858, z: -0.00000007786981, w: 0.9920348} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: Torso + parentName: Abdomen + position: {x: -1.8117063e-13, y: 0.0016995703, z: 1.7952341e-10} + rotation: {x: -0.016036926, y: 0.0000008322253, z: 0.0000000035738803, w: 0.9998715} + scale: {x: 1, y: 0.99999976, z: 0.9999998} + - name: Neck + parentName: Torso + position: {x: 3.2450485e-13, y: 0.002909483, z: 1.5289733e-10} + rotation: {x: -0.054767307, y: -0.00000067699915, z: 0.000000003817503, w: 0.9984992} + scale: {x: 1, y: 1.0000001, z: 1} + - name: Head + parentName: Neck + position: {x: 7.9424466e-13, y: 0.002062215, z: -1.5378247e-10} + rotation: {x: -0, y: 0.00027547532, z: -2.0008878e-11, w: 1} + scale: {x: 0.9999999, y: 0.9999998, z: 1} + - name: Head_end + parentName: Head + position: {x: -0, y: 0.006537089, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Shoulder.L + parentName: Torso + position: {x: -0.0033640428, y: -0.00034133357, z: 0.00026208174} + rotation: {x: -0.044307627, y: 0.032189265, z: 0.5868908, w: 0.8078118} + scale: {x: 0.9999998, y: 1.0000001, z: 0.99999994} + - name: UpperArm.L + parentName: Shoulder.L + position: {x: -1.5599652e-10, y: 0.0026827306, z: -1.3038516e-10} + rotation: {x: 0.14091474, y: -0.71103686, z: -0.12655093, w: -0.6771666} + scale: {x: 1, y: 1, z: 1.0000004} + - name: LowerArm.L + parentName: UpperArm.L + position: {x: -1.4901161e-10, y: 0.0037215813, z: 2.712477e-10} + rotation: {x: -0.0019426108, y: 0.03192256, z: -0.031908296, w: -0.9989791} + scale: {x: 1.0000002, y: 1.0000001, z: 1.0000001} + - name: Fist.L + parentName: LowerArm.L + position: {x: -5.2154064e-10, y: 0.0043135495, z: 9.872019e-10} + rotation: {x: 0.01239951, y: -0.018209426, z: 0.008240887, w: 0.99972343} + scale: {x: 1.0000005, y: 1.0000006, z: 1} + - name: Fist.L_end + parentName: Fist.L + position: {x: -0, y: 0.0026207783, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Shoulder.R + parentName: Torso + position: {x: 0.0033512749, y: -0.0003413324, z: 0.00026208552} + rotation: {x: -0.044307306, y: -0.032189757, z: -0.58689046, w: 0.8078121} + scale: {x: 1, y: 0.9999998, z: 1} + - name: UpperArm.R + parentName: Shoulder.R + position: {x: 7.52043e-10, y: 0.002682731, z: 1.3038516e-10} + rotation: {x: 0.14091523, y: 0.7110368, z: 0.12655106, w: -0.6771665} + scale: {x: 1.0000005, y: 1.0000002, z: 1.0000008} + - name: LowerArm.R + parentName: UpperArm.R + position: {x: -0, y: 0.0037215813, z: -2.7765054e-10} + rotation: {x: 0.0019425957, y: 0.03192285, z: -0.031908568, w: 0.998979} + scale: {x: 1, y: 1.0000004, z: 0.9999999} + - name: Fist.R + parentName: LowerArm.R + position: {x: -2.2351741e-10, y: 0.00431355, z: 3.352761e-10} + rotation: {x: 0.012400177, y: 0.018209439, z: -0.008240827, w: 0.9997234} + scale: {x: 0.9999998, y: 1.0000001, z: 1.0000002} + - name: Fist.R_end + parentName: Fist.R + position: {x: -0, y: 0.0026207783, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: UpperLeg.L + parentName: Body + position: {x: -0.0024019044, y: -0.0018387816, z: -0.0020146908} + rotation: {x: 0.99490196, y: -0.014494539, z: 0.00020899033, w: 0.09979958} + scale: {x: 1, y: 0.9999987, z: 0.99999636} + - name: LowerLeg.L + parentName: UpperLeg.L + position: {x: -9.200448e-11, y: 0.0030872738, z: 1.0710209e-10} + rotation: {x: 0.19693027, y: -0.0016305324, z: -0.014404061, w: 0.9803103} + scale: {x: 0.9999998, y: 1.000002, z: 1.0000012} + - name: LowerLeg.L_end + parentName: LowerLeg.L + position: {x: -0, y: 0.003570853, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: UpperLeg.R + parentName: Body + position: {x: 0.0024187332, y: -0.0018387816, z: -0.0020146943} + rotation: {x: 0.99490196, y: 0.014494637, z: -0.00020985058, w: 0.09979957} + scale: {x: 0.9999999, y: 0.9999993, z: 0.9999985} + - name: LowerLeg.R + parentName: UpperLeg.R + position: {x: 2.9958755e-10, y: 0.0030872747, z: 1.862645e-10} + rotation: {x: 0.19693017, y: 0.0016305184, z: 0.014404088, w: 0.9803103} + scale: {x: 1.0000001, y: 1.0000013, z: 1.0000012} + - name: LowerLeg.R_end + parentName: LowerLeg.R + position: {x: -0, y: 0.003570853, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: PoleTarget.L + parentName: Root + position: {x: -0.0024915545, y: 0.0024852224, z: 0.009631469} + rotation: {x: -0, y: -0.00000011920923, z: 1.4210855e-14, w: 1} + scale: {x: 1, y: 1.0000002, z: 1.0000002} + - name: PoleTarget.L_end + parentName: PoleTarget.L + position: {x: -0, y: 0.0027367168, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Foot.R + parentName: Root + position: {x: 0.0024996304, y: 0.00024662883, z: -0.0010843186} + rotation: {x: 0.00001205071, y: 0.70295185, z: 0.7112375, w: 0.000011617247} + scale: {x: 0.99999976, y: 0.99999994, z: 0.99999994} + - name: Foot.R_end + parentName: Foot.R + position: {x: -0, y: 0.0010722862, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: PoleTarget.R + parentName: Root + position: {x: 0.0024653345, y: 0.0024852224, z: 0.009631467} + rotation: {x: -0, y: 0.00000059604656, z: -5.684342e-14, w: 1} + scale: {x: 1, y: 1.0000002, z: 1.0000002} + - name: PoleTarget.R_end + parentName: PoleTarget.R + position: {x: -0, y: 0.0027367168, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character + parentName: Character_Male_1(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + scale: {x: 100, y: 100, z: 100} + 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: 1 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 1 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Plant_2.fbx b/Assets/Samples/CubeWorld/Art/Cube World/Plant_2.fbx new file mode 100644 index 00000000..a6ba98d9 Binary files /dev/null and b/Assets/Samples/CubeWorld/Art/Cube World/Plant_2.fbx differ diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Plant_2.fbx.meta b/Assets/Samples/CubeWorld/Art/Cube World/Plant_2.fbx.meta new file mode 100644 index 00000000..3a20118a --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World/Plant_2.fbx.meta @@ -0,0 +1,111 @@ +fileFormatVersion: 2 +guid: 20cbf757bdd31284ab42cea327c8ce71 +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Atlas + second: {fileID: 2100000, guid: f9df993833a4c3a439c1830f2db9f8e1, type: 2} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 1 + 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 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 180 + normalImportMode: 1 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 2 + 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 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Skeleton.fbx b/Assets/Samples/CubeWorld/Art/Cube World/Skeleton.fbx new file mode 100644 index 00000000..58a18610 Binary files /dev/null and b/Assets/Samples/CubeWorld/Art/Cube World/Skeleton.fbx differ diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Skeleton.fbx.meta b/Assets/Samples/CubeWorld/Art/Cube World/Skeleton.fbx.meta new file mode 100644 index 00000000..f1bf3cd2 --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World/Skeleton.fbx.meta @@ -0,0 +1,314 @@ +fileFormatVersion: 2 +guid: 7019161da462f364dbd6bf06ee5a863f +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Atlas + second: {fileID: 2100000, guid: f9df993833a4c3a439c1830f2db9f8e1, type: 2} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 1 + 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: + - serializedVersion: 16 + name: EnemyArmature|Attack + takeName: EnemyArmature|Attack + internalID: 6753285312757688217 + firstFrame: 0 + lastFrame: 15 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: EnemyArmature|Death + takeName: EnemyArmature|Death + internalID: 6576022200658911685 + firstFrame: 0 + lastFrame: 19 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: EnemyArmature|HitRecieve + takeName: EnemyArmature|HitRecieve + internalID: 7551886295184783850 + firstFrame: 0 + lastFrame: 7 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: EnemyArmature|Idle + takeName: EnemyArmature|Idle + internalID: 4867856843293186273 + firstFrame: 0 + lastFrame: 100 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: EnemyArmature|Jump + takeName: EnemyArmature|Jump + internalID: 5119388739051041813 + firstFrame: 0 + lastFrame: 8 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: EnemyArmature|Run + takeName: EnemyArmature|Run + internalID: 60244092366004141 + firstFrame: 0 + lastFrame: 20 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: EnemyArmature|Walk + takeName: EnemyArmature|Walk + internalID: -4229988164995517179 + firstFrame: 0 + lastFrame: 60 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 0 + loopBlend: 0 + loopBlendOrientation: 0 + loopBlendPositionY: 0 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 180 + normalImportMode: 1 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 2 + 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: 1 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Tree_2.fbx b/Assets/Samples/CubeWorld/Art/Cube World/Tree_2.fbx new file mode 100644 index 00000000..e583baa9 Binary files /dev/null and b/Assets/Samples/CubeWorld/Art/Cube World/Tree_2.fbx differ diff --git a/Assets/Samples/CubeWorld/Art/Cube World/Tree_2.fbx.meta b/Assets/Samples/CubeWorld/Art/Cube World/Tree_2.fbx.meta new file mode 100644 index 00000000..b50cc7ee --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Cube World/Tree_2.fbx.meta @@ -0,0 +1,111 @@ +fileFormatVersion: 2 +guid: f33fbdf1bd7f08543bee4615cdfb249c +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Atlas + second: {fileID: 2100000, guid: f9df993833a4c3a439c1830f2db9f8e1, type: 2} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 1 + 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 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 180 + normalImportMode: 1 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 2 + 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 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Ground.mat b/Assets/Samples/CubeWorld/Art/Ground.mat new file mode 100644 index 00000000..2061991f --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Ground.mat @@ -0,0 +1,72 @@ +%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: Ground + m_Shader: {fileID: 4800000, guid: 6ec1afc7d53b4974ab764de8b09311f7, type: 3} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _MainTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatcapTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClipThreshold: 0.5 + - _AlphaClipping: 0 + - _BlendDst: 0 + - _BlendMode: 0 + - _BlendSrc: 1 + - _ForceDisableEnvironmentLight: 0 + - _ForceDisableFog: 0 + - _ForwardStencilComp: 0 + - _ForwardStencilPass: 0 + - _ForwardStencilRef: 0 + - _ForwardStencilWriteMask: 0 + - _MatcapBlend: 1 + - _MatcapMode: 0 + - _OutlinesStencilLayer: 0 + - _OverrideRamp: 0 + - _OverrideRamp_RimSmoothness: 0.1 + - _OverrideRamp_RimThreshold: 0.5 + - _OverrideRamp_Smoothness: 0.083 + - _OverrideRamp_SpecularSmoothness: 0.005 + - _OverrideRamp_SpecularThreshold: 0.995 + - _OverrideRamp_Threshold: 0 + - _QueueOffset: 0 + - _ReceiveBlobShadows: 0 + - _RenderFace: 2 + - _SpecularSizeOffset: 0 + - _SurfaceType: 0 + - _ZWrite: 1 + m_Colors: + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 0.5535911, g: 0.6320754, b: 0.24746348, a: 1} + - _MatcapTint: {r: 1, g: 1, b: 1, a: 1} + - _RimColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 0.75} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + m_BuildTextureStacks: [] diff --git a/Assets/Samples/CubeWorld/Art/Ground.mat.meta b/Assets/Samples/CubeWorld/Art/Ground.mat.meta new file mode 100644 index 00000000..6196b87a --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Ground.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e7020ea67d5d3542b3f89217a1da2ec +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Art/Skeleton.controller b/Assets/Samples/CubeWorld/Art/Skeleton.controller new file mode 100644 index 00000000..eaffbd2e --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Skeleton.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-9147745103464217777 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CharacterArmature|Run + m_Speed: 0.6 + 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: 60244092366004141, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Skeleton + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 2497091716291060345} + 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} +--- !u!1107 &2497091716291060345 +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: -9147745103464217777} + m_Position: {x: 340, y: 90, 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: -9147745103464217777} diff --git a/Assets/Samples/CubeWorld/Art/Skeleton.controller.meta b/Assets/Samples/CubeWorld/Art/Skeleton.controller.meta new file mode 100644 index 00000000..628a0168 --- /dev/null +++ b/Assets/Samples/CubeWorld/Art/Skeleton.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b3ca99fca2a0d6c4dae6d9ace2a97b1d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/CubeWorld -Lighting Settings.lighting b/Assets/Samples/CubeWorld/CubeWorld -Lighting Settings.lighting new file mode 100644 index 00000000..e598a921 --- /dev/null +++ b/Assets/Samples/CubeWorld/CubeWorld -Lighting Settings.lighting @@ -0,0 +1,64 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CubeWorld -Lighting Settings + serializedVersion: 4 + m_GIWorkflowMode: 1 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_LightmapCompression: 3 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 1 + m_PVREnvironmentMIS: 1 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_PVRTiledBaking: 0 diff --git a/Assets/Samples/CubeWorld/CubeWorld -Lighting Settings.lighting.meta b/Assets/Samples/CubeWorld/CubeWorld -Lighting Settings.lighting.meta new file mode 100644 index 00000000..9edd27e5 --- /dev/null +++ b/Assets/Samples/CubeWorld/CubeWorld -Lighting Settings.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1052a73b546a4dc439fc556e55c3f433 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 4890085278179872738 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/CubeWorld.unity b/Assets/Samples/CubeWorld/CubeWorld.unity new file mode 100644 index 00000000..0b79a626 --- /dev/null +++ b/Assets/Samples/CubeWorld/CubeWorld.unity @@ -0,0 +1,1599 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 1 + m_FogColor: {r: 0.4156863, g: 0.39607847, b: 0.38823533, a: 1} + m_FogMode: 1 + m_FogDensity: 0.01 + m_LinearFogStart: 10.74 + m_LinearFogEnd: 15 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1.19 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 603621736} + m_IndirectSpecularColor: {r: 0.1802843, g: 0.22571476, b: 0.30692312, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 112000000, guid: 413d12a026455f84898630bea865cf69, type: 2} + m_LightingSettings: {fileID: 4890085278179872738, guid: 1052a73b546a4dc439fc556e55c3f433, type: 2} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &115527226 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_RootOrder + value: 16 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.x + value: -2.75 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.z + value: 3.33 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.w + value: 0.2624632 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.x + value: -0.26246324 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.y + value: 0.6565921 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.z + value: 0.656592 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 136.423 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_Name + value: Plant_05 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} +--- !u!1001 &120064459 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_RootOrder + value: 15 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.x + value: 3.06 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.z + value: 1.36 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.w + value: 0.69168156 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.x + value: -0.6916817 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.y + value: -0.14688961 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.z + value: -0.1468896 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -23.979 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_Name + value: Plant_04 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} +--- !u!1001 &227498791 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalPosition.x + value: 1.67 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalPosition.y + value: 0.00000023841858 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalPosition.z + value: -1.21 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9897367 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalRotation.y + value: -0.14290322 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -16.432 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + propertyPath: m_Name + value: Skeleton + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} +--- !u!1 &227498792 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 7019161da462f364dbd6bf06ee5a863f, type: 3} + m_PrefabInstance: {fileID: 227498791} + m_PrefabAsset: {fileID: 0} +--- !u!95 &227498793 +Animator: + serializedVersion: 4 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 227498792} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: b3ca99fca2a0d6c4dae6d9ace2a97b1d, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &232229932 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 232229936} + - component: {fileID: 232229935} + - component: {fileID: 232229934} + - component: {fileID: 232229933} + m_Layer: 0 + m_Name: Plane_06 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &232229933 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232229932} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &232229934 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232229932} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &232229935 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232229932} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &232229936 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 232229932} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -20, y: 0, z: 0} + 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 &233310795 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 233310799} + - component: {fileID: 233310798} + - component: {fileID: 233310797} + - component: {fileID: 233310796} + m_Layer: 0 + m_Name: Plane_05 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &233310796 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 233310795} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &233310797 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 233310795} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &233310798 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 233310795} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &233310799 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 233310795} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 10, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &465534235 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalPosition.x + value: 0.7 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalPosition.z + value: 1.53 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_Name + value: Character_Male_01 + objectReference: {fileID: 0} + - target: {fileID: 5866666021909216657, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} + propertyPath: m_Controller + value: + objectReference: {fileID: 9100000, guid: 99f7b1c02b721284dbf2c5ae2aebacb1, type: 2} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 584d77aca4a74a1459d29d9114c6861e, type: 3} +--- !u!1 &506373227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 506373230} + - component: {fileID: 506373229} + - component: {fileID: 506373228} + - component: {fileID: 506373232} + - component: {fileID: 506373231} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &506373228 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 506373227} + m_Enabled: 1 +--- !u!20 &506373229 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 506373227} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 16 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &506373230 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 506373227} + m_LocalRotation: {x: -0.039162155, y: 0.9611743, z: -0.19757286, w: -0.1886141} + m_LocalPosition: {x: 1.4563789, y: 3.0921288, z: 5.226021} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &506373231 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 506373227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 678d7e2cf9014aad8433bf1182f58ac3, type: 3} + m_Name: + m_EditorClassIdentifier: + _pipelineAsset: {fileID: 11400000, guid: 6e431d4367999db4f96f7cd6c7683c16, type: 2} +--- !u!114 &506373232 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 506373227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 95c2934b0cd14cf6acf388dc989c86dd, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &541481118 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 541481122} + - component: {fileID: 541481121} + - component: {fileID: 541481120} + - component: {fileID: 541481119} + m_Layer: 0 + m_Name: Plane_03 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &541481119 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 541481118} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &541481120 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 541481118} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &541481121 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 541481118} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &541481122 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 541481118} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.220446e-16, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &603621735 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 603621737} + - component: {fileID: 603621736} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &603621736 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 603621735} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 1 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &603621737 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 603621735} + m_LocalRotation: {x: -0.017476322, y: -0.90553254, z: 0.4222567, w: -0.037478097} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 50, y: -184.74, z: 0} +--- !u!1001 &697699288 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalPosition.x + value: -1.53 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalPosition.z + value: 2.62 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.w + value: 0.6314809 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.x + value: -0.631481 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.y + value: -0.31816953 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.z + value: -0.3181695 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -53.482 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_Name + value: Tree_02 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} +--- !u!1001 &937563000 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.x + value: -2.2578907 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.z + value: -0.29414225 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071067 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.x + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_Name + value: Plant_02 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} +--- !u!1001 &1157577425 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_RootOrder + value: 14 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.x + value: 3.03 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalPosition.z + value: -2.09 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.w + value: 0.2624632 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.x + value: -0.26246324 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.y + value: 0.6565921 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalRotation.z + value: 0.656592 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 136.423 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} + propertyPath: m_Name + value: Plant_03 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 20cbf757bdd31284ab42cea327c8ce71, type: 3} +--- !u!1 &1302770695 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1302770699} + - component: {fileID: 1302770698} + - component: {fileID: 1302770697} + - component: {fileID: 1302770696} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1302770696 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302770695} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1302770697 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302770695} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &1302770698 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302770695} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1302770699 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302770695} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1607766292 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1607766296} + - component: {fileID: 1607766295} + - component: {fileID: 1607766294} + - component: {fileID: 1607766293} + m_Layer: 0 + m_Name: Plane_04 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1607766293 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1607766292} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1607766294 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1607766292} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &1607766295 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1607766292} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1607766296 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1607766292} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 10, y: 2.220446e-16, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1893307535 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_RootOrder + value: 7 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalPosition.x + value: 3.37 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalPosition.z + value: -0.42 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.w + value: 0.23747922 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.x + value: -0.23747924 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.y + value: -0.6660359 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalRotation.z + value: -0.6660357 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -90 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -140.752 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} + propertyPath: m_Name + value: Tree_03 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f33fbdf1bd7f08543bee4615cdfb249c, type: 3} +--- !u!1 &1965583021 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1965583025} + - component: {fileID: 1965583024} + - component: {fileID: 1965583023} + - component: {fileID: 1965583022} + m_Layer: 0 + m_Name: Plane_02 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1965583022 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1965583021} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1965583023 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1965583021} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &1965583024 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1965583021} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1965583025 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1965583021} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -10, y: 2.220446e-16, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1977106945 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1977106949} + - component: {fileID: 1977106948} + - component: {fileID: 1977106947} + - component: {fileID: 1977106946} + m_Layer: 0 + m_Name: Plane_01 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1977106946 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1977106945} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1977106947 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1977106945} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &1977106948 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1977106945} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1977106949 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1977106945} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -10, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2028637893 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2028637897} + - component: {fileID: 2028637896} + - component: {fileID: 2028637895} + - component: {fileID: 2028637894} + m_Layer: 0 + m_Name: Plane_07 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &2028637894 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028637893} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &2028637895 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028637893} + 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: 4e7020ea67d5d3542b3f89217a1da2ec, 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 &2028637896 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028637893} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &2028637897 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2028637893} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.220446e-16, z: 10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Samples/CubeWorld/CubeWorld.unity.meta b/Assets/Samples/CubeWorld/CubeWorld.unity.meta new file mode 100644 index 00000000..e6377563 --- /dev/null +++ b/Assets/Samples/CubeWorld/CubeWorld.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0a6ed3662c65a7347ac19192496994d2 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Pipeline.meta b/Assets/Samples/CubeWorld/Pipeline.meta new file mode 100644 index 00000000..166a5be0 --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea72c0883d7b0504f82218bc2f1a0032 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - SSAO.asset b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - SSAO.asset new file mode 100644 index 00000000..97b237c9 --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - SSAO.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 38976e432d2a4b5c843d286e6436bafa, type: 3} + m_Name: CubeWorld - SSAO + m_EditorClassIdentifier: + _forceIncludedShaders: + - {fileID: 4800000, guid: b9380af3e4224cabbf4b789b6a3f87d0, type: 3} + Settings: + Radius: 0.05 + Power: 15 + KernelSize: 4 + ResolutionFactor: 2 + Threshold: 0.768 + Smoothness: 0.522 + Pattern: {fileID: 0} + PatternScale: {x: 1, y: 0, z: 1} diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - SSAO.asset.meta b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - SSAO.asset.meta new file mode 100644 index 00000000..dda57f7f --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - SSAO.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 907e254ee63fce94a868dfe743e3ca7f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Sharpen.asset b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Sharpen.asset new file mode 100644 index 00000000..107ef7be --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Sharpen.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 380e850bbb5b42e5918f6e5c6be80a6c, type: 3} + m_Name: CubeWorld - Sharpen + m_EditorClassIdentifier: + _forceIncludedShaders: + - {fileID: 4800000, guid: 986c305002ce4ab7b310d1520c097cee, type: 3} + Settings: + Order: 0 + Amount: 0.86 diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Sharpen.asset.meta b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Sharpen.asset.meta new file mode 100644 index 00000000..85bb7a93 --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Sharpen.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 076e5ca088b09c344a69c83e3e6502f9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - TAA.asset b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - TAA.asset new file mode 100644 index 00000000..f580cff2 --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - TAA.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1fd3c1cebd638fc4a8d33a05a462c8ab, type: 3} + m_Name: CubeWorld - TAA + m_EditorClassIdentifier: + _forceIncludedShaders: + - {fileID: 4800000, guid: 677d80d3ea664815bd08649680575719, type: 3} + Settings: + JitterScale: 1 + ModulationFactor: 0.75 diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - TAA.asset.meta b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - TAA.asset.meta new file mode 100644 index 00000000..0186351a --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - TAA.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 02a10764a83890740a78aa422f8488e5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Toon Render Pipeline Asset.asset b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Toon Render Pipeline Asset.asset new file mode 100644 index 00000000..a652c78f --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Toon Render Pipeline Asset.asset @@ -0,0 +1,89 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1f6a429550954192bf507d745572b8de, type: 3} + m_Name: CubeWorld - Toon Render Pipeline Asset + m_EditorClassIdentifier: + ForceIncludedShaders: + - {fileID: 4800000, guid: 32cf79821a574ca29fd7697e92aae19d, type: 3} + - {fileID: 4800000, guid: 48be904f99f74bee85d2e82c67910da8, type: 3} + - {fileID: 4800000, guid: 3774c88acba044f58195398345cfc7cd, type: 3} + GlobalRampSettings: + Threshold: -0.039 + SpecularThreshold: 0.89 + RimThreshold: 0.659 + Mode: 0 + Smoothness: 0.795 + SpecularSmoothness: 2 + RimSmoothness: 2 + RampTexture: {fileID: 0} + CameraRendererSettings: + AdditionalLights: 0 + TiledLighting: 0 + MaxLightsPerTile: 32 + OverrideRenderTextureFormat: 0 + RenderTextureFormat: 4 + AllowHdr: 0 + Stencil: 0 + Msaa: 1 + RenderScale: 1 + MaxRenderTextureWidth: 1200 + MaxRenderTextureHeight: 0 + RenderTextureFilterMode: 1 + PrePass: -1 + OpaqueLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + TransparentLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + UseSrpBatching: 1 + UseDynamicBatching: 0 + ShadowSettings: + Mode: 1 + Threshold: 0.746 + CrispAntiAliased: 0 + Smoothness: 0.953 + MaxDistance: 15 + DistanceFade: 0.1 + Pattern: {fileID: 0} + PatternScale: {x: 1, y: 0, z: 1} + Vsm: + DepthBits: 32 + Blur: 3 + BlurEarlyBail: 0 + BlurEarlyBailThreshold: 0.002 + BlurScatter: 1 + VsmPrecision: 1 + SoftShadows: 0 + LightBleedingReduction: 0.338 + Directional: + Enabled: 1 + AtlasSize: 256 + CascadeCount: 1 + CascadeRatio1: 0.1 + CascadeRatio2: 0.25 + CascadeRatio3: 0.5 + DepthBias: 0.16 + NormalBias: 0.03 + SlopeBias: 5.8 + Blobs: + AtlasSize: 128 + Mode: 0 + Saturation: 1 + Extensions: + Extensions: + - {fileID: 11400000, guid: 907e254ee63fce94a868dfe743e3ca7f, type: 2} + PostProcessing: + Enabled: 1 + Passes: + - {fileID: 11400000, guid: 02a10764a83890740a78aa422f8488e5, type: 2} + - {fileID: 11400000, guid: 076e5ca088b09c344a69c83e3e6502f9, type: 2} diff --git a/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Toon Render Pipeline Asset.asset.meta b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Toon Render Pipeline Asset.asset.meta new file mode 100644 index 00000000..80942645 --- /dev/null +++ b/Assets/Samples/CubeWorld/Pipeline/CubeWorld - Toon Render Pipeline Asset.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e431d4367999db4f96f7cd6c7683c16 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/Main/Art/Ultimate Stylized Nature Pack/PineTree_Leaves.png.meta b/Assets/Samples/Main/Art/Ultimate Stylized Nature Pack/PineTree_Leaves.png.meta index 9459fe52..74548266 100644 --- a/Assets/Samples/Main/Art/Ultimate Stylized Nature Pack/PineTree_Leaves.png.meta +++ b/Assets/Samples/Main/Art/Ultimate Stylized Nature Pack/PineTree_Leaves.png.meta @@ -3,7 +3,7 @@ guid: 106937cd0520d2448ab666c2455c659f TextureImporter: internalIDToNameTable: [] externalObjects: {} - serializedVersion: 11 + serializedVersion: 12 mipmaps: mipMapMode: 0 enableMipMap: 1 @@ -11,7 +11,7 @@ TextureImporter: linearTexture: 0 fadeOut: 0 borderMipMap: 0 - mipMapsPreserveCoverage: 0 + mipMapsPreserveCoverage: 1 alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 @@ -33,8 +33,8 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 1 - aniso: 1 + filterMode: 2 + aniso: 16 mipBias: 0 wrapU: 0 wrapV: 0 @@ -63,6 +63,7 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + cookieLightType: 1 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform diff --git a/Assets/Samples/Main/MainSampleScene.unity b/Assets/Samples/Main/MainSampleScene.unity index 222bbf29..70b83073 100644 --- a/Assets/Samples/Main/MainSampleScene.unity +++ b/Assets/Samples/Main/MainSampleScene.unity @@ -6116,6 +6116,7 @@ GameObject: - component: {fileID: 963194227} - component: {fileID: 963194226} - component: {fileID: 963194229} + - component: {fileID: 963194230} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -6141,7 +6142,7 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: 0.0990566, g: 0.17020994, b: 0.3962264, a: 0} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 @@ -6159,7 +6160,7 @@ Camera: field of view: 60 orthographic: 0 orthographic size: 5 - m_Depth: -1 + m_Depth: 0 m_CullingMask: serializedVersion: 2 m_Bits: 4294967295 @@ -6202,6 +6203,18 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _pipelineAsset: {fileID: 11400000, guid: c0de55e700edf6f4599a4dc6ddf08da0, type: 2} +--- !u!114 &963194230 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 963194225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 95c2934b0cd14cf6acf388dc989c86dd, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1128536939 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 3f31922a8210904438ece0cfa3bab096, type: 3} diff --git a/Assets/Samples/Main/Pipeline/Debug Pass.asset b/Assets/Samples/Main/Pipeline/Debug Pass.asset index 06020937..6c759d2f 100644 --- a/Assets/Samples/Main/Pipeline/Debug Pass.asset +++ b/Assets/Samples/Main/Pipeline/Debug Pass.asset @@ -16,3 +16,9 @@ MonoBehaviour: - {fileID: 0} Settings: Mode: 0 + TiledLighting: + ShowOpaque: 0 + ShowTransparent: 0 + MotionVectors: + Scale: 10 + SceneIntensity: 0.1 diff --git a/Assets/Samples/Main/Pipeline/Main - Toon Render Pipeline Asset.asset b/Assets/Samples/Main/Pipeline/Main - Toon Render Pipeline Asset.asset index 9f50db7a..80a588ba 100644 --- a/Assets/Samples/Main/Pipeline/Main - Toon Render Pipeline Asset.asset +++ b/Assets/Samples/Main/Pipeline/Main - Toon Render Pipeline Asset.asset @@ -28,6 +28,7 @@ MonoBehaviour: CameraRendererSettings: AdditionalLights: 1 TiledLighting: 0 + MaxLightsPerTile: 32 OverrideRenderTextureFormat: 0 RenderTextureFormat: 67 AllowHdr: 1 @@ -37,7 +38,7 @@ MonoBehaviour: MaxRenderTextureWidth: 0 MaxRenderTextureHeight: 0 RenderTextureFilterMode: 1 - DepthPrePass: 2 + PrePass: -1 OpaqueLayerMask: serializedVersion: 2 m_Bits: 4294967295 @@ -60,6 +61,7 @@ MonoBehaviour: Blur: 1 BlurEarlyBail: 1 BlurEarlyBailThreshold: 0.25 + BlurScatter: 1 VsmPrecision: 0 SoftShadows: 0 LightBleedingReduction: 0.9 @@ -80,9 +82,9 @@ MonoBehaviour: Extensions: Extensions: - {fileID: 11400000, guid: 91c04dff8aa908e4e951dac087bdf2ad, type: 2} - - {fileID: 11400000, guid: 1646ef03c10aee74d9d024dabb976ff3, type: 2} - {fileID: 11400000, guid: 30041836c268b614db8f6cfc9f36024b, type: 2} - {fileID: 11400000, guid: f0489e92ff979c443be4e14bcf3021bb, type: 2} + - {fileID: 11400000, guid: 1646ef03c10aee74d9d024dabb976ff3, type: 2} PostProcessing: Enabled: 1 Passes: diff --git a/Assets/Samples/TiledLighting/Pipelines/TiledLighting - Toon Render Pipeline Asset.asset b/Assets/Samples/TiledLighting/Pipelines/TiledLighting - Toon Render Pipeline Asset.asset index 04f8af54..a66f2df5 100644 --- a/Assets/Samples/TiledLighting/Pipelines/TiledLighting - Toon Render Pipeline Asset.asset +++ b/Assets/Samples/TiledLighting/Pipelines/TiledLighting - Toon Render Pipeline Asset.asset @@ -38,7 +38,7 @@ MonoBehaviour: MaxRenderTextureWidth: 0 MaxRenderTextureHeight: 0 RenderTextureFilterMode: 1 - DepthPrePass: 1 + PrePass: 1 OpaqueLayerMask: serializedVersion: 2 m_Bits: 4294967295 diff --git a/Packages/com.deltation.toon-rp/Editor/Stripping/ToonShaderBuildPreprocessor.cs b/Packages/com.deltation.toon-rp/Editor/Stripping/ToonShaderBuildPreprocessor.cs index 1267e479..b10e1ff2 100644 --- a/Packages/com.deltation.toon-rp/Editor/Stripping/ToonShaderBuildPreprocessor.cs +++ b/Packages/com.deltation.toon-rp/Editor/Stripping/ToonShaderBuildPreprocessor.cs @@ -396,6 +396,22 @@ bool AnyExtensionHasVertexColorThicknessSource( } } + // ToonTemporalAA + { + if (!AnyPostProcessingPass()) + { + _shadersToStrip.Add(ToonTemporalAA.ShaderName); + } + } + + // ToonSharpen + { + if (!AnyPostProcessingPass()) + { + _shadersToStrip.Add(ToonSharpen.ShaderName); + } + } + ReportStrippingConfiguration(); } @@ -560,6 +576,12 @@ private bool AnyPostProcessingPass(Func condition) a.PostProcessing.Passes.OfType().Any(condition) ); + private bool AnyPostProcessingPass() + where TPass : ToonPostProcessingPassAsset => + _allToonRenderPipelineAssets.Any(a => + a.PostProcessing.Passes.OfType().Any() + ); + private bool ShouldStripShader(Shader shader, ShaderCompilerData shaderCompilerData) { if (_shadersToStrip.Contains(shader.name)) diff --git a/Packages/com.deltation.toon-rp/Editor/ToonCameraSettingsPropertyDrawer.cs b/Packages/com.deltation.toon-rp/Editor/ToonCameraSettingsPropertyDrawer.cs index 7604faef..18b2d6c6 100644 --- a/Packages/com.deltation.toon-rp/Editor/ToonCameraSettingsPropertyDrawer.cs +++ b/Packages/com.deltation.toon-rp/Editor/ToonCameraSettingsPropertyDrawer.cs @@ -71,12 +71,12 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property) return; } - DepthPrePassMode mode = pipelineAsset.CameraRendererSettings.DepthPrePass; - DepthPrePassMode effectiveMode = pipelineAsset.GetEffectiveDepthPrePassMode(); + PrePassMode mode = pipelineAsset.CameraRendererSettings.PrePass; + PrePassMode effectiveMode = pipelineAsset.GetEffectiveDepthPrePassMode(); if (mode != effectiveMode) { EditorGUILayout.HelpBox( - $"Depth Pre-Pass Mode is overriden by one or many passes to: \"{effectiveMode}\"", + $"Pre-Pass Mode is overriden by one or many passes to: \"{effectiveMode}\"", MessageType.Warning ); } @@ -84,9 +84,9 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property) ) ); - root.Add(new PropertyField(property.FindPropertyRelative(nameof(ToonCameraRendererSettings.DepthPrePass))) + root.Add(new PropertyField(property.FindPropertyRelative(nameof(ToonCameraRendererSettings.PrePass))) { - label = "Depth Pre-Pass Mode", + label = "Pre-Pass Mode", } ); diff --git a/Packages/com.deltation.toon-rp/Runtime/DepthPrePass.cs b/Packages/com.deltation.toon-rp/Runtime/DepthPrePass.cs index b4c89cad..11f4a822 100644 --- a/Packages/com.deltation.toon-rp/Runtime/DepthPrePass.cs +++ b/Packages/com.deltation.toon-rp/Runtime/DepthPrePass.cs @@ -9,6 +9,10 @@ public class DepthPrePass { private static readonly ShaderTagId DepthOnlyShaderTagId = new("ToonRPDepthOnly"); private static readonly ShaderTagId DepthNormalsShaderTagId = new("ToonRPDepthNormals"); + + public static readonly int DepthTextureId = Shader.PropertyToID("_ToonRP_DepthTexture"); + public static readonly int NormalsTextureId = Shader.PropertyToID("_ToonRP_NormalsTexture"); + private readonly int _depthTextureId; private readonly int _normalsTextureId; @@ -22,9 +26,7 @@ public class DepthPrePass private ToonCameraRendererSettings _settings; private bool _stencil; - public DepthPrePass() : this( - Shader.PropertyToID("_ToonRP_DepthTexture"), Shader.PropertyToID("_ToonRP_NormalsTexture") - ) { } + public DepthPrePass() : this(DepthTextureId, NormalsTextureId) { } public DepthPrePass(int depthTextureId, int normalsTextureId) { @@ -33,10 +35,10 @@ public DepthPrePass(int depthTextureId, int normalsTextureId) } public void Setup(in ScriptableRenderContext context, in CullingResults cullingResults, Camera camera, - in ToonCameraRendererSettings settings, DepthPrePassMode mode, int rtWidth, int rtHeight, + in ToonCameraRendererSettings settings, PrePassMode mode, int rtWidth, int rtHeight, bool stencil = false) { - Assert.IsTrue(mode != DepthPrePassMode.Off, "mode != DepthPrePassMode.Off"); + Assert.IsTrue(mode.Includes(PrePassMode.Depth), "mode.Includes(PrePassMode.Depth)"); _context = context; _cullingResults = cullingResults; @@ -44,7 +46,7 @@ public void Setup(in ScriptableRenderContext context, in CullingResults cullingR _settings = settings; _rtWidth = rtWidth; _rtHeight = rtHeight; - _normals = mode == DepthPrePassMode.DepthNormals; + _normals = mode.Includes(PrePassMode.Normals); _stencil = stencil; } @@ -112,7 +114,7 @@ private void DrawRenderers() { enableDynamicBatching = _settings.UseDynamicBatching, }; - var filteringSettings = new FilteringSettings(RenderQueueRange.opaque); + var filteringSettings = new FilteringSettings(RenderQueueRange.opaque, _camera.cullingMask); _context.DrawRenderers(_cullingResults, ref drawingSettings, ref filteringSettings diff --git a/Packages/com.deltation.toon-rp/Runtime/DepthPrePassMode.cs b/Packages/com.deltation.toon-rp/Runtime/DepthPrePassMode.cs deleted file mode 100644 index fb8b8078..00000000 --- a/Packages/com.deltation.toon-rp/Runtime/DepthPrePassMode.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace DELTation.ToonRP -{ - public enum DepthPrePassMode - { - Off, - Depth, - DepthNormals, - } -} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/DepthPrePassModeUtils.cs b/Packages/com.deltation.toon-rp/Runtime/DepthPrePassModeUtils.cs deleted file mode 100644 index a3bc3880..00000000 --- a/Packages/com.deltation.toon-rp/Runtime/DepthPrePassModeUtils.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace DELTation.ToonRP -{ - public static class DepthPrePassModeUtils - { - public static DepthPrePassMode CombineDepthPrePassModes(DepthPrePassMode mode1, DepthPrePassMode mode2) => - mode1 > mode2 ? mode1 : mode2; - } -} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/DepthPrePassModeUtils.cs.meta b/Packages/com.deltation.toon-rp/Runtime/DepthPrePassModeUtils.cs.meta deleted file mode 100644 index 0505b5d0..00000000 --- a/Packages/com.deltation.toon-rp/Runtime/DepthPrePassModeUtils.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 7d3d49514a1f4037ab20b297c8a21ff4 -timeCreated: 1684616622 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonCameraOverride.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonCameraOverride.cs index 8b25d9a8..87d6cc6e 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonCameraOverride.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonCameraOverride.cs @@ -10,15 +10,19 @@ public struct ToonCameraOverride private readonly float _zFar; private readonly Camera _camera; private bool _overriden; + private readonly ToonAdditionalCameraData _additionalCameraData; + private readonly bool _setInverse; - public ToonCameraOverride(Camera camera) + public ToonCameraOverride(Camera camera, ToonAdditionalCameraData additionalCameraData, bool setInverse = false) { _camera = camera; + _additionalCameraData = additionalCameraData; Rect pixelRect = camera.pixelRect; _aspectRatio = pixelRect.width / pixelRect.height; _zNear = camera.nearClipPlane; _zFar = camera.farClipPlane; _overriden = false; + _setInverse = setInverse; } public void OverrideIfEnabled(CommandBuffer cmd, in ToonCameraOverrideSettings settings) @@ -36,25 +40,28 @@ public void OverrideIfEnabled(CommandBuffer cmd, in ToonCameraOverrideSettings s } float fieldOfView = settings.FieldOfView; - Matrix4x4 projectionMatrix = - ToonRpUtils.GetGPUProjectionMatrix( - Matrix4x4.Perspective(fieldOfView, _aspectRatio, - _zNear, - _zFar - ) - ); - ToonRpUtils.SetViewAndProjectionMatrices(cmd, _camera.worldToCameraMatrix, projectionMatrix, false); + var matrix = Matrix4x4.Perspective(fieldOfView, _aspectRatio, + _zNear, + _zFar + ); + Matrix4x4 projectionMatrix = ToonRpUtils.GetGPUProjectionMatrix(matrix); + ToonRpUtils.SetViewAndProjectionMatrices(cmd, _camera.worldToCameraMatrix, projectionMatrix, + _setInverse + ); _overriden = true; } - public void RestoreIfEnabled(CommandBuffer cmd) + public void Restore(CommandBuffer cmd) { if (!_overriden) { return; } - ToonRpUtils.RestoreCameraMatrices(_camera, cmd, false); + ToonRpUtils.SetViewAndProjectionMatrices(cmd, + _camera.worldToCameraMatrix, _additionalCameraData.JitteredGpuProjectionMatrix, + _setInverse + ); _overriden = false; } } diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonInvertedHullOutline.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonInvertedHullOutline.cs index 12819a5f..a84da565 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonInvertedHullOutline.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonInvertedHullOutline.cs @@ -26,6 +26,7 @@ public class ToonInvertedHullOutline : ToonRenderingExtensionBase private static readonly int NoiseFrequencyId = Shader.PropertyToID("_NoiseFrequency"); private static readonly int NoiseAmplitudeId = Shader.PropertyToID("_NoiseAmplitude"); private readonly List _materials = new(); + private ToonAdditionalCameraData _additionalCameraData; private Camera _camera; private ToonCameraRendererSettings _cameraRendererSettings; @@ -45,7 +46,7 @@ public override void Render() CommandBuffer cmd = CommandBufferPool.Get(); - var cameraOverride = new ToonCameraOverride(_camera); + var cameraOverride = new ToonCameraOverride(_camera, _additionalCameraData); using (new ProfilingScope(cmd, NamedProfilingSampler.Get(ToonRpPassId.InvertedHullOutlines))) { @@ -147,7 +148,7 @@ public override void Render() ); cmd.SetGlobalDepthBias(0, 0); - cameraOverride.RestoreIfEnabled(cmd); + cameraOverride.Restore(cmd); } } } @@ -164,6 +165,7 @@ public override void Setup(in ToonRenderingExtensionContext context, _context = context.ScriptableRenderContext; _cullingResults = context.CullingResults; _outlineSettings = settingsStorage.GetSettings(this); + _additionalCameraData = context.AdditionalCameraData; PopulateMaterialsForAllPasses(); } diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparency.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparency.cs index c98764e0..35b33288 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparency.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparency.cs @@ -65,7 +65,7 @@ public override void Render() const bool stencil = true; _depthPrePass.Setup(_srpContext, _cullingResults, _camera, _cameraRendererSettings, - DepthPrePassMode.Depth, + PrePassMode.Depth, _width, _height, stencil ); diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparencyAsset.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparencyAsset.cs index 62c7e891..f3104ccf 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparencyAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonOffScreenTransparencyAsset.cs @@ -29,9 +29,9 @@ protected override string[] ForceIncludedShaderNames() => new[] ToonDepthDownsample.ShaderName, }; - public override DepthPrePassMode RequiredDepthPrePassMode() => + public override PrePassMode RequiredPrePassMode() => Settings.DepthMode == ToonOffScreenTransparencySettings.DepthRenderMode.Downsample - ? DepthPrePassMode.Depth - : DepthPrePassMode.Off; + ? PrePassMode.Depth + : PrePassMode.Off; } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonRenderObjects.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonRenderObjects.cs index 3aaeb907..6b816ae3 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonRenderObjects.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonRenderObjects.cs @@ -7,6 +7,7 @@ namespace DELTation.ToonRP.Extensions.BuiltIn public class ToonRenderObjects : ToonRenderingExtensionBase { private readonly List _lightModeTags = new(); + private ToonAdditionalCameraData _additionalCameraData; private Camera _camera; private ToonCameraRendererSettings _cameraRendererSettings; private ScriptableRenderContext _context; @@ -22,6 +23,7 @@ public override void Setup(in ToonRenderingExtensionContext context, _camera = context.Camera; _cameraRendererSettings = context.CameraRendererSettings; _cullingResults = context.CullingResults; + _additionalCameraData = context.AdditionalCameraData; } public override void Render() @@ -44,7 +46,7 @@ public override void Render() } } - var cameraOverride = new ToonCameraOverride(_camera); + var cameraOverride = new ToonCameraOverride(_camera, _additionalCameraData); cameraOverride.OverrideIfEnabled(cmd, _settings.Overrides.Camera); _context.ExecuteCommandBufferAndClear(cmd); @@ -65,7 +67,7 @@ public override void Render() _settings.Overrides.Material ); - cameraOverride.RestoreIfEnabled(cmd); + cameraOverride.Restore(cmd); } _context.ExecuteCommandBufferAndClear(cmd); diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonScreenSpaceOutlineAfterOpaqueAsset.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonScreenSpaceOutlineAfterOpaqueAsset.cs index 0d17312f..96db89b1 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonScreenSpaceOutlineAfterOpaqueAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonScreenSpaceOutlineAfterOpaqueAsset.cs @@ -40,7 +40,7 @@ protected override string[] ForceIncludedShaderNames() => new[] ToonScreenSpaceOutlineImpl.ShaderName, }; - public override DepthPrePassMode RequiredDepthPrePassMode() => - ToonScreenSpaceOutlineAsset.RequiredDepthPrePassMode(ConvertToCommonSettings(Settings)); + public override PrePassMode RequiredPrePassMode() => + ToonScreenSpaceOutline.RequiredPrePassMode(ConvertToCommonSettings(Settings)); } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsao.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsao.cs index d4a02882..78da7038 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsao.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsao.cs @@ -28,9 +28,10 @@ public class ToonSsao : ToonRenderingExtensionBase private static readonly int BlurDirectionId = Shader.PropertyToID("_ToonRP_SSAO_Blur_Direction"); private static readonly int BlurSourceId = Shader.PropertyToID("_ToonRP_SSAO_Blur_SourceTex"); - private readonly Vector4[] _samples; - private readonly GlobalKeyword _ssaoKeyword; - private readonly GlobalKeyword _ssaoPatternKeyword; + private readonly Vector4[] _samples = GenerateRandomSamples(MaxSamplesCount); + private readonly GlobalKeyword _ssaoKeyword = GlobalKeyword.Create(SsaoKeywordName); + private readonly GlobalKeyword _ssaoPatternKeyword = GlobalKeyword.Create(SsaoPatternKeywordName); + private ToonAdditionalCameraData _additionalCameraData; private ScriptableRenderContext _context; private int _height; private Material _material; @@ -38,18 +39,13 @@ public class ToonSsao : ToonRenderingExtensionBase private ToonSsaoSettings _settings; private int _width; - public ToonSsao() - { - _samples = GenerateRandomSamples(MaxSamplesCount); - _ssaoKeyword = GlobalKeyword.Create(SsaoKeywordName); - _ssaoPatternKeyword = GlobalKeyword.Create(SsaoPatternKeywordName); - } - public override void Setup(in ToonRenderingExtensionContext context, IToonRenderingExtensionSettingsStorage settingsStorage) { _context = context.ScriptableRenderContext; _settings = settingsStorage.GetSettings(this); + _additionalCameraData = context.AdditionalCameraData; + _width = context.CameraRenderTarget.Width; _height = context.CameraRenderTarget.Height; diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsaoAsset.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsaoAsset.cs index 391ed53e..6403331f 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsaoAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/BuiltIn/ToonSsaoAsset.cs @@ -5,7 +5,7 @@ namespace DELTation.ToonRP.Extensions.BuiltIn [CreateAssetMenu(menuName = Path + "SSAO")] public class ToonSsaoAsset : ToonRenderingExtensionAsset { - public override ToonRenderingEvent Event => ToonRenderingEvent.AfterDepthPrepass; + public override ToonRenderingEvent Event => ToonRenderingEvent.AfterPrepass; private void Reset() { @@ -23,8 +23,8 @@ private void Reset() public override IToonRenderingExtension CreateExtension() => new ToonSsao(); - public override DepthPrePassMode RequiredDepthPrePassMode() => - DepthPrePassMode.DepthNormals; + public override PrePassMode RequiredPrePassMode() => + PrePassMode.Depth | PrePassMode.Normals; protected override string[] ForceIncludedShaderNames() => new[] { diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionAsset.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionAsset.cs index 11e5ae92..1dbaae83 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionAsset.cs @@ -22,8 +22,8 @@ protected virtual void OnValidate() public virtual bool RequiresStencil() => false; - public virtual DepthPrePassMode RequiredDepthPrePassMode() => - DepthPrePassMode.Off; + public virtual PrePassMode RequiredPrePassMode() => + PrePassMode.Off; public abstract IToonRenderingExtension CreateExtension(); diff --git a/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionContext.cs b/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionContext.cs index 4e7bc6ce..296b487e 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionContext.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Extensions/ToonRenderingExtensionContext.cs @@ -10,16 +10,18 @@ public readonly struct ToonRenderingExtensionContext public readonly ToonCameraRendererSettings CameraRendererSettings; public readonly CullingResults CullingResults; public readonly ToonCameraRenderTarget CameraRenderTarget; + public readonly ToonAdditionalCameraData AdditionalCameraData; public ToonRenderingExtensionContext(ScriptableRenderContext scriptableRenderContext, Camera camera, ToonCameraRendererSettings cameraRendererSettings, CullingResults cullingResults, - ToonCameraRenderTarget cameraRenderTarget) + ToonCameraRenderTarget cameraRenderTarget, ToonAdditionalCameraData additionalCameraData) { ScriptableRenderContext = scriptableRenderContext; Camera = camera; CameraRendererSettings = cameraRendererSettings; CullingResults = cullingResults; CameraRenderTarget = cameraRenderTarget; + AdditionalCameraData = additionalCameraData; } } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/Lighting/ToonTiledLighting.cs b/Packages/com.deltation.toon-rp/Runtime/Lighting/ToonTiledLighting.cs index 995167b3..d102e0f7 100644 --- a/Packages/com.deltation.toon-rp/Runtime/Lighting/ToonTiledLighting.cs +++ b/Packages/com.deltation.toon-rp/Runtime/Lighting/ToonTiledLighting.cs @@ -168,7 +168,7 @@ public void CullLights() CommandBufferPool.Release(cmd); } - public static void PrepareForOpaqueGeometry(CommandBuffer cmd) + public void PrepareForOpaqueGeometry(CommandBuffer cmd) { PrepareForGeometryPass(cmd, 0); } diff --git a/Packages/com.deltation.toon-rp/Runtime/MotionVectorsPrePass.cs b/Packages/com.deltation.toon-rp/Runtime/MotionVectorsPrePass.cs new file mode 100644 index 00000000..1c4d2c3f --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/MotionVectorsPrePass.cs @@ -0,0 +1,104 @@ +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; + +namespace DELTation.ToonRP +{ + public class MotionVectorsPrePass + { + private static readonly ShaderTagId MotionVectorsShaderTagId = new("ToonRPMotionVectors"); + private static readonly int PrevViewProjMatrixId = Shader.PropertyToID("_PrevViewProjMatrix"); + private static readonly int NonJitteredViewProjMatrixId = Shader.PropertyToID("_NonJitteredViewProjMatrix"); + public readonly int MotionVectorsTextureId = Shader.PropertyToID("_ToonRP_MotionVectorsTexture"); + private ToonAdditionalCameraData _additionalCameraData; + + private Camera _camera; + private ScriptableRenderContext _context; + + private CullingResults _cullingResults; + private int _rtHeight; + private int _rtWidth; + private ToonCameraRendererSettings _settings; + + public void Setup(in ScriptableRenderContext context, in CullingResults cullingResults, Camera camera, + ToonAdditionalCameraData additionalCameraData, + in ToonCameraRendererSettings settings, int rtWidth, int rtHeight) + { + _context = context; + _cullingResults = cullingResults; + _camera = camera; + _additionalCameraData = additionalCameraData; + _settings = settings; + _rtWidth = rtWidth; + _rtHeight = rtHeight; + } + + public void Render() + { + CommandBuffer cmd = CommandBufferPool.Get(); + + // This is required to compute previous object matrices + _camera.depthTextureMode |= DepthTextureMode.MotionVectors | DepthTextureMode.Depth; + + using (new ProfilingScope(cmd, NamedProfilingSampler.Get(ToonRpPassId.MotionVectorsPrePass))) + { + cmd.SetGlobalMatrix(PrevViewProjMatrixId, + _additionalCameraData.MotionVectorsPersistentData.PreviousViewProjection + ); + cmd.SetGlobalMatrix(NonJitteredViewProjMatrixId, + _additionalCameraData.MotionVectorsPersistentData.ViewProjection + ); + + cmd.GetTemporaryRT(MotionVectorsTextureId, _rtWidth, _rtHeight, 0, FilterMode.Point, + GraphicsFormat.R16G16_SFloat + ); + cmd.SetRenderTarget( + MotionVectorsTextureId, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.Store, + DepthPrePass.DepthTextureId, RenderBufferLoadAction.Load, RenderBufferStoreAction.Store + ); + cmd.ClearRenderTarget(false, true, Color.black); + + _context.ExecuteCommandBufferAndClear(cmd); + + DrawRenderers(); + } + + _context.ExecuteCommandBufferAndClear(cmd); + CommandBufferPool.Release(cmd); + } + + public void Cleanup() + { + CommandBuffer cmd = CommandBufferPool.Get(); + cmd.ReleaseTemporaryRT(MotionVectorsTextureId); + _context.ExecuteCommandBufferAndClear(cmd); + CommandBufferPool.Release(cmd); + } + + private void DrawRenderers() + { + var sortingSettings = new SortingSettings(_camera) + { + criteria = SortingCriteria.CommonOpaque, + }; + var drawingSettings = new DrawingSettings(MotionVectorsShaderTagId, sortingSettings) + { + enableDynamicBatching = _settings.UseDynamicBatching, + perObjectData = PerObjectData.MotionVectors, + }; + var filteringSettings = new FilteringSettings(RenderQueueRange.opaque, _camera.cullingMask) + { + excludeMotionVectorObjects = true, + }; + + var renderStateBlock = new RenderStateBlock(RenderStateMask.Depth) + { + depthState = new DepthState { writeEnabled = false, compareFunction = CompareFunction.LessEqual }, + }; + + _context.DrawRenderers(_cullingResults, + ref drawingSettings, ref filteringSettings, ref renderStateBlock + ); + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/MotionVectorsPrePass.cs.meta b/Packages/com.deltation.toon-rp/Runtime/MotionVectorsPrePass.cs.meta new file mode 100644 index 00000000..efdcbfcf --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/MotionVectorsPrePass.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: eebdbb9dba6f40ab8983c838469261bf +timeCreated: 1696973991 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPass.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPass.cs index 9cddee87..2f601de3 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPass.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPass.cs @@ -11,8 +11,16 @@ public class ToonDebugPass : ToonPostProcessingPassBase Shader.PropertyToID("_TiledLighting_ShowTransparent"); private static readonly int TiledLightingShowOpaqueId = Shader.PropertyToID("_TiledLighting_ShowOpaque"); + private static readonly int MotionVectorsScaleId = + Shader.PropertyToID("_MotionVectors_Scale"); + private static readonly int MotionVectorsSceneIntensityId = + Shader.PropertyToID("_MotionVectors_SceneIntensity"); - private readonly Material _material = ToonRpUtils.CreateEngineMaterial(ShaderName, "Toon RP Debug Pass"); + // Using Lazy to avoid creating a material when it's not used (it also can be stripped). + private readonly Lazy _material = new( + () => ToonRpUtils.CreateEngineMaterial(ShaderName, "Toon RP Debug Pass") + ); + private Camera _camera; private ToonDebugPassSettings _settings; public override bool IsEnabled(in ToonPostProcessingSettings settings) => @@ -21,6 +29,7 @@ public override bool IsEnabled(in ToonPostProcessingSettings settings) => public override void Setup(CommandBuffer cmd, in ToonPostProcessingContext context) { base.Setup(cmd, in context); + _camera = context.Camera; _settings = context.Settings.Find(); } @@ -29,27 +38,47 @@ public override void Render(CommandBuffer cmd, RenderTargetIdentifier source, { using (new ProfilingScope(cmd, NamedProfilingSampler.Get(ToonRpPassId.Debug))) { - switch (_settings.Mode) + if (_camera.cameraType == CameraType.Game) { - case ToonDebugPassSettings.DebugMode.None: - break; - case ToonDebugPassSettings.DebugMode.TiledLighting: + Material material = _material.Value; + + switch (_settings.Mode) { - _material.SetInt(TiledLightingShowOpaqueId, - _settings.TiledLighting.ShowOpaque ? 1 : 0 - ); - - _material.SetInt(TiledLightingShowTransparentId, - _settings.TiledLighting.ShowTransparent ? 1 : 0 - ); - break; + case ToonDebugPassSettings.DebugMode.None: + break; + case ToonDebugPassSettings.DebugMode.TiledLighting: + { + material.SetInt(TiledLightingShowOpaqueId, + _settings.TiledLighting.ShowOpaque ? 1 : 0 + ); + + material.SetInt(TiledLightingShowTransparentId, + _settings.TiledLighting.ShowTransparent ? 1 : 0 + ); + break; + } + case ToonDebugPassSettings.DebugMode.MotionVectors: + { + material.SetFloat(MotionVectorsScaleId, _settings.MotionVectors.Scale); + material.SetFloat(MotionVectorsSceneIntensityId, _settings.MotionVectors.SceneIntensity); + break; + } + + case ToonDebugPassSettings.DebugMode.Depth: + break; + case ToonDebugPassSettings.DebugMode.Normals: + break; + default: + throw new ArgumentOutOfRangeException(); } - default: - throw new ArgumentOutOfRangeException(); - } - int passIndex = (int) _settings.Mode - 1; - cmd.Blit(source, destination, _material, passIndex); + int passIndex = (int) _settings.Mode - 1; + cmd.Blit(source, destination, material, passIndex); + } + else + { + cmd.Blit(source, destination); + } } } } diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassAsset.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassAsset.cs index c78d3171..fc3dd1f8 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassAsset.cs @@ -1,4 +1,6 @@ -using UnityEngine; +using System; +using UnityEngine; +using static DELTation.ToonRP.PostProcessing.BuiltIn.ToonDebugPassSettings; namespace DELTation.ToonRP.PostProcessing.BuiltIn { @@ -7,7 +9,16 @@ public class ToonDebugPassAsset : ToonPostProcessingPassAsset ToonPostProcessingPassOrders.Debug; @@ -18,5 +29,16 @@ protected override string[] ForceIncludedShaderNames() => new[] { ToonDebugPass.ShaderName, }; + + public override PrePassMode RequiredPrePassMode() => + Settings.Mode switch + { + DebugMode.None => PrePassMode.Off, + DebugMode.TiledLighting => PrePassMode.Off, + DebugMode.MotionVectors => PrePassMode.MotionVectors, + DebugMode.Depth => PrePassMode.Depth, + DebugMode.Normals => PrePassMode.Normals, + _ => throw new ArgumentOutOfRangeException(), + }; } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassSettings.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassSettings.cs index f0238bf8..fc15f128 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassSettings.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonDebugPassSettings.cs @@ -1,5 +1,6 @@ using System; using DELTation.ToonRP.Attributes; +using UnityEngine; namespace DELTation.ToonRP.PostProcessing.BuiltIn { @@ -10,20 +11,26 @@ public enum DebugMode { None, TiledLighting, + Depth, + Normals, + MotionVectors, } public DebugMode Mode; [ToonRpShowIf(nameof(TiledLightingOn))] public TiledLightingSettings TiledLighting; + [ToonRpShowIf(nameof(MotionVectorsOn))] + public MotionVectorsSettings MotionVectors; private bool TiledLightingOn => Mode == DebugMode.TiledLighting; + private bool MotionVectorsOn => Mode == DebugMode.MotionVectors; public bool IsEffectivelyEnabled() { #if UNITY_EDITOR || DEVELOPMENT_BUILD return Mode != DebugMode.None; -#else +#else return false; #endif } @@ -34,5 +41,14 @@ public struct TiledLightingSettings public bool ShowOpaque; public bool ShowTransparent; } + + [Serializable] + public struct MotionVectorsSettings + { + [Min(0.0f)] + public float Scale; + [Range(0.0f, 1.0f)] + public float SceneIntensity; + } } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingPassOrders.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingPassOrders.cs index f56319a3..73eb46b9 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingPassOrders.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingPassOrders.cs @@ -5,7 +5,14 @@ public static class ToonPostProcessingPassOrders public const int Outline = 100; public const int LightScattering = 450; public const int Bloom = 500; - public const int PostProcessingStack = 1000; + public const int TemporalAA = 750; + public const int SharpenPreUpscale = 900; + public const int PostProcessingStackPreUpscale = 1000; + + public const int SwitchToNativeResolution = 5000; + + public const int SharpenPostUpscale = 5900; + public const int PostProcessingStackPostUpscale = 6000; public const int Debug = 1_000_000; } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStack.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStack.cs index 886157d3..f676dc35 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStack.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStack.cs @@ -82,7 +82,7 @@ public override void Render(CommandBuffer cmd, RenderTargetIdentifier source, private void HandleFxaaProperties() { - if (_fxaaSettings.Enabled && _fxaaSettings.HighQuality) + if (_fxaaSettings is { Enabled: true, HighQuality: true }) { _material.SetFloat(FxaaFixedContrastThresholdId, _fxaaSettings.FixedContrastThresholdId); _material.SetFloat(FxaaRelativeContrastThresholdId, _fxaaSettings.RelativeContrastThreshold); diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackAsset.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackAsset.cs index 8508b4a4..d8d3fb83 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackAsset.cs @@ -1,4 +1,5 @@ -using UnityEngine; +using System; +using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif // UNITY_EDITOR @@ -47,7 +48,14 @@ private void Reset() #endif // UNITY_EDITOR } - public override int Order() => ToonPostProcessingPassOrders.PostProcessingStack; + public override int Order() => Settings.Order switch + { + ToonPostProcessingStackSettings.PassOrder.PreUpscale => + ToonPostProcessingPassOrders.PostProcessingStackPreUpscale, + ToonPostProcessingStackSettings.PassOrder.PostUpscale => + ToonPostProcessingPassOrders.PostProcessingStackPostUpscale, + _ => throw new ArgumentOutOfRangeException(), + }; public override IToonPostProcessingPass CreatePass() => new ToonPostProcessingStack(); diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackSettings.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackSettings.cs index a8fa8ba0..a44cd2ab 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackSettings.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonPostProcessingStackSettings.cs @@ -6,8 +6,16 @@ namespace DELTation.ToonRP.PostProcessing.BuiltIn [Serializable] public struct ToonPostProcessingStackSettings { + public enum PassOrder + { + PreUpscale, + PostUpscale, + } + private const int HeaderSize = 12; + public PassOrder Order; + [ToonRpHeader("FXAA", Size = HeaderSize)] public ToonFxaaSettings Fxaa; diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutline.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutline.cs index 3f53e455..8860216b 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutline.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutline.cs @@ -21,5 +21,10 @@ public override void Render(CommandBuffer cmd, RenderTargetIdentifier source, _impl.RenderViaBlit(cmd, _settings, source, destination); } } + + public static PrePassMode RequiredPrePassMode(in ToonScreenSpaceOutlineSettings settings) + => settings.NormalsFilter.Enabled + ? PrePassMode.Normals | PrePassMode.Depth + : PrePassMode.Depth; } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutlineAsset.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutlineAsset.cs index 953ad300..a5a837e6 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutlineAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonScreenSpaceOutlineAsset.cs @@ -34,12 +34,7 @@ private void Reset() }; } - public override DepthPrePassMode RequiredDepthPrePassMode() => RequiredDepthPrePassMode(Settings); - - public static DepthPrePassMode RequiredDepthPrePassMode(in ToonScreenSpaceOutlineSettings settings) - => settings.NormalsFilter.Enabled - ? DepthPrePassMode.DepthNormals - : DepthPrePassMode.Depth; + public override PrePassMode RequiredPrePassMode() => ToonScreenSpaceOutline.RequiredPrePassMode(Settings); public override int Order() => ToonPostProcessingPassOrders.Outline; diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpen.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpen.cs new file mode 100644 index 00000000..c4e33fd6 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpen.cs @@ -0,0 +1,39 @@ +using UnityEngine; +using UnityEngine.Rendering; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + public class ToonSharpen : ToonPostProcessingPassBase + { + public const string ShaderName = "Hidden/Toon RP/Sharpen"; + private static readonly int AmountId = Shader.PropertyToID("_Amount"); + private readonly Material _material = ToonRpUtils.CreateEngineMaterial(ShaderName, "Toon RP Sharpen"); + private Camera _camera; + private ToonSharpenSettings _settings; + + public override void Setup(CommandBuffer cmd, in ToonPostProcessingContext context) + { + base.Setup(cmd, in context); + + _camera = context.Camera; + _settings = context.Settings.Find(); + } + + public override void Render(CommandBuffer cmd, RenderTargetIdentifier source, + RenderTargetIdentifier destination) + { + using (new ProfilingScope(cmd, NamedProfilingSampler.Get(ToonRpPassId.Sharpen))) + { + if (_camera.cameraType == CameraType.Game) + { + _material.SetFloat(AmountId, _settings.Amount); + cmd.Blit(source, destination, _material); + } + else + { + cmd.Blit(source, destination); + } + } + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpen.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpen.cs.meta new file mode 100644 index 00000000..6cd61bd2 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpen.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ddbfa66b083f4266abf06f5f96b99442 +timeCreated: 1697289349 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenAsset.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenAsset.cs new file mode 100644 index 00000000..bcaada53 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenAsset.cs @@ -0,0 +1,28 @@ +using System; +using UnityEngine; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + [CreateAssetMenu(menuName = Path + "Sharpen")] + public class ToonSharpenAsset : ToonPostProcessingPassAsset + { + private void Reset() + { + Settings = new ToonSharpenSettings + { + Amount = 0.8f, + }; + } + + public override int Order() => Settings.Order switch + { + ToonSharpenSettings.PassOrder.PreUpscale => ToonPostProcessingPassOrders.SharpenPreUpscale, + ToonSharpenSettings.PassOrder.PostUpscale => ToonPostProcessingPassOrders.SharpenPostUpscale, + _ => throw new ArgumentOutOfRangeException(), + }; + + public override IToonPostProcessingPass CreatePass() => new ToonSharpen(); + + protected override string[] ForceIncludedShaderNames() => new[] { ToonSharpen.ShaderName }; + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenAsset.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenAsset.cs.meta new file mode 100644 index 00000000..16fbd358 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenAsset.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 380e850bbb5b42e5918f6e5c6be80a6c +timeCreated: 1697289543 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenSettings.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenSettings.cs new file mode 100644 index 00000000..fc4561eb --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenSettings.cs @@ -0,0 +1,20 @@ +using System; +using UnityEngine; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + [Serializable] + public struct ToonSharpenSettings + { + public enum PassOrder + { + PreUpscale, + PostUpscale, + } + + public PassOrder Order; + + [Range(-0.0f, 10.0f)] + public float Amount; + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenSettings.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenSettings.cs.meta new file mode 100644 index 00000000..b4d533cf --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonSharpenSettings.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 863e4f627d9346fdb5bdf0bad0a03e2d +timeCreated: 1697289496 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAA.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAA.cs new file mode 100644 index 00000000..b2f58ef9 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAA.cs @@ -0,0 +1,64 @@ +using UnityEngine; +using UnityEngine.Rendering; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + public class ToonTemporalAA : ToonPostProcessingPassBase + { + public const string ShaderName = "Hidden/Toon RP/Temporal AA"; + private const string HistoryRtName = "_ToonRP_TAAHistory"; + private static readonly int HistoryRtId = Shader.PropertyToID(HistoryRtName); + private static readonly int ModulationFactorId = Shader.PropertyToID("_ToonRP_TemporalAA_ModulationFactor"); + private readonly Material _material = ToonRpUtils.CreateEngineMaterial(ShaderName, "Toon RP Temporal AA"); + private Camera _camera; + private ToonTemporalAAPersistentData _persistentData; + private ToonTemporalAASettings _settings; + + public override void Setup(CommandBuffer cmd, in ToonPostProcessingContext context) + { + base.Setup(cmd, in context); + + _persistentData = context.AdditionalCameraData.TemporalAAPersistentData; + _camera = context.Camera; + EnsureHistoryIsAllocated(context, _persistentData); + + _settings = context.Settings.Find(); + } + + private static void EnsureHistoryIsAllocated(ToonPostProcessingContext context, + ToonTemporalAAPersistentData persistentData) + { + if (persistentData.HistoryRt != null) + { + return; + } + + ToonCameraRendererSettings cameraRendererSettings = context.CameraRendererSettings; + persistentData.HistoryRt = RTHandles.Alloc(Vector2.one, + colorFormat: ToonCameraRenderer.GetRenderTextureColorFormat(cameraRendererSettings, true), + filterMode: cameraRendererSettings.RenderTextureFilterMode, name: HistoryRtName + ); + } + + public override void Render(CommandBuffer cmd, RenderTargetIdentifier source, + RenderTargetIdentifier destination) + { + using (new ProfilingScope(cmd, NamedProfilingSampler.Get(ToonRpPassId.TemporalAA))) + { + if (ToonTemporalAAUtils.CameraSupportsTaa(_camera) && _persistentData.HistoryRtStoredValidData) + { + cmd.SetGlobalTexture(HistoryRtId, _persistentData.HistoryRt); + cmd.SetGlobalFloat(ModulationFactorId, _settings.ModulationFactor); + cmd.Blit(source, destination, _material); + } + else + { + cmd.Blit(source, destination); + } + + cmd.Blit(destination, _persistentData.HistoryRt); + _persistentData.OnCapturedHistoryRt(); + } + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAA.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAA.cs.meta new file mode 100644 index 00000000..cc28574e --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAA.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 54815bae5c18e894b8cc992568dbc533 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAAsset.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAAsset.cs new file mode 100644 index 00000000..fe4e8cdc --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAAsset.cs @@ -0,0 +1,25 @@ +using UnityEngine; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + [CreateAssetMenu(menuName = Path + "Temporal AA")] + public class ToonTemporalAAAsset : ToonPostProcessingPassAsset + { + private void Reset() + { + Settings = new ToonTemporalAASettings + { + JitterScale = 1.0f, + ModulationFactor = 0.8f, + }; + } + + public override int Order() => ToonPostProcessingPassOrders.TemporalAA; + + public override IToonPostProcessingPass CreatePass() => new ToonTemporalAA(); + + protected override string[] ForceIncludedShaderNames() => new[] { ToonTemporalAA.ShaderName }; + + public override PrePassMode RequiredPrePassMode() => PrePassMode.MotionVectors; + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAAsset.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAAsset.cs.meta new file mode 100644 index 00000000..f2b6f41e --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAAsset.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1fd3c1cebd638fc4a8d33a05a462c8ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAPersistentData.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAPersistentData.cs new file mode 100644 index 00000000..ba26e693 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAPersistentData.cs @@ -0,0 +1,19 @@ +using System; +using JetBrains.Annotations; +using UnityEngine.Rendering; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + public class ToonTemporalAAPersistentData : IDisposable + { + [CanBeNull] public RTHandle HistoryRt { get; set; } + public bool HistoryRtStoredValidData { get; private set; } + + public void Dispose() + { + HistoryRt?.Release(); + } + + public void OnCapturedHistoryRt() => HistoryRtStoredValidData = true; + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAPersistentData.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAPersistentData.cs.meta new file mode 100644 index 00000000..fb7b674a --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAPersistentData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0ff0ddff4990ca47b85b03483a1e9d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAASettings.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAASettings.cs new file mode 100644 index 00000000..f8c1c234 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAASettings.cs @@ -0,0 +1,14 @@ +using System; +using UnityEngine; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + [Serializable] + public struct ToonTemporalAASettings + { + [Min(0.0f)] + public float JitterScale; + [Range(0.0f, 1.0f)] + public float ModulationFactor; + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAASettings.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAASettings.cs.meta new file mode 100644 index 00000000..a84b3b20 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAASettings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0a5250171759bf4889187c0adee1546 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAUtils.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAUtils.cs new file mode 100644 index 00000000..0b61347a --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAUtils.cs @@ -0,0 +1,74 @@ +using UnityEngine; +using UnityEngine.Rendering; + +namespace DELTation.ToonRP.PostProcessing.BuiltIn +{ + public static class ToonTemporalAAUtils + { + public static bool CameraSupportsTaa(Camera camera) => camera.cameraType == CameraType.Game; + + public static Matrix4x4 CalculateJitterMatrix( + in ToonPostProcessingSettings postProcessingSettings, + Camera camera, + ToonCameraRenderTarget renderTarget) + { + Matrix4x4 jitterMatrix = Matrix4x4.identity; + + if (!CameraSupportsTaa(camera)) + { + return jitterMatrix; + } + + if (!postProcessingSettings.Enabled) + { + return jitterMatrix; + } + + if (!TryGetTaaSettings(postProcessingSettings, out ToonTemporalAASettings taaSettings)) + { + return jitterMatrix; + } + + int taaFrameIndex = Time.frameCount; + + float actualWidth = renderTarget.Width; + float actualHeight = renderTarget.Height; + float jitterScale = taaSettings.JitterScale; + + Vector2 jitter = CalculateJitter(taaFrameIndex) * jitterScale; + + float offsetX = jitter.x * (2.0f / actualWidth); + float offsetY = jitter.y * (2.0f / actualHeight); + + jitterMatrix = Matrix4x4.Translate(new Vector3(offsetX, offsetY, 0.0f)); + + return jitterMatrix; + } + + private static Vector2 CalculateJitter(int frameIndex) + { + // The variance between 0 and the actual halton sequence values reveals noticeable + // instability in Unity's shadow maps, so we avoid index 0. + float jitterX = HaltonSequence.Get((frameIndex & 1023) + 1, 2) - 0.5f; + float jitterY = HaltonSequence.Get((frameIndex & 1023) + 1, 3) - 0.5f; + + return new Vector2(jitterX, jitterY); + } + + private static bool TryGetTaaSettings(in ToonPostProcessingSettings postProcessingSettings, + out ToonTemporalAASettings taaSettings) + { + foreach (ToonPostProcessingPassAsset passAsset in postProcessingSettings.Passes) + { + if (passAsset is ToonPostProcessingPassAsset taaAsset) + { + taaSettings = taaAsset.Settings; + return true; + } + } + + taaSettings = default; + return false; + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAUtils.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAUtils.cs.meta new file mode 100644 index 00000000..5ef35aa0 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/BuiltIn/ToonTemporalAAUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee734a6dc0e2f994cb68a50ba196232b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/IToonPostProcessingPass.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/IToonPostProcessingPass.cs index 9ca69770..8f2b7bc8 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/IToonPostProcessingPass.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/IToonPostProcessingPass.cs @@ -1,9 +1,12 @@ -using UnityEngine.Rendering; +using System; +using UnityEngine.Rendering; namespace DELTation.ToonRP.PostProcessing { - public interface IToonPostProcessingPass + public interface IToonPostProcessingPass : IDisposable { + int Order { get; set; } + /// /// Given the current settings, whether the pass should run. /// diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessing.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessing.cs index 83f36a61..9d9f5f47 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessing.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessing.cs @@ -1,14 +1,21 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; +using DELTation.ToonRP.PostProcessing.BuiltIn; using UnityEngine; using UnityEngine.Experimental.Rendering; using UnityEngine.Rendering; namespace DELTation.ToonRP.PostProcessing { - public class ToonPostProcessing + public class ToonPostProcessing : IDisposable { private static readonly int PostProcessingBufferId = Shader.PropertyToID("_ToonRP_PostProcessing"); + private static readonly int PostProcessingBufferNative0Id = + Shader.PropertyToID("_ToonRP_PostProcessing_Native0"); + private static readonly int PostProcessingBufferNative1Id = + Shader.PropertyToID("_ToonRP_PostProcessing_Native1"); + private readonly Dictionary _assetToPass = new(); private List _allFullScreenPasses; private ToonCameraRendererSettings _cameraRendererSettings; private ScriptableRenderContext _context; @@ -17,6 +24,14 @@ public class ToonPostProcessing public bool AnyFullScreenEffectsEnabled => _enabledFullScreenPasses.Count > 0; + public void Dispose() + { + foreach (IToonPostProcessingPass pass in _allFullScreenPasses) + { + pass.Dispose(); + } + } + public void UpdatePasses(Camera camera, in ToonPostProcessingSettings settings) { _enabledFullScreenPasses ??= new List(); @@ -32,19 +47,36 @@ public void UpdatePasses(Camera camera, in ToonPostProcessingSettings settings) return; } + // Invalidate of any of the orders have changed + foreach ((ToonPostProcessingPassAsset passAsset, IToonPostProcessingPass pass) in _assetToPass) + { + if (passAsset != null && passAsset.Order() == pass.Order) + { + continue; + } + + _allFullScreenPasses = null; + _assetToPass.Clear(); + break; + } + if (_allFullScreenPasses == null) { _allFullScreenPasses = new List(); + _assetToPass.Clear(); if (settings.Passes != null) { - foreach (ToonPostProcessingPassAsset passAsset in settings.Passes - .Where(p => p != null) - .OrderBy(p => p.Order()) + foreach ((ToonPostProcessingPassAsset passAsset, int order) in settings.Passes + .Select(p => (Pass: p, Order: p.Order())) + .Where(i => i.Pass != null) + .OrderBy(i => i.Order) ) { IToonPostProcessingPass pass = passAsset.CreatePass(); + pass.Order = order; _allFullScreenPasses.Add(pass); + _assetToPass[passAsset] = pass; } } } @@ -60,6 +92,7 @@ public void UpdatePasses(Camera camera, in ToonPostProcessingSettings settings) public void Setup(in ScriptableRenderContext context, in ToonPostProcessingSettings settings, in ToonCameraRendererSettings cameraRendererSettings, + ToonAdditionalCameraData additionalCameraData, GraphicsFormat colorFormat, Camera camera, int rtWidth, int rtHeight) { _context = context; @@ -72,6 +105,8 @@ public void Setup(in ScriptableRenderContext context, in ToonPostProcessingSetti RtWidth = rtWidth, RtHeight = rtHeight, Camera = camera, + CameraRendererSettings = _cameraRendererSettings, + AdditionalCameraData = additionalCameraData, }; SetupPasses(); @@ -117,13 +152,43 @@ public void RenderFullScreenEffects(int width, int height, GraphicsFormat format _cameraRendererSettings.RenderTextureFilterMode, format ); + bool native = false; + foreach (IToonPostProcessingPass pass in _enabledFullScreenPasses) { - if (pass.NeedsDistinctSourceAndDestination()) + bool switchedToNative = false; + + if (pass.Order >= ToonPostProcessingPassOrders.SwitchToNativeResolution && !native) + { + int nativeWidth = _postProcessingContext.Camera.pixelWidth; + int nativeHeight = _postProcessingContext.Camera.pixelHeight; + cmd.GetTemporaryRT(PostProcessingBufferNative0Id, nativeWidth, nativeHeight, 0, + FilterMode.Point, RenderTextureFormat.Default + ); + cmd.GetTemporaryRT(PostProcessingBufferNative1Id, nativeWidth, nativeHeight, 0, + FilterMode.Point, RenderTextureFormat.Default + ); + currentDestination = PostProcessingBufferNative0Id; + native = true; + switchedToNative = true; + } + + + // Case 1: source and destination need to be distinct + if (switchedToNative || pass.NeedsDistinctSourceAndDestination()) { pass.Render(cmd, currentSource, currentDestination); - (currentSource, currentDestination) = (currentDestination, currentSource); + + if (switchedToNative) + { + (currentSource, currentDestination) = (currentDestination, PostProcessingBufferNative1Id); + } + else + { + (currentSource, currentDestination) = (currentDestination, currentSource); + } } + // Case 2: source and destination can be the same else { pass.Render(cmd, currentSource, currentSource); @@ -140,9 +205,16 @@ public void RenderFullScreenEffects(int width, int height, GraphicsFormat format ToonBlitter.BlitDefault(cmd, currentSource); } } + + cmd.ReleaseTemporaryRT(PostProcessingBufferId); + + if (native) + { + cmd.ReleaseTemporaryRT(PostProcessingBufferNative0Id); + cmd.ReleaseTemporaryRT(PostProcessingBufferNative1Id); + } } - cmd.ReleaseTemporaryRT(PostProcessingBufferId); _context.ExecuteCommandBuffer(cmd); cmd.Clear(); diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingContext.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingContext.cs index 8d9a401e..321a4158 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingContext.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingContext.cs @@ -10,5 +10,7 @@ public struct ToonPostProcessingContext public int RtWidth; public int RtHeight; public Camera Camera; + public ToonCameraRendererSettings CameraRendererSettings; + public ToonAdditionalCameraData AdditionalCameraData; } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassAsset.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassAsset.cs index 2199eba7..6340981d 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassAsset.cs @@ -20,8 +20,7 @@ protected virtual void OnValidate() public virtual int Order() => 0; - public virtual DepthPrePassMode RequiredDepthPrePassMode() => - DepthPrePassMode.Off; + public virtual PrePassMode RequiredPrePassMode() => PrePassMode.Off; public abstract IToonPostProcessingPass CreatePass(); diff --git a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassBase.cs b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassBase.cs index 0f10fc57..b0823b9c 100644 --- a/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassBase.cs +++ b/Packages/com.deltation.toon-rp/Runtime/PostProcessing/ToonPostProcessingPassBase.cs @@ -18,5 +18,9 @@ public abstract void Render(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination); public virtual void Cleanup(CommandBuffer cmd) { } + + public int Order { get; set; } + + public virtual void Dispose() { } } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/PrePassMode.cs b/Packages/com.deltation.toon-rp/Runtime/PrePassMode.cs new file mode 100644 index 00000000..b3f4dd67 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/PrePassMode.cs @@ -0,0 +1,34 @@ +using System; +using JetBrains.Annotations; + +namespace DELTation.ToonRP +{ + [Flags] + public enum PrePassMode + { + Off, + Depth = 1 << 0, + Normals = 1 << 1, + MotionVectors = 1 << 2, + } + + public static class PrePassModeExtensions + { + [Pure] + public static bool Includes(this PrePassMode mode, PrePassMode other) => (mode & other) != 0; + + [Pure] + public static PrePassMode Sanitize(this PrePassMode mode) + { + if (!mode.Includes(PrePassMode.Depth)) + { + if (mode.Includes(PrePassMode.Normals) || mode.Includes(PrePassMode.MotionVectors)) + { + mode |= PrePassMode.Depth; + } + } + + return mode; + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/DepthPrePassMode.cs.meta b/Packages/com.deltation.toon-rp/Runtime/PrePassMode.cs.meta similarity index 100% rename from Packages/com.deltation.toon-rp/Runtime/DepthPrePassMode.cs.meta rename to Packages/com.deltation.toon-rp/Runtime/PrePassMode.cs.meta diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonAdditionalCameraData.cs b/Packages/com.deltation.toon-rp/Runtime/ToonAdditionalCameraData.cs new file mode 100644 index 00000000..639996d9 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/ToonAdditionalCameraData.cs @@ -0,0 +1,52 @@ +using DELTation.ToonRP.PostProcessing.BuiltIn; +using UnityEngine; +using UnityEngine.Rendering; + +namespace DELTation.ToonRP +{ + [DisallowMultipleComponent] + [RequireComponent(typeof(Camera))] + [ExecuteAlways] + public sealed class ToonAdditionalCameraData : MonoBehaviour, IAdditionalData + { + public Camera Camera { get; private set; } + + public Matrix4x4 BaseProjectionMatrix { get; set; } + public Matrix4x4 JitteredProjectionMatrix { get; set; } + public Matrix4x4 JitteredGpuProjectionMatrix { get; set; } + public int RtWidth { get; set; } + public int RtHeight { get; set; } + + public bool UsingCustomProjection { get; private set; } + + public ToonMotionVectorsPersistentData MotionVectorsPersistentData { get; } = new(); + public ToonTemporalAAPersistentData TemporalAAPersistentData { get; } = new(); + + private void Awake() + { + Camera = GetComponent(); + } + + private void OnDestroy() + { + TemporalAAPersistentData.Dispose(); + } + + public void SetCustomProjectionMatrix(Matrix4x4 projectionMatrix) + { + Camera.projectionMatrix = projectionMatrix; + UsingCustomProjection = true; + } + + public void RestoreProjection() + { + if (!UsingCustomProjection) + { + return; + } + + UsingCustomProjection = false; + Camera.ResetProjectionMatrix(); + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonAdditionalCameraData.cs.meta b/Packages/com.deltation.toon-rp/Runtime/ToonAdditionalCameraData.cs.meta new file mode 100644 index 00000000..a1959493 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/ToonAdditionalCameraData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 95c2934b0cd14cf6acf388dc989c86dd +timeCreated: 1697041814 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonCameraData.cs b/Packages/com.deltation.toon-rp/Runtime/ToonCameraData.cs new file mode 100644 index 00000000..1421020b --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/ToonCameraData.cs @@ -0,0 +1,20 @@ +using UnityEngine; + +namespace DELTation.ToonRP +{ + public readonly struct ToonCameraData + { + public readonly Camera Camera; + public readonly float AspectRatio; + public readonly Matrix4x4 ViewMatrix; + public readonly Matrix4x4 ProjectionMatrix; + + public ToonCameraData(Camera camera) + { + Camera = camera; + AspectRatio = camera.aspect; + ViewMatrix = camera.worldToCameraMatrix; + ProjectionMatrix = camera.projectionMatrix; + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonCameraData.cs.meta b/Packages/com.deltation.toon-rp/Runtime/ToonCameraData.cs.meta new file mode 100644 index 00000000..9fa07b2e --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/ToonCameraData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d6f971e11261bb4b8a914622c23dae4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonCameraRenderer.cs b/Packages/com.deltation.toon-rp/Runtime/ToonCameraRenderer.cs index 9314dd63..e383be8e 100644 --- a/Packages/com.deltation.toon-rp/Runtime/ToonCameraRenderer.cs +++ b/Packages/com.deltation.toon-rp/Runtime/ToonCameraRenderer.cs @@ -3,6 +3,7 @@ using DELTation.ToonRP.Extensions; using DELTation.ToonRP.Lighting; using DELTation.ToonRP.PostProcessing; +using DELTation.ToonRP.PostProcessing.BuiltIn; using DELTation.ToonRP.Shadows; using UnityEngine; using UnityEngine.Experimental.Rendering; @@ -20,26 +21,28 @@ public sealed partial class ToonCameraRenderer : IDisposable new("SRPDefaultUnlit"), }; private static readonly int PostProcessingSourceId = Shader.PropertyToID("_ToonRP_PostProcessingSource"); - private static readonly int UnityMatrixInvPId = Shader.PropertyToID("unity_MatrixInvP"); private readonly DepthPrePass _depthPrePass = new(); private readonly ToonRenderingExtensionsCollection _extensionsCollection = new(); private readonly CommandBuffer _finalBlitCmd = new() { name = "Final Blit" }; private readonly ToonGlobalRamp _globalRamp = new(); private readonly ToonLighting _lighting = new(); + private readonly MotionVectorsPrePass _motionVectorsPrePass = new(); private readonly ToonPostProcessing _postProcessing = new(); private readonly ToonCameraRenderTarget _renderTarget = new(); private readonly ToonShadows _shadows = new(); private readonly ToonTiledLighting _tiledLighting; + private ToonAdditionalCameraData _additionalCameraData; private Camera _camera; + private ToonCameraData _cameraData; private string _cmdName = DefaultCmdName; private ScriptableRenderContext _context; private CullingResults _cullingResults; - private DepthPrePassMode _depthPrePassMode; private GraphicsFormat _depthStencilFormat; private ToonRenderingExtensionContext _extensionContext; + private PrePassMode _prePassMode; private ToonCameraRendererSettings _settings; public ToonCameraRenderer() => _tiledLighting = new ToonTiledLighting(_lighting); @@ -49,11 +52,41 @@ public void Dispose() _tiledLighting?.Dispose(); } - public static DepthPrePassMode GetOverrideDepthPrePassMode(in ToonCameraRendererSettings settings, + private static GraphicsFormat GetDefaultGraphicsFormat() => + GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.Default, true); + + public static GraphicsFormat GetRenderTextureColorFormat(in ToonCameraRendererSettings settings, + bool ignoreMsaa = false) + { + if (!settings.OverrideRenderTextureFormat) + { + return settings.AllowHdr + ? GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.DefaultHDR, false) + : GetDefaultGraphicsFormat(); + } + + GraphicsFormat rawGraphicsFormat = settings.RenderTextureFormat; + FormatUsage formatUsage = FormatUsage.Render; + if (!ignoreMsaa) + { + // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags + formatUsage |= settings.Msaa switch + { + MsaaMode._2x => FormatUsage.MSAA2x, + MsaaMode._4x => FormatUsage.MSAA4x, + MsaaMode._8x => FormatUsage.MSAA8x, + _ => 0, + }; + } + + return SystemInfo.GetCompatibleFormat(rawGraphicsFormat, formatUsage); + } + + public static PrePassMode GetOverridePrePassMode(in ToonCameraRendererSettings settings, in ToonPostProcessingSettings postProcessingSettings, in ToonRenderingExtensionSettings extensionSettings) { - DepthPrePassMode mode = settings.DepthPrePass; + PrePassMode mode = settings.PrePass; if (postProcessingSettings.Passes != null) { @@ -64,7 +97,7 @@ public static DepthPrePassMode GetOverrideDepthPrePassMode(in ToonCameraRenderer continue; } - mode = DepthPrePassModeUtils.CombineDepthPrePassModes(mode, pass.RequiredDepthPrePassMode()); + mode |= pass.RequiredPrePassMode(); } } @@ -77,28 +110,32 @@ public static DepthPrePassMode GetOverrideDepthPrePassMode(in ToonCameraRenderer continue; } - mode = DepthPrePassModeUtils.CombineDepthPrePassModes(mode, extension.RequiredDepthPrePassMode()); + mode |= extension.RequiredPrePassMode(); } } if (settings.IsTiledLightingEnabledAndSupported()) { - mode = DepthPrePassModeUtils.CombineDepthPrePassModes(mode, DepthPrePassMode.Depth); + mode |= PrePassMode.Depth; } return mode; } - public void Render(ScriptableRenderContext context, Camera camera, in ToonCameraRendererSettings settings, - in ToonRampSettings globalRampSettings, in ToonShadowSettings toonShadowSettings, + public void Render( + ScriptableRenderContext context, Camera camera, ToonAdditionalCameraData additionalCameraData, + in ToonCameraRendererSettings settings, + in ToonRampSettings globalRampSettings, + in ToonShadowSettings shadowSettings, in ToonPostProcessingSettings postProcessingSettings, in ToonRenderingExtensionSettings extensionSettings) { _context = context; _camera = camera; _settings = settings; + _additionalCameraData = additionalCameraData; - if (!Cull(toonShadowSettings)) + if (!Cull(shadowSettings)) { return; } @@ -111,24 +148,41 @@ public void Render(ScriptableRenderContext context, Camera camera, in ToonCamera PrepareMsaa(camera, out int msaaSamples); PrepareForSceneWindow(); - _depthPrePassMode = GetOverrideDepthPrePassMode(settings, postProcessingSettings, extensionSettings); + _prePassMode = GetOverridePrePassMode(settings, postProcessingSettings, extensionSettings).Sanitize(); _postProcessing.UpdatePasses(camera, postProcessingSettings); - Setup(cmd, globalRampSettings, toonShadowSettings, extensionSettings, msaaSamples); + Setup(cmd, globalRampSettings, shadowSettings, extensionSettings, postProcessingSettings, msaaSamples); _extensionsCollection.Update(extensionSettings); _extensionsCollection.Setup(_extensionContext); - _postProcessing.Setup(_context, postProcessingSettings, _settings, _renderTarget.ColorFormat, _camera, + _postProcessing.Setup(_context, postProcessingSettings, _settings, additionalCameraData, + _renderTarget.ColorFormat, _camera, _renderTarget.Width, _renderTarget.Height ); - if (_depthPrePassMode != DepthPrePassMode.Off) + if (_prePassMode != PrePassMode.Off) { - _extensionsCollection.RenderEvent(ToonRenderingEvent.BeforeDepthPrepass); - _depthPrePass.Setup(_context, _cullingResults, _camera, settings, _depthPrePassMode, - _renderTarget.Width, _renderTarget.Height - ); - _depthPrePass.Render(); - _extensionsCollection.RenderEvent(ToonRenderingEvent.AfterDepthPrepass); + _extensionsCollection.RenderEvent(ToonRenderingEvent.BeforePrepass); + + _context.ExecuteCommandBufferAndClear(cmd); + + if (_prePassMode.Includes(PrePassMode.Depth)) + { + _depthPrePass.Setup(_context, _cullingResults, _camera, settings, _prePassMode, + _renderTarget.Width, _renderTarget.Height + ); + _depthPrePass.Render(); + } + + if (_prePassMode.Includes(PrePassMode.MotionVectors)) + { + _motionVectorsPrePass.Setup(_context, _cullingResults, _camera, additionalCameraData, + settings, + _renderTarget.Width, _renderTarget.Height + ); + _motionVectorsPrePass.Render(); + } + + _extensionsCollection.RenderEvent(ToonRenderingEvent.AfterPrepass); } _tiledLighting.CullLights(); @@ -156,6 +210,7 @@ public void Render(ScriptableRenderContext context, Camera camera, in ToonCamera Cleanup(cmd); Submit(cmd); + _additionalCameraData.RestoreProjection(); CommandBufferPool.Release(cmd); } @@ -197,14 +252,11 @@ private bool Cull(in ToonShadowSettings toonShadowSettings) private void Setup(CommandBuffer cmd, in ToonRampSettings globalRampSettings, in ToonShadowSettings toonShadowSettings, in ToonRenderingExtensionSettings extensionSettings, + in ToonPostProcessingSettings postProcessingSettings, int msaaSamples) { SetupLighting(cmd, globalRampSettings, toonShadowSettings); - _context.SetupCameraProperties(_camera); - Matrix4x4 gpuProjectionMatrix = ToonRpUtils.GetGPUProjectionMatrix(_camera.projectionMatrix); - cmd.SetGlobalMatrix(UnityMatrixInvPId, Matrix4x4.Inverse(gpuProjectionMatrix)); - float renderScale = _camera.cameraType == CameraType.Game ? _settings.RenderScale : 1.0f; int maxRtWidth = int.MaxValue; int maxRtHeight = int.MaxValue; @@ -224,31 +276,6 @@ private void Setup(CommandBuffer cmd, in ToonRampSettings globalRampSettings, int rtWidth = _camera.pixelWidth; int rtHeight = _camera.pixelHeight; - static GraphicsFormat GetDefaultGraphicsFormat() => - GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.Default, true); - - static GraphicsFormat GetRenderTextureColorFormat(in ToonCameraRendererSettings settings) - { - if (!settings.OverrideRenderTextureFormat) - { - return settings.AllowHdr - ? GraphicsFormatUtility.GetGraphicsFormat(RenderTextureFormat.DefaultHDR, false) - : GetDefaultGraphicsFormat(); - } - - GraphicsFormat rawGraphicsFormat = settings.RenderTextureFormat; - FormatUsage formatUsage = FormatUsage.Render; - formatUsage |= settings.Msaa switch - { - MsaaMode._2x => FormatUsage.MSAA2x, - MsaaMode._4x => FormatUsage.MSAA4x, - MsaaMode._8x => FormatUsage.MSAA8x, - _ => 0, - }; - - return SystemInfo.GetCompatibleFormat(rawGraphicsFormat, formatUsage); - } - GraphicsFormat renderTextureColorFormat = GetRenderTextureColorFormat(_settings); bool renderToTexture = renderTextureColorFormat != GetDefaultGraphicsFormat() || msaaSamples > 1 || @@ -305,14 +332,53 @@ static GraphicsFormat GetRenderTextureColorFormat(in ToonCameraRendererSettings _renderTarget.InitializeAsCameraRenderTarget(_camera, rtWidth, rtHeight, renderTextureColorFormat); } - _context.ExecuteCommandBufferAndClear(cmd); + UpdateRtHandles(rtWidth, rtHeight); + + Matrix4x4 jitterMatrix = + ToonTemporalAAUtils.CalculateJitterMatrix(postProcessingSettings, _camera, _renderTarget); + _cameraData = new ToonCameraData(_camera); + + _additionalCameraData.MotionVectorsPersistentData.JitterMatrix = jitterMatrix; + _additionalCameraData.BaseProjectionMatrix = _camera.nonJitteredProjectionMatrix; + _additionalCameraData.JitteredProjectionMatrix = jitterMatrix * _additionalCameraData.BaseProjectionMatrix; + _additionalCameraData.JitteredGpuProjectionMatrix = + ToonRpUtils.GetGPUProjectionMatrix(_additionalCameraData.JitteredProjectionMatrix); + ToonRpUtils.SetupCameraProperties(ref _context, _additionalCameraData, + _additionalCameraData.JitteredProjectionMatrix + ); + cmd.SetGlobalMatrix(ToonRpUtils.ShaderPropertyId.InverseProjectionMatrix, + Matrix4x4.Inverse(_additionalCameraData.JitteredGpuProjectionMatrix) + ); + + if (_prePassMode.Includes(PrePassMode.MotionVectors)) + { + SupportedRenderingFeatures.active.motionVectors = true; + _additionalCameraData.MotionVectorsPersistentData.Update(_cameraData); + } _extensionContext = - new ToonRenderingExtensionContext(_context, _camera, _settings, _cullingResults, _renderTarget); + new ToonRenderingExtensionContext(_context, _camera, _settings, _cullingResults, _renderTarget, + _additionalCameraData + ); _tiledLighting.Setup(_context, _extensionContext); } + private void UpdateRtHandles(int rtWidth, int rtHeight) + { + if (_additionalCameraData.RtWidth != rtWidth || _additionalCameraData.RtHeight != rtHeight) + { + RTHandles.ResetReferenceSize(rtWidth, rtHeight); + } + else + { + RTHandles.SetReferenceSize(rtWidth, rtHeight); + } + + _additionalCameraData.RtWidth = rtWidth; + _additionalCameraData.RtHeight = rtHeight; + } + private bool RequireStencil(in ToonRenderingExtensionSettings extensionSettings) { if (_settings.Stencil) @@ -441,9 +507,17 @@ private void Cleanup(CommandBuffer cmd) { _shadows.Cleanup(); - if (_depthPrePassMode != DepthPrePassMode.Off) + // Pre-Pass Cleanup { - _depthPrePass.Cleanup(); + if (_prePassMode.Includes(PrePassMode.Depth)) + { + _depthPrePass.Cleanup(); + } + + if (_prePassMode.Includes(PrePassMode.MotionVectors)) + { + _motionVectorsPrePass.Cleanup(); + } } _extensionsCollection.Cleanup(); @@ -466,7 +540,7 @@ private void DrawVisibleGeometry(CommandBuffer cmd) _context.ExecuteCommandBufferAndClear(cmd); { - ToonTiledLighting.PrepareForOpaqueGeometry(cmd); + _tiledLighting.PrepareForOpaqueGeometry(cmd); _extensionsCollection.RenderEvent(ToonRenderingEvent.BeforeOpaque); diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonCameraRendererSettings.cs b/Packages/com.deltation.toon-rp/Runtime/ToonCameraRendererSettings.cs index 13d32a75..1758ed0a 100644 --- a/Packages/com.deltation.toon-rp/Runtime/ToonCameraRendererSettings.cs +++ b/Packages/com.deltation.toon-rp/Runtime/ToonCameraRendererSettings.cs @@ -48,7 +48,7 @@ public enum MsaaMode [Min(0)] public int MaxRenderTextureHeight; public FilterMode RenderTextureFilterMode; - public DepthPrePassMode DepthPrePass; + public PrePassMode PrePass; public LayerMask OpaqueLayerMask; public LayerMask TransparentLayerMask; diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonMotionVectorsPersistentData.cs b/Packages/com.deltation.toon-rp/Runtime/ToonMotionVectorsPersistentData.cs new file mode 100644 index 00000000..73658253 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/ToonMotionVectorsPersistentData.cs @@ -0,0 +1,35 @@ +using UnityEngine; + +namespace DELTation.ToonRP +{ + public sealed class ToonMotionVectorsPersistentData + { + private float _prevAspectRatio = -1; + + public int LastFrameIndex { get; private set; } = -1; + + public Matrix4x4 ViewProjection { get; private set; } = Matrix4x4.identity; + + internal Matrix4x4 PreviousViewProjection { get; private set; } = Matrix4x4.identity; + + public Matrix4x4 JitterMatrix { get; set; } + + public void Update(in ToonCameraData cameraData) + { + bool aspectChanged = !Mathf.Approximately(_prevAspectRatio, cameraData.AspectRatio); + bool shouldUpdate = LastFrameIndex != Time.frameCount || aspectChanged; + if (!shouldUpdate) + { + return; + } + + Matrix4x4 gpuViewProjection = GL.GetGPUProjectionMatrix(cameraData.ProjectionMatrix, true) * + cameraData.ViewMatrix; + PreviousViewProjection = aspectChanged ? gpuViewProjection : ViewProjection; + ViewProjection = gpuViewProjection; + + LastFrameIndex = Time.frameCount; + _prevAspectRatio = cameraData.AspectRatio; + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonMotionVectorsPersistentData.cs.meta b/Packages/com.deltation.toon-rp/Runtime/ToonMotionVectorsPersistentData.cs.meta new file mode 100644 index 00000000..584496c8 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Runtime/ToonMotionVectorsPersistentData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc5a7541c3e3f0847adf63c31921cf39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipeline.cs b/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipeline.cs index 86b4a791..58f2a46f 100644 --- a/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipeline.cs +++ b/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipeline.cs @@ -47,7 +47,9 @@ protected override void Render(ScriptableRenderContext context, Camera[] cameras foreach (Camera camera in cameras) { - _cameraRenderer.Render(context, camera, + ToonAdditionalCameraData additionalCameraData = GetOrAddAdditionalCameraData(camera); + + _cameraRenderer.Render(context, camera, additionalCameraData, _cameraRendererSettings, _globalRampSettings, _shadowSettings, @@ -56,5 +58,15 @@ protected override void Render(ScriptableRenderContext context, Camera[] cameras ); } } + + private static ToonAdditionalCameraData GetOrAddAdditionalCameraData(Camera camera) + { + if (!camera.TryGetComponent(out ToonAdditionalCameraData additionalCameraData)) + { + additionalCameraData = camera.gameObject.AddComponent(); + } + + return additionalCameraData; + } } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipelineAsset.cs b/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipelineAsset.cs index 4331aa8b..94ad1b35 100644 --- a/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipelineAsset.cs +++ b/Packages/com.deltation.toon-rp/Runtime/ToonRenderPipelineAsset.cs @@ -141,10 +141,12 @@ protected override void OnValidate() { CameraRendererSettings.MaxLightsPerTile = ToonTiledLighting.MaxLightsPerTile / 2; } + + CameraRendererSettings.PrePass = CameraRendererSettings.PrePass.Sanitize(); } - public DepthPrePassMode GetEffectiveDepthPrePassMode() => - ToonCameraRenderer.GetOverrideDepthPrePassMode(CameraRendererSettings, PostProcessing, Extensions); + public PrePassMode GetEffectiveDepthPrePassMode() => + ToonCameraRenderer.GetOverridePrePassMode(CameraRendererSettings, PostProcessing, Extensions); protected override RenderPipeline CreatePipeline() => new ToonRenderPipeline(CameraRendererSettings, GlobalRampSettings, ShadowSettings, PostProcessing, diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonRenderingEvent.cs b/Packages/com.deltation.toon-rp/Runtime/ToonRenderingEvent.cs index 2973f6d7..9d426a51 100644 --- a/Packages/com.deltation.toon-rp/Runtime/ToonRenderingEvent.cs +++ b/Packages/com.deltation.toon-rp/Runtime/ToonRenderingEvent.cs @@ -2,8 +2,8 @@ { public enum ToonRenderingEvent { - BeforeDepthPrepass, - AfterDepthPrepass, + BeforePrepass, + AfterPrepass, BeforeOpaque, AfterOpaque, BeforeSkybox, diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonRpPassId.cs b/Packages/com.deltation.toon-rp/Runtime/ToonRpPassId.cs index 39766410..f85ae48c 100644 --- a/Packages/com.deltation.toon-rp/Runtime/ToonRpPassId.cs +++ b/Packages/com.deltation.toon-rp/Runtime/ToonRpPassId.cs @@ -6,6 +6,7 @@ public static class ToonRpPassId public const string Shadows = "Shadows"; public const string BlobShadows = "Blob Shadows"; public const string DepthPrePass = "Depth Pre-Pass"; + public const string MotionVectorsPrePass = "Motion Vectors Pre-Pass"; public const string Ssao = "SSAO"; public const string TiledLighting = "Tiled Lighting"; public const string PrepareRenderTargets = "Prepare Render Targets"; @@ -20,6 +21,8 @@ public static class ToonRpPassId public const string Bloom = "Bloom"; public const string LightScattering = "Light Scattering"; public const string RenderObjects = "Render Objects"; + public const string TemporalAA = "TAA"; + public const string Sharpen = "Sharpen"; public const string Debug = "Debug"; public const string BlitPostProcessingResults = "Blit Post-Processing Results"; } diff --git a/Packages/com.deltation.toon-rp/Runtime/ToonRpUtils.cs b/Packages/com.deltation.toon-rp/Runtime/ToonRpUtils.cs index 8f2c7813..f7f54258 100644 --- a/Packages/com.deltation.toon-rp/Runtime/ToonRpUtils.cs +++ b/Packages/com.deltation.toon-rp/Runtime/ToonRpUtils.cs @@ -37,7 +37,8 @@ public static void ExecuteCommandBufferAndClear(ref this ScriptableRenderContext } public static void SetViewAndProjectionMatrices(CommandBuffer cmd, Matrix4x4 viewMatrix, - Matrix4x4 gpuProjectionMatrix, bool setInverseMatrices) + Matrix4x4 gpuProjectionMatrix, + bool setInverseMatrices) { Matrix4x4 viewAndProjectionMatrix = gpuProjectionMatrix * viewMatrix; cmd.SetGlobalMatrix(ShaderPropertyId.ViewMatrix, viewMatrix); @@ -49,9 +50,26 @@ public static void SetViewAndProjectionMatrices(CommandBuffer cmd, Matrix4x4 vie return; } + SetInverseViewAndProjectionMatrices(cmd, viewMatrix, gpuProjectionMatrix, viewAndProjectionMatrix); + } + + public static void SetupCameraProperties(ref ScriptableRenderContext context, + ToonAdditionalCameraData additionalCameraData, + Matrix4x4 overrideProjectionMatrix) + { + additionalCameraData.SetCustomProjectionMatrix(overrideProjectionMatrix); + context.SetupCameraProperties(additionalCameraData.Camera); + } + + private static void SetInverseViewAndProjectionMatrices(CommandBuffer cmd, + Matrix4x4 viewMatrix, + Matrix4x4 gpuProjectionMatrix, + Matrix4x4 viewAndProjectionMatrix + ) + { var inverseViewMatrix = Matrix4x4.Inverse(viewMatrix); var inverseProjectionMatrix = Matrix4x4.Inverse(gpuProjectionMatrix); - Matrix4x4 inverseViewProjection = inverseViewMatrix * inverseProjectionMatrix; + var inverseViewProjection = Matrix4x4.Inverse(viewAndProjectionMatrix); cmd.SetGlobalMatrix(ShaderPropertyId.InverseViewMatrix, inverseViewMatrix); cmd.SetGlobalMatrix(ShaderPropertyId.InverseProjectionMatrix, inverseProjectionMatrix); cmd.SetGlobalMatrix(ShaderPropertyId.InverseViewAndProjectionMatrix, inverseViewProjection); @@ -60,12 +78,6 @@ public static void SetViewAndProjectionMatrices(CommandBuffer cmd, Matrix4x4 vie public static Matrix4x4 GetGPUProjectionMatrix(Matrix4x4 projectionMatrix) => GL.GetGPUProjectionMatrix(projectionMatrix, SystemInfo.graphicsUVStartsAtTop); - public static void RestoreCameraMatrices(Camera camera, CommandBuffer cmd, bool setInverseMatrices) - { - Matrix4x4 gpuProjectionMatrix = GetGPUProjectionMatrix(camera.projectionMatrix); - SetViewAndProjectionMatrices(cmd, camera.worldToCameraMatrix, gpuProjectionMatrix, setInverseMatrices); - } - public static Vector4 BuildRampVectorFromEdges(float edge1, float edge2) => BuildRampVectorFromSmoothness(edge1, edge2 - edge1); @@ -81,7 +93,7 @@ public static Vector4 BuildRampVectorFromSmoothness(float a, float smoothness) return new Vector4(invBMinusA, -a * invBMinusA); } - private static class ShaderPropertyId + public static class ShaderPropertyId { public static readonly int ViewMatrix = Shader.PropertyToID("unity_MatrixV"); public static readonly int ProjectionMatrix = Shader.PropertyToID("glstate_matrix_projection"); diff --git a/Packages/com.deltation.toon-rp/ShaderLibrary/MotionVectors.hlsl b/Packages/com.deltation.toon-rp/ShaderLibrary/MotionVectors.hlsl new file mode 100644 index 00000000..7375bff9 --- /dev/null +++ b/Packages/com.deltation.toon-rp/ShaderLibrary/MotionVectors.hlsl @@ -0,0 +1,48 @@ +#ifndef TOON_RP_MOTION_VECTORS +#define TOON_RP_MOTION_VECTORS + +#include "Common.hlsl" + +TEXTURE2D(_ToonRP_MotionVectorsTexture); +SAMPLER(sampler_ToonRP_MotionVectorsTexture); + +// This is required to avoid artifacts ("gaps" in the _MotionVectorTexture) on some platform +void ApplyMotionVectorZBias(inout float4 positionCs) +{ + #if defined(UNITY_REVERSED_Z) + positionCs.z -= unity_MotionVectorsParams.z * positionCs.w; + #else + positionCs.z += unity_MotionVectorsParams.z * positionCs.w; + #endif +} + +float2 CalcNdcMotionVectorFromCsPositions(const float4 positionCs, const float4 previousPositionCs) +{ + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + const bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + return float2(0.0, 0.0); + } + + // Non-uniform raster needs to keep the posNDC values in float to avoid additional conversions + // since uv remap functions use floats + const float2 positionNdc = positionCs.xy * rcp(positionCs.w); + const float2 previousPositionNdc = previousPositionCs.xy * rcp(previousPositionCs.w); + + // Calculate forward velocity + float2 velocity = positionNdc.xy - previousPositionNdc.xy; + #if UNITY_UV_STARTS_AT_TOP + velocity.y = -velocity.y; + #endif + + // Convert velocity from NDC space (-1..1) to UV 0..1 space + // Note: It doesn't mean we don't have negative values, we store negative or positive offset in UV space. + // Note: ((posNDC * 0.5 + 0.5) - (prevPosNDC * 0.5 + 0.5)) = (velocity * 0.5) + velocity.xy *= 0.5; + + return velocity; +} + + +#endif // TOON_RP_UNITY_INPUT \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/ShaderLibrary/MotionVectors.hlsl.meta b/Packages/com.deltation.toon-rp/ShaderLibrary/MotionVectors.hlsl.meta new file mode 100644 index 00000000..469f273d --- /dev/null +++ b/Packages/com.deltation.toon-rp/ShaderLibrary/MotionVectors.hlsl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 677ccb36d9674d948de5d8ad84421259 +timeCreated: 1696974382 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/ShaderLibrary/UnityInput.hlsl b/Packages/com.deltation.toon-rp/ShaderLibrary/UnityInput.hlsl index a806f53d..1cd92a0a 100644 --- a/Packages/com.deltation.toon-rp/ShaderLibrary/UnityInput.hlsl +++ b/Packages/com.deltation.toon-rp/ShaderLibrary/UnityInput.hlsl @@ -6,29 +6,32 @@ // Block Layout should be respected due to SRP Batcher CBUFFER_START(UnityPerDraw) -// Space block Feature -float4x4 unity_ObjectToWorld; -float4x4 unity_WorldToObject; -float4 unity_LODFade; // x is the fade value ranging within [0,1]. y is x quantized into 16 levels -real4 unity_WorldTransformParams; // w is usually 1.0, or -1.0 for odd-negative scale transforms - -// Light Indices block feature -real4 unity_LightData; -real4 unity_LightIndices[2]; - -// Velocity -float4x4 unity_MatrixPreviousM; -float4x4 unity_MatrixPreviousMI; - -// SH block feature -real4 unity_SHAr; -real4 unity_SHAg; -real4 unity_SHAb; -real4 unity_SHBr; -real4 unity_SHBg; -real4 unity_SHBb; -real4 unity_SHC; - + // Space block Feature + float4x4 unity_ObjectToWorld; + float4x4 unity_WorldToObject; + float4 unity_LODFade; // x is the fade value ranging within [0,1]. y is x quantized into 16 levels + real4 unity_WorldTransformParams; // w is usually 1.0, or -1.0 for odd-negative scale transforms + + // Light Indices block feature + real4 unity_LightData; + real4 unity_LightIndices[2]; + + // SH block feature + real4 unity_SHAr; + real4 unity_SHAg; + real4 unity_SHAb; + real4 unity_SHBr; + real4 unity_SHBg; + real4 unity_SHBb; + real4 unity_SHC; + + // Motion Vectors + float4x4 unity_MatrixPreviousM; + float4x4 unity_MatrixPreviousMI; + //X : Use last frame positions (right now skinned meshes are the only objects that use this + //Y : Force No Motion + //Z : Z bias value + float4 unity_MotionVectorsParams; CBUFFER_END float4x4 unity_MatrixVP; @@ -49,10 +52,12 @@ float4 unity_OrthoParams; float4 unity_FogParams; real4 unity_FogColor; +float4x4 _PrevViewProjMatrix; // non-jittered. Motion vectors. +float4x4 _NonJitteredViewProjMatrix; // non-jittered. + bool IsOrthographicCamera() { return unity_OrthoParams.w == 1.0; } - #endif // TOON_RP_UNITY_INPUT \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/Particles/ToonRPParticlesUnlit.shader b/Packages/com.deltation.toon-rp/Shaders/Particles/ToonRPParticlesUnlit.shader index 169912cd..275cce91 100644 --- a/Packages/com.deltation.toon-rp/Shaders/Particles/ToonRPParticlesUnlit.shader +++ b/Packages/com.deltation.toon-rp/Shaders/Particles/ToonRPParticlesUnlit.shader @@ -39,6 +39,8 @@ HLSLINCLUDE + //#pragma enable_d3d11_debug_symbols + // Require variable-length loops #pragma target 3.5 @@ -56,8 +58,6 @@ HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_fog #pragma multi_compile_instancing @@ -80,8 +80,6 @@ HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_instancing // Per-Material @@ -102,8 +100,6 @@ HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_instancing // Per-Material @@ -124,8 +120,6 @@ HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_instancing // Per-Material @@ -134,6 +128,26 @@ #include "ToonRPParticlesUnlitInput.hlsl" #include "../ToonRPDefaultDepthNormalsPass.hlsl" + ENDHLSL + } + + Pass + { + Name "Toon RP Particles Motion Vectors" + Tags{ "LightMode" = "ToonRPMotionVectors" } + + ColorMask RG + + HLSLPROGRAM + + #pragma multi_compile_instancing + + // Per-Material + #pragma shader_feature_local _ALPHATEST_ON + + #include "ToonRPParticlesUnlitInput.hlsl" + #include "../ToonRPDefaultMotionVectorsPass.hlsl" + ENDHLSL } } diff --git a/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPDebugPass.shader b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPDebugPass.shader index b5dba55b..bf2d51fa 100644 --- a/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPDebugPass.shader +++ b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPDebugPass.shader @@ -21,6 +21,35 @@ { return SAMPLE_TEXTURE2D_LOD(_MainTex, LINEAR_SAMPLER, uv, 0).rgb; } + + //#pragma enable_d3d11_debug_symbols + + #pragma vertex VS + #pragma fragment PS + + #include "../../ShaderLibrary/TiledLighting.hlsl" + + struct appdata + { + float3 position : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float4 positionCs : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + v2f VS(const appdata IN) + { + v2f OUT; + OUT.uv = IN.uv; + OUT.positionCs = TransformObjectToHClip(IN.position); + return OUT; + } + + float4 PS(v2f IN); ENDHLSL Pass @@ -29,33 +58,6 @@ HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - - #pragma vertex VS - #pragma fragment PS - - #include "../../ShaderLibrary/TiledLighting.hlsl" - - struct appdata - { - float3 position : POSITION; - float2 uv : TEXCOORD0; - }; - - struct v2f - { - float4 positionCs : SV_POSITION; - float2 uv : TEXCOORD0; - }; - - v2f VS(const appdata IN) - { - v2f OUT; - OUT.uv = IN.uv; - OUT.positionCs = TransformObjectToHClip(IN.position); - return OUT; - } - bool _TiledLighting_ShowOpaque; bool _TiledLighting_ShowTransparent; @@ -90,5 +92,60 @@ ENDHLSL } + + Pass + { + Name "Toon RP Debug Pass: Depth" + + HLSLPROGRAM + + #include "../../ShaderLibrary/DepthNormals.hlsl" + + float4 PS(const v2f IN) : SV_TARGET + { + const float depth = SampleDepthTexture(IN.uv); + return float4(depth, 0.0f, 0.0f, 1.0f); + } + + ENDHLSL + } + + Pass + { + Name "Toon RP Debug Pass: Normals" + + HLSLPROGRAM + + #include "../../ShaderLibrary/DepthNormals.hlsl" + + float4 PS(const v2f IN) : SV_TARGET + { + const float3 normals = SampleNormalsTexture(IN.uv) * 0.5f + 0.5f; + return float4(normals, 1.0f); + } + + ENDHLSL + } + + Pass + { + Name "Toon RP Debug Pass: Motion Vectors" + + HLSLPROGRAM + + #include "../../ShaderLibrary/MotionVectors.hlsl" + + float _MotionVectors_Scale; + float _MotionVectors_SceneIntensity; + + float4 PS(const v2f IN) : SV_TARGET + { + const float2 motionVectorsSample = SAMPLE_TEXTURE2D_LOD(_ToonRP_MotionVectorsTexture, sampler_ToonRP_MotionVectorsTexture, IN.uv, 0).rg; + const float3 result = SampleSource(IN.uv) * _MotionVectors_SceneIntensity + float3(abs(motionVectorsSample) * _MotionVectors_Scale, 0.0f); + return float4(result, 1.0f); + } + + ENDHLSL + } } } \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPSharpen.shader b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPSharpen.shader new file mode 100644 index 00000000..eb237841 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPSharpen.shader @@ -0,0 +1,86 @@ +Shader "Hidden/Toon RP/Sharpen" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + HLSLINCLUDE + + #include "../../ShaderLibrary/Common.hlsl" + #include "../../ShaderLibrary/Textures.hlsl" + + TEXTURE2D(_MainTex); + DECLARE_TEXEL_SIZE(_MainTex); + SAMPLER(sampler_MainTex); + + float3 SampleSource(const float2 uv) + { + return SAMPLE_TEXTURE2D_LOD(_MainTex, sampler_MainTex, uv, 0).rgb; + } + + float3 SampleSourceOffset(const float2 uv, const float2 offset) + { + return SAMPLE_TEXTURE2D_LOD(_MainTex, sampler_MainTex, uv + _MainTex_TexelSize.xy * offset, 0).rgb; + } + + //#pragma enable_d3d11_debug_symbols + + #pragma vertex VS + #pragma fragment PS + + struct appdata + { + float3 position : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float4 positionCs : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + v2f VS(const appdata IN) + { + v2f OUT; + OUT.uv = IN.uv; + OUT.positionCs = TransformObjectToHClip(IN.position); + return OUT; + } + + float4 PS(v2f IN); + + ENDHLSL + Pass + { + HLSLPROGRAM + + float _Amount; + + // https://lettier.github.io/3d-game-shaders-for-beginners/sharpen.html + float3 ApplySharpen(const float2 uv) + { + const float neighbor = _Amount * -1; + const float center = _Amount * 4 + 1; + + float3 color = + SampleSourceOffset(uv, float2(0, 1)) * neighbor + + SampleSourceOffset(uv, float2(-1, 0)) * neighbor + + SampleSource(uv) * center + + SampleSourceOffset(uv, float2(1, 0)) * neighbor + + SampleSourceOffset(uv, float2(0, -1)) * neighbor; + return color; + } + + float4 PS(const v2f IN) : SV_TARGET + { + float3 color = ApplySharpen(IN.uv); + return float4(color, 1.0f); + } + + ENDHLSL + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPSharpen.shader.meta b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPSharpen.shader.meta new file mode 100644 index 00000000..fb9bdaf2 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPSharpen.shader.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 986c305002ce4ab7b310d1520c097cee +timeCreated: 1697289108 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPTemporalAA.shader b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPTemporalAA.shader new file mode 100644 index 00000000..bca43ac1 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPTemporalAA.shader @@ -0,0 +1,98 @@ +Shader "Hidden/Toon RP/Temporal AA" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + SubShader + { + HLSLINCLUDE + + #include "../../ShaderLibrary/Common.hlsl" + #include "../../ShaderLibrary/MotionVectors.hlsl" + #include "../../ShaderLibrary/Textures.hlsl" + + TEXTURE2D(_MainTex); + DECLARE_TEXEL_SIZE(_MainTex); + SAMPLER(sampler_MainTex); + + TEXTURE2D(_ToonRP_TAAHistory); + SAMPLER(sampler_ToonRP_TAAHistory); + + float _ToonRP_TemporalAA_ModulationFactor; + + float3 SampleSource(const float2 uv) + { + return SAMPLE_TEXTURE2D_LOD(_MainTex, sampler_MainTex, uv, 0).rgb; + } + + float3 SampleSourceOffset(const float2 uv, const float2 offset) + { + return SAMPLE_TEXTURE2D_LOD(_MainTex, sampler_MainTex, uv + _MainTex_TexelSize.xy * offset, 0).rgb; + } + + float3 SampleHistory(const float2 uv) + { + return SAMPLE_TEXTURE2D_LOD(_ToonRP_TAAHistory, sampler_ToonRP_TAAHistory, uv, 0).rgb; + } + + //#pragma enable_d3d11_debug_symbols + + #pragma vertex VS + #pragma fragment PS + + struct appdata + { + float3 position : POSITION; + float2 uv : TEXCOORD0; + }; + + struct v2f + { + float4 positionCs : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + v2f VS(const appdata IN) + { + v2f OUT; + OUT.uv = IN.uv; + OUT.positionCs = TransformObjectToHClip(IN.position); + return OUT; + } + + float4 PS(v2f IN); + + ENDHLSL + Pass + { + HLSLPROGRAM + + float4 PS(const v2f IN) : SV_TARGET + { + // Originally from here: https://sugulee.wordpress.com/2021/06/21/temporal-anti-aliasingtaa-tutorial/ + // Adapted from the version from: https://github.com/Delt06/dx12-renderer/blob/master/Framework/shaders/TAA_Resolve_PS.hlsl + const float2 uv = IN.uv; + const float2 velocity = SAMPLE_TEXTURE2D_LOD(_ToonRP_MotionVectorsTexture, sampler_ToonRP_MotionVectorsTexture, uv, 0).xy; + const float2 previousPixelUv = uv - velocity; + + const float3 currentColor = SampleSource(uv); + const float3 historyColor = SampleHistory(previousPixelUv); + + const float3 nearColor0 = SampleSourceOffset(uv, float2(1, 0)); + const float3 nearColor1 = SampleSourceOffset(uv, float2(0, 1)); + const float3 nearColor2 = SampleSourceOffset(uv, float2(-1, 0)); + const float3 nearColor3 = SampleSourceOffset(uv, float2(0, -1)); + + const float3 boxMin = min(currentColor, min(nearColor0, min(nearColor1, min(nearColor2, nearColor3)))); + const float3 boxMax = max(currentColor, max(nearColor0, max(nearColor1, max(nearColor2, nearColor3)))); + + const float3 boxedHistoryColor = clamp(historyColor, boxMin, boxMax); + float3 resultColor = lerp(currentColor, boxedHistoryColor, _ToonRP_TemporalAA_ModulationFactor); + return float4(resultColor, 1.0f); + } + + ENDHLSL + } + } +} \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPTemporalAA.shader.meta b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPTemporalAA.shader.meta new file mode 100644 index 00000000..843ac126 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Shaders/PostProcessing/ToonRPTemporalAA.shader.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 677d80d3ea664815bd08649680575719 +timeCreated: 1697141546 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefault.shader b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefault.shader index a0b34ea8..15cf4709 100644 --- a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefault.shader +++ b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefault.shader @@ -72,6 +72,8 @@ HLSLINCLUDE + //#pragma enable_d3d11_debug_symbols + // Require variable-length loops #pragma target 3.5 @@ -162,6 +164,24 @@ #include "ToonRPDefaultInput.hlsl" #include "ToonRPDefaultDepthNormalsPass.hlsl" + ENDHLSL + } + + Pass + { + Name "Toon RP Motion Vectors" + Tags{ "LightMode" = "ToonRPMotionVectors" } + + ColorMask RG + + HLSLPROGRAM + + #include_with_pragmas "PragmaIncludes/ToonRPDefaultBaseMultiCompileList.hlsl" + #include_with_pragmas "PragmaIncludes/ToonRPDefaultBaseShaderFeatureList.hlsl" + + #include "ToonRPDefaultInput.hlsl" + #include "ToonRPDefaultMotionVectorsPass.hlsl" + ENDHLSL } } diff --git a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultDepthOnlyPass.hlsl b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultDepthOnlyPass.hlsl index 9d63d1e0..c9dcfa6b 100644 --- a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultDepthOnlyPass.hlsl +++ b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultDepthOnlyPass.hlsl @@ -4,9 +4,9 @@ #include "../ShaderLibrary/Common.hlsl" #include "../ShaderLibrary/Textures.hlsl" -#if defined(_NORMAL_MAP) || defined(_ALPHATEST_ON) +#if defined(_ALPHATEST_ON) #define REQUIRE_UV_INTERPOLANT -#endif // _NORMAL_MAP || _ALPHATEST_ON +#endif // _ALPHATEST_ON struct appdata { diff --git a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultLite.shader b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultLite.shader index 5c41c8a1..49968f30 100644 --- a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultLite.shader +++ b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultLite.shader @@ -68,6 +68,8 @@ HLSLINCLUDE + //#pragma enable_d3d11_debug_symbols + // Require variable-length loops #pragma target 3.5 @@ -156,6 +158,24 @@ #include "ToonRPDefaultLiteInput.hlsl" #include "ToonRPDefaultDepthNormalsPass.hlsl" + ENDHLSL + } + + Pass + { + Name "Toon RP Motion Vectors (Lite)" + Tags{ "LightMode" = "ToonRPMotionVectors" } + + ColorMask RG + + HLSLPROGRAM + + #include_with_pragmas "PragmaIncludes/ToonRPDefaultBaseMultiCompileList.hlsl" + #include_with_pragmas "PragmaIncludes/ToonRPDefaultBaseShaderFeatureList.hlsl" + + #include "ToonRPDefaultLiteInput.hlsl" + #include "ToonRPDefaultMotionVectorsPass.hlsl" + ENDHLSL } } diff --git a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultMotionVectorsPass.hlsl b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultMotionVectorsPass.hlsl new file mode 100644 index 00000000..84691aaa --- /dev/null +++ b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultMotionVectorsPass.hlsl @@ -0,0 +1,69 @@ +#ifndef TOON_RP_DEFAULT_DEPTH_ONLY_PASS +#define TOON_RP_DEFAULT_DEPTH_ONLY_PASS + +#include "../ShaderLibrary/Common.hlsl" +#include "../ShaderLibrary/MotionVectors.hlsl" +#include "../ShaderLibrary/Textures.hlsl" + +#if defined(_ALPHATEST_ON) +#define REQUIRE_UV_INTERPOLANT +#endif // _ALPHATEST_ON + +struct appdata +{ + float3 vertex : POSITION; + + #ifdef REQUIRE_UV_INTERPOLANT + float2 uv : TEXCOORD; + #endif // REQUIRE_UV_INTERPOLANT + + float3 positionOld : TEXCOORD4; + + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct v2f +{ + #ifdef REQUIRE_UV_INTERPOLANT + float2 uv : TEXCOORD; + #endif // REQUIRE_UV_INTERPOLANT + + float4 positionCs : SV_POSITION; + float4 positionCsNoJitter : POSITION_CS_NO_JITTER; + float4 previousPositionCsNoJitter : PREVIOUS_POSITION_CS_NO_JITTER; +}; + +v2f VS(const appdata IN) +{ + v2f OUT; + + UNITY_SETUP_INSTANCE_ID(IN); + + #ifdef REQUIRE_UV_INTERPOLANT + OUT.uv = APPLY_TILING_OFFSET(IN.uv, _MainTexture); + #endif // REQUIRE_UV_INTERPOLANT + + const float3 positionWs = TransformObjectToWorld(IN.vertex); + + OUT.positionCs = TransformWorldToHClip(positionWs); + OUT.positionCsNoJitter = mul(_NonJitteredViewProjMatrix, float4(positionWs, 1)); + + const float3 previousPosition = (unity_MotionVectorsParams.x == 1) ? IN.positionOld.xyz : IN.vertex; + OUT.previousPositionCsNoJitter = mul(_PrevViewProjMatrix, mul(UNITY_PREV_MATRIX_M, float4(previousPosition, 1))); + + ApplyMotionVectorZBias(OUT.positionCs); + + return OUT; +} + +float4 PS(const v2f IN) : SV_TARGET +{ + #ifdef _ALPHATEST_ON + const float alpha = SampleAlbedo(IN.uv).a; + AlphaClip(alpha); + #endif // _ALPHATEST_ON + + return float4(CalcNdcMotionVectorFromCsPositions(IN.positionCsNoJitter, IN.previousPositionCsNoJitter), 0, 0); +} + +#endif // TOON_RP_DEFAULT_DEPTH_ONLY_PASS \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultMotionVectorsPass.hlsl.meta b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultMotionVectorsPass.hlsl.meta new file mode 100644 index 00000000..416654d9 --- /dev/null +++ b/Packages/com.deltation.toon-rp/Shaders/ToonRPDefaultMotionVectorsPass.hlsl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: d300d4729f3e442b8f388a773b0481c8 +timeCreated: 1696974484 \ No newline at end of file diff --git a/Packages/com.deltation.toon-rp/Shaders/ToonRPUnlit.shader b/Packages/com.deltation.toon-rp/Shaders/ToonRPUnlit.shader index a05526b4..5c120509 100644 --- a/Packages/com.deltation.toon-rp/Shaders/ToonRPUnlit.shader +++ b/Packages/com.deltation.toon-rp/Shaders/ToonRPUnlit.shader @@ -39,6 +39,8 @@ HLSLINCLUDE + //#pragma enable_d3d11_debug_symbols + #pragma vertex VS #pragma fragment PS @@ -62,8 +64,6 @@ HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_fog #pragma multi_compile_instancing @@ -82,15 +82,13 @@ Pass { - Name "Toon RP Shadow Caster" + Name "Toon RP Shadow Caster (Unlit)" Tags{ "LightMode" = "ShadowCaster" } ColorMask RG HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_instancing // Shadows @@ -107,15 +105,13 @@ Pass { - Name "Toon RP Depth Only" + Name "Toon RP Depth Only (Unlit)" Tags{ "LightMode" = "ToonRPDepthOnly" } ColorMask 0 HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_instancing // Per-Material @@ -129,15 +125,13 @@ Pass { - Name "Toon RP Depth Normals" + Name "Toon RP Depth Normals (Unlit)" Tags{ "LightMode" = "ToonRPDepthNormals" } ColorMask RGB HLSLPROGRAM - //#pragma enable_d3d11_debug_symbols - #pragma multi_compile_instancing // Per-Material @@ -146,6 +140,26 @@ #include "ToonRPUnlitInput.hlsl" #include "ToonRPDefaultDepthNormalsPass.hlsl" + ENDHLSL + } + + Pass + { + Name "Toon RP Motion Vectors (Unlit)" + Tags{ "LightMode" = "ToonRPMotionVectors" } + + ColorMask RG + + HLSLPROGRAM + + #pragma multi_compile_instancing + + // Per-Material + #pragma shader_feature_local _ALPHATEST_ON + + #include "ToonRPUnlitInput.hlsl" + #include "ToonRPDefaultMotionVectorsPass.hlsl" + ENDHLSL } } diff --git a/README.md b/README.md index a6166314..b8fa75ab 100644 --- a/README.md +++ b/README.md @@ -143,12 +143,15 @@ Go to `Edit/Project Settings/Graphics` and set the field `Scriptable Render Pipe - [Ronja's tutorials - Partial Derivatives (fwidth)](https://www.ronja-tutorials.com/post/046-fwidth/) - [Geeks 3D - Fast Approximate Anti-Aliasing (FXAA) Demo](https://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/3/) - [Forward vs Deferred vs Forward+ Rendering with DirectX 11](https://www.3dgep.com/forward-plus/) +- [Sharpen](https://lettier.github.io/3d-game-shaders-for-beginners/sharpen.html) +- [Temporal Anti-Aliasing(TAA) Tutorial - Sugu Lee](https://sugulee.wordpress.com/2021/06/21/temporal-anti-aliasingtaa-tutorial/) ## Used Assets - [Quaternius - Animated Mech Pack](https://quaternius.com/packs/animatedmech.html) - [Quaternius - Ultimate Stylized Nature Pack](https://quaternius.com/packs/ultimatestylizednature.html) - [Quaternius - Ultimate Space Kit](https://quaternius.com/packs/ultimatespacekit.html) - [Quaternius - Toon Shooter Game Kit](https://quaternius.com/packs/toonshootergamekit.html) +- [Quaternius - Cube World Kit](https://quaternius.com/packs/cubeworldkit.html) - [Aika: Sailor Uniform](https://assetstore.unity.com/packages/3d/characters/aika-sailor-uniform-222398) - [Stone](https://assetstore.unity.com/packages/3d/environments/landscapes/stone-62333) - [nidorx/matcaps: A huge library of MatCap textures in PNG and ZMT.](https://github.com/nidorx/matcaps)