Commit cf22936c authored by ljq's avatar ljq

添加测试展台

parent fa1263d3
fileFormatVersion: 2
guid: aa1640041d09e9f4fa50a6e436d6dae1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 586027b68bdc7a64ab47b8f03960ed55
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 2e7f1cb0edc3a3e4bb403aafbd48c84c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Material_01
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.64
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 0aa302868ebb2314f833d57046287d9a
timeCreated: 1453132858
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Material_02
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.736
- _GlossyReflections: 1
- _Metallic: 0.019
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.5188679, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 7106f0947d0801046a5d830966fd4dd7
timeCreated: 1453132857
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 577f53a370eada241a98b3b9e5a94841
timeCreated: 1453132858
licenseType: Store
ModelImporter:
serializedVersion: 18
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2300000: //RootNode
3300000: //RootNode
4300000: Demo_Module
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
optimizeGameObjects: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
animationCompression: 1
animationRotationError: .5
animationPositionError: .5
animationScaleError: .5
animationWrapMode: 0
extraExposedTransformPaths: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 1
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
splitTangentsAcrossUV: 1
normalImportMode: 0
tangentImportMode: 1
importAnimation: 1
copyAvatar: 0
humanDescription:
human: []
skeleton: []
armTwist: .5
foreArmTwist: .5
upperLegTwist: .5
legTwist: .5
armStretch: .0500000007
legStretch: .0500000007
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e090c14bda23a354a8941ec5323af01b
timeCreated: 1453132858
licenseType: Store
ModelImporter:
serializedVersion: 18
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
2300000: //RootNode
3300000: //RootNode
4300000: Demo_Module_Cap
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
optimizeGameObjects: 0
motionNodeName:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
animationCompression: 1
animationRotationError: .5
animationPositionError: .5
animationScaleError: .5
animationWrapMode: 0
extraExposedTransformPaths: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 1
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
splitTangentsAcrossUV: 1
normalImportMode: 0
tangentImportMode: 1
importAnimation: 1
copyAvatar: 0
humanDescription:
human: []
skeleton: []
armTwist: .5
foreArmTwist: .5
upperLegTwist: .5
legTwist: .5
armStretch: .0500000007
legStretch: .0500000007
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a5758b110afdff044835d888762c3b2d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &127556
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 422306}
- component: {fileID: 3352648}
- component: {fileID: 2395996}
m_Layer: 0
m_Name: Showcase_cap
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &422306
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 127556}
m_LocalRotation: {x: 0.000000021855694, y: 0, z: -0, w: 1}
m_LocalPosition: {x: 1.5, y: 1.446, z: 1.446}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &3352648
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 127556}
m_Mesh: {fileID: 4300000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
--- !u!23 &2395996
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 127556}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 0aa302868ebb2314f833d57046287d9a, 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
fileFormatVersion: 2
guid: 2f9795fa03122d3478a4dc1d0b7b712c
timeCreated: 1453280924
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fe487e5f9d4767443bff86b6e88e2bcc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d72ca71962b15d94b892e6b2cf4f3a84
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c9b954a501cc09f4eaa31e3ae39be4fc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6270625156154343967
MonoBehaviour:
m_ObjectHideFlags: 3
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: adb84e30e02715445aeb9959894e3b4d, type: 3}
m_Name: ColorGrading
m_EditorClassIdentifier:
active: 0
enabled:
overrideState: 1
value: 1
gradingMode:
overrideState: 1
value: 1
externalLut:
overrideState: 0
value: {fileID: 0}
defaultState: 1
tonemapper:
overrideState: 1
value: 3
toneCurveToeStrength:
overrideState: 0
value: 0
toneCurveToeLength:
overrideState: 0
value: 0.5
toneCurveShoulderStrength:
overrideState: 0
value: 0
toneCurveShoulderLength:
overrideState: 0
value: 0.5
toneCurveShoulderAngle:
overrideState: 0
value: 0
toneCurveGamma:
overrideState: 0
value: 1
ldrLut:
overrideState: 0
value: {fileID: 0}
defaultState: 4
ldrLutContribution:
overrideState: 0
value: 1
temperature:
overrideState: 0
value: 0
tint:
overrideState: 0
value: 0
colorFilter:
overrideState: 0
value: {r: 1, g: 1, b: 1, a: 1}
hueShift:
overrideState: 0
value: 0
saturation:
overrideState: 0
value: 0
brightness:
overrideState: 0
value: 0
postExposure:
overrideState: 0
value: 0
contrast:
overrideState: 0
value: 0
mixerRedOutRedIn:
overrideState: 0
value: 100
mixerRedOutGreenIn:
overrideState: 0
value: 0
mixerRedOutBlueIn:
overrideState: 0
value: 0
mixerGreenOutRedIn:
overrideState: 0
value: 0
mixerGreenOutGreenIn:
overrideState: 0
value: 100
mixerGreenOutBlueIn:
overrideState: 0
value: 0
mixerBlueOutRedIn:
overrideState: 0
value: 0
mixerBlueOutGreenIn:
overrideState: 0
value: 0
mixerBlueOutBlueIn:
overrideState: 0
value: 100
lift:
overrideState: 0
value: {x: 1, y: 1, z: 1, w: 0}
gamma:
overrideState: 0
value: {x: 1, y: 1, z: 1, w: 0}
gain:
overrideState: 0
value: {x: 1, y: 1, z: 1, w: 0}
masterCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
cachedData:
- 0
- 0.0078125
- 0.015625
- 0.0234375
- 0.03125
- 0.0390625
- 0.046875
- 0.0546875
- 0.0625
- 0.0703125
- 0.078125
- 0.0859375
- 0.09375
- 0.1015625
- 0.109375
- 0.1171875
- 0.125
- 0.1328125
- 0.140625
- 0.1484375
- 0.15625
- 0.1640625
- 0.171875
- 0.1796875
- 0.1875
- 0.1953125
- 0.203125
- 0.2109375
- 0.21875
- 0.2265625
- 0.234375
- 0.2421875
- 0.25
- 0.2578125
- 0.265625
- 0.2734375
- 0.28125
- 0.2890625
- 0.296875
- 0.3046875
- 0.3125
- 0.3203125
- 0.328125
- 0.3359375
- 0.34375
- 0.3515625
- 0.359375
- 0.3671875
- 0.375
- 0.3828125
- 0.390625
- 0.3984375
- 0.40625
- 0.4140625
- 0.421875
- 0.4296875
- 0.4375
- 0.4453125
- 0.453125
- 0.4609375
- 0.46875
- 0.4765625
- 0.484375
- 0.4921875
- 0.5
- 0.5078125
- 0.515625
- 0.5234375
- 0.53125
- 0.5390625
- 0.546875
- 0.5546875
- 0.5625
- 0.5703125
- 0.578125
- 0.5859375
- 0.59375
- 0.6015625
- 0.609375
- 0.6171875
- 0.625
- 0.6328125
- 0.640625
- 0.6484375
- 0.65625
- 0.6640625
- 0.671875
- 0.6796875
- 0.6875
- 0.6953125
- 0.703125
- 0.7109375
- 0.71875
- 0.7265625
- 0.734375
- 0.7421875
- 0.75
- 0.7578125
- 0.765625
- 0.7734375
- 0.78125
- 0.7890625
- 0.796875
- 0.8046875
- 0.8125
- 0.8203125
- 0.828125
- 0.8359375
- 0.84375
- 0.8515625
- 0.859375
- 0.8671875
- 0.875
- 0.8828125
- 0.890625
- 0.8984375
- 0.90625
- 0.9140625
- 0.921875
- 0.9296875
- 0.9375
- 0.9453125
- 0.953125
- 0.9609375
- 0.96875
- 0.9765625
- 0.984375
- 0.9921875
redCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
cachedData:
- 0
- 0.0078125
- 0.015625
- 0.0234375
- 0.03125
- 0.0390625
- 0.046875
- 0.0546875
- 0.0625
- 0.0703125
- 0.078125
- 0.0859375
- 0.09375
- 0.1015625
- 0.109375
- 0.1171875
- 0.125
- 0.1328125
- 0.140625
- 0.1484375
- 0.15625
- 0.1640625
- 0.171875
- 0.1796875
- 0.1875
- 0.1953125
- 0.203125
- 0.2109375
- 0.21875
- 0.2265625
- 0.234375
- 0.2421875
- 0.25
- 0.2578125
- 0.265625
- 0.2734375
- 0.28125
- 0.2890625
- 0.296875
- 0.3046875
- 0.3125
- 0.3203125
- 0.328125
- 0.3359375
- 0.34375
- 0.3515625
- 0.359375
- 0.3671875
- 0.375
- 0.3828125
- 0.390625
- 0.3984375
- 0.40625
- 0.4140625
- 0.421875
- 0.4296875
- 0.4375
- 0.4453125
- 0.453125
- 0.4609375
- 0.46875
- 0.4765625
- 0.484375
- 0.4921875
- 0.5
- 0.5078125
- 0.515625
- 0.5234375
- 0.53125
- 0.5390625
- 0.546875
- 0.5546875
- 0.5625
- 0.5703125
- 0.578125
- 0.5859375
- 0.59375
- 0.6015625
- 0.609375
- 0.6171875
- 0.625
- 0.6328125
- 0.640625
- 0.6484375
- 0.65625
- 0.6640625
- 0.671875
- 0.6796875
- 0.6875
- 0.6953125
- 0.703125
- 0.7109375
- 0.71875
- 0.7265625
- 0.734375
- 0.7421875
- 0.75
- 0.7578125
- 0.765625
- 0.7734375
- 0.78125
- 0.7890625
- 0.796875
- 0.8046875
- 0.8125
- 0.8203125
- 0.828125
- 0.8359375
- 0.84375
- 0.8515625
- 0.859375
- 0.8671875
- 0.875
- 0.8828125
- 0.890625
- 0.8984375
- 0.90625
- 0.9140625
- 0.921875
- 0.9296875
- 0.9375
- 0.9453125
- 0.953125
- 0.9609375
- 0.96875
- 0.9765625
- 0.984375
- 0.9921875
greenCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
cachedData:
- 0
- 0.0078125
- 0.015625
- 0.0234375
- 0.03125
- 0.0390625
- 0.046875
- 0.0546875
- 0.0625
- 0.0703125
- 0.078125
- 0.0859375
- 0.09375
- 0.1015625
- 0.109375
- 0.1171875
- 0.125
- 0.1328125
- 0.140625
- 0.1484375
- 0.15625
- 0.1640625
- 0.171875
- 0.1796875
- 0.1875
- 0.1953125
- 0.203125
- 0.2109375
- 0.21875
- 0.2265625
- 0.234375
- 0.2421875
- 0.25
- 0.2578125
- 0.265625
- 0.2734375
- 0.28125
- 0.2890625
- 0.296875
- 0.3046875
- 0.3125
- 0.3203125
- 0.328125
- 0.3359375
- 0.34375
- 0.3515625
- 0.359375
- 0.3671875
- 0.375
- 0.3828125
- 0.390625
- 0.3984375
- 0.40625
- 0.4140625
- 0.421875
- 0.4296875
- 0.4375
- 0.4453125
- 0.453125
- 0.4609375
- 0.46875
- 0.4765625
- 0.484375
- 0.4921875
- 0.5
- 0.5078125
- 0.515625
- 0.5234375
- 0.53125
- 0.5390625
- 0.546875
- 0.5546875
- 0.5625
- 0.5703125
- 0.578125
- 0.5859375
- 0.59375
- 0.6015625
- 0.609375
- 0.6171875
- 0.625
- 0.6328125
- 0.640625
- 0.6484375
- 0.65625
- 0.6640625
- 0.671875
- 0.6796875
- 0.6875
- 0.6953125
- 0.703125
- 0.7109375
- 0.71875
- 0.7265625
- 0.734375
- 0.7421875
- 0.75
- 0.7578125
- 0.765625
- 0.7734375
- 0.78125
- 0.7890625
- 0.796875
- 0.8046875
- 0.8125
- 0.8203125
- 0.828125
- 0.8359375
- 0.84375
- 0.8515625
- 0.859375
- 0.8671875
- 0.875
- 0.8828125
- 0.890625
- 0.8984375
- 0.90625
- 0.9140625
- 0.921875
- 0.9296875
- 0.9375
- 0.9453125
- 0.953125
- 0.9609375
- 0.96875
- 0.9765625
- 0.984375
- 0.9921875
blueCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 1
outSlope: 1
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0
m_Range: 1
cachedData:
- 0
- 0.0078125
- 0.015625
- 0.0234375
- 0.03125
- 0.0390625
- 0.046875
- 0.0546875
- 0.0625
- 0.0703125
- 0.078125
- 0.0859375
- 0.09375
- 0.1015625
- 0.109375
- 0.1171875
- 0.125
- 0.1328125
- 0.140625
- 0.1484375
- 0.15625
- 0.1640625
- 0.171875
- 0.1796875
- 0.1875
- 0.1953125
- 0.203125
- 0.2109375
- 0.21875
- 0.2265625
- 0.234375
- 0.2421875
- 0.25
- 0.2578125
- 0.265625
- 0.2734375
- 0.28125
- 0.2890625
- 0.296875
- 0.3046875
- 0.3125
- 0.3203125
- 0.328125
- 0.3359375
- 0.34375
- 0.3515625
- 0.359375
- 0.3671875
- 0.375
- 0.3828125
- 0.390625
- 0.3984375
- 0.40625
- 0.4140625
- 0.421875
- 0.4296875
- 0.4375
- 0.4453125
- 0.453125
- 0.4609375
- 0.46875
- 0.4765625
- 0.484375
- 0.4921875
- 0.5
- 0.5078125
- 0.515625
- 0.5234375
- 0.53125
- 0.5390625
- 0.546875
- 0.5546875
- 0.5625
- 0.5703125
- 0.578125
- 0.5859375
- 0.59375
- 0.6015625
- 0.609375
- 0.6171875
- 0.625
- 0.6328125
- 0.640625
- 0.6484375
- 0.65625
- 0.6640625
- 0.671875
- 0.6796875
- 0.6875
- 0.6953125
- 0.703125
- 0.7109375
- 0.71875
- 0.7265625
- 0.734375
- 0.7421875
- 0.75
- 0.7578125
- 0.765625
- 0.7734375
- 0.78125
- 0.7890625
- 0.796875
- 0.8046875
- 0.8125
- 0.8203125
- 0.828125
- 0.8359375
- 0.84375
- 0.8515625
- 0.859375
- 0.8671875
- 0.875
- 0.8828125
- 0.890625
- 0.8984375
- 0.90625
- 0.9140625
- 0.921875
- 0.9296875
- 0.9375
- 0.9453125
- 0.953125
- 0.9609375
- 0.96875
- 0.9765625
- 0.984375
- 0.9921875
hueVsHueCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 1
m_ZeroValue: 0.5
m_Range: 1
cachedData:
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
hueVsSatCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 1
m_ZeroValue: 0.5
m_Range: 1
cachedData:
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
satVsSatCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0.5
m_Range: 1
cachedData:
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
lumVsSatCurve:
overrideState: 0
value:
curve:
serializedVersion: 2
m_Curve: []
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_Loop: 0
m_ZeroValue: 0.5
m_Range: 1
cachedData:
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
- 0.5
--- !u!114 &-4218328433535059677
MonoBehaviour:
m_ObjectHideFlags: 3
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: d65e486e4de6e5448a8fbb43dc8756a0, type: 3}
m_Name: Grain
m_EditorClassIdentifier:
active: 0
enabled:
overrideState: 1
value: 1
colored:
overrideState: 1
value: 1
intensity:
overrideState: 1
value: 0
size:
overrideState: 1
value: 1
lumContrib:
overrideState: 1
value: 0.8
--- !u!114 &-2636238096547806426
MonoBehaviour:
m_ObjectHideFlags: 3
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: 40b924e2dad56384a8df2a1e111bb675, type: 3}
m_Name: Vignette
m_EditorClassIdentifier:
active: 0
enabled:
overrideState: 1
value: 1
mode:
overrideState: 1
value: 0
color:
overrideState: 1
value: {r: 0, g: 0, b: 0, a: 1}
center:
overrideState: 0
value: {x: 0.5, y: 0.5}
intensity:
overrideState: 1
value: 0
smoothness:
overrideState: 1
value: 0.2
roundness:
overrideState: 1
value: 1
rounded:
overrideState: 1
value: 0
mask:
overrideState: 0
value: {fileID: 0}
defaultState: 1
opacity:
overrideState: 0
value: 1
--- !u!114 &-2177415799399285720
MonoBehaviour:
m_ObjectHideFlags: 3
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: 7a34fa72bd4185749832024e9c8010bf, type: 3}
m_Name: ScreenSpaceReflections
m_EditorClassIdentifier:
active: 1
enabled:
overrideState: 1
value: 1
preset:
overrideState: 1
value: 4
maximumIterationCount:
overrideState: 0
value: 16
resolution:
overrideState: 0
value: 0
thickness:
overrideState: 0
value: 8
maximumMarchDistance:
overrideState: 1
value: 50
distanceFade:
overrideState: 1
value: 0.5
vignette:
overrideState: 0
value: 0.5
--- !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: 8e6292b2c06870d4495f009f912b9600, type: 3}
m_Name: PostProcessing Profile
m_EditorClassIdentifier:
settings:
- {fileID: 5964015449369692137}
- {fileID: 8545935925657258247}
- {fileID: -2177415799399285720}
- {fileID: 575356639671618827}
- {fileID: 1188992873569465299}
- {fileID: -6270625156154343967}
- {fileID: -4218328433535059677}
- {fileID: -2636238096547806426}
--- !u!114 &575356639671618827
MonoBehaviour:
m_ObjectHideFlags: 3
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: b3f6f3f7c722b4544b97e3c75840aa33, type: 3}
m_Name: AutoExposure
m_EditorClassIdentifier:
active: 0
enabled:
overrideState: 1
value: 1
filtering:
overrideState: 1
value: {x: 54.000004, y: 99}
minLuminance:
overrideState: 1
value: 0
maxLuminance:
overrideState: 1
value: 0
keyValue:
overrideState: 1
value: 1.13
eyeAdaptation:
overrideState: 0
value: 0
speedUp:
overrideState: 0
value: 2
speedDown:
overrideState: 0
value: 1
--- !u!114 &1188992873569465299
MonoBehaviour:
m_ObjectHideFlags: 3
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: 6050e2d5de785ce4d931e4dbdbf2d755, type: 3}
m_Name: ChromaticAberration
m_EditorClassIdentifier:
active: 1
enabled:
overrideState: 1
value: 1
spectralLut:
overrideState: 1
value: {fileID: 0}
defaultState: 1
intensity:
overrideState: 1
value: 0.106
fastMode:
overrideState: 1
value: 0
--- !u!114 &5964015449369692137
MonoBehaviour:
m_ObjectHideFlags: 3
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: c1cb7e9e120078f43bce4f0b1be547a7, type: 3}
m_Name: AmbientOcclusion
m_EditorClassIdentifier:
active: 1
enabled:
overrideState: 1
value: 1
mode:
overrideState: 1
value: 1
intensity:
overrideState: 1
value: 0.12
color:
overrideState: 0
value: {r: 0, g: 0, b: 0, a: 1}
ambientOnly:
overrideState: 0
value: 1
noiseFilterTolerance:
overrideState: 0
value: 0
blurTolerance:
overrideState: 0
value: -4.6
upsampleTolerance:
overrideState: 0
value: -12
thicknessModifier:
overrideState: 1
value: 1
directLightingStrength:
overrideState: 0
value: 0
radius:
overrideState: 0
value: 0.25
quality:
overrideState: 0
value: 2
--- !u!114 &8545935925657258247
MonoBehaviour:
m_ObjectHideFlags: 3
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: 48a79b01ea5641d4aa6daa2e23605641, type: 3}
m_Name: Bloom
m_EditorClassIdentifier:
active: 1
enabled:
overrideState: 1
value: 1
intensity:
overrideState: 1
value: 0.88
threshold:
overrideState: 1
value: 1
softKnee:
overrideState: 0
value: 0.5
clamp:
overrideState: 0
value: 65472
diffusion:
overrideState: 0
value: 7
anamorphicRatio:
overrideState: 0
value: 0
color:
overrideState: 0
value: {r: 1, g: 1, b: 1, a: 1}
fastMode:
overrideState: 0
value: 0
dirtTexture:
overrideState: 0
value: {fileID: 0}
defaultState: 1
dirtIntensity:
overrideState: 0
value: 0
fileFormatVersion: 2
guid: fb10bece07b6ef14296459b864d31d99
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 670ef73247a469a47805e3eb96a7974c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System.Collections;
using UnityEditor;
using UnityEngine.UI;
[ExecuteInEditMode]
public class SCG_Base_Controller : MonoBehaviour
{
[Header(" Modules material setup")]
public Color wallsColor = new Color(1f,1f,1f,1f);
public Color baseColor = new Color(0.235f,0.235f,0.235f,1f);
[Header(" Text setup")]
public Color textColor = new Color(1f,1f,1f,1f);
public string baseText;
[Header(" Lighting setup")]
public Color lightColor = new Color(1f,1f,1f,1f);
public float lightIntensity = 1.0f;
Material mat01;
Material mat02;
Text textEditor;
Light pointLight;
void Update ()
{
//Initialize components
mat01 = this.GetComponent<MeshRenderer>().sharedMaterials.GetValue(0) as Material;
mat02 = this.GetComponent<MeshRenderer>().sharedMaterials.GetValue(1) as Material;
textEditor = this.GetComponentInChildren<Text>();
pointLight = this.GetComponentInChildren<Light>();
//Do something
mat01.color = baseColor;
mat02.color = wallsColor;
textEditor.text = baseText;
textEditor.color = textColor;
pointLight.color = lightColor;
pointLight.intensity = lightIntensity;
}
void OnRenderObject ()
{
}
}
fileFormatVersion: 2
guid: 49924851be85d38429b411d5f0d239f9
timeCreated: 1453275999
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 03726e2d4c8ac2e49948b89e91043210
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fc055cdf74196124ab39905e388463c6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6e588ce23a11a7a448fd1554ffd9f7b3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 02cf02f980780254bbe4fe2b49c41e9f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Image Effects/Other/SMAA")]
public class AntiAliasing : MonoBehaviour
{
public enum DebugDisplay
{
Off,
Edges,
Weights,
Depth,
Accumulation
}
public enum EdgeType
{
Luminance,
Color,
Depth
}
public enum TemporalType
{
Off,
SMAA_2x,
Standard_2x,
Standard_4x,
Standard_8x,
Standard_16x
}
private enum Passes
{
Copy = 0,
LumaDetection = 1,
ClearToBlack = 2,
WeightCalculation = 3,
WeightsAndBlend1 = 4,
WeightsAndBlend2 = 5,
ColorDetection = 6,
MergeFrames = 7,
DepthDetection = 8,
DebugDepth = 9
}
public DebugDisplay displayType = DebugDisplay.Off;
// we could make this public, but color and luma are less reliable so we can
// hardcode this to depth for now
public EdgeType edgeType = EdgeType.Depth;
public Texture2D areaTex;
public Texture2D searchTex;
// temporal AA parameters
private Matrix4x4 m_BaseProjectionMatrix;
private Matrix4x4 m_PrevViewProjMat;
private Camera m_AACamera;
private int m_SampleIndex;
[Range(0, 80)] public float K = 1.0f;
public TemporalType temporalType = TemporalType.Off;
[Range(0, 1)] public float temporalAccumulationWeight = 0.3f;
// This should be hidden from view when EdgeType is not Depth
[Range(0.01f, 1.0f)] public float depthThreshold = 0.1f;
private static Matrix4x4 CalculateViewProjection(Camera camera, Matrix4x4 prjMatrix)
{
Matrix4x4 viewMat = camera.worldToCameraMatrix;
Matrix4x4 projMat = GL.GetGPUProjectionMatrix(prjMatrix, true);
return projMat * viewMat;
}
private void StoreBaseProjectionMatrix(Matrix4x4 prjMatrix)
{
m_BaseProjectionMatrix = prjMatrix;
}
private void StorePreviousViewProjMatrix(Matrix4x4 viewPrjMatrix)
{
m_PrevViewProjMat = viewPrjMatrix;
}
private Camera aaCamera
{
get
{
if (m_AACamera == null)
m_AACamera = GetComponent<Camera>();
return m_AACamera;
}
}
public void UpdateSampleIndex()
{
int numSamples = 1;
if (temporalType == TemporalType.SMAA_2x || temporalType == TemporalType.Standard_2x)
{
numSamples = 2;
}
else if (temporalType == TemporalType.Standard_4x)
{
numSamples = 4;
}
else if (temporalType == TemporalType.Standard_8x)
{
numSamples = 8;
}
else if (temporalType == TemporalType.Standard_16x)
{
numSamples = 16;
}
m_SampleIndex = (m_SampleIndex + 1) % numSamples;
}
private Vector2 GetJitterStandard2X()
{
int[,] samples =
{
{4, 4},
{-4, -4},
};
int sampleX = samples[m_SampleIndex, 0];
int sampleY = samples[m_SampleIndex, 1];
float v0 = sampleX / 16.0f;
float v1 = sampleY / 16.0f;
return new Vector2(v0, v1);
}
private Vector2 GetJitterStandard4X()
{
int[,] samples =
{
{-2, -6},
{6, -2},
{-6, 2},
{2, 6}
};
int sampleX = samples[m_SampleIndex, 0];
int sampleY = samples[m_SampleIndex, 1];
float v0 = sampleX / 16.0f;
float v1 = sampleY / 16.0f;
return new Vector2(v0, v1);
}
private Vector2 GetJitterStandard8X()
{
int[,] samples =
{
{7, -7},
{-3, -5},
{3, 7},
{-7, -1},
{5, 1},
{-1, 3},
{1, -3},
{-5, 5}
};
int sampleX = samples[m_SampleIndex, 0];
int sampleY = samples[m_SampleIndex, 1];
float v0 = sampleX / 16.0f;
float v1 = sampleY / 16.0f;
return new Vector2(v0, v1);
}
private Vector2 GetJitterStandard16X()
{
int[,] samples =
{
{7, -4},
{-1, -3},
{3, -5},
{-5, -2},
{6, 7},
{-2, 6},
{2, 5},
{-6, -4},
{4, -1},
{-3, 2},
{1, 1},
{-8, 0},
{5, 3},
{-4, -6},
{0, -7},
{-7, -8}
};
int sampleX = samples[m_SampleIndex, 0];
int sampleY = samples[m_SampleIndex, 1];
float v0 = (sampleX + .5f) / 16.0f;
float v1 = (sampleY + .5f) / 16.0f;
return new Vector2(v0, v1);
}
private Vector2 GetJitterSMAAX2()
{
float jitterAmount = .25f;
jitterAmount *= (m_SampleIndex == 0) ? -1.0f : 1.0f;
//Debug.Log("Jitter");
//jitterAmount = 0.0f;
float v0 = jitterAmount;
float v1 = -jitterAmount;
return new Vector2(v0, v1);
}
private Vector2 GetCurrentJitter()
{
// add a quarter pixel diagonal translation
Vector2 jitterOffset = new Vector2(0.0f, 0.0f);
if (temporalType == TemporalType.SMAA_2x)
{
jitterOffset = GetJitterSMAAX2();
}
else if (temporalType == TemporalType.Standard_2x)
{
jitterOffset = GetJitterStandard2X();
}
else if (temporalType == TemporalType.Standard_4x)
{
jitterOffset = GetJitterStandard4X();
}
else if (temporalType == TemporalType.Standard_8x)
{
jitterOffset = GetJitterStandard8X();
}
else if (temporalType == TemporalType.Standard_16x)
{
jitterOffset = GetJitterStandard16X();
}
return jitterOffset;
}
private void OnPreCull()
{
StoreBaseProjectionMatrix(aaCamera.projectionMatrix);
if (temporalType != TemporalType.Off)
{
// flip
UpdateSampleIndex();
Vector2 jitterOffset = GetCurrentJitter();
Matrix4x4 offset = Matrix4x4.identity;
offset.m03 = jitterOffset.x * 2.0f / aaCamera.pixelWidth;
offset.m13 = jitterOffset.y * 2.0f / aaCamera.pixelHeight;
var offsetMatrix = offset * m_BaseProjectionMatrix;
aaCamera.projectionMatrix = offsetMatrix;
}
}
private void OnPostRender()
{
aaCamera.ResetProjectionMatrix();
}
// usual & internal stuff
public Shader smaaShader = null;
private Material m_SmaaMaterial;
public Material smaaMaterial
{
get
{
if (m_SmaaMaterial == null)
m_SmaaMaterial = ImageEffectHelper.CheckShaderAndCreateMaterial(smaaShader);
return m_SmaaMaterial;
}
}
// accumulation render texture
private RenderTexture m_RtAccum;
protected void OnEnable()
{
if (smaaShader == null)
smaaShader = Shader.Find("Hidden/SMAA");
if (!ImageEffectHelper.IsSupported(smaaShader, true, true, this))
{
enabled = false;
Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
return;
}
aaCamera.depthTextureMode |= DepthTextureMode.Depth;
}
private void OnDisable()
{
aaCamera.ResetProjectionMatrix();
if (m_SmaaMaterial)
{
DestroyImmediate(m_SmaaMaterial);
m_SmaaMaterial = null;
}
if (m_RtAccum)
{
DestroyImmediate(m_RtAccum);
m_RtAccum = null;
}
}
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
if (smaaMaterial == null)
{
Graphics.Blit(source, destination);
return;
}
bool isFirst = false;
// relying on short-circuit evaluation here
if (m_RtAccum == null || (m_RtAccum.width != source.width || m_RtAccum.height != source.height))
{
if (m_RtAccum != null)
RenderTexture.ReleaseTemporary(m_RtAccum);
m_RtAccum = RenderTexture.GetTemporary(source.width, source.height, 0, source.format);
m_RtAccum.hideFlags = HideFlags.DontSave;
isFirst = true;
}
// the values for jitter offset are hardcoded based on the SMAA shader
int actualJitterOffset = 0;
if (temporalType == TemporalType.SMAA_2x)
actualJitterOffset = m_SampleIndex < 1 ? 1 : 2;
var sizeX = source.width;
var sizeY = source.height;
// should this always be RGBA8?
const RenderTextureFormat rtFormat = RenderTextureFormat.ARGB32;
var rtEdges = RenderTexture.GetTemporary(sizeX, sizeY, 0, rtFormat);
var rtWeights = RenderTexture.GetTemporary(sizeX, sizeY, 0, rtFormat);
// motion blur matrix
var matrix = CalculateViewProjection(aaCamera, m_BaseProjectionMatrix);
Matrix4x4 invViewPrj = Matrix4x4.Inverse(matrix);
smaaMaterial.SetMatrix("_ToPrevViewProjCombined", m_PrevViewProjMat * invViewPrj);
smaaMaterial.SetInt("_JitterOffset", actualJitterOffset);
smaaMaterial.SetTexture("areaTex", areaTex);
smaaMaterial.SetTexture("searchTex", searchTex);
smaaMaterial.SetTexture("colorTex", source);
smaaMaterial.SetVector("_PixelSize", new Vector4(1.0f / source.width, 1.0f / source.height, 0.0f, 0.0f));
Vector2 pixelOffset = GetCurrentJitter();
smaaMaterial.SetVector("_PixelOffset", new Vector4(pixelOffset.x / source.width, pixelOffset.y / source.height, 0.0f, 0.0f));
smaaMaterial.SetTexture("edgesTex", rtEdges);
smaaMaterial.SetTexture("blendTex", rtWeights);
smaaMaterial.SetFloat("K", K);
smaaMaterial.SetFloat("_TemporalAccum", temporalAccumulationWeight);
// clear
Graphics.Blit(source, rtEdges, smaaMaterial, (int)Passes.ClearToBlack);
if (edgeType == EdgeType.Luminance)
{
// luma detect
Graphics.Blit(source, rtEdges, smaaMaterial, (int)Passes.LumaDetection);
}
else if (edgeType == EdgeType.Color)
{
// color detect
Graphics.Blit(source, rtEdges, smaaMaterial, (int)Passes.ColorDetection);
}
else
{
smaaMaterial.SetFloat("_DepthThreshold", 0.01f * depthThreshold);
// depth detect
Graphics.Blit(source, rtEdges, smaaMaterial, (int)Passes.DepthDetection);
}
// calculate weights
Graphics.Blit(rtEdges, rtWeights, smaaMaterial, (int)Passes.WeightCalculation);
if (temporalType == TemporalType.Off)
{
Graphics.Blit(source, destination, smaaMaterial, (int)Passes.WeightsAndBlend1);
}
else
{
// temporal blending
RenderTexture rtTemp = RenderTexture.GetTemporary(source.width, source.height, 0, source.format);
// render for this frame
if (temporalType == TemporalType.SMAA_2x)
{
// set the accumulation texture
smaaMaterial.SetTexture("accumTex", m_RtAccum);
if (isFirst)
{
// if we are the first frame, just copy
Graphics.Blit(source, rtTemp, smaaMaterial, (int)Passes.WeightsAndBlend1);
}
else
{
// if not first, then blend with accumulation
Graphics.Blit(source, rtTemp, smaaMaterial, (int)Passes.WeightsAndBlend2);
}
// copy to accumulation
Graphics.Blit(rtTemp, m_RtAccum, smaaMaterial, (int)Passes.Copy);
// copy to destination
Graphics.Blit(rtTemp, destination, smaaMaterial, (int)Passes.Copy);
}
else
{
// solve SMAA as 1x
Graphics.Blit(source, rtTemp, smaaMaterial, 4);
if (isFirst)
{
Graphics.Blit(rtTemp, m_RtAccum, smaaMaterial, 0);
}
// set the accumulation texture
smaaMaterial.SetTexture("accumTex", m_RtAccum);
smaaMaterial.SetTexture("smaaTex", rtTemp);
rtTemp.filterMode = FilterMode.Bilinear;
RenderTexture rtTemp2 = RenderTexture.GetTemporary(source.width, source.height, 0, source.format);
// copy to accumulation
Graphics.Blit(rtTemp, rtTemp2, smaaMaterial, (int)Passes.MergeFrames);
// copy to accumulation
Graphics.Blit(rtTemp2, m_RtAccum, smaaMaterial, (int)Passes.Copy);
// copy to destination
Graphics.Blit(rtTemp2, destination, smaaMaterial, (int)Passes.Copy);
RenderTexture.ReleaseTemporary(rtTemp2);
}
RenderTexture.ReleaseTemporary(rtTemp);
}
if (displayType == DebugDisplay.Edges)
{
// copy to accumulation
Graphics.Blit(rtEdges, destination, smaaMaterial, (int)Passes.Copy);
}
else if (displayType == DebugDisplay.Weights)
{
// copy to accumulation
Graphics.Blit(rtWeights, destination, smaaMaterial, (int)Passes.Copy);
}
else if (displayType == DebugDisplay.Depth)
{
Graphics.Blit(null, destination, smaaMaterial, (int)Passes.DebugDepth);
}
else if (displayType == DebugDisplay.Accumulation)
{
Graphics.Blit(m_RtAccum, destination);
}
RenderTexture.ReleaseTemporary(rtEdges);
RenderTexture.ReleaseTemporary(rtWeights);
// store matrix for next frame
StorePreviousViewProjMatrix(matrix);
}
}
}
fileFormatVersion: 2
guid: fdc35e0180670ab4e8d2f9439137791f
timeCreated: 1441806930
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences:
- areaTex: {fileID: 2800000, guid: e62aa7035ea66c94b90b2d8774d02cca, type: 3}
- searchTex: {fileID: 2800000, guid: 387ed7c38eb63554db846987adb98e68, type: 3}
- smaaShader: {fileID: 4800000, guid: 4505fec7a81214243b8e59edf89e3a53, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6abc8cedff0ccb3449facf54cd7b7b32
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Hidden/SMAA" {
Properties {
_MainTex ("", 2D) = "black" {}
}
CGINCLUDE
#include "UnityCG.cginc"
///////// from SMAA.fx
float4 _PixelSize;
#define SMAA_PIXEL_SIZE _PixelSize.xy
#define SMAA_PRESET_HIGH 1
// porting the DX9 version of functions
#define SMAA_HLSL_3 1
#define SMAA_ONLY_COMPILE_PS 1
#include "SMAA.cginc"
sampler2D _CameraDepthTexture;
sampler2D_float _CameraMotionVectors;
sampler2D _VelTex;
sampler2D colorTex;
sampler2D edgesTex;
sampler2D blendTex;
sampler2D areaTex;
sampler2D searchTex;
sampler2D accumTex;
sampler2D smaaTex;
int _JitterOffset;
float4 _MainTex_TexelSize;
float4x4 _ToPrevViewProjCombined; // combined
float4 _PixelOffset;
float _TemporalAccum;
float _DepthThreshold;
struct v2f {
half4 pos : SV_POSITION;
half2 uv : TEXCOORD0;
};
sampler2D _MainTex; // set implicitly in Graphics.Blit()
v2f vert( appdata_img v )
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
return o;
}
half4 fragCopy(v2f i) : SV_Target
{
half4 color = tex2D (_MainTex, i.uv);
return color;
}
half4 fragBlack(v2f i) : SV_Target
{
return float4(0,0,0,0);
}
half4 DX9_SMAALumaEdgeDetectionPS(v2f i) : SV_Target
{
float2 texcoord = i.uv;
float4 offset[3];
offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-1.0, 0.0, 0.0, -1.0);
offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4( 1.0, 0.0, 0.0, 1.0);
offset[2] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-2.0, 0.0, 0.0, -2.0);
half4 color = SMAALumaEdgeDetectionPS(texcoord,offset,colorTex);
return color;
}
half4 DX9_SMAAColorEdgeDetectionPS(v2f i) : SV_Target
{
float2 texcoord = i.uv;
float4 offset[3];
offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-1.0, 0.0, 0.0, -1.0);
offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4( 1.0, 0.0, 0.0, 1.0);
offset[2] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-2.0, 0.0, 0.0, -2.0);
half4 color = SMAAColorEdgeDetectionPS(texcoord,offset,colorTex);
return color;
}
half4 DX9_SMAADepthEdgeDetectionPS(v2f i) : SV_Target
{
float2 texcoord = i.uv;
float4 offset[3];
offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-1.0, 0.0, 0.0, -1.0);
offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4( 1.0, 0.0, 0.0, 1.0);
offset[2] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-2.0, 0.0, 0.0, -2.0);
half4 color = SMAADepthEdgeDetectionPS(texcoord,offset,_CameraDepthTexture,_DepthThreshold);
return color;
}
half4 DX9_SMAABlendingWeightCalculationPS(v2f i) : SV_Target
{
float2 texcoord = i.uv;
float2 pixcoord;
float4 offset[3];
pixcoord = texcoord / SMAA_PIXEL_SIZE;
// these are taken from SMAABlendingWeightCalculationVS
// We will use these offsets for the searches later on (see @PSEUDO_GATHER4):
offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-0.25, -0.125, 1.25, -0.125);
offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-0.125, -0.25, -0.125, 1.25);
// And these for the searches, they indicate the ends of the loops:
offset[2] = float4(offset[0].xz, offset[1].yw) +
float4(-2.0, 2.0, -2.0, 2.0) *
SMAA_PIXEL_SIZE.xxyy * float(SMAA_MAX_SEARCH_STEPS);
int4 jitterData = int4(_JitterOffset,_JitterOffset,_JitterOffset,0);
half4 color = SMAABlendingWeightCalculationPS(texcoord, pixcoord, offset, edgesTex, areaTex, searchTex, jitterData);
return color;
}
half4 DX9_SMAANeighborhoodBlendingPS(v2f i) : SV_Target
{
float2 texcoord = i.uv;
float4 offset[2];
offset[0] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4(-1.0, 0.0, 0.0, -1.0);
offset[1] = texcoord.xyxy + SMAA_PIXEL_SIZE.xyxy * float4( 1.0, 0.0, 0.0, 1.0);
half4 color = SMAANeighborhoodBlendingPS(texcoord, offset, colorTex, blendTex);
return color;
}
float PixelsFromEdge(float2 uv)
{
float distX = min(uv.x,1.0-uv.x) / SMAA_PIXEL_SIZE.x;
float distY = min(uv.y,1.0-uv.y) / SMAA_PIXEL_SIZE.y;
float bestDist = min(distX,distY);
return bestDist;
}
float K;
float3 FetchPreviousUvWeight(float2 currUv)
{
float2 depth_uv = currUv;
#if UNITY_UV_STARTS_AT_TOP
//if (_MainTex_TexelSize.y < 0)
{
depth_uv.y = 1 - depth_uv.y;
}
#endif
// read depth
float d = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, depth_uv);
// calculate position from pixel from depth
float3 clipPos = float3(depth_uv.x*2.0-1.0, depth_uv.y*2.0-1.0, d);
// only 1 matrix mul:
float4 prevClipPos = mul(_ToPrevViewProjCombined, float4(clipPos, 1.0));
prevClipPos.xyz /= prevClipPos.w;
float2 prevUv = prevClipPos.xyz*.5f+.5f;
#if UNITY_UV_STARTS_AT_TOP
//if (_MainTex_TexelSize.y < 0)
{
prevUv.y = 1.0f - prevUv.y;
}
#endif
float distFromEdge = PixelsFromEdge(prevUv);
float weight = saturate(distFromEdge - .5f);
float distSqr = dot(prevUv - currUv, prevUv - currUv);
// 1% of the screen seems like a good number
float rho = 0.01;
float invRR = 1.0f/(rho*rho);
float distW = exp(-invRR * distSqr);
weight *= distW;
// weight = 0.5 * max(0, 1 - K * sqrt(abs(length(currUv) - length(prevUv))));
return float3(prevUv,weight);
}
// color is the current value, accum is the previous accumulation
half4 ClampAccumulation(float2 texcoord, half4 accum, half4 color)
{
// get the corner pixels for max/max
float3 pixelUL = tex2D(colorTex, texcoord + float2( 0.5f, 0.5f)*SMAA_PIXEL_SIZE.xy).rgb;
float3 pixelUR = tex2D(colorTex, texcoord + float2(-0.5f, 0.5f)*SMAA_PIXEL_SIZE.xy).rgb;
float3 pixelDL = tex2D(colorTex, texcoord + float2( 0.5f,-0.5f)*SMAA_PIXEL_SIZE.xy).rgb;
float3 pixelDR = tex2D(colorTex, texcoord + float2(-0.5f,-0.5f)*SMAA_PIXEL_SIZE.xy).rgb;
float3 colorMax = max(color,max(max(pixelUL,pixelUR),max(pixelDL,pixelDR)));
float3 colorMin = min(color,min(min(pixelUL,pixelUR),min(pixelDL,pixelDR)));
// since we are sampling half way to the pixels, we need to multiply by 2.0 on the intensity
// which gives a rough guess as to min and max color in a 1 pixel radius
float scale = 2.0f;
colorMin = color + scale*(colorMin - color);
colorMax = color + scale*(colorMax - color);
accum.rgb = max(colorMin,min(colorMax,accum.rgb));
return accum;
}
// same as above, but also blend with accumulation buffer
half4 DX9_SMAANeighborhoodBlendingAccumPS(v2f i) : SV_Target
{
float2 uv = i.uv;
#if UNITY_UV_STARTS_AT_TOP
uv.y = 1 - uv.y;
#endif
float4 position = float4(2. * uv - 1., SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv), 1.);
float4 previousPosition = mul(_ToPrevViewProjCombined, position);
previousPosition.xyz /= previousPosition.w;
uv = previousPosition.xy * .5 + .5;
#if UNITY_UV_STARTS_AT_TOP
uv.y = 1. - uv.y;
#endif
// Inverse velocity from the current position to the previous position
float2 velocity = uv - i.uv;
half4 current = SMAASample(colorTex, i.uv);
half4 previous = SMAASample(colorTex, uv);
float delta = abs(current.a * current.a - previous.a * previous.a) / 5.0;
float weight = .5 * SMAASaturate(1. - (sqrt(delta) * K)); // K ~= SMAA_REPROJECTION_WEIGHT_SCALE
//return half4(.5 * (uv - i.uv) + .5, 0., 1.);
return lerp(current, previous, weight);
}
half4 DX9_SMAADebugDepthPS(v2f i) : SV_Target
{
return SMAASampleDepth_Unity(i.uv, _CameraDepthTexture, i.uv);
}
// same as above, but also blend with accumulation buffer
half4 fragAccumulateOffset(v2f i) : SV_Target
{
float3 prevUvWeight = FetchPreviousUvWeight(i.uv);
float prevWeight = prevUvWeight.z;
float2 prevUv = prevUvWeight.xy;
half4 accum = tex2D (accumTex, prevUv);
half4 color = tex2D (smaaTex, i.uv + _PixelOffset.xy);
// get better accumulation
{
half4 clampAccum = ClampAccumulation(i.uv + _PixelOffset.xy,accum,color);
half2 edgeData = tex2D (edgesTex, i.uv + SMAA_PIXEL_SIZE.xy*0.5f);
float edgeVal = saturate(max(edgeData.x,edgeData.y));
accum = lerp(clampAccum,accum,edgeVal);
}
float t = _TemporalAccum;
t = t + (1.0f-t)*(1.0f-prevWeight);
half4 res = accum * (1.0f-t) + color * t;
return res;
}
ENDCG
Subshader {
// 0 - just copy
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCopy
ENDCG
}
// 1 - luma detection
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment DX9_SMAALumaEdgeDetectionPS
ENDCG
}
// 2 - just clear to black, necessary becuase luma detection will discard
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment fragBlack
ENDCG
}
// 3 - weight calculation
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment DX9_SMAABlendingWeightCalculationPS
ENDCG
}
// 4 - apply weights and blend
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment DX9_SMAANeighborhoodBlendingPS
ENDCG
}
// 5 - apply weights and blend
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment DX9_SMAANeighborhoodBlendingAccumPS
ENDCG
}
// 6 - color detection
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment DX9_SMAAColorEdgeDetectionPS
ENDCG
}
// 7 - merge previous frame with current frame (with offset)
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment fragAccumulateOffset
ENDCG
}
// 8 - depth detection
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment DX9_SMAADepthEdgeDetectionPS
ENDCG
}
// 9 - debug depth
Pass {
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma vertex vert
#pragma fragment DX9_SMAADebugDepthPS
ENDCG
}
}
Fallback off
} // shader
fileFormatVersion: 2
guid: 4505fec7a81214243b8e59edf89e3a53
timeCreated: 1432603500
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3f6b047d2cb63a04e807c4531381a440
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e62aa7035ea66c94b90b2d8774d02cca
timeCreated: 1432601000
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: 5
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 387ed7c38eb63554db846987adb98e68
timeCreated: 1432601000
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: 0
aniso: -1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 2
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: 5
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 995f206a50fe63347953da0c8c239411
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f30b5d194b5f1674996cdcaafc558c90
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections.Generic;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
public static class ImageEffectHelper
{
public static bool IsSupported(Shader s, bool needDepth, bool needHdr, MonoBehaviour effect)
{
if (s == null || !s.isSupported)
{
Debug.LogWarningFormat("Missing shader for image effect {0}", effect);
return false;
}
if (!SystemInfo.supportsImageEffects || !SystemInfo.supportsRenderTextures)
return false;
if (needDepth && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth))
return false;
if (needHdr && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf))
return false;
return true;
}
public static Material CheckShaderAndCreateMaterial(Shader s)
{
if (s == null || !s.isSupported)
return null;
var material = new Material(s);
material.hideFlags = HideFlags.DontSave;
return material;
}
public static bool supportsDX11
{
get { return SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders; }
}
}
}
fileFormatVersion: 2
guid: ab6a3f50deeee984c88794eeeb901226
timeCreated: 1448544124
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections.Generic;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
public class RenderTexureUtility
{
//Temporary render texture handling
private List<RenderTexture> m_TemporaryRTs = new List<RenderTexture>();
public RenderTexture GetTemporaryRenderTexture(int width, int height, int depthBuffer = 0, RenderTextureFormat format = RenderTextureFormat.ARGBHalf, FilterMode filterMode = FilterMode.Bilinear)
{
var rt = RenderTexture.GetTemporary(width, height, depthBuffer, format);
rt.filterMode = filterMode;
rt.wrapMode = TextureWrapMode.Clamp;
rt.name = "RenderTextureUtilityTempTexture";
m_TemporaryRTs.Add(rt);
return rt;
}
public void ReleaseTemporaryRenderTexture(RenderTexture rt)
{
if (rt == null)
return;
if (!m_TemporaryRTs.Contains(rt))
{
Debug.LogErrorFormat("Attempting to remove texture that was not allocated: {0}", rt);
return;
}
m_TemporaryRTs.Remove(rt);
RenderTexture.ReleaseTemporary(rt);
}
public void ReleaseAllTemporyRenderTexutres()
{
for (int i = 0; i < m_TemporaryRTs.Count; ++i)
RenderTexture.ReleaseTemporary(m_TemporaryRTs[i]);
m_TemporaryRTs.Clear();
}
}
}
fileFormatVersion: 2
guid: 054e694bae00c374a97c2bc495fca66b
timeCreated: 1449148391
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 979964515958d6b478daee0f56e1632f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System;
namespace UnityStandardAssets.CinematicEffects
{
//Improvement ideas:
// In hdr do local tonemapping/inverse tonemapping to stabilize bokeh.
// Use rgba8 buffer in ldr / in some pass in hdr (in correlation to previous point and remapping coc from -1/0/1 to 0/0.5/1)
// Use temporal stabilisation.
// Add a mode to do bokeh texture in quarter res as well
// Support different near and far blur for the bokeh texture
// Try distance field for the bokeh texture.
// Try to separate the output of the blur pass to two rendertarget near+far, see the gain in quality vs loss in performance.
// Try swirl effect on the samples of the circle blur.
//References :
// This DOF implementation use ideas from public sources, a big thank to them :
// http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare
// http://www.crytek.com/download/Sousa_Graphics_Gems_CryENGINE3.pdf
// http://graphics.cs.williams.edu/papers/MedianShaderX6/
// http://http.developer.nvidia.com/GPUGems/gpugems_ch24.html
// http://vec3.ca/bicubic-filtering-in-fewer-taps/
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/Other/DepthOfField")]
[RequireComponent(typeof(Camera))]
public class DepthOfField : MonoBehaviour
{
[AttributeUsage(AttributeTargets.Field)]
public sealed class GradientRangeAttribute : PropertyAttribute
{
public readonly float max;
public readonly float min;
// Attribute used to make a float or int variable in a script be restricted to a specific range.
public GradientRangeAttribute(float min, float max)
{
this.min = min;
this.max = max;
}
}
const float kMaxBlur = 35.0f;
private enum Passes
{
BlurAlphaWeighted = 0 ,
BoxBlur = 1 ,
DilateFgCocFromColor = 2 ,
DilateFgCoc = 3 ,
CaptureCoc = 4 ,
CaptureCocExplicit = 5 ,
VisualizeCoc = 6 ,
VisualizeCocExplicit = 7 ,
CocPrefilter = 8 ,
CircleBlur = 9 ,
CircleBlurWithDilatedFg = 10,
CircleBlurLowQuality = 11,
CircleBlowLowQualityWithDilatedFg = 12,
Merge = 13,
MergeExplicit = 14,
MergeBicubic = 15,
MergeExplicitBicubic = 16,
ShapeLowQuality = 17,
ShapeLowQualityDilateFg = 18,
ShapeLowQualityMerge = 19,
ShapeLowQualityMergeDilateFg = 20,
ShapeMediumQuality = 21,
ShapeMediumQualityDilateFg = 22,
ShapeMediumQualityMerge = 23,
ShapeMediumQualityMergeDilateFg = 24,
ShapeHighQuality = 25,
ShapeHighQualityDilateFg = 26,
ShapeHighQualityMerge = 27,
ShapeHighQualityMergeDilateFg = 28
}
public enum MedianPasses
{
Median3 = 0,
Median3X3 = 1
}
public enum BokehTexturesPasses
{
Apply = 0,
Collect = 1
}
public enum UIMode
{
Basic,
Advanced,
Explicit
}
public enum ApertureShape
{
Circular,
Hexagonal,
Octogonal
}
public enum FilterQuality
{
None,
Normal,
High
}
[Tooltip("Allow to view where the blur will be applied. Yellow for near blur, Blue for far blur.")]
public bool visualizeBluriness = false;
[Tooltip("When enabled quality settings can be hand picked, rather than being driven by the quality slider.")]
public bool customizeQualitySettings = false;
public bool prefilterBlur = true;
public FilterQuality medianFilter = FilterQuality.High;
public bool dilateNearBlur = true;
public bool highQualityUpsampling = true;
[GradientRange(0.0f, 100.0f)]
[Tooltip("Color represent relative performance. From green (faster) to yellow (slower).")]
public float quality = 100.0f;
[Range(0.0f, 1.0f)]
public float focusPlane = 0.225f;
[Range(0.0f, 1.0f)]
public float focusRange = 0.9f;
[Range(0.0f, 1.0f)]
public float nearPlane = 0.0f;
[Range(0.0f, kMaxBlur)]
public float nearRadius = 20.0f;
[Range(0.0f, 1.0f)]
public float farPlane = 1.0f;
[Range(0.0f, kMaxBlur)]
public float farRadius = 20.0f;
[Range(0.0f, kMaxBlur)]
public float radius = 20.0f;
[Range(0.5f, 4.0f)]
public float boostPoint = 0.75f;
[Range(0.0f, 1.0f)]
public float nearBoostAmount = 0.0f;
[Range(0.0f, 1.0f)]
public float farBoostAmount = 0.0f;
[Range(0.0f, 32.0f)]
public float fStops = 5.0f;
[Range(0.01f, 5.0f)]
public float textureBokehScale = 1.0f;
[Range(0.01f, 100.0f)]
public float textureBokehIntensity = 50.0f;
[Range(0.01f, 50.0f)]
public float textureBokehThreshold = 2.0f;
[Range(0.01f, 1.0f)]
public float textureBokehSpawnHeuristic = 0.15f;
public Transform focusTransform = null;
public Texture2D bokehTexture = null;
public ApertureShape apertureShape = ApertureShape.Circular;
[Range(0.0f, 179.0f)]
public float apertureOrientation = 0.0f;
[Tooltip("Use with care Bokeh texture are only available on shader model 5, and performance scale with the number of bokehs.")]
public bool useBokehTexture;
public UIMode uiMode = UIMode.Basic;
public Shader filmicDepthOfFieldShader;
public Shader medianFilterShader;
public Shader textureBokehShader;
[NonSerialized]
private RenderTexureUtility m_RTU = new RenderTexureUtility();
public Material filmicDepthOfFieldMaterial
{
get
{
if (m_FilmicDepthOfFieldMaterial == null)
m_FilmicDepthOfFieldMaterial = ImageEffectHelper.CheckShaderAndCreateMaterial(filmicDepthOfFieldShader);
return m_FilmicDepthOfFieldMaterial;
}
}
public Material medianFilterMaterial
{
get
{
if (m_MedianFilterMaterial == null)
m_MedianFilterMaterial = ImageEffectHelper.CheckShaderAndCreateMaterial(medianFilterShader);
return m_MedianFilterMaterial;
}
}
public Material textureBokehMaterial
{
get
{
if (m_TextureBokehMaterial == null)
m_TextureBokehMaterial = ImageEffectHelper.CheckShaderAndCreateMaterial(textureBokehShader);
return m_TextureBokehMaterial;
}
}
public ComputeBuffer computeBufferDrawArgs
{
get
{
if (m_ComputeBufferDrawArgs == null)
{
m_ComputeBufferDrawArgs = new ComputeBuffer(1, 16, ComputeBufferType.IndirectArguments);
var args = new int[4];
args[0] = 0;
args[1] = 1;
args[2] = 0;
args[3] = 0;
m_ComputeBufferDrawArgs.SetData(args);
}
return m_ComputeBufferDrawArgs;
}
}
public ComputeBuffer computeBufferPoints
{
get
{
if (m_ComputeBufferPoints == null)
{
m_ComputeBufferPoints = new ComputeBuffer(90000, 12 + 16, ComputeBufferType.Append);
}
return m_ComputeBufferPoints;
}
}
private ComputeBuffer m_ComputeBufferDrawArgs;
private ComputeBuffer m_ComputeBufferPoints;
private Material m_FilmicDepthOfFieldMaterial;
private Material m_MedianFilterMaterial;
private Material m_TextureBokehMaterial;
private float m_LastApertureOrientation;
private Vector4 m_OctogonalBokehDirection1;
private Vector4 m_OctogonalBokehDirection2;
private Vector4 m_OctogonalBokehDirection3;
private Vector4 m_OctogonalBokehDirection4;
private Vector4 m_HexagonalBokehDirection1;
private Vector4 m_HexagonalBokehDirection2;
private Vector4 m_HexagonalBokehDirection3;
protected void OnEnable()
{
if (filmicDepthOfFieldShader == null)
filmicDepthOfFieldShader = Shader.Find("Hidden/DepthOfField/DepthOfField");
if (medianFilterShader == null)
medianFilterShader = Shader.Find("Hidden/DepthOfField/MedianFilter");
if (textureBokehShader == null)
textureBokehShader = Shader.Find("Hidden/DepthOfField/BokehSplatting");
if (!ImageEffectHelper.IsSupported(filmicDepthOfFieldShader, true, true, this)
|| !ImageEffectHelper.IsSupported(medianFilterShader, true, true, this)
)
{
enabled = false;
Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
return;
}
if (ImageEffectHelper.supportsDX11)
{
if (!ImageEffectHelper.IsSupported(textureBokehShader, true, true, this))
{
enabled = false;
Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
return;
}
}
ComputeBlurDirections(true);
GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;
}
protected void OnDisable()
{
ReleaseComputeResources();
if (m_FilmicDepthOfFieldMaterial)
DestroyImmediate(m_FilmicDepthOfFieldMaterial);
if (m_TextureBokehMaterial)
DestroyImmediate(m_TextureBokehMaterial);
if (m_MedianFilterMaterial)
DestroyImmediate(m_MedianFilterMaterial);
m_TextureBokehMaterial = null;
m_FilmicDepthOfFieldMaterial = null;
m_MedianFilterMaterial = null;
m_RTU.ReleaseAllTemporyRenderTexutres();
}
//-------------------------------------------------------------------//
// Main entry point //
//-------------------------------------------------------------------//
public void OnRenderImage(RenderTexture source, RenderTexture destination)
{
if (medianFilterMaterial == null || filmicDepthOfFieldMaterial == null)
{
Graphics.Blit(source, destination);
return;
}
if (visualizeBluriness)
{
Vector4 blurrinessParam;
Vector4 blurrinessCoe;
ComputeCocParameters(out blurrinessParam, out blurrinessCoe);
filmicDepthOfFieldMaterial.SetVector("_BlurParams", blurrinessParam);
filmicDepthOfFieldMaterial.SetVector("_BlurCoe", blurrinessCoe);
Graphics.Blit(null, destination, filmicDepthOfFieldMaterial, (uiMode == UIMode.Explicit) ? (int)Passes.VisualizeCocExplicit : (int)Passes.VisualizeCoc);
}
else
{
DoDepthOfField(source, destination);
}
m_RTU.ReleaseAllTemporyRenderTexutres();
}
private void DoDepthOfField(RenderTexture source, RenderTexture destination)
{
float radiusAdjustement = source.height / 720.0f;
float textureBokehScale = radiusAdjustement;
float textureBokehMaxRadius = Mathf.Max(nearRadius, farRadius) * textureBokehScale * 0.75f;
float nearBlurRadius = nearRadius * radiusAdjustement;
float farBlurRadius = farRadius * radiusAdjustement;
float maxBlurRadius = Mathf.Max(nearBlurRadius, farBlurRadius);
switch (apertureShape)
{
case ApertureShape.Hexagonal: maxBlurRadius *= 1.2f; break;
case ApertureShape.Octogonal: maxBlurRadius *= 1.15f; break;
}
if (maxBlurRadius < 0.5f)
{
Graphics.Blit(source, destination);
return;
}
//Quarter resolution
int rtW = source.width / 2;
int rtH = source.height / 2;
Vector4 blurrinessCoe = new Vector4(nearBlurRadius * 0.5f, farBlurRadius * 0.5f, 0.0f, 0.0f);
RenderTexture colorAndCoc = m_RTU.GetTemporaryRenderTexture(rtW, rtH);
RenderTexture colorAndCoc2 = m_RTU.GetTemporaryRenderTexture(rtW, rtH);
// Downsample to Color + COC buffer and apply boost
Vector4 cocParam;
Vector4 cocCoe;
ComputeCocParameters(out cocParam, out cocCoe);
filmicDepthOfFieldMaterial.SetVector("_BlurParams", cocParam);
filmicDepthOfFieldMaterial.SetVector("_BlurCoe", cocCoe);
filmicDepthOfFieldMaterial.SetVector("_BoostParams", new Vector4(nearBlurRadius * nearBoostAmount * -0.5f, farBlurRadius * farBoostAmount * 0.5f, boostPoint, 0.0f));
Graphics.Blit(source, colorAndCoc2, filmicDepthOfFieldMaterial, (uiMode == UIMode.Explicit) ? (int)Passes.CaptureCocExplicit : (int)Passes.CaptureCoc);
RenderTexture src = colorAndCoc2;
RenderTexture dst = colorAndCoc;
// Collect texture bokeh candidates and replace with a darker pixel
if (shouldPerformBokeh)
{
// Blur a bit so we can do a frequency check
RenderTexture blurred = m_RTU.GetTemporaryRenderTexture(rtW, rtH);
Graphics.Blit(src, blurred, filmicDepthOfFieldMaterial, (int)Passes.BoxBlur);
filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(0.0f, 1.5f, 0.0f, 1.5f));
Graphics.Blit(blurred, dst, filmicDepthOfFieldMaterial, (int)Passes.BlurAlphaWeighted);
filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(1.5f, 0.0f, 0.0f, 1.5f));
Graphics.Blit(dst, blurred, filmicDepthOfFieldMaterial, (int)Passes.BlurAlphaWeighted);
// Collect texture bokeh candidates and replace with a darker pixel
textureBokehMaterial.SetTexture("_BlurredColor", blurred);
textureBokehMaterial.SetFloat("_SpawnHeuristic", textureBokehSpawnHeuristic);
textureBokehMaterial.SetVector("_BokehParams", new Vector4(this.textureBokehScale * textureBokehScale, textureBokehIntensity, textureBokehThreshold, textureBokehMaxRadius));
Graphics.SetRandomWriteTarget(1, computeBufferPoints);
Graphics.Blit(src, dst, textureBokehMaterial, (int)BokehTexturesPasses.Collect);
Graphics.ClearRandomWriteTargets();
SwapRenderTexture(ref src, ref dst);
m_RTU.ReleaseTemporaryRenderTexture(blurred);
}
filmicDepthOfFieldMaterial.SetVector("_BlurParams", cocParam);
filmicDepthOfFieldMaterial.SetVector("_BlurCoe", blurrinessCoe);
filmicDepthOfFieldMaterial.SetVector("_BoostParams", new Vector4(nearBlurRadius * nearBoostAmount * -0.5f, farBlurRadius * farBoostAmount * 0.5f, boostPoint, 0.0f));
// Dilate near blur factor
RenderTexture blurredFgCoc = null;
if (dilateNearBlur)
{
RenderTexture blurredFgCoc2 = m_RTU.GetTemporaryRenderTexture(rtW, rtH, 0, RenderTextureFormat.RGHalf);
blurredFgCoc = m_RTU.GetTemporaryRenderTexture(rtW, rtH, 0, RenderTextureFormat.RGHalf);
filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(0.0f, nearBlurRadius * 0.75f, 0.0f, 0.0f));
Graphics.Blit(src, blurredFgCoc2, filmicDepthOfFieldMaterial, (int)Passes.DilateFgCocFromColor);
filmicDepthOfFieldMaterial.SetVector("_Offsets", new Vector4(nearBlurRadius * 0.75f, 0.0f, 0.0f, 0.0f));
Graphics.Blit(blurredFgCoc2, blurredFgCoc, filmicDepthOfFieldMaterial, (int)Passes.DilateFgCoc);
m_RTU.ReleaseTemporaryRenderTexture(blurredFgCoc2);
}
// Blur downsampled color to fill the gap between samples
if (prefilterBlur)
{
Graphics.Blit(src, dst, filmicDepthOfFieldMaterial, (int)Passes.CocPrefilter);
SwapRenderTexture(ref src, ref dst);
}
// Apply blur : Circle / Hexagonal or Octagonal (blur will create bokeh if bright pixel where not removed by "m_UseBokehTexture")
switch (apertureShape)
{
case ApertureShape.Circular: DoCircularBlur(blurredFgCoc, ref src, ref dst, maxBlurRadius); break;
case ApertureShape.Hexagonal: DoHexagonalBlur(blurredFgCoc, ref src, ref dst, maxBlurRadius); break;
case ApertureShape.Octogonal: DoOctogonalBlur(blurredFgCoc, ref src, ref dst, maxBlurRadius); break;
}
// Smooth result
switch (medianFilter)
{
case FilterQuality.Normal:
{
medianFilterMaterial.SetVector("_Offsets", new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
Graphics.Blit(src, dst, medianFilterMaterial, (int)MedianPasses.Median3);
SwapRenderTexture(ref src, ref dst);
medianFilterMaterial.SetVector("_Offsets", new Vector4(0.0f, 1.0f, 0.0f, 0.0f));
Graphics.Blit(src, dst, medianFilterMaterial, (int)MedianPasses.Median3);
SwapRenderTexture(ref src, ref dst);
break;
}
case FilterQuality.High:
{
Graphics.Blit(src, dst, medianFilterMaterial, (int)MedianPasses.Median3X3);
SwapRenderTexture(ref src, ref dst);
break;
}
}
// Merge to full resolution (with boost) + upsampling (linear or bicubic)
filmicDepthOfFieldMaterial.SetVector("_BlurCoe", blurrinessCoe);
filmicDepthOfFieldMaterial.SetVector("_Convolved_TexelSize", new Vector4(src.width, src.height, 1.0f / src.width, 1.0f / src.height));
filmicDepthOfFieldMaterial.SetTexture("_SecondTex", src);
int mergePass = (uiMode == UIMode.Explicit) ? (int)Passes.MergeExplicit : (int)Passes.Merge;
if (highQualityUpsampling)
{
mergePass = (uiMode == UIMode.Explicit) ? (int)Passes.MergeExplicitBicubic : (int)Passes.MergeBicubic;
}
// Apply texture bokeh
if (shouldPerformBokeh)
{
RenderTexture tmp = m_RTU.GetTemporaryRenderTexture(source.height, source.width, 0, source.format);
Graphics.Blit(source, tmp, filmicDepthOfFieldMaterial, mergePass);
Graphics.SetRenderTarget(tmp);
ComputeBuffer.CopyCount(computeBufferPoints, computeBufferDrawArgs, 0);
textureBokehMaterial.SetBuffer("pointBuffer", computeBufferPoints);
textureBokehMaterial.SetTexture("_MainTex", bokehTexture);
textureBokehMaterial.SetVector("_Screen", new Vector3(1.0f / (1.0f * source.width), 1.0f / (1.0f * source.height), textureBokehMaxRadius));
textureBokehMaterial.SetPass((int)BokehTexturesPasses.Apply);
Graphics.DrawProceduralIndirectNow(MeshTopology.Points, computeBufferDrawArgs, 0);
Graphics.Blit(tmp, destination);// hackaround for DX11 flipfun (OPTIMIZEME)
}
else
{
Graphics.Blit(source, destination, filmicDepthOfFieldMaterial, mergePass);
}
}
//-------------------------------------------------------------------//
// Blurs //
//-------------------------------------------------------------------//
private void DoHexagonalBlur(RenderTexture blurredFgCoc, ref RenderTexture src, ref RenderTexture dst, float maxRadius)
{
ComputeBlurDirections(false);
int blurPass;
int blurPassMerge;
GetDirectionalBlurPassesFromRadius(blurredFgCoc, maxRadius, out blurPass, out blurPassMerge);
filmicDepthOfFieldMaterial.SetTexture("_SecondTex", blurredFgCoc);
RenderTexture tmp = m_RTU.GetTemporaryRenderTexture(src.width, src.height, 0, src.format);
filmicDepthOfFieldMaterial.SetVector("_Offsets", m_HexagonalBokehDirection1);
Graphics.Blit(src, tmp, filmicDepthOfFieldMaterial, blurPass);
filmicDepthOfFieldMaterial.SetVector("_Offsets", m_HexagonalBokehDirection2);
Graphics.Blit(tmp, src, filmicDepthOfFieldMaterial, blurPass);
filmicDepthOfFieldMaterial.SetVector("_Offsets", m_HexagonalBokehDirection3);
filmicDepthOfFieldMaterial.SetTexture("_ThirdTex", src);
Graphics.Blit(tmp, dst, filmicDepthOfFieldMaterial, blurPassMerge);
m_RTU.ReleaseTemporaryRenderTexture(tmp);
SwapRenderTexture(ref src, ref dst);
}
private void DoOctogonalBlur(RenderTexture blurredFgCoc, ref RenderTexture src, ref RenderTexture dst, float maxRadius)
{
ComputeBlurDirections(false);
int blurPass;
int blurPassMerge;
GetDirectionalBlurPassesFromRadius(blurredFgCoc, maxRadius, out blurPass, out blurPassMerge);
filmicDepthOfFieldMaterial.SetTexture("_SecondTex", blurredFgCoc);
RenderTexture tmp = m_RTU.GetTemporaryRenderTexture(src.width, src.height, 0, src.format);
filmicDepthOfFieldMaterial.SetVector("_Offsets", m_OctogonalBokehDirection1);
Graphics.Blit(src, tmp, filmicDepthOfFieldMaterial, blurPass);
filmicDepthOfFieldMaterial.SetVector("_Offsets", m_OctogonalBokehDirection2);
Graphics.Blit(tmp, dst, filmicDepthOfFieldMaterial, blurPass);
filmicDepthOfFieldMaterial.SetVector("_Offsets", m_OctogonalBokehDirection3);
Graphics.Blit(src, tmp, filmicDepthOfFieldMaterial, blurPass);
filmicDepthOfFieldMaterial.SetVector("_Offsets", m_OctogonalBokehDirection4);
filmicDepthOfFieldMaterial.SetTexture("_ThirdTex", dst);
Graphics.Blit(tmp, src, filmicDepthOfFieldMaterial, blurPassMerge);
m_RTU.ReleaseTemporaryRenderTexture(tmp);
}
private void DoCircularBlur(RenderTexture blurredFgCoc, ref RenderTexture src, ref RenderTexture dst, float maxRadius)
{
int bokehPass;
if (blurredFgCoc != null)
{
filmicDepthOfFieldMaterial.SetTexture("_SecondTex", blurredFgCoc);
bokehPass = (maxRadius > 10.0f) ? (int)Passes.CircleBlurWithDilatedFg : (int)Passes.CircleBlowLowQualityWithDilatedFg;
}
else
{
bokehPass = (maxRadius > 10.0f) ? (int)Passes.CircleBlur : (int)Passes.CircleBlurLowQuality;
}
Graphics.Blit(src, dst, filmicDepthOfFieldMaterial, bokehPass);
SwapRenderTexture(ref src, ref dst);
}
//-------------------------------------------------------------------//
// Helpers //
//-------------------------------------------------------------------//
private void ComputeCocParameters(out Vector4 blurParams, out Vector4 blurCoe)
{
Camera sceneCamera = GetComponent<Camera>();
float focusDistance01 = focusTransform ? (sceneCamera.WorldToViewportPoint(focusTransform.position)).z / (sceneCamera.farClipPlane) : (focusPlane * focusPlane * focusPlane * focusPlane);
if (uiMode == UIMode.Basic || uiMode == UIMode.Advanced)
{
float focusRange01 = focusRange * focusRange * focusRange * focusRange;
float focalLength = 4.0f / Mathf.Tan(0.5f * sceneCamera.fieldOfView * Mathf.Deg2Rad);
float aperture = focalLength / fStops;
blurCoe = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
blurParams = new Vector4(aperture, focalLength, focusDistance01, focusRange01);
}
else
{
float nearDistance01 = nearPlane * nearPlane * nearPlane * nearPlane;
float farDistance01 = farPlane * farPlane * farPlane * farPlane;
float nearFocusRange01 = focusRange * focusRange * focusRange * focusRange;
float farFocusRange01 = nearFocusRange01;
if (focusDistance01 <= nearDistance01)
focusDistance01 = nearDistance01 + 0.0000001f;
if (focusDistance01 >= farDistance01)
focusDistance01 = farDistance01 - 0.0000001f;
if ((focusDistance01 - nearFocusRange01) <= nearDistance01)
nearFocusRange01 = (focusDistance01 - nearDistance01 - 0.0000001f);
if ((focusDistance01 + farFocusRange01) >= farDistance01)
farFocusRange01 = (farDistance01 - focusDistance01 - 0.0000001f);
float a1 = 1.0f / (nearDistance01 - focusDistance01 + nearFocusRange01);
float a2 = 1.0f / (farDistance01 - focusDistance01 - farFocusRange01);
float b1 = (1.0f - a1 * nearDistance01), b2 = (1.0f - a2 * farDistance01);
const float c1 = -1.0f;
const float c2 = 1.0f;
blurParams = new Vector4(c1 * a1, c1 * b1, c2 * a2, c2 * b2);
blurCoe = new Vector4(0.0f, 0.0f, (b2 - b1) / (a1 - a2), 0.0f);
}
}
private void ReleaseComputeResources()
{
if (m_ComputeBufferDrawArgs != null)
m_ComputeBufferDrawArgs.Release();
m_ComputeBufferDrawArgs = null;
if (m_ComputeBufferPoints != null)
m_ComputeBufferPoints.Release();
m_ComputeBufferPoints = null;
}
private void ComputeBlurDirections(bool force)
{
if (!force && Math.Abs(m_LastApertureOrientation - apertureOrientation) < float.Epsilon) return;
m_LastApertureOrientation = apertureOrientation;
float rotationRadian = apertureOrientation * Mathf.Deg2Rad;
float cosinus = Mathf.Cos(rotationRadian);
float sinus = Mathf.Sin(rotationRadian);
m_OctogonalBokehDirection1 = new Vector4(0.5f, 0.0f, 0.0f, 0.0f);
m_OctogonalBokehDirection2 = new Vector4(0.0f, 0.5f, 1.0f, 0.0f);
m_OctogonalBokehDirection3 = new Vector4(-0.353553f, 0.353553f, 1.0f, 0.0f);
m_OctogonalBokehDirection4 = new Vector4(0.353553f, 0.353553f, 1.0f, 0.0f);
m_HexagonalBokehDirection1 = new Vector4(0.5f, 0.0f, 0.0f, 0.0f);
m_HexagonalBokehDirection2 = new Vector4(0.25f, 0.433013f, 1.0f, 0.0f);
m_HexagonalBokehDirection3 = new Vector4(0.25f, -0.433013f, 1.0f, 0.0f);
if (rotationRadian > float.Epsilon)
{
Rotate2D(ref m_OctogonalBokehDirection1, cosinus, sinus);
Rotate2D(ref m_OctogonalBokehDirection2, cosinus, sinus);
Rotate2D(ref m_OctogonalBokehDirection3, cosinus, sinus);
Rotate2D(ref m_OctogonalBokehDirection4, cosinus, sinus);
Rotate2D(ref m_HexagonalBokehDirection1, cosinus, sinus);
Rotate2D(ref m_HexagonalBokehDirection2, cosinus, sinus);
Rotate2D(ref m_HexagonalBokehDirection3, cosinus, sinus);
}
}
private bool shouldPerformBokeh
{
get { return ImageEffectHelper.supportsDX11 && useBokehTexture && textureBokehMaterial; }
}
private static void Rotate2D(ref Vector4 direction, float cosinus, float sinus)
{
Vector4 source = direction;
direction.x = source.x * cosinus - source.y * sinus;
direction.y = source.x * sinus + source.y * cosinus;
}
private static void SwapRenderTexture(ref RenderTexture src, ref RenderTexture dst)
{
RenderTexture tmp = dst;
dst = src;
src = tmp;
}
private static void GetDirectionalBlurPassesFromRadius(RenderTexture blurredFgCoc, float maxRadius, out int blurPass, out int blurAndMergePass)
{
if (blurredFgCoc == null)
{
if (maxRadius > 10.0f)
{
blurPass = (int)Passes.ShapeHighQuality;
blurAndMergePass = (int)Passes.ShapeHighQualityMerge;
}
else if (maxRadius > 5.0f)
{
blurPass = (int)Passes.ShapeMediumQuality;
blurAndMergePass = (int)Passes.ShapeMediumQualityMerge;
}
else
{
blurPass = (int)Passes.ShapeLowQuality;
blurAndMergePass = (int)Passes.ShapeLowQualityMerge;
}
}
else
{
if (maxRadius > 10.0f)
{
blurPass = (int)Passes.ShapeHighQualityDilateFg;
blurAndMergePass = (int)Passes.ShapeHighQualityMergeDilateFg;
}
else if (maxRadius > 5.0f)
{
blurPass = (int)Passes.ShapeMediumQualityDilateFg;
blurAndMergePass = (int)Passes.ShapeMediumQualityMergeDilateFg;
}
else
{
blurPass = (int)Passes.ShapeLowQualityDilateFg;
blurAndMergePass = (int)Passes.ShapeLowQualityMergeDilateFg;
}
}
}
}
}
fileFormatVersion: 2
guid: 8a338d679868f45439ea43c7ae035e36
timeCreated: 1449750736
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences:
- focusTransform: {instanceID: 0}
- bokehTexture: {instanceID: 0}
- filmicDepthOfFieldShader: {fileID: 4800000, guid: bff0e5458fb914f5c9985ba4f09171d2,
type: 3}
- medianFilterShader: {fileID: 4800000, guid: a058b22d4123add4b807e832604e5e7b,
type: 3}
- textureBokehShader: {fileID: 4800000, guid: c961b8ed1f00f924d804ada5143bd0e8,
type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 76c5f1c75a576cc438604ab899641524
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
[CustomEditor(typeof(DepthOfField))]
class DepthOfFieldEditor : Editor
{
[CustomPropertyDrawer(typeof(DepthOfField.GradientRangeAttribute))]
internal sealed class GradientRangeDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if (property.propertyType != SerializedPropertyType.Float)
{
EditorGUI.LabelField(position, label.text, "Use GradientRange with float.");
return;
}
var savedbackgroundColor = GUI.backgroundColor;
var gradientRange = (DepthOfField.GradientRangeAttribute)attribute;
float range01 = (property.floatValue - gradientRange.min) / (gradientRange.max - gradientRange.min);
GUI.backgroundColor = Color.Lerp(Color.green, Color.yellow, range01);
EditorGUI.Slider(position, property, gradientRange.min, gradientRange.max, label);
GUI.backgroundColor = savedbackgroundColor;
}
}
SerializedProperty m_UIMode;
SerializedProperty m_VisualizeBluriness;
SerializedProperty m_FocusPlane;
SerializedProperty m_FocusRange;
SerializedProperty m_NearPlane;
SerializedProperty m_NearRadius;
SerializedProperty m_HighQualityUpsampling;
SerializedProperty m_DilateNearBlur;
SerializedProperty m_PrefilterBlur;
SerializedProperty m_MedianFilter;
SerializedProperty m_FarPlane;
SerializedProperty m_FarRadius;
SerializedProperty m_ApertureShape;
SerializedProperty m_UseBokehTexture;
SerializedProperty m_ApertureOrientation;
SerializedProperty m_BoostPoint;
SerializedProperty m_NearBoostAmount;
SerializedProperty m_FarBoostAmount;
SerializedProperty m_FStops;
SerializedProperty m_Radius;
SerializedProperty m_FocusTransform;
SerializedProperty m_Dx11BokehThreshold;
SerializedProperty m_Dx11SpawnHeuristic;
SerializedProperty m_Dx11BokehTexture;
SerializedProperty m_Dx11BokehScale;
SerializedProperty m_Dx11BokehIntensity;
SerializedObject m_TargetSerializedDOFObject;
SerializedProperty m_Quality;
SerializedProperty m_CustomizeQualitySettings;
bool useBokehTexture { get { return m_UseBokehTexture.boolValue; } }
bool useAdvancedOrExplicitView { get { return (m_UIMode.enumValueIndex != (int)DepthOfField.UIMode.Basic); } }
bool useExplicitView { get { return (m_UIMode.enumValueIndex == (int)DepthOfField.UIMode.Explicit); } }
bool useBlurOrientation
{
get
{
return ((m_ApertureShape.enumValueIndex == (int)DepthOfField.ApertureShape.Hexagonal) ||
(m_ApertureShape.enumValueIndex == (int)DepthOfField.ApertureShape.Octogonal));
}
}
AnimBool showQualitySettings = new AnimBool();
AnimBool showBoostSettings = new AnimBool();
AnimBool showBlurOrientation = new AnimBool();
AnimBool showDX11BlurSettings = new AnimBool();
AnimBool showExplicitSettings = new AnimBool();
void OnEnable()
{
m_TargetSerializedDOFObject = new SerializedObject(target);
m_UIMode = m_TargetSerializedDOFObject.FindProperty("uiMode");
m_VisualizeBluriness = m_TargetSerializedDOFObject.FindProperty("visualizeBluriness");
m_FocusPlane = m_TargetSerializedDOFObject.FindProperty("focusPlane");
m_FocusRange = m_TargetSerializedDOFObject.FindProperty("focusRange");
m_NearPlane = m_TargetSerializedDOFObject.FindProperty("nearPlane");
m_NearRadius = m_TargetSerializedDOFObject.FindProperty("nearRadius");
m_FarPlane = m_TargetSerializedDOFObject.FindProperty("farPlane");
m_FarRadius = m_TargetSerializedDOFObject.FindProperty("farRadius");
m_ApertureShape = m_TargetSerializedDOFObject.FindProperty("apertureShape");
m_ApertureOrientation = m_TargetSerializedDOFObject.FindProperty("apertureOrientation");
m_UseBokehTexture = m_TargetSerializedDOFObject.FindProperty("useBokehTexture");
m_BoostPoint = m_TargetSerializedDOFObject.FindProperty("boostPoint");
m_NearBoostAmount = m_TargetSerializedDOFObject.FindProperty("nearBoostAmount");
m_FarBoostAmount = m_TargetSerializedDOFObject.FindProperty("farBoostAmount");
m_FStops = m_TargetSerializedDOFObject.FindProperty("fStops");
m_Radius = m_TargetSerializedDOFObject.FindProperty("radius");
m_FocusTransform = m_TargetSerializedDOFObject.FindProperty("focusTransform");
m_Dx11BokehThreshold = m_TargetSerializedDOFObject.FindProperty("textureBokehThreshold");
m_Dx11SpawnHeuristic = m_TargetSerializedDOFObject.FindProperty("textureBokehSpawnHeuristic");
m_Dx11BokehTexture = m_TargetSerializedDOFObject.FindProperty("bokehTexture");
m_Dx11BokehScale = m_TargetSerializedDOFObject.FindProperty("textureBokehScale");
m_Dx11BokehIntensity = m_TargetSerializedDOFObject.FindProperty("textureBokehIntensity");
m_HighQualityUpsampling = m_TargetSerializedDOFObject.FindProperty("highQualityUpsampling");
m_DilateNearBlur = m_TargetSerializedDOFObject.FindProperty("dilateNearBlur");
m_PrefilterBlur = m_TargetSerializedDOFObject.FindProperty("prefilterBlur");
m_MedianFilter = m_TargetSerializedDOFObject.FindProperty("medianFilter");
m_Quality = m_TargetSerializedDOFObject.FindProperty("quality");
m_CustomizeQualitySettings = m_TargetSerializedDOFObject.FindProperty("customizeQualitySettings");
InitializedAnimBools();
}
void InitializedAnimBools()
{
showQualitySettings.valueChanged.AddListener(Repaint);
showQualitySettings.value = useAdvancedOrExplicitView;
showBlurOrientation.valueChanged.AddListener(Repaint);
showBlurOrientation.value = useBlurOrientation;
showDX11BlurSettings.valueChanged.AddListener(Repaint);
showDX11BlurSettings.value = useBokehTexture;
showBoostSettings.valueChanged.AddListener(Repaint);
showBoostSettings.value = useAdvancedOrExplicitView;
showExplicitSettings.valueChanged.AddListener(Repaint);
showExplicitSettings.value = useExplicitView;
}
void UpdateAnimBoolTargets()
{
showQualitySettings.target = useAdvancedOrExplicitView;
showBlurOrientation.target = useBlurOrientation;
showDX11BlurSettings.target = useBokehTexture;
showBoostSettings.target = useAdvancedOrExplicitView;
showExplicitSettings.target = useExplicitView;
}
void SyncParametersAndQualityLevel(bool fromQualityLevelToParams)
{
const float prefilterBlurQuality = 10.0f;
const float medianFilterQuality = 30.0f;
const float dilateNearBlurQuality = 50.0f;
const float medianFilterQualityHigh = 70.0f;
const float highUpsamplingQuality = 90.0f;
if (fromQualityLevelToParams)
{
int medianFilterEnumValue = 0;
if (m_Quality.floatValue >= medianFilterQuality) ++medianFilterEnumValue;
if (m_Quality.floatValue >= medianFilterQualityHigh) ++medianFilterEnumValue;
m_MedianFilter.enumValueIndex = medianFilterEnumValue;
m_DilateNearBlur.boolValue = (m_Quality.floatValue >= dilateNearBlurQuality);
m_PrefilterBlur.boolValue = (m_Quality.floatValue >= prefilterBlurQuality);
m_HighQualityUpsampling.boolValue = (m_Quality.floatValue >= highUpsamplingQuality);
}
else
{
const float stepBack = 5.0f;
//trying to find a quality level matching the parameters (going down first and climbing back)
if (!m_HighQualityUpsampling.boolValue) m_Quality.floatValue = Mathf.Min(highUpsamplingQuality - stepBack, m_Quality.floatValue);
if (!m_PrefilterBlur.boolValue) m_Quality.floatValue = Mathf.Min(prefilterBlurQuality - stepBack, m_Quality.floatValue);
if (!m_DilateNearBlur.boolValue) m_Quality.floatValue = Mathf.Min(dilateNearBlurQuality - stepBack, m_Quality.floatValue);
if (m_MedianFilter.enumValueIndex == (int)DepthOfField.FilterQuality.Normal) m_Quality.floatValue = Mathf.Min(medianFilterQualityHigh - stepBack, m_Quality.floatValue);
if (m_MedianFilter.enumValueIndex == (int)DepthOfField.FilterQuality.None) m_Quality.floatValue = Mathf.Min(medianFilterQuality - stepBack, m_Quality.floatValue);
if (m_HighQualityUpsampling.boolValue) m_Quality.floatValue = Mathf.Max(highUpsamplingQuality, m_Quality.floatValue);
if (m_PrefilterBlur.boolValue) m_Quality.floatValue = Mathf.Max(prefilterBlurQuality, m_Quality.floatValue);
if (m_DilateNearBlur.boolValue) m_Quality.floatValue = Mathf.Max(dilateNearBlurQuality, m_Quality.floatValue);
if (m_MedianFilter.enumValueIndex == (int)DepthOfField.FilterQuality.High) m_Quality.floatValue = Mathf.Max(medianFilterQualityHigh, m_Quality.floatValue);
if (m_MedianFilter.enumValueIndex == (int)DepthOfField.FilterQuality.Normal) m_Quality.floatValue = Mathf.Max(medianFilterQuality - 1, m_Quality.floatValue);
}
}
private void OnQualityLevelInspectorGUI()
{
SyncParametersAndQualityLevel(!m_CustomizeQualitySettings.boolValue);
GUI.enabled = !m_CustomizeQualitySettings.boolValue;
EditorGUILayout.PropertyField(m_Quality);
GUI.enabled = true;
if (m_UIMode.enumValueIndex == (int)DepthOfField.UIMode.Basic)
{
m_CustomizeQualitySettings.boolValue = false;
}
if (EditorGUILayout.BeginFadeGroup(showQualitySettings.faded))
{
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(m_CustomizeQualitySettings);
++EditorGUI.indentLevel;
GUI.enabled = m_CustomizeQualitySettings.boolValue;
EditorGUILayout.PropertyField(m_PrefilterBlur, new GUIContent(" Smooth Bokeh"));
EditorGUILayout.PropertyField(m_MedianFilter, new GUIContent(" More smooth Bokeh"));
EditorGUILayout.PropertyField(m_DilateNearBlur, new GUIContent(" Dilate near blur"));
EditorGUILayout.PropertyField(m_HighQualityUpsampling, new GUIContent(" Smooth Edges"));
GUI.enabled = true;
EditorGUI.indentLevel -= 2;
}
EditorGUILayout.EndFadeGroup();
}
private void OnBokehTextureInspectorGUI()
{
EditorGUILayout.PropertyField(m_UseBokehTexture);
if (EditorGUILayout.BeginFadeGroup(showDX11BlurSettings.faded))
{
if (!ImageEffectHelper.supportsDX11)
{
EditorGUILayout.HelpBox("Bokeh Texture not supported (need shader model 5)",
MessageType.Info);
}
}
EditorGUILayout.EndFadeGroup();
if (EditorGUILayout.BeginFadeGroup(showDX11BlurSettings.faded))
{
if (ImageEffectHelper.supportsDX11)
{
EditorGUILayout.PropertyField(m_Dx11BokehTexture, new GUIContent(" Texture"));
EditorGUILayout.PropertyField(m_Dx11BokehScale, new GUIContent(" Scale"));
EditorGUILayout.PropertyField(m_Dx11BokehIntensity, new GUIContent(" Intensity"));
EditorGUILayout.PropertyField(m_Dx11BokehThreshold, new GUIContent(" Min Luminance"));
EditorGUILayout.PropertyField(m_Dx11SpawnHeuristic, new GUIContent(" Spawn Heuristic"));
}
}
EditorGUILayout.EndFadeGroup();
EditorGUILayout.Separator();
}
public override void OnInspectorGUI()
{
m_TargetSerializedDOFObject.Update();
UpdateAnimBoolTargets();
EditorGUILayout.LabelField("Simulates camera lens defocus", EditorStyles.miniLabel);
EditorGUILayout.Separator();
EditorGUILayout.PropertyField(m_VisualizeBluriness);
EditorGUILayout.Separator();
EditorGUILayout.PropertyField(m_UIMode, new GUIContent("Mode"));
EditorGUILayout.Separator();
EditorGUILayout.PropertyField(m_ApertureShape);
if (EditorGUILayout.BeginFadeGroup(showBlurOrientation.faded))
{
EditorGUILayout.PropertyField(m_ApertureOrientation);
}
EditorGUILayout.EndFadeGroup();
if ((m_ApertureShape.enumValueIndex == (int)DepthOfField.ApertureShape.Circular) ||
(m_ApertureShape.enumValueIndex == (int)DepthOfField.ApertureShape.Hexagonal) ||
(m_ApertureShape.enumValueIndex == (int)DepthOfField.ApertureShape.Octogonal)
)
{
EditorGUILayout.Separator();
OnQualityLevelInspectorGUI();
}
EditorGUILayout.Separator();
EditorGUILayout.PropertyField(m_FocusPlane);
EditorGUILayout.PropertyField(m_FocusTransform, new GUIContent("Focus on Transform"));
EditorGUILayout.Separator();
if (m_UIMode.enumValueIndex == (int)DepthOfField.UIMode.Basic)
{
EditorGUILayout.PropertyField(m_FStops, new GUIContent("F-Stops"));
EditorGUILayout.PropertyField(m_FocusRange);
EditorGUILayout.Separator();
EditorGUILayout.PropertyField(m_Radius, new GUIContent("Max Blur"));
m_NearRadius.floatValue = m_Radius.floatValue;
m_FarRadius.floatValue = m_Radius.floatValue;
m_UseBokehTexture.boolValue = false;
}
else
{
if (EditorGUILayout.BeginFadeGroup(1 - showExplicitSettings.faded))
{
EditorGUILayout.Slider(m_FStops, 1.0f, 128.0f, new GUIContent("F-Stops"));
EditorGUILayout.PropertyField(m_FocusRange);
}
EditorGUILayout.EndFadeGroup();
if (EditorGUILayout.BeginFadeGroup(showExplicitSettings.faded))
{
EditorGUILayout.PropertyField(m_FocusRange);
EditorGUILayout.PropertyField(m_NearPlane);
EditorGUILayout.PropertyField(m_FarPlane);
}
EditorGUILayout.EndFadeGroup();
EditorGUILayout.Separator();
OnBokehTextureInspectorGUI();
if (EditorGUILayout.BeginFadeGroup(showDX11BlurSettings.faded))
{
EditorGUILayout.PropertyField(m_Radius, new GUIContent("Max Blur"));
m_NearRadius.floatValue = m_Radius.floatValue;
m_FarRadius.floatValue = m_Radius.floatValue;
}
EditorGUILayout.EndFadeGroup();
if (EditorGUILayout.BeginFadeGroup(1 - showDX11BlurSettings.faded))
{
EditorGUILayout.PropertyField(m_NearRadius, new GUIContent("Near Max Blur"));
EditorGUILayout.PropertyField(m_FarRadius, new GUIContent("Far Max Blur"));
m_Radius.floatValue = (m_FarRadius.floatValue + m_NearRadius.floatValue) * 0.5f;
}
EditorGUILayout.EndFadeGroup();
}
EditorGUILayout.Separator();
if (EditorGUILayout.BeginFadeGroup(showBoostSettings.faded))
{
EditorGUILayout.PropertyField(m_BoostPoint);
EditorGUILayout.PropertyField(m_NearBoostAmount);
EditorGUILayout.PropertyField(m_FarBoostAmount);
}
EditorGUILayout.EndFadeGroup();
m_TargetSerializedDOFObject.ApplyModifiedProperties();
}
}
}
fileFormatVersion: 2
guid: 3eb07ef5681934662814cc768bcdb60c
timeCreated: 1429220270
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: cfba4499f10c3c34daea5b968cfc0c6b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
/*
DX11 Bokeh splatting
basic algorithm:
* find bright spots
* verify high frequency (otherwise dont care)
* if possitive, replace with black pixel and add to append buffer
* blend bokeh texture sprites via append buffer on top of blurred buffer
*/
Shader "Hidden/DepthOfField/BokehSplatting"
{
Properties
{
_MainTex ("", 2D) = "white" {}
_BlurredColor ("", 2D) = "white" {}
_FgCocMask ("", 2D) = "white" {}
}
CGINCLUDE
#include "UnityCG.cginc"
#define BOKEH_ZERO_VEC (float4(0,0,0,0))
#define BOKEH_ONE_VEC (float4(1,1,1,1))
float4 _BokehParams; // legend: dx11BokehScale, dx11BokehIntensity,dx11BokehThreshhold, internalBlurWidth
float4 _MainTex_TexelSize;
float3 _Screen;
float _SpawnHeuristic;
sampler2D_float _CameraDepthTexture;
sampler2D _BlurredColor;
sampler2D _MainTex;
sampler2D _FgCocMask;
struct appendStruct {
float3 pos;
float4 color;
};
struct gs_out {
float4 pos : SV_POSITION;
float3 uv : TEXCOORD0;
float4 color : TEXCOORD1;
float4 misc : TEXCOORD2;
};
// TODO: activate border clamp tex sampler state instead?
inline float4 clampBorderColor(float2 uv)
{
#if 1
if(uv.x<=0) return BOKEH_ZERO_VEC; if(uv.x>=1) return BOKEH_ZERO_VEC;
if(uv.y<=0) return BOKEH_ZERO_VEC; if(uv.y>=1) return BOKEH_ZERO_VEC;
#endif
return BOKEH_ONE_VEC;
}
struct vs_out {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 color : TEXCOORD1;
float cocOverlap : TEXCOORD2;
};
struct appdata {
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
};
struct v2f {
float4 pos : SV_POSITION;
float2 uv_flip : TEXCOORD0;
float2 uv : TEXCOORD1;
};
AppendStructuredBuffer<appendStruct> pointBufferOutput : register(u1);
StructuredBuffer<appendStruct> pointBuffer;
vs_out vertApply (uint id : SV_VertexID)
{
vs_out o = (vs_out)0;
float2 pos = pointBuffer[id].pos.xy ;
o.pos = float4(pos * 2.0 - 1.0, 0, 1);
o.color = pointBuffer[id].color;
#if UNITY_UV_STARTS_AT_TOP
o.pos.y *= -1;
#endif
o.cocOverlap = pointBuffer[id].pos.z;
return o;
}
v2f vertCollect (appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv = v.texcoord;
o.uv_flip = v.texcoord;
#if UNITY_UV_STARTS_AT_TOP
if(_MainTex_TexelSize.y<0)
o.uv_flip.y = 1.0-o.uv_flip.y;
if(_MainTex_TexelSize.y<0)
o.pos.y *= -1.0;
#endif
return o;
}
[maxvertexcount(4)]
void geom (point vs_out input[1], inout TriangleStream<gs_out> outStream)
{
// NEW ENERGY CONSERVATION:
float2 scale2 = _BokehParams.ww * input[0].color.aa * _BokehParams.xx;
float4 offs = 0;
offs.xy = float2(3.0, 3.0) + 2.0f * floor(scale2 + float2(0.5,0.5));
float2 rs = ((float2(1.0, 1.0) + 2.0f * (scale2 + float2(0.5,0.5))));;
float2 f2 = offs.xy / rs;
float energyAdjustment = (_BokehParams.y) / (rs.x*rs.y);
offs.xy *= _Screen.xy;
gs_out output;
output.pos = input[0].pos + offs*float4(-1,1,0,0);
output.misc = float4(f2,0,0);
output.uv = float3(0, 1, input[0].cocOverlap);
output.color = input[0].color * energyAdjustment;
outStream.Append (output);
output.pos = input[0].pos + offs*float4(1,1,0,0);
output.misc = float4(f2,0,0);
output.uv = float3(1, 1, input[0].cocOverlap);
output.color = input[0].color * energyAdjustment;
outStream.Append (output);
output.pos = input[0].pos + offs*float4(-1,-1,0,0);
output.misc = float4(f2,0,0);
output.uv = float3(0, 0, input[0].cocOverlap);
output.color = input[0].color * energyAdjustment;
outStream.Append (output);
output.pos = input[0].pos + offs*float4(1,-1,0,0);
output.misc = float4(f2,0,0);
output.uv = float3(1, 0, input[0].cocOverlap);
output.color = input[0].color * energyAdjustment;
outStream.Append (output);
outStream.RestartStrip();
}
float4 collectBrightPixel(half2 uv)
{
half4 c = tex2D (_MainTex, uv);
half coc = abs(c.a);
half lumc = Luminance (c.rgb);
half4 cblurred = tex2D (_BlurredColor, uv);
half cocBlurred = abs(cblurred.a);
half lumblurred = Luminance (cblurred.rgb);
half fgCoc = -min(c.a,0.0h);
[branch]
if (coc * _BokehParams.w > 1 && cocBlurred > 0.1 && lumc > _BokehParams.z && abs(lumc-lumblurred) > _SpawnHeuristic)
{
appendStruct append = (appendStruct)0;
append.pos = float3(uv, fgCoc);
append.color.rgba = half4(c.rgb * saturate(coc*4), coc);
pointBufferOutput.Append(append);
c = half4(c.rgb * saturate(1-coc*4), c.a);
}
return c;
}
ENDCG
SubShader
{
// pass 0: bokeh splatting
Pass {
ZWrite Off ZTest Always Cull Off
BlendOp Add, Add
Blend DstAlpha One, Zero One
ColorMask RGBA
CGPROGRAM
#pragma target 5.0
#pragma vertex vertApply
#pragma geometry geom
#pragma fragment frag
fixed4 frag (gs_out i) : SV_Target
{
float2 uv = (i.uv.xy) * i.misc.xy + (float2(1,1)-i.misc.xy) * 0.5; // smooth uv scale
return float4(i.color.rgb, 1) * float4(tex2D(_MainTex, uv.xy).rgb, i.uv.z) * clampBorderColor (uv);
}
ENDCG
}
// pass 1: append buffer "collect"
Pass
{
ZWrite Off ZTest Always Cull Off
CGPROGRAM
#pragma vertex vertCollect
#pragma fragment frag
#pragma target 5.0
float4 frag (v2f i) : SV_Target
{
return collectBrightPixel(i.uv);
}
ENDCG
}
}
Fallback Off
}
fileFormatVersion: 2
guid: c961b8ed1f00f924d804ada5143bd0e8
timeCreated: 1449750679
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Hidden/DepthOfField/DepthOfField"
{
Properties
{
_MainTex ("-", 2D) = "black"
_SecondTex ("-", 2D) = "black"
_ThirdTex ("-", 2D) = "black"
}
CGINCLUDE
#pragma target 3.0
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
sampler2D _MainTex;
sampler2D _SecondTex;
sampler2D _ThirdTex;
sampler2D _CameraDepthTexture;
uniform half4 _MainTex_TexelSize;
uniform half4 _BlurCoe;
uniform half4 _BlurParams;
uniform half4 _BoostParams;
uniform half4 _Convolved_TexelSize;
uniform float4 _Offsets;
uniform half4 _MainTex_ST;
uniform half4 _SecondTex_ST;
uniform half4 _ThirdTex_ST;
///////////////////////////////////////////////////////////////////////////////
// Verter Shaders and declaration
///////////////////////////////////////////////////////////////////////////////
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float2 uv1 : TEXCOORD1;
};
struct v2fDepth
{
half4 pos : SV_POSITION;
half2 uv : TEXCOORD0;
};
struct v2fBlur
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 uv01 : TEXCOORD1;
float4 uv23 : TEXCOORD2;
float4 uv45 : TEXCOORD3;
float4 uv67 : TEXCOORD4;
float4 uv89 : TEXCOORD5;
};
v2fDepth vert(appdata_img v)
{
v2fDepth o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0)
o.uv.y = 1-o.uv.y;
#endif
return o;
}
v2fDepth vertNoFlip(appdata_img v)
{
v2fDepth o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
return o;
}
v2f vert_d( appdata_img v )
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv1.xy = v.texcoord.xy;
o.uv.xy = v.texcoord.xy;
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0)
o.uv.y = 1-o.uv.y;
#endif
return o;
}
v2f vertFlip( appdata_img v )
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);
o.uv1.xy = v.texcoord.xy;
o.uv.xy = v.texcoord.xy;
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0)
o.uv.y = 1-o.uv.y;
if (_MainTex_TexelSize.y < 0)
o.uv1.y = 1-o.uv1.y;
#endif
return o;
}
v2fBlur vertBlurPlusMinus (appdata_img v)
{
v2fBlur o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv.xy = v.texcoord.xy;
o.uv01 = v.texcoord.xyxy + _Offsets.xyxy * float4(1,1, -1,-1) * _MainTex_TexelSize.xyxy / 6.0;
o.uv23 = v.texcoord.xyxy + _Offsets.xyxy * float4(2,2, -2,-2) * _MainTex_TexelSize.xyxy / 6.0;
o.uv45 = v.texcoord.xyxy + _Offsets.xyxy * float4(3,3, -3,-3) * _MainTex_TexelSize.xyxy / 6.0;
o.uv67 = v.texcoord.xyxy + _Offsets.xyxy * float4(4,4, -4,-4) * _MainTex_TexelSize.xyxy / 6.0;
o.uv89 = v.texcoord.xyxy + _Offsets.xyxy * float4(5,5, -5,-5) * _MainTex_TexelSize.xyxy / 6.0;
return o;
}
///////////////////////////////////////////////////////////////////////////////
// Helpers
///////////////////////////////////////////////////////////////////////////////
inline half3 getBoostAmount(half4 colorAndCoc)
{
half boost = colorAndCoc.a * (colorAndCoc.a < 0.0f ?_BoostParams.x:_BoostParams.y);
half luma = dot(colorAndCoc.rgb, half3(0.3h, 0.59h, 0.11h));
return luma < _BoostParams.z ? half3(0.0h, 0.0h, 0.0h):colorAndCoc.rgb * boost.rrr;
}
inline half GetCocFromDepth(half2 uv, bool useExplicit)
{
half d = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv);
d = Linear01Depth (d);
if (useExplicit)
{
half coc = d < _BlurCoe.z ? clamp((_BlurParams.x * d + _BlurParams.y), -1.0f, 0.0f):clamp((_BlurParams.z * d + _BlurParams.w), 0.0f, 1.0f);
return coc;
}
else
{
half aperture = _BlurParams.x;
half focalLength = _BlurParams.y;
half focusDistance01 = _BlurParams.z;
half focusRange01 = _BlurParams.w;
half coc = aperture * abs(d - focusDistance01) / (d + 1e-5f) - focusRange01;
coc = (d < focusDistance01 ? -1.0h:1.0h) * clamp(coc, 0.0f, 1.0f);
return coc;
}
}
///////////////////////////////////////////////////////////////////////////////
// Directional (hexagonal/octogonal) bokeh
///////////////////////////////////////////////////////////////////////////////
#define SAMPLE_NUM_L 6
#define SAMPLE_NUM_M 11
#define SAMPLE_NUM_H 16
half4 shapeDirectionalBlur(half2 uv, bool mergePass, int numSample, bool sampleDilatedFG)
{
half4 centerTap = tex2Dlod (_MainTex, float4(uv,0,0));
half fgCoc = centerTap.a;
half fgBlendFromPreviousPass = centerTap.a * _Offsets.z;
if (sampleDilatedFG)
{
half2 cocs = tex2Dlod(_SecondTex, half4(uv,0,0)).rg;
fgCoc = min(cocs.r, cocs.g);
centerTap.a = cocs.g;
}
half bgRadius = smoothstep(0.0h, 0.85h, centerTap.a) * _BlurCoe.y;
half fgRadius = smoothstep(0.0h, 0.85h, -fgCoc) * _BlurCoe.x;
half radius = max(bgRadius, fgRadius);
if (radius < 1e-2f )
{
return half4(centerTap.rgb, (sampleDilatedFG||mergePass)?fgBlendFromPreviousPass:centerTap.a);
}
half radOtherFgRad = radius/(fgRadius + 1e-2h);
half radOtherBgRad = radius/(bgRadius + 1e-2h);
half2 range = radius * _MainTex_TexelSize.xy;
half fgWeight = 0.001h;
half bgWeight = 0.001h;
half3 fgSum = half3(0,0,0);
half3 bgSum = half3(0,0,0);
for (int k = 0; k < numSample; k++)
{
half t = (half)k / half(numSample-1);
half2 kVal = lerp(_Offsets.xy, -_Offsets.xy, t);
half2 offset = kVal * range;
half2 texCoord = uv + offset;
half4 sample0 = tex2Dlod(_MainTex, half4(texCoord,0,0));
if (sampleDilatedFG)
{
sample0.a = tex2Dlod(_SecondTex, half4(texCoord,0,0)).g;
}
half dist = abs(2.0h * t - 1);
half distanceFactor = saturate(-0.5f * abs(sample0.a - centerTap.a) * dist + 1.0f);
half isNear = max(0.0h, -sample0.a);
half isFar = max(0.0h, sample0.a) * distanceFactor;
isNear *= 1- smoothstep(1.0h, 2.0h, dist * radOtherFgRad);
isFar *= 1- smoothstep(1.0h, 2.0h, dist * radOtherBgRad);
fgWeight += isNear;
fgSum += sample0.rgb * isNear;
bgWeight += isFar;
bgSum += sample0.rgb * isFar;
}
half3 fgColor = fgSum / (fgWeight + 0.0001h);
half3 bgColor = bgSum / (bgWeight + 0.0001h);
half bgBlend = saturate (2.0h * bgWeight / numSample);
half fgBlend = saturate (2.0h * fgWeight / numSample);
half3 finalBg = lerp(centerTap.rgb, bgColor, bgBlend);
half3 finalColor = lerp(finalBg, fgColor, max(max(0.0h , -centerTap.a) , fgBlend));
if (mergePass)
{
finalColor = min(finalColor, tex2Dlod(_ThirdTex, half4(uv,0,0)).rgb);
}
finalColor = lerp(centerTap.rgb, finalColor, saturate(bgBlend+fgBlend));
fgBlend = max(fgBlendFromPreviousPass, fgBlend);
return half4(finalColor, (sampleDilatedFG||mergePass)?fgBlend:centerTap.a);
}
half4 fragShapeLowQuality(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, false, SAMPLE_NUM_L, false);
}
half4 fragShapeLowQualityDilateFg(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, false, SAMPLE_NUM_L, true);
}
half4 fragShapeLowQualityMerge(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, true, SAMPLE_NUM_L, false);
}
half4 fragShapeLowQualityMergeDilateFg(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, true, SAMPLE_NUM_L, true);
}
half4 fragShapeMediumQuality(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, false, SAMPLE_NUM_M, false);
}
half4 fragShapeMediumQualityDilateFg(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, false, SAMPLE_NUM_M, true);
}
half4 fragShapeMediumQualityMerge(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, true, SAMPLE_NUM_M, false);
}
half4 fragShapeMediumQualityMergeDilateFg(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, true, SAMPLE_NUM_M, true);
}
half4 fragShapeHighQuality(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, false, SAMPLE_NUM_H, false);
}
half4 fragShapeHighQualityDilateFg(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, false, SAMPLE_NUM_H, true);
}
half4 fragShapeHighQualityMerge(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, true, SAMPLE_NUM_H, false);
}
half4 fragShapeHighQualityMergeDilateFg(v2fDepth i) : COLOR
{
return shapeDirectionalBlur(i.uv, true, SAMPLE_NUM_H, true);
}
///////////////////////////////////////////////////////////////////////////////
// Disk Bokeh
///////////////////////////////////////////////////////////////////////////////
static const half3 DiscBokeh48[48] =
{
//48 tap regularly spaced circular kernel (x,y, length)
//fill free to change the shape to try other bokehs style :)
half3( 0.99144h, 0.13053h, 1.0h),
half3( 0.92388h, 0.38268h, 1.0h),
half3( 0.79335h, 0.60876h, 1.0h),
half3( 0.60876h, 0.79335h, 1.0h),
half3( 0.38268h, 0.92388h, 1.0h),
half3( 0.13053h, 0.99144h, 1.0h),
half3(-0.13053h, 0.99144h, 1.0h),
half3(-0.38268h, 0.92388h, 1.0h),
half3(-0.60876h, 0.79335h, 1.0h),
half3(-0.79335h, 0.60876h, 1.0h),
half3(-0.92388h, 0.38268h, 1.0h),
half3(-0.99144h, 0.13053h, 1.0h),
half3(-0.99144h,-0.13053h, 1.0h),
half3(-0.92388h,-0.38268h, 1.0h),
half3(-0.79335h,-0.60876h, 1.0h),
half3(-0.60876h,-0.79335h, 1.0h),
half3(-0.38268h,-0.92388h, 1.0h),
half3(-0.13053h,-0.99144h, 1.0h),
half3( 0.13053h,-0.99144h, 1.0h),
half3( 0.38268h,-0.92388h, 1.0h),
half3( 0.60876h,-0.79335h, 1.0h),
half3( 0.79335h,-0.60876h, 1.0h),
half3( 0.92388h,-0.38268h, 1.0h),
half3( 0.99144h,-0.13053h, 1.0h),
half3( 0.64732h, 0.12876h, 0.66h),
half3( 0.54877h, 0.36668h, 0.66h),
half3( 0.36668h, 0.54877h, 0.66h),
half3( 0.12876h, 0.64732h, 0.66h),
half3(-0.12876h, 0.64732h, 0.66h),
half3(-0.36668h, 0.54877h, 0.66h),
half3(-0.54877h, 0.36668h, 0.66h),
half3(-0.64732h, 0.12876h, 0.66h),
half3(-0.64732h,-0.12876h, 0.66h),
half3(-0.54877h,-0.36668h, 0.66h),
half3(-0.36668h,-0.54877h, 0.66h),
half3(-0.12876h,-0.64732h, 0.66h),
half3( 0.12876h,-0.64732h, 0.66h),
half3( 0.36668h,-0.54877h, 0.66h),
half3( 0.54877h,-0.36668h, 0.66h),
half3( 0.64732h,-0.12876h, 0.66h),
half3( 0.30488h, 0.12629h, 0.33h),
half3( 0.12629h, 0.30488h, 0.33h),
half3(-0.12629h, 0.30488h, 0.33h),
half3(-0.30488h, 0.12629h, 0.33h),
half3(-0.30488h,-0.12629h, 0.33h),
half3(-0.12629h,-0.30488h, 0.33h),
half3( 0.12629h,-0.30488h, 0.33h),
half3( 0.30488h,-0.12629h, 0.33h)
};
inline float4 circleCocBokeh(float2 uv, bool sampleDilatedFG, int increment)
{
half4 centerTap = tex2Dlod(_MainTex, half4(uv,0,0));
half fgCoc = centerTap.a;
if (sampleDilatedFG)
{
fgCoc = min(tex2Dlod(_SecondTex, half4(uv,0,0)).r, fgCoc);
}
half bgRadius = 0.5h * smoothstep(0.0h, 0.85h, centerTap.a) * _BlurCoe.y;
half fgRadius = 0.5h * smoothstep(0.0h, 0.85h, -fgCoc) * _BlurCoe.x;
half radius = max(bgRadius, fgRadius);
if (radius < 1e-2f )
{
return half4(centerTap.rgb, 0);
}
half2 poissonScale = radius * _MainTex_TexelSize.xy;
half fgWeight = max(0,-centerTap.a);
half bgWeight = max(0, centerTap.a);
half3 fgSum = centerTap.rgb * fgWeight;
half3 bgSum = centerTap.rgb * bgWeight;
half radOtherFgRad = radius/(fgRadius + 1e-2h);
half radOtherBgRad = radius/(bgRadius + 1e-2h);
for (int l = 0; l < 48; l+= increment)
{
half2 sampleUV = uv + DiscBokeh48[l].xy * poissonScale.xy;
half4 sample0 = tex2Dlod(_MainTex, half4(sampleUV,0,0));
half isNear = max(0.0h, -sample0.a);
half distanceFactor = saturate(-0.5f * abs(sample0.a - centerTap.a) * DiscBokeh48[l].z + 1.0f);
half isFar = max(0.0h, sample0.a) * distanceFactor;
isNear *= 1- smoothstep(1.0h, 2.0h, DiscBokeh48[l].z * radOtherFgRad);
isFar *= 1- smoothstep(1.0h, 2.0h, DiscBokeh48[l].z * radOtherBgRad);
fgWeight += isNear;
fgSum += sample0.rgb * isNear;
bgWeight += isFar;
bgSum += sample0.rgb * isFar;
}
half3 fgColor = fgSum / (fgWeight + 0.0001h);
half3 bgColor = bgSum / (bgWeight + 0.0001h);
half bgBlend = saturate (2.0h * bgWeight / 49.0h);
half fgBlend = saturate (2.0h * fgWeight / 49.0h);
half3 finalBg = lerp(centerTap.rgb, bgColor, bgBlend);
half3 finalColor = lerp(finalBg, fgColor, max(max(0.0h , -centerTap.a) , fgBlend));
half4 returnValue = half4(finalColor, fgBlend );
return returnValue;
}
float4 fragCircleBlurWithDilatedFg (v2fDepth i) : SV_Target
{
return circleCocBokeh(i.uv, true, 1);
}
float4 fragCircleBlur (v2fDepth i) : SV_Target
{
return circleCocBokeh(i.uv, false, 1);
}
float4 fragCircleBlurWithDilatedFgLowQuality (v2fDepth i) : SV_Target
{
return circleCocBokeh(i.uv, true, 2);
}
float4 fragCircleBlurLowQuality (v2fDepth i) : SV_Target
{
return circleCocBokeh(i.uv, false, 2);
}
///////////////////////////////////////////////////////////////////////////////
// Prefilter blur
///////////////////////////////////////////////////////////////////////////////
#define DISC_PREFILTER_SAMPLE 9
static const half2 DiscPrefilter[DISC_PREFILTER_SAMPLE] =
{
half2(0.01288369f, 0.5416069f),
half2(-0.9192798f, -0.09529364f),
half2(0.7596578f, 0.1922738f),
half2(-0.14132f, -0.2880242f),
half2(-0.5249333f, 0.7777638f),
half2(-0.5871695f, -0.7403569f),
half2(0.3202196f, -0.6442268f),
half2(0.8553214f, -0.3920982f),
half2(0.5827708f, 0.7599297f)
};
float4 fragCocPrefilter (v2fDepth i) : SV_Target
{
half4 centerTap = tex2Dlod(_MainTex, half4(i.uv.xy,0,0));
half radius = 0.33h * 0.5h * (centerTap.a < 0.0f ? -(centerTap.a * _BlurCoe.x):(centerTap.a * _BlurCoe.y));
half2 poissonScale = radius * _MainTex_TexelSize.xy;
if (radius < 0.01h )
{
return centerTap;
}
half sampleCount = 1;
half3 sum = centerTap.rgb * 1;
for (int l = 0; l < DISC_PREFILTER_SAMPLE; l++)
{
half2 sampleUV = i.uv + DiscPrefilter[l].xy * poissonScale.xy;
half4 sample0 = tex2Dlod(_MainTex, half4(sampleUV.xy,0,0));
half weight = max(sample0.a * centerTap.a,0.0h);
sum += sample0.rgb * weight;
sampleCount += weight;
}
half4 returnValue = half4(sum / sampleCount, centerTap.a);
return returnValue;
}
///////////////////////////////////////////////////////////////////////////////
// Final merge and upsample
///////////////////////////////////////////////////////////////////////////////
float4 upSampleConvolved(half2 uv, bool useBicubic)
{
if (useBicubic)
{
//bicubic upsampling (B-spline)
half2 convolvedTexelPos = uv * _Convolved_TexelSize.xy;
half2 convolvedTexelCenter = floor( convolvedTexelPos - 0.5h ) + 0.5h;
half2 f = convolvedTexelPos - convolvedTexelCenter;
half2 f2 = f * f;
half2 f3 = f * f2;
half2 w0 = -0.166h * f3 + 0.5h * f2 - 0.5h * f + 0.166h;
half2 w1 = 0.5h * f3 - f2 + 0.666h;
half2 w3 = 0.166h * f3;
half2 w2 = 1.0h - w0 - w1 - w3;
half2 s0 = w0 + w1;
half2 s1 = w2 + w3;
half2 f0 = w1 / s0;
half2 f1 = w3 / s1;
half2 t0 = _Convolved_TexelSize.zw * (convolvedTexelCenter - 1.0h + f0);
half2 t1 = _Convolved_TexelSize.zw * (convolvedTexelCenter + 1.0h + f1);
return tex2Dlod(_SecondTex, half4(t0.x, t0.y, 0, 0)) * s0.x * s0.y +
tex2Dlod(_SecondTex, half4(t1.x, t0.y, 0, 0)) * s1.x * s0.y +
tex2Dlod(_SecondTex, half4(t0.x, t1.y, 0, 0)) * s0.x * s1.y +
tex2Dlod(_SecondTex, half4(t1.x, t1.y, 0, 0)) * s1.x * s1.y;
}
else
{
return tex2Dlod(_SecondTex, half4(uv,0,0));
}
}
float4 circleCocMerge (half2 uv, bool useExplicit, bool useBicubic)
{
half4 convolvedTap = upSampleConvolved(uv, useBicubic);
half4 sourceTap = tex2Dlod(_MainTex, half4(uv,0,0));
half coc = GetCocFromDepth(uv, useExplicit);
sourceTap.rgb += getBoostAmount(half4(sourceTap.rgb, coc));
coc = (coc * _BlurCoe.y > 1.0h )?coc:0.0h;
half blendValue = smoothstep(0.0, 0.33h, max(coc, convolvedTap.a));
half3 returnValue = lerp(sourceTap.rgb, convolvedTap.rgb, blendValue);
return (blendValue < 1e-2f) ? sourceTap : half4(returnValue.rgb, sourceTap.a);
}
float4 fragMergeBicubic (v2fDepth i) : SV_Target
{
return circleCocMerge(i.uv, false, true);
}
float4 fragMergeExplicitBicubic (v2fDepth i) : SV_Target
{
return circleCocMerge(i.uv, true, true);
}
float4 fragMerge (v2fDepth i) : SV_Target
{
return circleCocMerge(i.uv, false, false);
}
float4 fragMergeExplicit (v2fDepth i) : SV_Target
{
return circleCocMerge(i.uv, true, false);
}
///////////////////////////////////////////////////////////////////////////////
// Downsampling and COC computation
///////////////////////////////////////////////////////////////////////////////
half4 captureCoc(half2 uvColor, half2 uvDepth, bool useExplicit)
{
half4 color = tex2Dlod (_MainTex, half4(uvColor, 0, 0 ));
//TODO should use gather4 on supported platform!
//TODO do only 1 tap on high resolution mode
half cocA = GetCocFromDepth(uvDepth + _MainTex_TexelSize.xy * half2(+0.25f,+0.25f), useExplicit);
half cocB = GetCocFromDepth(uvDepth + _MainTex_TexelSize.xy * half2(+0.25f,-0.25f), useExplicit);
half cocC = GetCocFromDepth(uvDepth + _MainTex_TexelSize.xy * half2(-0.25f,+0.25f), useExplicit);
half cocD = GetCocFromDepth(uvDepth + _MainTex_TexelSize.xy * half2(-0.25f,-0.25f), useExplicit);
half cocAB = (abs(cocA)<abs(cocB))?cocA:cocB;
half cocCD = (abs(cocC)<abs(cocD))?cocC:cocD;
color.a = (abs(cocAB)<abs(cocCD))?cocAB:cocCD;
color.rgb += getBoostAmount(color);
return color;
}
half4 fragCaptureCoc (v2f i) : SV_Target
{
return captureCoc(i.uv, i.uv1, false);
}
half4 fragCaptureCocExplicit (v2f i) : SV_Target
{
return captureCoc(i.uv, i.uv1, true);
}
///////////////////////////////////////////////////////////////////////////////
// Coc visualisation
///////////////////////////////////////////////////////////////////////////////
inline float4 visualizeCoc(half2 uv, bool useExplicit)
{
half coc = GetCocFromDepth(uv, useExplicit);
return (coc < 0)? half4(-coc, -coc, 0, 1.0) : half4(0, coc, coc, 1.0);
}
float4 fragVisualizeCoc(v2fDepth i) : SV_Target
{
return visualizeCoc(i.uv, false);
}
float4 fragVisualizeCocExplicit(v2fDepth i) : SV_Target
{
return visualizeCoc(i.uv, true);
}
///////////////////////////////////////////////////////////////////////////////
// Foreground blur dilatation
///////////////////////////////////////////////////////////////////////////////
inline half2 fgCocSourceChannel(half2 uv, bool fromAlpha)
{
if (fromAlpha)
return tex2Dlod(_MainTex, half4(uv,0,0)).aa;
else
return tex2Dlod(_MainTex, half4(uv,0,0)).rg;
}
inline half2 weigthedFGCocBlur(v2fBlur i, bool fromAlpha)
{
half2 fgCoc00 = fgCocSourceChannel(i.uv.xy , fromAlpha);
half2 fgCoc01 = fgCocSourceChannel(i.uv01.zw, fromAlpha) * 1.0h;
half2 fgCoc02 = fgCocSourceChannel(i.uv01.xy, fromAlpha) * 1.0h;
half2 fgCoc03 = fgCocSourceChannel(i.uv23.xy, fromAlpha) * 0.8h;
half2 fgCoc04 = fgCocSourceChannel(i.uv23.zw, fromAlpha) * 0.8h;
half2 fgCoc05 = fgCocSourceChannel(i.uv45.xy, fromAlpha) * 0.6h;
half2 fgCoc06 = fgCocSourceChannel(i.uv45.zw, fromAlpha) * 0.6h;
half2 fgCoc07 = fgCocSourceChannel(i.uv67.xy, fromAlpha) * 0.40h;
half2 fgCoc08 = fgCocSourceChannel(i.uv67.zw, fromAlpha) * 0.40f;
half2 fgCoc09 = fgCocSourceChannel(i.uv89.xy, fromAlpha) * 0.25f;
half2 fgCoc10 = fgCocSourceChannel(i.uv89.zw, fromAlpha) * 0.25f;
half fgCoc;
fgCoc = min( 0.0h, fgCoc00.r);
fgCoc = min(fgCoc, fgCoc01.r);
fgCoc = min(fgCoc, fgCoc02.r);
fgCoc = min(fgCoc, fgCoc03.r);
fgCoc = min(fgCoc, fgCoc04.r);
fgCoc = min(fgCoc, fgCoc05.r);
fgCoc = min(fgCoc, fgCoc06.r);
fgCoc = min(fgCoc, fgCoc07.r);
fgCoc = min(fgCoc, fgCoc08.r);
fgCoc = min(fgCoc, fgCoc09.r);
fgCoc = min(fgCoc, fgCoc10.r);
return half2(fgCoc,fgCoc00.g);
}
float4 fragDilateFgCocFromColor (v2fBlur i) : SV_Target
{
return weigthedFGCocBlur(i,true).xyxy;
}
float4 fragDilateFgCoc (v2fBlur i) : SV_Target
{
return weigthedFGCocBlur(i,false).xyxy;
}
///////////////////////////////////////////////////////////////////////////////
// Texture Bokeh related
///////////////////////////////////////////////////////////////////////////////
float4 fragBlurAlphaWeighted (v2fBlur i) : SV_Target
{
const float ALPHA_WEIGHT = 2.0f;
float4 sum = float4 (0,0,0,0);
float w = 0;
float weights = 0;
const float G_WEIGHTS[6] = {1.0, 0.8, 0.675, 0.5, 0.2, 0.075};
float4 sampleA = tex2D(_MainTex, i.uv.xy);
float4 sampleB = tex2D(_MainTex, i.uv01.xy);
float4 sampleC = tex2D(_MainTex, i.uv01.zw);
float4 sampleD = tex2D(_MainTex, i.uv23.xy);
float4 sampleE = tex2D(_MainTex, i.uv23.zw);
float4 sampleF = tex2D(_MainTex, i.uv45.xy);
float4 sampleG = tex2D(_MainTex, i.uv45.zw);
float4 sampleH = tex2D(_MainTex, i.uv67.xy);
float4 sampleI = tex2D(_MainTex, i.uv67.zw);
float4 sampleJ = tex2D(_MainTex, i.uv89.xy);
float4 sampleK = tex2D(_MainTex, i.uv89.zw);
w = sampleA.a * G_WEIGHTS[0]; sum += sampleA * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleB.a) * G_WEIGHTS[1]; sum += sampleB * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleC.a) * G_WEIGHTS[1]; sum += sampleC * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleD.a) * G_WEIGHTS[2]; sum += sampleD * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleE.a) * G_WEIGHTS[2]; sum += sampleE * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleF.a) * G_WEIGHTS[3]; sum += sampleF * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleG.a) * G_WEIGHTS[3]; sum += sampleG * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleH.a) * G_WEIGHTS[4]; sum += sampleH * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleI.a) * G_WEIGHTS[4]; sum += sampleI * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleJ.a) * G_WEIGHTS[5]; sum += sampleJ * w; weights += w;
w = saturate(ALPHA_WEIGHT*sampleK.a) * G_WEIGHTS[5]; sum += sampleK * w; weights += w;
sum /= weights + 1e-4f;
sum.a = sampleA.a;
if(sampleA.a<1e-2f) sum.rgb = sampleA.rgb;
return sum;
}
float4 fragBoxBlur (v2f i) : SV_Target
{
float4 returnValue = tex2D(_MainTex, i.uv1.xy + 0.75*_MainTex_TexelSize.xy);
returnValue += tex2D(_MainTex, i.uv1.xy - 0.75*_MainTex_TexelSize.xy);
returnValue += tex2D(_MainTex, i.uv1.xy + 0.75*_MainTex_TexelSize.xy * float2(1,-1));
returnValue += tex2D(_MainTex, i.uv1.xy - 0.75*_MainTex_TexelSize.xy * float2(1,-1));
return returnValue/4;
}
ENDCG
///////////////////////////////////////////////////////////////////////////////
SubShader
{
ZTest Always Cull Off ZWrite Off Fog { Mode Off } Lighting Off Blend Off
// 1
Pass
{
CGPROGRAM
#pragma vertex vertBlurPlusMinus
#pragma fragment fragBlurAlphaWeighted
ENDCG
}
// 2
Pass
{
CGPROGRAM
#pragma vertex vert_d
#pragma fragment fragBoxBlur
ENDCG
}
// 3
Pass
{
CGPROGRAM
#pragma vertex vertBlurPlusMinus
#pragma fragment fragDilateFgCocFromColor
ENDCG
}
// 4
Pass
{
CGPROGRAM
#pragma vertex vertBlurPlusMinus
#pragma fragment fragDilateFgCoc
ENDCG
}
// 5
Pass
{
CGPROGRAM
#pragma vertex vert_d
#pragma fragment fragCaptureCoc
ENDCG
}
// 6
Pass
{
CGPROGRAM
#pragma vertex vert_d
#pragma fragment fragCaptureCocExplicit
ENDCG
}
// 7
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragVisualizeCoc
ENDCG
}
// 8
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragVisualizeCocExplicit
ENDCG
}
// 9
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCocPrefilter
ENDCG
}
// 10
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCircleBlur
ENDCG
}
// 11
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCircleBlurWithDilatedFg
ENDCG
}
// 12
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCircleBlurLowQuality
ENDCG
}
// 13
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCircleBlurWithDilatedFgLowQuality
ENDCG
}
// 14
Pass
{
CGPROGRAM
#pragma vertex vertNoFlip
#pragma fragment fragMerge
ENDCG
}
// 15
Pass
{
CGPROGRAM
#pragma vertex vertNoFlip
#pragma fragment fragMergeExplicit
ENDCG
}
// 16
Pass
{
CGPROGRAM
#pragma vertex vertNoFlip
#pragma fragment fragMergeBicubic
ENDCG
}
// 17
Pass
{
CGPROGRAM
#pragma vertex vertNoFlip
#pragma fragment fragMergeExplicitBicubic
ENDCG
}
// 18
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeLowQuality
ENDCG
}
// 19
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeLowQualityDilateFg
ENDCG
}
// 20
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeLowQualityMerge
ENDCG
}
// 21
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeLowQualityMergeDilateFg
ENDCG
}
// 22
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeMediumQuality
ENDCG
}
// 23
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeMediumQualityDilateFg
ENDCG
}
// 24
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeMediumQualityMerge
ENDCG
}
// 25
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeMediumQualityMergeDilateFg
ENDCG
}
// 26
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeHighQuality
ENDCG
}
// 27
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeHighQualityDilateFg
ENDCG
}
// 28
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeHighQualityMerge
ENDCG
}
// 29
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragShapeHighQualityMergeDilateFg
ENDCG
}
}
FallBack Off
}
fileFormatVersion: 2
guid: bff0e5458fb914f5c9985ba4f09171d2
timeCreated: 1447081022
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Hidden/DepthOfField/MedianFilter"
{
Properties
{
_MainTex ("-", 2D) = "black"
}
CGINCLUDE
#pragma target 3.0
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
sampler2D _MainTex;
uniform half4 _MainTex_TexelSize;
uniform half4 _MainTex_ST;
uniform float4 _Offsets;
///////////////////////////////////////////////////////////////////////////////
// Verter Shaders and declaration
///////////////////////////////////////////////////////////////////////////////
struct v2f
{
half4 pos : SV_POSITION;
half2 uv : TEXCOORD0;
};
v2f vert(appdata_img v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0)
o.uv.y = 1-o.uv.y;
#endif
return o;
}
///////////////////////////////////////////////////////////////////////////////
float4 fragCocMedian3 (v2f i) : SV_Target
{
//TODO use med3 on GCN architecture.
half4 A = tex2Dlod(_MainTex, half4(i.uv,0,0));
half3 B = tex2Dlod(_MainTex, half4(i.uv + _Offsets.xy * _MainTex_TexelSize.xy,0,0)).rgb;
half3 C = tex2Dlod(_MainTex, half4(i.uv - _Offsets.xy * _MainTex_TexelSize.xy,0,0)).rgb;
half3 minAB = min(A.rgb,B);
half3 maxAB = max(A.rgb,B);
half3 temp = min(C, maxAB);
half3 median = max(minAB, temp);
return half4(lerp(A.rgb, median, A.a*A.a), A.a);
}
/*/////////////////////////////////////////////////////////////////////////////
3x3 Median
Morgan McGuire and Kyle Whitson
http://graphics.cs.williams.edu
Copyright (c) Morgan McGuire and Williams College, 2006
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define s2(a, b) temp = a; a = min(a, b); b = max(temp, b);
#define mn3(a, b, c) s2(a, b); s2(a, c);
#define mx3(a, b, c) s2(b, c); s2(a, c);
#define mnmx3(a, b, c) mx3(a, b, c); s2(a, b);
#define mnmx4(a, b, c, d) s2(a, b); s2(c, d); s2(a, c); s2(b, d);
#define mnmx5(a, b, c, d, e) s2(a, b); s2(c, d); mn3(a, c, e); mx3(b, d, e);
#define mnmx6(a, b, c, d, e, f) s2(a, d); s2(b, e); s2(c, f); mn3(a, b, c); mx3(d, e, f);
float4 fragCocMedian3x3 (v2f i) : SV_Target
{
half4 center = tex2Dlod(_MainTex, half4(i.uv + half2(0, 0) * _MainTex_TexelSize.xy,0,0));
half3 v[9];
// Add the pixels which make up our window to the pixel array.
v[0] = tex2Dlod(_MainTex, half4(i.uv + half2(-1, -1) * _MainTex_TexelSize.xy,0,0)).rgb;
v[1] = tex2Dlod(_MainTex, half4(i.uv + half2(-1, 0) * _MainTex_TexelSize.xy,0,0)).rgb;
v[2] = tex2Dlod(_MainTex, half4(i.uv + half2(-1, 1) * _MainTex_TexelSize.xy,0,0)).rgb;
v[3] = tex2Dlod(_MainTex, half4(i.uv + half2( 0, -1) * _MainTex_TexelSize.xy,0,0)).rgb;
v[4] = center.rgb;
v[5] = tex2Dlod(_MainTex, half4(i.uv + half2( 0, 1) * _MainTex_TexelSize.xy,0,0)).rgb;
v[6] = tex2Dlod(_MainTex, half4(i.uv + half2( 1, -1) * _MainTex_TexelSize.xy,0,0)).rgb;
v[7] = tex2Dlod(_MainTex, half4(i.uv + half2( 1, 0) * _MainTex_TexelSize.xy,0,0)).rgb;
v[8] = tex2Dlod(_MainTex, half4(i.uv + half2( 1, 1) * _MainTex_TexelSize.xy,0,0)).rgb;
half3 temp;
// TODO use med3 on GCN architecture.
// Starting with a subset of size 6, remove the min and max each time
mnmx6(v[0], v[1], v[2], v[3], v[4], v[5]);
mnmx5(v[1], v[2], v[3], v[4], v[6]);
mnmx4(v[2], v[3], v[4], v[7]);
mnmx3(v[3], v[4], v[8]);
return half4(lerp(center.rgb, v[4], center.a*center.a), center.a);
}
#undef s2
#undef mn3
#undef mx3
#undef mnmx3
#undef mnmx4
#undef mnmx5
#undef mnmx6
///////////////////////////////////////////////////////////////////////////////
ENDCG
SubShader
{
ZTest Always Cull Off ZWrite Off Fog { Mode Off } Lighting Off Blend Off
// 0
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCocMedian3
ENDCG
}
// 15
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment fragCocMedian3x3
ENDCG
}
}
FallBack Off
}
fileFormatVersion: 2
guid: a058b22d4123add4b807e832604e5e7b
timeCreated: 1449046205
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9fc24c72af61e1146942d8d8b569e1a3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a2165e322b8057c4dbc2660f74978e79
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
[CustomPropertyDrawer(typeof(ScreenSpaceReflection.SSRSettings.LayoutAttribute))]
public class LayoutDrawer : PropertyDrawer
{
private const float kHeadingSpace = 22.0f;
static Styles m_Styles;
private class Styles
{
public readonly GUIStyle header = "ShurikenModuleTitle";
internal Styles()
{
header.font = (new GUIStyle("Label")).font;
header.border = new RectOffset(15, 7, 4, 4);
header.fixedHeight = kHeadingSpace;
header.contentOffset = new Vector2(20f, -2f);
}
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
if (!property.isExpanded)
return kHeadingSpace;
var count = property.CountInProperty();
return EditorGUIUtility.singleLineHeight * count + 15;
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if (m_Styles == null)
m_Styles = new Styles();
position.height = EditorGUIUtility.singleLineHeight;
property.isExpanded = Header(position, property.displayName, property.isExpanded);
position.y += kHeadingSpace;
if (!property.isExpanded)
return;
foreach (SerializedProperty child in property)
{
EditorGUI.PropertyField(position, child);
position.y += EditorGUIUtility.singleLineHeight;
}
}
private bool Header(Rect position, String title, bool display)
{
Rect rect = position;
position.height = EditorGUIUtility.singleLineHeight;
GUI.Box(rect, title, m_Styles.header);
Rect toggleRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f);
if (Event.current.type == EventType.Repaint)
EditorStyles.foldout.Draw(toggleRect, false, false, display, false);
Event e = Event.current;
if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition))
{
display = !display;
e.Use();
}
return display;
}
}
[CustomEditor(typeof(ScreenSpaceReflection))]
internal class ScreenSpaceReflectionEditor : Editor
{
private static class StaticFieldFinder<T>
{
public static FieldInfo GetField<TValue>(Expression<Func<T, TValue>> selector)
{
Expression body = selector;
if (body is LambdaExpression)
{
body = ((LambdaExpression)body).Body;
}
switch (body.NodeType)
{
case ExpressionType.MemberAccess:
return (FieldInfo)((MemberExpression)body).Member;
default:
throw new InvalidOperationException();
}
}
}
private enum SettingsMode
{
HighQuality,
Default,
Performance,
Custom,
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.Space();
var currentState = ((ScreenSpaceReflection)target).settings;
var settingsMode = SettingsMode.Custom;
if (currentState.Equals(ScreenSpaceReflection.SSRSettings.performanceSettings))
settingsMode = SettingsMode.Performance;
else if (currentState.Equals(ScreenSpaceReflection.SSRSettings.defaultSettings))
settingsMode = SettingsMode.Default;
else if (currentState.Equals(ScreenSpaceReflection.SSRSettings.highQualitySettings))
settingsMode = SettingsMode.HighQuality;
EditorGUI.BeginChangeCheck();
settingsMode = (SettingsMode)EditorGUILayout.EnumPopup("Preset", settingsMode);
if (EditorGUI.EndChangeCheck())
Apply(settingsMode);
// move into the settings fields...
var settings = StaticFieldFinder<ScreenSpaceReflection>.GetField(x => x.settings);
foreach (var setting in settings.FieldType.GetFields())
{
var prop = settings.Name + "." + setting.Name;
var settingsProperty = serializedObject.FindProperty(prop);
EditorGUILayout.PropertyField(settingsProperty);
}
serializedObject.ApplyModifiedProperties();
}
private void Apply(SettingsMode settingsMode)
{
switch (settingsMode)
{
case SettingsMode.Default:
Apply(ScreenSpaceReflection.SSRSettings.defaultSettings);
break;
case SettingsMode.HighQuality:
Apply(ScreenSpaceReflection.SSRSettings.highQualitySettings);
break;
case SettingsMode.Performance:
Apply(ScreenSpaceReflection.SSRSettings.performanceSettings);
break;
}
}
private void Apply(ScreenSpaceReflection.SSRSettings settings)
{
var validTargets = targets.Where(x => x is ScreenSpaceReflection).Cast<ScreenSpaceReflection>().ToArray();
Undo.RecordObjects(validTargets, "Apply SSR Settings");
foreach (var validTarget in validTargets)
validTarget.settings = settings;
}
}
}
fileFormatVersion: 2
guid: eb0236f80884a1f4793c96b4d2da5c68
timeCreated: 1446039760
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Image Effects/Rendering/Screen Space Reflection")]
public class ScreenSpaceReflection : MonoBehaviour
{
public enum SSRDebugMode
{
None = 0,
IncomingRadiance = 1,
SSRResult = 2,
FinalGlossyTerm = 3,
SSRMask = 4,
Roughness = 5,
BaseColor = 6,
SpecColor = 7,
Reflectivity = 8,
ReflectionProbeOnly = 9,
ReflectionProbeMinusSSR = 10,
SSRMinusReflectionProbe = 11,
NoGlossy = 12,
NegativeNoGlossy = 13,
MipLevel = 14,
}
public enum SSRResolution
{
FullResolution = 0,
HalfTraceFullResolve = 1,
HalfResolution = 2,
}
[Serializable]
public struct SSRSettings
{
[AttributeUsage(AttributeTargets.Field)]
public class LayoutAttribute : PropertyAttribute
{}
[Layout]
public BasicSettings basicSettings;
[Layout]
public ReflectionSettings reflectionSettings;
[Layout]
public AdvancedSettings advancedSettings;
[Layout]
public DebugSettings debugSettings;
private static readonly SSRSettings s_Performance = new SSRSettings
{
basicSettings = new BasicSettings
{
screenEdgeFading = 0,
maxDistance = 10.0f,
fadeDistance = 10.0f,
reflectionMultiplier = 1.0f,
enableHDR = false,
additiveReflection = false
},
reflectionSettings = new ReflectionSettings
{
maxSteps = 64,
rayStepSize = 4,
widthModifier = 0.5f,
smoothFallbackThreshold = 0.4f,
distanceBlur = 1.0f,
fresnelFade = 0.2f,
fresnelFadePower = 2.0f,
smoothFallbackDistance = 0.05f,
},
advancedSettings = new AdvancedSettings
{
useTemporalConfidence = false,
temporalFilterStrength = 0.0f,
treatBackfaceHitAsMiss = false,
allowBackwardsRays = false,
traceBehindObjects = true,
highQualitySharpReflections = false,
traceEverywhere = false,
resolution = SSRResolution.HalfResolution,
bilateralUpsample = false,
improveCorners = false,
reduceBanding = false,
highlightSuppression = false
},
debugSettings = new DebugSettings
{
debugMode = SSRDebugMode.None
}
};
private static readonly SSRSettings s_Default = new SSRSettings
{
basicSettings = new BasicSettings
{
screenEdgeFading = 0.03f,
maxDistance = 100.0f,
fadeDistance = 100.0f,
reflectionMultiplier = 1.0f,
enableHDR = true,
additiveReflection = false,
},
reflectionSettings = new ReflectionSettings
{
maxSteps = 128,
rayStepSize = 3,
widthModifier = 0.5f,
smoothFallbackThreshold = 0.2f,
distanceBlur = 1.0f,
fresnelFade = 0.2f,
fresnelFadePower = 2.0f,
smoothFallbackDistance = 0.05f,
},
advancedSettings = new AdvancedSettings
{
useTemporalConfidence = true,
temporalFilterStrength = 0.7f,
treatBackfaceHitAsMiss = false,
allowBackwardsRays = false,
traceBehindObjects = true,
highQualitySharpReflections = true,
traceEverywhere = true,
resolution = SSRResolution.HalfTraceFullResolve,
bilateralUpsample = true,
improveCorners = true,
reduceBanding = true,
highlightSuppression = false
},
debugSettings = new DebugSettings
{
debugMode = SSRDebugMode.None
}
};
private static readonly SSRSettings s_HighQuality = new SSRSettings
{
basicSettings = new BasicSettings
{
screenEdgeFading = 0.03f,
maxDistance = 100.0f,
fadeDistance = 100.0f,
reflectionMultiplier = 1.0f,
enableHDR = true,
additiveReflection = false,
},
reflectionSettings = new ReflectionSettings
{
maxSteps = 512,
rayStepSize = 1,
widthModifier = 0.5f,
smoothFallbackThreshold = 0.2f,
distanceBlur = 1.0f,
fresnelFade = 0.2f,
fresnelFadePower = 2.0f,
smoothFallbackDistance = 0.05f,
},
advancedSettings = new AdvancedSettings
{
useTemporalConfidence = true,
temporalFilterStrength = 0.7f,
treatBackfaceHitAsMiss = false,
allowBackwardsRays = false,
traceBehindObjects = true,
highQualitySharpReflections = true,
traceEverywhere = true,
resolution = SSRResolution.HalfTraceFullResolve,
bilateralUpsample = true,
improveCorners = true,
reduceBanding = true,
highlightSuppression = false
},
debugSettings = new DebugSettings
{
debugMode = SSRDebugMode.None
}
};
public static SSRSettings performanceSettings
{
get { return s_Performance; }
}
public static SSRSettings defaultSettings
{
get { return s_Default; }
}
public static SSRSettings highQualitySettings
{
get { return s_HighQuality; }
}
}
[Serializable]
public struct BasicSettings
{
/// BASIC SETTINGS
[Tooltip("Nonphysical multiplier for the SSR reflections. 1.0 is physically based.")]
[Range(0.0f, 2.0f)]
public float reflectionMultiplier;
[Tooltip("Maximum reflection distance in world units.")]
[Range(0.5f, 1000.0f)]
public float maxDistance;
[Tooltip("How far away from the maxDistance to begin fading SSR.")]
[Range(0.0f, 1000.0f)]
public float fadeDistance;
[Tooltip("Higher = fade out SSRR near the edge of the screen so that reflections don't pop under camera motion.")]
[Range(0.0f, 1.0f)]
public float screenEdgeFading;
[Tooltip("Enable for better reflections of very bright objects at a performance cost")]
public bool enableHDR;
// When enabled, we just add our reflections on top of the existing ones. This is physically incorrect, but several
// popular demos and games have taken this approach, and it does hide some artifacts.
[Tooltip("Add reflections on top of existing ones. Not physically correct.")]
public bool additiveReflection;
}
[Serializable]
public struct ReflectionSettings
{
/// REFLECTIONS
[Tooltip("Max raytracing length.")]
[Range(16, 2048)]
public int maxSteps;
[Tooltip("Log base 2 of ray tracing coarse step size. Higher traces farther, lower gives better quality silhouettes.")]
[Range(0, 4)]
public int rayStepSize;
[Tooltip("Typical thickness of columns, walls, furniture, and other objects that reflection rays might pass behind.")]
[Range(0.01f, 10.0f)]
public float widthModifier;
[Tooltip("Increase if reflections flicker on very rough surfaces.")]
[Range(0.0f, 1.0f)]
public float smoothFallbackThreshold;
[Tooltip("Start falling back to non-SSR value solution at smoothFallbackThreshold - smoothFallbackDistance, with full fallback occuring at smoothFallbackThreshold.")]
[Range(0.0f, 0.2f)]
public float smoothFallbackDistance;
[Tooltip("Amplify Fresnel fade out. Increase if floor reflections look good close to the surface and bad farther 'under' the floor.")]
[Range(0.0f, 1.0f)]
public float fresnelFade;
[Tooltip("Higher values correspond to a faster Fresnel fade as the reflection changes from the grazing angle.")]
[Range(0.1f, 10.0f)]
public float fresnelFadePower;
[Tooltip("Controls how blurry reflections get as objects are further from the camera. 0 is constant blur no matter trace distance or distance from camera. 1 fully takes into account both factors.")]
[Range(0.0f, 1.0f)]
public float distanceBlur;
}
[Serializable]
public struct AdvancedSettings
{
/// ADVANCED
[Range(0.0f, 0.99f)]
[Tooltip("Increase to decrease flicker in scenes; decrease to prevent ghosting (especially in dynamic scenes). 0 gives maximum performance.")]
public float temporalFilterStrength;
[Tooltip("Enable to limit ghosting from applying the temporal filter.")]
public bool useTemporalConfidence;
[Tooltip("Enable to allow rays to pass behind objects. This can lead to more screen-space reflections, but the reflections are more likely to be wrong.")]
public bool traceBehindObjects;
[Tooltip("Enable to increase quality of the sharpest reflections (through filtering), at a performance cost.")]
public bool highQualitySharpReflections;
[Tooltip("Improves quality in scenes with varying smoothness, at a potential performance cost.")]
public bool traceEverywhere;
[Tooltip("Enable to force more surfaces to use reflection probes if you see streaks on the sides of objects or bad reflections of their backs.")]
public bool treatBackfaceHitAsMiss;
[Tooltip("Enable for a performance gain in scenes where most glossy objects are horizontal, like floors, water, and tables. Leave on for scenes with glossy vertical objects.")]
public bool allowBackwardsRays;
[Tooltip("Improve visual fidelity of reflections on rough surfaces near corners in the scene, at the cost of a small amount of performance.")]
public bool improveCorners;
[Tooltip("Half resolution SSRR is much faster, but less accurate. Quality can be reclaimed for some performance by doing the resolve at full resolution.")]
public SSRResolution resolution;
[Tooltip("Drastically improves reflection reconstruction quality at the expense of some performance.")]
public bool bilateralUpsample;
[Tooltip("Improve visual fidelity of mirror reflections at the cost of a small amount of performance.")]
public bool reduceBanding;
[Tooltip("Enable to limit the effect a few bright pixels can have on rougher surfaces")]
public bool highlightSuppression;
}
[Serializable]
public struct DebugSettings
{
/// DEBUG
[Tooltip("Various Debug Visualizations")]
public SSRDebugMode debugMode;
}
[SerializeField]
public SSRSettings settings = SSRSettings.defaultSettings;
///////////// Unexposed Variables //////////////////
// Perf optimization we still need to test across platforms
[Tooltip("Enable to try and bypass expensive bilateral upsampling away from edges. There is a slight performance hit for generating the edge buffers, but a potentially high performance savings from bypassing bilateral upsampling where it is unneeded. Test on your target platforms to see if performance improves.")]
private bool useEdgeDetector = false;
// Debug variable, useful for forcing all surfaces in a scene to reflection with arbitrary sharpness/roughness
[Range(-4.0f, 4.0f)]
private float mipBias = 0.0f;
// Flag for whether to knock down the reflection term by occlusion stored in the gbuffer. Currently consistently gives
// better results when true, so this flag is private for now.
private bool useOcclusion = true;
// When enabled, all filtering is performed at the highest resolution. This is extraordinarily slow, and should only be used during development.
private bool fullResolutionFiltering = false;
// Crude sky fallback, feature-gated until next revision
private bool fallbackToSky = false;
// For next release; will improve quality at the expense of performance
private bool computeAverageRayDistance = false;
// Internal values for temporal filtering
private bool m_HasInformationFromPreviousFrame;
private Matrix4x4 m_PreviousWorldToCameraMatrix;
private RenderTexture m_PreviousDepthBuffer;
private RenderTexture m_PreviousHitBuffer;
private RenderTexture m_PreviousReflectionBuffer;
public Shader ssrShader;
private Material m_SSRMaterial;
[NonSerialized]
private RenderTexureUtility m_RTU = new RenderTexureUtility();
public Material ssrMaterial
{
get
{
if (m_SSRMaterial == null)
m_SSRMaterial = ImageEffectHelper.CheckShaderAndCreateMaterial(ssrShader);
return m_SSRMaterial;
}
}
// Shader pass indices used by the effect
private enum PassIndex
{
RayTraceStep1 = 0,
RayTraceStep2 = 1,
RayTraceStep4 = 2,
RayTraceStep8 = 3,
RayTraceStep16 = 4,
CompositeFinal = 5,
Blur = 6,
CompositeSSR = 7,
Blit = 8,
EdgeGeneration = 9,
MinMipGeneration = 10,
HitPointToReflections = 11,
BilateralKeyPack = 12,
BlitDepthAsCSZ = 13,
TemporalFilter = 14,
AverageRayDistanceGeneration = 15,
PoissonBlur = 16,
}
protected void OnEnable()
{
if (ssrShader == null)
ssrShader = Shader.Find("Hidden/ScreenSpaceReflection");
if (!ImageEffectHelper.IsSupported(ssrShader, true, true, this))
{
enabled = false;
Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
return;
}
GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;
}
void OnDisable()
{
if (m_SSRMaterial)
DestroyImmediate(m_SSRMaterial);
if (m_PreviousDepthBuffer)
DestroyImmediate(m_PreviousDepthBuffer);
if (m_PreviousHitBuffer)
DestroyImmediate(m_PreviousHitBuffer);
if (m_PreviousReflectionBuffer)
DestroyImmediate(m_PreviousReflectionBuffer);
m_SSRMaterial = null;
m_PreviousDepthBuffer = null;
m_PreviousHitBuffer = null;
m_PreviousReflectionBuffer = null;
}
private void PreparePreviousBuffers(int w, int h)
{
if (m_PreviousDepthBuffer != null)
{
if ((m_PreviousDepthBuffer.width != w) || (m_PreviousDepthBuffer.height != h))
{
DestroyImmediate(m_PreviousDepthBuffer);
DestroyImmediate(m_PreviousHitBuffer);
DestroyImmediate(m_PreviousReflectionBuffer);
m_PreviousDepthBuffer = null;
m_PreviousHitBuffer = null;
m_PreviousReflectionBuffer = null;
}
}
if (m_PreviousDepthBuffer == null)
{
m_PreviousDepthBuffer = new RenderTexture(w, h, 0, RenderTextureFormat.RFloat);
m_PreviousHitBuffer = new RenderTexture(w, h, 0, RenderTextureFormat.ARGBHalf);
m_PreviousReflectionBuffer = new RenderTexture(w, h, 0, RenderTextureFormat.ARGBHalf);
}
}
[ImageEffectOpaque]
public void OnRenderImage(RenderTexture source, RenderTexture destination)
{
if (ssrMaterial == null)
{
Graphics.Blit(source, destination);
return;
}
if (m_HasInformationFromPreviousFrame)
{
m_HasInformationFromPreviousFrame = (m_PreviousDepthBuffer != null) &&
(source.width == m_PreviousDepthBuffer.width) &&
(source.height == m_PreviousDepthBuffer.height);
}
bool doTemporalFilterThisFrame = m_HasInformationFromPreviousFrame && settings.advancedSettings.temporalFilterStrength > 0.0;
m_HasInformationFromPreviousFrame = false;
// Not using deferred shading? Just blit source to destination.
if (Camera.current.actualRenderingPath != RenderingPath.DeferredShading)
{
Graphics.Blit(source, destination);
return;
}
var rtW = source.width;
var rtH = source.height;
// RGB: Normals, A: Roughness.
// Has the nice benefit of allowing us to control the filtering mode as well.
RenderTexture bilateralKeyTexture = m_RTU.GetTemporaryRenderTexture(rtW, rtH, 0, RenderTextureFormat.ARGB32);
bilateralKeyTexture.filterMode = FilterMode.Point;
Graphics.Blit(source, bilateralKeyTexture, ssrMaterial, (int)PassIndex.BilateralKeyPack);
ssrMaterial.SetTexture("_NormalAndRoughnessTexture", bilateralKeyTexture);
float sWidth = source.width;
float sHeight = source.height;
Vector2 sourceToTempUV = new Vector2(sWidth / rtW, sHeight / rtH);
int downsampleAmount = (settings.advancedSettings.resolution == SSRResolution.FullResolution) ? 1 : 2;
rtW = rtW / downsampleAmount;
rtH = rtH / downsampleAmount;
ssrMaterial.SetVector("_SourceToTempUV", new Vector4(sourceToTempUV.x, sourceToTempUV.y, 1.0f / sourceToTempUV.x, 1.0f / sourceToTempUV.y));
Matrix4x4 P = GetComponent<Camera>().projectionMatrix;
Vector4 projInfo = new Vector4
((-2.0f / (sWidth * P[0])),
(-2.0f / (sHeight * P[5])),
((1.0f - P[2]) / P[0]),
((1.0f + P[6]) / P[5]));
/** The height in pixels of a 1m object if viewed from 1m away. */
float pixelsPerMeterAtOneMeter = sWidth / (-2.0f * (float)(Math.Tan(GetComponent<Camera>().fieldOfView / 180.0 * Math.PI * 0.5)));
ssrMaterial.SetFloat("_PixelsPerMeterAtOneMeter", pixelsPerMeterAtOneMeter);
float sx = sWidth / 2.0f;
float sy = sHeight / 2.0f;
Matrix4x4 warpToScreenSpaceMatrix = new Matrix4x4();
warpToScreenSpaceMatrix.SetRow(0, new Vector4(sx, 0.0f, 0.0f, sx));
warpToScreenSpaceMatrix.SetRow(1, new Vector4(0.0f, sy, 0.0f, sy));
warpToScreenSpaceMatrix.SetRow(2, new Vector4(0.0f, 0.0f, 1.0f, 0.0f));
warpToScreenSpaceMatrix.SetRow(3, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));
Matrix4x4 projectToPixelMatrix = warpToScreenSpaceMatrix * P;
ssrMaterial.SetVector("_ScreenSize", new Vector2(sWidth, sHeight));
ssrMaterial.SetVector("_ReflectionBufferSize", new Vector2(rtW, rtH));
Vector2 invScreenSize = new Vector2((float)(1.0 / sWidth), (float)(1.0 / sHeight));
Matrix4x4 worldToCameraMatrix = GetComponent<Camera>().worldToCameraMatrix;
Matrix4x4 cameraToWorldMatrix = GetComponent<Camera>().worldToCameraMatrix.inverse;
ssrMaterial.SetVector("_InvScreenSize", invScreenSize);
ssrMaterial.SetVector("_ProjInfo", projInfo); // used for unprojection
ssrMaterial.SetMatrix("_ProjectToPixelMatrix", projectToPixelMatrix);
ssrMaterial.SetMatrix("_WorldToCameraMatrix", worldToCameraMatrix);
ssrMaterial.SetMatrix("_CameraToWorldMatrix", cameraToWorldMatrix);
ssrMaterial.SetInt("_EnableRefine", settings.advancedSettings.reduceBanding ? 1 : 0);
ssrMaterial.SetInt("_AdditiveReflection", settings.basicSettings.additiveReflection ? 1 : 0);
ssrMaterial.SetInt("_ImproveCorners", settings.advancedSettings.improveCorners ? 1 : 0);
ssrMaterial.SetFloat("_ScreenEdgeFading", settings.basicSettings.screenEdgeFading);
ssrMaterial.SetFloat("_MipBias", mipBias);
ssrMaterial.SetInt("_UseOcclusion", useOcclusion ? 1 : 0);
ssrMaterial.SetInt("_BilateralUpsampling", settings.advancedSettings.bilateralUpsample ? 1 : 0);
ssrMaterial.SetInt("_FallbackToSky", fallbackToSky ? 1 : 0);
ssrMaterial.SetInt("_TreatBackfaceHitAsMiss", settings.advancedSettings.treatBackfaceHitAsMiss ? 1 : 0);
ssrMaterial.SetInt("_AllowBackwardsRays", settings.advancedSettings.allowBackwardsRays ? 1 : 0);
ssrMaterial.SetInt("_TraceEverywhere", settings.advancedSettings.traceEverywhere ? 1 : 0);
float z_f = GetComponent<Camera>().farClipPlane;
float z_n = GetComponent<Camera>().nearClipPlane;
Vector3 cameraClipInfo = (float.IsPositiveInfinity(z_f)) ?
new Vector3(z_n, -1.0f, 1.0f) :
new Vector3(z_n * z_f, z_n - z_f, z_f);
ssrMaterial.SetVector("_CameraClipInfo", cameraClipInfo);
ssrMaterial.SetFloat("_MaxRayTraceDistance", settings.basicSettings.maxDistance);
ssrMaterial.SetFloat("_FadeDistance", settings.basicSettings.fadeDistance);
ssrMaterial.SetFloat("_LayerThickness", settings.reflectionSettings.widthModifier);
const int maxMip = 5;
RenderTexture[] reflectionBuffers;
RenderTextureFormat intermediateFormat = settings.basicSettings.enableHDR ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.ARGB32;
reflectionBuffers = new RenderTexture[maxMip];
for (int i = 0; i < maxMip; ++i)
{
if (fullResolutionFiltering)
reflectionBuffers[i] = m_RTU.GetTemporaryRenderTexture(rtW, rtH, 0, intermediateFormat);
else
reflectionBuffers[i] = m_RTU.GetTemporaryRenderTexture(rtW >> i, rtH >> i, 0, intermediateFormat);
// We explicitly interpolate during bilateral upsampling.
reflectionBuffers[i].filterMode = settings.advancedSettings.bilateralUpsample ? FilterMode.Point : FilterMode.Bilinear;
}
ssrMaterial.SetInt("_EnableSSR", 1);
ssrMaterial.SetInt("_DebugMode", (int)settings.debugSettings.debugMode);
ssrMaterial.SetInt("_TraceBehindObjects", settings.advancedSettings.traceBehindObjects ? 1 : 0);
ssrMaterial.SetInt("_MaxSteps", settings.reflectionSettings.maxSteps);
RenderTexture rayHitTexture = m_RTU.GetTemporaryRenderTexture(rtW, rtH);
// We have 5 passes for different step sizes
int tracePass = Mathf.Clamp(settings.reflectionSettings.rayStepSize, 0, 4);
Graphics.Blit(source, rayHitTexture, ssrMaterial, tracePass);
ssrMaterial.SetTexture("_HitPointTexture", rayHitTexture);
// Resolve the hitpoints into the mirror reflection buffer
Graphics.Blit(source, reflectionBuffers[0], ssrMaterial, (int)PassIndex.HitPointToReflections);
ssrMaterial.SetTexture("_ReflectionTexture0", reflectionBuffers[0]);
ssrMaterial.SetInt("_FullResolutionFiltering", fullResolutionFiltering ? 1 : 0);
ssrMaterial.SetFloat("_MaxRoughness", 1.0f - settings.reflectionSettings.smoothFallbackThreshold);
ssrMaterial.SetFloat("_RoughnessFalloffRange", settings.reflectionSettings.smoothFallbackDistance);
ssrMaterial.SetFloat("_SSRMultiplier", settings.basicSettings.reflectionMultiplier);
RenderTexture[] edgeTextures = new RenderTexture[maxMip];
if (settings.advancedSettings.bilateralUpsample && useEdgeDetector)
{
edgeTextures[0] = m_RTU.GetTemporaryRenderTexture(rtW, rtH);
Graphics.Blit(source, edgeTextures[0], ssrMaterial, (int)PassIndex.EdgeGeneration);
for (int i = 1; i < maxMip; ++i)
{
edgeTextures[i] = m_RTU.GetTemporaryRenderTexture(rtW >> i, rtH >> i);
ssrMaterial.SetInt("_LastMip", i - 1);
Graphics.Blit(edgeTextures[i - 1], edgeTextures[i], ssrMaterial, (int)PassIndex.MinMipGeneration);
}
}
if (settings.advancedSettings.highQualitySharpReflections)
{
RenderTexture filteredReflections = m_RTU.GetTemporaryRenderTexture(reflectionBuffers[0].width, reflectionBuffers[0].height, 0, reflectionBuffers[0].format);
filteredReflections.filterMode = reflectionBuffers[0].filterMode;
reflectionBuffers[0].filterMode = FilterMode.Bilinear;
Graphics.Blit(reflectionBuffers[0], filteredReflections, ssrMaterial, (int)PassIndex.PoissonBlur);
// Replace the unfiltered buffer with the newly filtered one.
m_RTU.ReleaseTemporaryRenderTexture(reflectionBuffers[0]);
reflectionBuffers[0] = filteredReflections;
ssrMaterial.SetTexture("_ReflectionTexture0", reflectionBuffers[0]);
}
// Generate the blurred low-resolution buffers
for (int i = 1; i < maxMip; ++i)
{
RenderTexture inputTex = reflectionBuffers[i - 1];
RenderTexture hBlur;
if (fullResolutionFiltering)
hBlur = m_RTU.GetTemporaryRenderTexture(rtW, rtH, 0, intermediateFormat);
else
{
int lowMip = i;
hBlur = m_RTU.GetTemporaryRenderTexture(rtW >> lowMip, rtH >> (i - 1), 0, intermediateFormat);
}
for (int j = 0; j < (fullResolutionFiltering ? (i * i) : 1); ++j)
{
// Currently we blur at the resolution of the previous mip level, we could save bandwidth by blurring directly to the lower resolution.
ssrMaterial.SetVector("_Axis", new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
ssrMaterial.SetFloat("_CurrentMipLevel", i - 1.0f);
Graphics.Blit(inputTex, hBlur, ssrMaterial, (int)PassIndex.Blur);
ssrMaterial.SetVector("_Axis", new Vector4(0.0f, 1.0f, 0.0f, 0.0f));
inputTex = reflectionBuffers[i];
Graphics.Blit(hBlur, inputTex, ssrMaterial, (int)PassIndex.Blur);
}
ssrMaterial.SetTexture("_ReflectionTexture" + i, reflectionBuffers[i]);
m_RTU.ReleaseTemporaryRenderTexture(hBlur);
}
if (settings.advancedSettings.bilateralUpsample && useEdgeDetector)
{
for (int i = 0; i < maxMip; ++i)
ssrMaterial.SetTexture("_EdgeTexture" + i, edgeTextures[i]);
}
ssrMaterial.SetInt("_UseEdgeDetector", useEdgeDetector ? 1 : 0);
RenderTexture averageRayDistanceBuffer = m_RTU.GetTemporaryRenderTexture(source.width, source.height, 0, RenderTextureFormat.RHalf);
if (computeAverageRayDistance)
{
Graphics.Blit(source, averageRayDistanceBuffer, ssrMaterial, (int)PassIndex.AverageRayDistanceGeneration);
}
ssrMaterial.SetInt("_UseAverageRayDistance", computeAverageRayDistance ? 1 : 0);
ssrMaterial.SetTexture("_AverageRayDistanceBuffer", averageRayDistanceBuffer);
bool resolveDiffersFromTraceRes = (settings.advancedSettings.resolution == SSRResolution.HalfTraceFullResolve);
RenderTexture finalReflectionBuffer = m_RTU.GetTemporaryRenderTexture(resolveDiffersFromTraceRes ? source.width : rtW, resolveDiffersFromTraceRes ? source.height : rtH, 0, intermediateFormat);
ssrMaterial.SetFloat("_FresnelFade", settings.reflectionSettings.fresnelFade);
ssrMaterial.SetFloat("_FresnelFadePower", settings.reflectionSettings.fresnelFadePower);
ssrMaterial.SetFloat("_DistanceBlur", settings.reflectionSettings.distanceBlur);
ssrMaterial.SetInt("_HalfResolution", (settings.advancedSettings.resolution != SSRResolution.FullResolution) ? 1 : 0);
ssrMaterial.SetInt("_HighlightSuppression", settings.advancedSettings.highlightSuppression ? 1 : 0);
Graphics.Blit(reflectionBuffers[0], finalReflectionBuffer, ssrMaterial, (int)PassIndex.CompositeSSR);
ssrMaterial.SetTexture("_FinalReflectionTexture", finalReflectionBuffer);
RenderTexture temporallyFilteredBuffer = m_RTU.GetTemporaryRenderTexture(resolveDiffersFromTraceRes ? source.width : rtW, resolveDiffersFromTraceRes ? source.height : rtH, 0, intermediateFormat);
if (doTemporalFilterThisFrame)
{
ssrMaterial.SetInt("_UseTemporalConfidence", settings.advancedSettings.useTemporalConfidence ? 1 : 0);
ssrMaterial.SetFloat("_TemporalAlpha", settings.advancedSettings.temporalFilterStrength);
ssrMaterial.SetMatrix("_CurrentCameraToPreviousCamera", m_PreviousWorldToCameraMatrix * cameraToWorldMatrix);
ssrMaterial.SetTexture("_PreviousReflectionTexture", m_PreviousReflectionBuffer);
ssrMaterial.SetTexture("_PreviousCSZBuffer", m_PreviousDepthBuffer);
Graphics.Blit(source, temporallyFilteredBuffer, ssrMaterial, (int)PassIndex.TemporalFilter);
ssrMaterial.SetTexture("_FinalReflectionTexture", temporallyFilteredBuffer);
}
if (settings.advancedSettings.temporalFilterStrength > 0.0)
{
m_PreviousWorldToCameraMatrix = worldToCameraMatrix;
PreparePreviousBuffers(source.width, source.height);
Graphics.Blit(source, m_PreviousDepthBuffer, ssrMaterial, (int)PassIndex.BlitDepthAsCSZ);
Graphics.Blit(rayHitTexture, m_PreviousHitBuffer);
Graphics.Blit(doTemporalFilterThisFrame ? temporallyFilteredBuffer : finalReflectionBuffer, m_PreviousReflectionBuffer);
m_HasInformationFromPreviousFrame = true;
}
Graphics.Blit(source, destination, ssrMaterial, (int)PassIndex.CompositeFinal);
m_RTU.ReleaseAllTemporyRenderTexutres();
}
}
}
fileFormatVersion: 2
guid: da3ff4a1bef2e8d47a1dfb734aa54de1
timeCreated: 1433488439
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences:
- ssrShader: {fileID: 4800000, guid: 7e2fcc83af19e744787647ec0ac5d42c, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0e103881644e777488867c3edea3eca9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
/**
\author Michael Mara and Morgan McGuire, Casual Effects. 2015.
*/
Shader "Hidden/ScreenSpaceReflection"
{
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
CGINCLUDE
#include "UnityCG.cginc"
#include "UnityPBSLighting.cginc"
#include "UnityStandardBRDF.cginc"
#include "UnityStandardUtils.cginc"
#include "ScreenSpaceRaytrace.cginc"
float4 _ProjInfo;
float4x4 _WorldToCameraMatrix;
float4x4 _CameraToWorldMatrix;
float4x4 _ProjectToPixelMatrix;
float2 _ScreenSize;
float2 _ReflectionBufferSize;
float2 _InvScreenSize;
float3 _CameraClipInfo;
sampler2D _CameraGBufferTexture0;
sampler2D _CameraGBufferTexture1;
sampler2D _CameraGBufferTexture2;
sampler2D _CameraGBufferTexture3;
sampler2D _CameraReflectionsTexture;
float _CurrentMipLevel;
float _RayStepSize;
float _MaxRayTraceDistance;
float _LayerThickness;
float _FresnelFade;
float _FresnelFadePower;
sampler2D _MainTex;
int _VisualizeWhereBilateral;
int _EnableSSR;
int _DebugMode;
int _HalfResolution;
int _TreatBackfaceHitAsMiss;
int _AllowBackwardsRays;
int _TraceEverywhere;
// RG: SS Hitpoint of ray
// B: distance ray travelled, used for mip-selection in the final resolve
// A: confidence value
sampler2D _HitPointTexture;
sampler2D _FinalReflectionTexture;
// RGB: camera-space normal (encoded in [0-1])
// A: Roughness
sampler2D _NormalAndRoughnessTexture;
float4 _MainTex_TexelSize;
float4 _SourceToTempUV;
int _EnableRefine;
int _AdditiveReflection;
int _ImproveCorners;
float _ScreenEdgeFading;
float _MipBias;
int _UseOcclusion;
int _MaxSteps;
int _FullResolutionFiltering;
int _BilateralUpsampling;
float _MaxRoughness;
float _RoughnessFalloffRange;
float _SSRMultiplier;
float _FadeDistance;
float _DistanceBlur;
int _TraceBehindObjects;
int _FallbackToSky;
int _UseEdgeDetector;
int _HighlightSuppression;
/** The height in pixels of a 1m object if viewed from 1m away. */
float _PixelsPerMeterAtOneMeter;
int _UseAverageRayDistance;
sampler2D _AverageRayDistanceBuffer;
// For temporal filtering:
float4x4 _CurrentCameraToPreviousCamera;
sampler2D _PreviousReflectionTexture;
sampler2D _PreviousCSZBuffer;
float _TemporalAlpha;
int _UseTemporalConfidence;
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float2 uv2 : TEXCOORD1;
};
v2f vert( appdata_img v )
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
o.uv2 = v.texcoord.xy;
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0)
o.uv2.y = 1-o.uv2.y;
#endif
return o;
}
float2 mipToSize(int mip) {
return floor(_ReflectionBufferSize * exp2(-mip));
}
float3 ReconstructCSPosition(float2 S, float z)
{
float linEyeZ = -LinearEyeDepth(z);
return float3(( (( S.xy * _MainTex_TexelSize.zw) ) * _ProjInfo.xy + _ProjInfo.zw) * linEyeZ, linEyeZ);
}
/** Read the camera-space position of the point at screen-space pixel ssP */
float3 GetPosition(float2 ssP) {
float3 P;
P.z = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, ssP.xy);
// Offset to pixel center
P = ReconstructCSPosition(float2(ssP) /*+ float2(0.5, 0.5)*/, P.z);
return P;
}
float square(float x)
{
return x*x;
}
float applyEdgeFade(float2 tsP, float fadeStrength) {
float maxFade = 0.1;
float2 itsP = float2(1.0, 1.0) - tsP;
float dist = min(min(itsP.x, itsP.y), min(tsP.x, tsP.x));
float fade = dist / (maxFade*fadeStrength + 0.001);
fade = max(min(fade, 1.0), 0.0);
fade = pow(fade, 0.2);
return fade;
}
float3 csMirrorVector(float3 csPosition, float3 csN) {
float3 csE = -normalize(csPosition.xyz);
float cos_o = dot(csN, csE);
float3 c_mi = normalize((csN * (2.0 * cos_o)) - csE);
return c_mi;
}
float4 fragRaytrace(v2f i, int stepRate)
{
float2 ssP = i.uv2.xy * _SourceToTempUV.zw;
float3 csPosition = GetPosition(ssP);
float smoothness = tex2D(_CameraGBufferTexture1, ssP).a;
if (csPosition.z < -100.0 || smoothness == 0.0) {
return float4(0.0,0.0,0.0,0.0);
}
if ((!_TraceEverywhere) && (smoothness < (1.0 - _MaxRoughness)) ) {
return float4(0.0, 0.0, 0.0, 0.0);
}
float3 wsNormal = tex2D(_CameraGBufferTexture2, ssP).rgb * 2.0 - 1.0;
int2 ssC = int2(ssP * _ScreenSize);
float3 csN = mul((float3x3)(_WorldToCameraMatrix), wsNormal);
float3 csRayDirection = csMirrorVector(csPosition, csN);
if (_AllowBackwardsRays == 0 && csRayDirection.z > 0.0) {
return float4(0.0, 0.0, 0.0, 0.0);
}
float maxRayTraceDistance = _MaxRayTraceDistance;
float jitterFraction = 0.0f;
float layerThickness = _LayerThickness;
int maxSteps = _MaxSteps;
// Bump the ray more in world space as it gets farther away (and so each pixel covers more WS distance)
float rayBump = max(-0.01*csPosition.z, 0.001);
float2 hitPixel;
float3 csHitPoint;
float stepCount;
bool wasHit = castDenseScreenSpaceRay
(csPosition + (csN) * rayBump,
csRayDirection,
_ProjectToPixelMatrix,
_ScreenSize,
_CameraClipInfo,
jitterFraction,
maxSteps,
layerThickness,
maxRayTraceDistance,
hitPixel,
stepRate,
_EnableRefine == 1,
_TraceBehindObjects == 1,
csHitPoint,
stepCount);
float2 tsPResult = hitPixel / _ScreenSize;
float rayDist = dot(csHitPoint - csPosition, csRayDirection);
float confidence = 0.0;
if (wasHit) {
confidence = square(1.0 - max(2.0*float(stepCount) / float(maxSteps) - 1.0, 0.0));
confidence *= clamp(((_MaxRayTraceDistance - rayDist) / _FadeDistance), 0.0, 1.0);
// Fake fresnel fade
float3 csE = -normalize(csPosition.xyz);
confidence *= max(0.0, lerp(pow(abs(dot(csRayDirection, -csE)), _FresnelFadePower), 1, 1.0 - _FresnelFade));
if (_TreatBackfaceHitAsMiss > 0) {
float3 wsHitNormal = tex2Dlod(_CameraGBufferTexture2, float4(tsPResult, 0, 0)).rgb * 2.0 - 1.0;
float3 wsRayDirection = mul(_CameraToWorldMatrix, float4(csRayDirection, 0)).xyz;
if (dot(wsHitNormal, wsRayDirection) > 0) {
confidence = 0.0;
}
}
} else if (_FallbackToSky > 0) {
float sceneZ = tex2Dlod(_CameraDepthTexture, float4(tsPResult, 0, 0)).r;
sceneZ = -LinearEyeDepth(sceneZ);
if (sceneZ < -1000) { // 1km ~= infinity
confidence = 1.0;
}
}
// Fade out reflections that hit near edge of screen, to prevent abrupt appearance/disappearance when object go off screen
// Fade out reflections that hit near edge of screen,
// to prevent abrupt appearance/disappearance when object go off screen
float vignette = applyEdgeFade(tsPResult, _ScreenEdgeFading);
confidence *= vignette;
confidence *= vignette;
return float4(tsPResult, rayDist, confidence);
}
float4 fragComposite(v2f i) : SV_Target
{
// Pixel being shaded
float2 tsP = i.uv2.xy;
// View space point being shaded
float3 C = GetPosition(tsP);
// Final image before this pass
float4 gbuffer3 = tex2D(_MainTex, i.uv);
float4 specEmission = float4(0.0,0.0,0.0,0.0);
float3 specColor = tex2D(_CameraGBufferTexture1, tsP).rgb;
float roughness = 1.0-tex2D(_CameraGBufferTexture1, tsP).a;
float4 reflectionTexel = tex2D(_FinalReflectionTexture, tsP * _SourceToTempUV.xy);
float4 gbuffer0 = tex2D(_CameraGBufferTexture0, tsP);
// Let core Unity functions do the dirty work of applying the BRDF
float3 baseColor = gbuffer0.rgb;
float occlusion = gbuffer0.a;
float oneMinusReflectivity;
baseColor = EnergyConservationBetweenDiffuseAndSpecular(baseColor, specColor, oneMinusReflectivity);
float3 wsNormal = tex2D(_CameraGBufferTexture2, tsP).rgb * 2.0 - 1.0;
float3 csEyeVec = normalize(C);
float3 eyeVec = mul(_CameraToWorldMatrix, float4(csEyeVec, 0)).xyz;
float3 worldPos = mul(_CameraToWorldMatrix, float4(C, 1)).xyz;
float cos_o = dot(wsNormal, eyeVec);
float3 w_mi = -normalize((wsNormal * (2.0 * cos_o)) - eyeVec);
float3 incomingRadiance = reflectionTexel.rgb;
UnityLight light;
light.color = 0;
light.dir = 0;
light.ndotl = 0;
UnityIndirect ind;
ind.diffuse = 0;
ind.specular = incomingRadiance;
float3 ssrResult = UNITY_BRDF_PBS (0, specColor, oneMinusReflectivity, 1-roughness, wsNormal, -eyeVec, light, ind).rgb * _SSRMultiplier;
float confidence = reflectionTexel.a;
if(_EnableSSR == 0) {
confidence = 0.0;
}
specEmission.rgb = tex2D(_CameraReflectionsTexture, tsP).rgb;
float3 finalGlossyTerm;
// Subtract out Unity's glossy result: (we're just applying the delta)
if (_AdditiveReflection == 0) {
gbuffer3 -= specEmission;
// We may have blown out our dynamic range by adding then subtracting the reflection probes.
// As a half-measure to fix this, simply clamp to zero
gbuffer3 = max(gbuffer3, 0);
finalGlossyTerm = lerp(specEmission.rgb, ssrResult, saturate(confidence));
} else {
finalGlossyTerm = ssrResult*saturate(confidence);
}
if (_UseOcclusion) {
finalGlossyTerm *= occlusion;
}
if (_DebugMode == 1)
return float4(incomingRadiance,0);
if (_DebugMode == 2)
return float4(ssrResult,0);
if (_DebugMode == 3)
return float4(finalGlossyTerm,0);
if (_DebugMode == 4)
return confidence;
if (_DebugMode == 5)
return roughness;
if (_DebugMode == 6)
return float4(baseColor,0);
if (_DebugMode == 7)
return float4(specColor,0);
if (_DebugMode == 8)
return 1.0-oneMinusReflectivity;
if (_DebugMode == 9)
return float4(specEmission.rgb,0);
if (_DebugMode == 10)
return float4(specEmission.rgb-ssrResult,0);
if (_DebugMode == 11)
return float4(ssrResult-specEmission.rgb,0);
if (_DebugMode == 12)
return gbuffer3;
if (_DebugMode == 13)
return -float4(gbuffer3.rgb, 0.0);
if (_DebugMode == 14) // Mip level, stored directly in ssrResult
return float4(incomingRadiance, 0);
// Additively blend the glossy GI result with the output buffer
return gbuffer3 + float4(finalGlossyTerm, 0);
}
float roughnessWeight(float midpointRoughness, float tapRoughness) {
return (1.0 - sqrt(sqrt(abs(midpointRoughness-tapRoughness))));
}
float normalWeight(float3 midpointNormal, float3 tapNormal) {
return clamp(dot(midpointNormal, tapNormal), 0, 1);
}
float highlightDecompression(float x) {
return x / (1.0 - x);
}
float3 highlightDecompression(float3 x) {
return float3(
highlightDecompression(x.x),
highlightDecompression(x.y),
highlightDecompression(x.z));
}
float highlightCompression(float x) {
return x / (1.0 + x);
}
float3 highlightCompression(float3 x) {
return float3(
highlightCompression(x.x),
highlightCompression(x.y),
highlightCompression(x.z));
}
float4 _Axis;
float4 fragGBlur(v2f i) : SV_Target
{
int radius = 4;
// Pixel being shaded
float2 tsP = i.uv2.xy;
float weightSum = 0.0;
float gaussWeights[5] = {0.225, 0.150, 0.110, 0.075, 0.0525};//{0.225, 0.150, 0.110, 0.075, 0.0525};
float4 resultSum = float4(0.0, 0.0, 0.0, 0.0);
float4 unweightedResultSum = float4(0.0, 0.0, 0.0, 0.0);
float4 nAndRough = tex2D(_NormalAndRoughnessTexture, tsP);
float midpointRoughness = nAndRough.a;
float3 midpointNormal = nAndRough.rgb * 2 - 1;
if (_FullResolutionFiltering) {
for (int i = -2*radius; i <= 2*radius; ++i) {
float4 temp;
float tapRoughness = midpointRoughness;
float3 tapNormal = midpointNormal;
float2 tsTap = tsP + (_Axis.xy * _MainTex_TexelSize.xy * float2(i,i));
temp = tex2D(_MainTex, tsTap);
int gaussWeightIndex;
#if defined(UNITY_COMPILER_HLSL) && !defined(SHADER_API_D3D9)
gaussWeightIndex = abs(i) >> 1; // We purposefully do integer division, but that does not compile on hlsl2glsl
#else
gaussWeightIndex = frac(abs(i) / 2);
#endif
float weight = temp.a * gaussWeights[gaussWeightIndex]*0.5;
// Bilateral filtering
if (_ImproveCorners) {
nAndRough = tex2D(_NormalAndRoughnessTexture, tsTap);
tapRoughness = nAndRough.a;
tapNormal = nAndRough.rgb * 2 - 1;
weight *= normalWeight(midpointNormal, tapNormal);
}
weightSum += weight;
resultSum += temp*weight;
unweightedResultSum += temp;
}
} else {
for (int i = -radius; i <= radius; ++i) {
float4 temp;
float tapRoughness;
float3 tapNormal;
float2 tsTap = tsP + (_Axis.xy * _MainTex_TexelSize.xy * float2(i,i)*2.0);
temp = tex2D(_MainTex, tsTap);
float weight = temp.a * gaussWeights[abs(i)];
// Bilateral filtering
if (_ImproveCorners) {
nAndRough = tex2D(_NormalAndRoughnessTexture, tsTap);
tapRoughness = nAndRough.a;
tapNormal = nAndRough.rgb * 2 - 1;
weight *= normalWeight(midpointNormal, tapNormal);
}
weightSum += weight;
if (_HighlightSuppression) {
temp.rgb = highlightCompression(temp.rgb);
}
unweightedResultSum += temp;
resultSum += temp*weight;
}
}
if (weightSum > 0.01) {
float invWeightSum = (1.0/weightSum);
// Adding the sqrt seems to decrease temporal flickering at the expense
// of having larger "halos" of fallback on rough surfaces
// Subject to change with testing. Sqrt around only half the expression is *intentional*.
float confidence = min(resultSum.a * sqrt(max(invWeightSum, 2.0)), 1.0);
float3 finalColor = resultSum.rgb * invWeightSum;
if (_HighlightSuppression) {
finalColor = highlightDecompression(finalColor);
}
return float4(finalColor, confidence);
} else {
float3 finalColor = unweightedResultSum.rgb / (2 * radius + 1);
if (_HighlightSuppression) {
finalColor = highlightDecompression(finalColor);
}
return float4(finalColor, 0.0);
}
}
sampler2D _ReflectionTexture0;
sampler2D _ReflectionTexture1;
sampler2D _ReflectionTexture2;
sampler2D _ReflectionTexture3;
sampler2D _ReflectionTexture4;
// Simulate mip maps, since we don't have NPOT mip-chains
float4 getReflectionValue(float2 tsP, int mip) {
float4 coord = float4(tsP,0,0);
if (mip == 0) {
return tex2Dlod(_ReflectionTexture0, coord);
} else if (mip == 1) {
return tex2Dlod(_ReflectionTexture1, coord);
} else if (mip == 2) {
return tex2Dlod(_ReflectionTexture2, coord);
} else if (mip == 3) {
return tex2Dlod(_ReflectionTexture3, coord);
} else {
return tex2Dlod(_ReflectionTexture4, coord);
}
}
sampler2D _EdgeTexture0;
sampler2D _EdgeTexture1;
sampler2D _EdgeTexture2;
sampler2D _EdgeTexture3;
sampler2D _EdgeTexture4;
// Simulate mip maps, since we don't have NPOT mip-chains
float4 getEdgeValue(float2 tsP, int mip) {
float4 coord = float4(tsP + float2(1.0/(2 * mipToSize(mip))),0,0);
if (mip == 0) {
return tex2Dlod(_EdgeTexture0, coord);
} else if (mip == 1) {
return tex2Dlod(_EdgeTexture1, coord);
} else if (mip == 2) {
return tex2Dlod(_EdgeTexture2, coord);
} else if (mip == 3) {
return tex2Dlod(_EdgeTexture3, coord);
} else {
return tex2Dlod(_EdgeTexture4, coord);
}
}
float2 centerPixel(float2 inputP) {
return floor(inputP - float2(0.5,0.5)) + float2(0.5,0.5);
}
float2 snapToTexelCenter(float2 inputP, float2 texSize, float2 texSizeInv) {
return centerPixel(inputP * texSize) * texSizeInv;
}
float4 bilateralUpsampleReflection(float2 tsP, int mip) {
float2 smallTexSize = mipToSize(mip);
float2 smallPixelPos = tsP * smallTexSize;
float2 smallPixelPosi = centerPixel(smallPixelPos);
float2 smallTexSizeInv = 1.0 / smallTexSize;
float2 p0 = smallPixelPosi * smallTexSizeInv;
float2 p3 = (smallPixelPosi + float2(1.0, 1.0)) * smallTexSizeInv;
float2 p1 = float2(p3.x, p0.y);
float2 p2 = float2(p0.x, p3.y);
float4 V0 = getReflectionValue(p0.xy, mip);
float4 V1 = getReflectionValue(p1.xy, mip);
float4 V2 = getReflectionValue(p2.xy, mip);
float4 V3 = getReflectionValue(p3.xy, mip);
float a0 = 1.0;
float a1 = 1.0;
float a2 = 1.0;
float a3 = 1.0;
// Bilateral weights:
// Bilinear interpolation (filter distance)
float2 smallPixelPosf = smallPixelPos - smallPixelPosi;
a0 = (1.0 - smallPixelPosf.x) * (1.0 - smallPixelPosf.y);
a1 = smallPixelPosf.x * (1.0 - smallPixelPosf.y);
a2 = (1.0 - smallPixelPosf.x) * smallPixelPosf.y;
a3 = smallPixelPosf.x * smallPixelPosf.y;
float2 fullTexSize = _ReflectionBufferSize;
float2 fullTexSizeInv = 1.0 / fullTexSize;
float4 hiP0 = float4(snapToTexelCenter(p0, fullTexSize, fullTexSizeInv), 0,0);
float4 hiP3 = float4(snapToTexelCenter(p3, fullTexSize, fullTexSizeInv), 0,0);
float4 hiP1 = float4(snapToTexelCenter(p1, fullTexSize, fullTexSizeInv), 0,0);
float4 hiP2 = float4(snapToTexelCenter(p2, fullTexSize, fullTexSizeInv), 0,0);
float4 tempCenter = tex2Dlod(_NormalAndRoughnessTexture, float4(tsP, 0, 0));
float3 n = tempCenter.xyz * 2 - 1;
float4 temp0 = tex2Dlod(_NormalAndRoughnessTexture, hiP0);
float4 temp1 = tex2Dlod(_NormalAndRoughnessTexture, hiP1);
float4 temp2 = tex2Dlod(_NormalAndRoughnessTexture, hiP2);
float4 temp3 = tex2Dlod(_NormalAndRoughnessTexture, hiP3);
float3 n0 = temp0.xyz * 2 - 1;
float3 n1 = temp1.xyz * 2 - 1;
float3 n2 = temp2.xyz * 2 - 1;
float3 n3 = temp3.xyz * 2 - 1;
a0 *= normalWeight(n, n0);
a1 *= normalWeight(n, n1);
a2 *= normalWeight(n, n2);
a3 *= normalWeight(n, n3);
float r = tempCenter.a;
float r0 = temp0.a;
float r1 = temp1.a;
float r2 = temp2.a;
float r3 = temp3.a;
a0 *= roughnessWeight(r, r0);
a1 *= roughnessWeight(r, r1);
a2 *= roughnessWeight(r, r2);
a3 *= roughnessWeight(r, r3);
// Slightly offset from zero
a0 = max(a0, 0.001);
a1 = max(a1, 0.001);
a2 = max(a2, 0.001);
a3 = max(a3, 0.001);
// Nearest neighbor
// a0 = a1 = a2 = a3 = 1.0;
// Normalize the blending weights (weights were chosen so that
// the denominator can never be zero)
float norm = 1.0 / (a0 + a1 + a2 + a3);
// Blend
float4 value = (V0 * a0 + V1 * a1 + V2 * a2 + V3 * a3) * norm;
//return V0;
return value;
}
/** Explicit bilinear fetches; must be used if the reflection buffer is bound using point sampling */
float4 bilinearUpsampleReflection(float2 tsP, int mip) {
float2 smallTexSize = mipToSize(mip);
float2 smallPixelPos = tsP * smallTexSize;
float2 smallPixelPosi = centerPixel(smallPixelPos);
float2 smallTexSizeInv = 1.0 / smallTexSize;
float2 p0 = smallPixelPosi * smallTexSizeInv;
float2 p3 = (smallPixelPosi + float2(1.0, 1.0)) * smallTexSizeInv;
float2 p1 = float2(p3.x, p0.y);
float2 p2 = float2(p0.x, p3.y);
float4 V0 = getReflectionValue(p0.xy, mip);
float4 V1 = getReflectionValue(p1.xy, mip);
float4 V2 = getReflectionValue(p2.xy, mip);
float4 V3 = getReflectionValue(p3.xy, mip);
float a0 = 1.0;
float a1 = 1.0;
float a2 = 1.0;
float a3 = 1.0;
// Bilateral weights:
// Bilinear interpolation (filter distance)
float2 smallPixelPosf = smallPixelPos - smallPixelPosi;
a0 = (1.0 - smallPixelPosf.x) * (1.0 - smallPixelPosf.y);
a1 = smallPixelPosf.x * (1.0 - smallPixelPosf.y);
a2 = (1.0 - smallPixelPosf.x) * smallPixelPosf.y;
a3 = smallPixelPosf.x * smallPixelPosf.y;
// Blend
float4 value = (V0 * a0 + V1 * a1 + V2 * a2 + V3 * a3);
return value;
}
// Unity's roughness is GGX roughness squared
float roughnessToBlinnPhongExponent(float roughness) {
float r2 = roughness*roughness;
return 2.0f / r2*r2 - 2.0f;
}
float glossyLobeSlope(float roughness) {
return pow(roughness, 4.0/3.0);
}
// Empirically based on our filter:
// Mip | Pixels
// --------------
// 0 | 1 no filter, so single pixel
// 1 | 17 2r + 1 filter applied once, grabbing from pixels r away in either direction (r=8, four samples times stride of 2)
// 2 | 50 2r + 1 filter applied on double size pixels, and each of those pixels had reached another r out to the side 2(2r + 1) + m_1
// 3 | 118 4(2r + 1) + m_2
// 4 | 254 8(2r + 1) + m_3
//
// Approximated by pixels = 16*2^mip-15
// rearranging we get mip = log_2((pixels + 15) / 16)
//
float filterFootprintInPixelsToMip(float footprint) {
return log2((footprint + 15) / 16);
}
float3 ansiGradient(float t) {
//return float3(t, t, t);
return fmod(floor(t * float3(8.0, 4.0, 2.0)), 2.0);
}
float4 fragCompositeSSR(v2f i) : SV_Target
{
// Pixel being shaded
float2 tsP = i.uv2.xy;
float roughness = 1.0-tex2D(_CameraGBufferTexture1, tsP * _SourceToTempUV.zw).a;
float rayDistance = 0.0;
if (_UseAverageRayDistance) {
rayDistance = tex2D(_AverageRayDistanceBuffer, tsP).r;
} else {
rayDistance = tex2D(_HitPointTexture, tsP).z;
}
// Get the camera space position of the reflection hit
float3 csPosition = GetPosition(tsP);
float3 wsNormal = tex2D(_CameraGBufferTexture2, tsP).rgb * 2.0 - 1.0;
float3 csN = mul((float3x3)(_WorldToCameraMatrix), wsNormal);
float3 c_mi = csMirrorVector(csPosition, csN);
float3 csHitpoint = c_mi * rayDistance + csPosition;
float gatherFootprintInMeters = glossyLobeSlope(roughness) * rayDistance;
// We could add a term that incorporates the normal
// This approximation assumes reflections happen at a glancing angle
float filterFootprintInPixels = gatherFootprintInMeters * _PixelsPerMeterAtOneMeter / csHitpoint.z;
if (_HalfResolution == 1) {
filterFootprintInPixels *= 0.5;
}
float mip = filterFootprintInPixelsToMip(filterFootprintInPixels);
float nonPhysicalMip = pow(roughness, 3.0 / 4.0) * UNITY_SPECCUBE_LOD_STEPS;
if (_HalfResolution == 1) {
nonPhysicalMip = nonPhysicalMip * 0.7;
}
mip = lerp(nonPhysicalMip, mip, _DistanceBlur);
mip = max(0, min(4, mip + _MipBias));
if (_DebugMode == 14) {
return float4(ansiGradient(mip*0.25), 1.0);
}
float4 result;
{
int mipMin = int(mip);
int mipMax = min(mipMin + 1, 4);
float mipLerp = mip-mipMin;
if (_BilateralUpsampling == 1) {
if (_UseEdgeDetector == 1) {
float nonEdginess = lerp(getEdgeValue(tsP, mipMin),
getEdgeValue(tsP, mipMax), mipLerp);
if (nonEdginess < 0.9) {
result = lerp(bilateralUpsampleReflection(tsP, mipMin), bilateralUpsampleReflection(tsP, mipMax), mipLerp);
if (_VisualizeWhereBilateral == 1) {
result = float4(1, 0, 0, 0);
}
} else {
result = lerp(bilinearUpsampleReflection(tsP, mipMin), bilinearUpsampleReflection(tsP, mipMax), mipLerp);
}
} else {
result = lerp(bilateralUpsampleReflection(tsP, mipMin), bilateralUpsampleReflection(tsP, mipMax), mipLerp);
}
} else {
float4 minResult = getReflectionValue(tsP, mipMin);
float4 maxResult = getReflectionValue(tsP, mipMax);
result = lerp(minResult, maxResult, mipLerp);
result.a = min(minResult.a, maxResult.a);
}
}
result.a = min(result.a, 1.0);
float vignette = applyEdgeFade(tsP, _ScreenEdgeFading);
result.a *= vignette;
float alphaModifier = 1.0 - clamp((roughness - (_MaxRoughness - _RoughnessFalloffRange)) / _RoughnessFalloffRange, 0.0, 1.0);
result.a *= alphaModifier;
return result;
}
float4 fragBlit(v2f i) : SV_Target
{
// Pixel being shaded
float2 ssP = i.uv2.xy;
return tex2D(_MainTex, ssP);
}
float edgeDetector(float2 tsP, float2 axis, float2 texelSize) {
float4 temp = tex2D(_NormalAndRoughnessTexture, tsP);
float midpointRoughness = temp.a;
float3 midpointNormal = temp.rgb * 2 - 1;
float tapRoughness;
float3 tapNormal;
float2 tsTap = tsP + (axis * _MainTex_TexelSize.xy);
temp = tex2D(_NormalAndRoughnessTexture, tsTap);
tapRoughness = temp.a;
tapNormal = temp.rgb * 2 - 1;
float weight = 1.0;
weight *= roughnessWeight(midpointRoughness, tapRoughness);
weight *= normalWeight(midpointNormal, tapNormal);
return weight;
}
float4 fragEdge(v2f i) : SV_Target
{
float2 tsP = i.uv2.xy;
return edgeDetector(tsP, float2(1,0), _MainTex_TexelSize.xy) * edgeDetector(tsP, float2(0,1), _MainTex_TexelSize.xy);
}
int _LastMip;
float4 fragMin(v2f i) : SV_Target
{
float2 tsP = i.uv2.xy;
float2 lastTexSize = mipToSize(_LastMip);
float2 lastTexSizeInv = 1.0 / lastTexSize;//_SourceToTempUV.xy * exp2(mip);
float2 p00 = snapToTexelCenter(tsP, lastTexSize, lastTexSizeInv);
float2 p11 = p00 + lastTexSizeInv;
return min(
min(tex2D(_MainTex, p00), tex2D(_MainTex, p11)),
min(tex2D(_MainTex, float2(p00.x, p11.y)), tex2D(_MainTex, float2(p11.x, p00.y)))
);
}
float4 fragResolveHitPoints(v2f i) : SV_Target
{
float2 tsP = i.uv2.xy;
float4 temp = tex2D(_HitPointTexture, tsP);
float2 hitPoint = temp.xy;
float confidence = temp.w;
float3 colorResult = confidence > 0.0 ?
tex2D(_MainTex, hitPoint).rgb :
tex2D(_CameraReflectionsTexture, tsP).rgb;
#ifdef UNITY_COMPILER_HLSL
if (any(isnan(colorResult)))
colorResult = float3(0.0, 0.0, 0.0);
// As of 11/29/2015, on Unity 5.3 on a Windows 8.1 computer with a NVIDIA GeForce 980,
// with driver 347.62, the above check does not actually work to get rid of NaNs!
// So we add this "redundant" check.
if (!all(isfinite(colorResult)))
colorResult = float3(0.0, 0.0, 0.0);
#endif
return float4(colorResult, confidence);
}
float4 fragBilatKeyPack(v2f i) : SV_Target
{
float2 tsP = i.uv2.xy;
float3 csN = tex2D(_CameraGBufferTexture2, tsP).xyz;
float roughness = tex2D(_CameraGBufferTexture1, tsP).a;
return float4(csN, roughness);
}
float4 fragDepthToCSZ(v2f i) : SV_Target
{
float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv2.xy);
return float4(-LinearEyeDepth(depth), 0.0, 0.0, 0.0);
}
float3 csPositionToOldNormalizedScreenCoordinate(float3 csPosition)
{
// We could multiply these matrices together on the CPU
float4 oldCSPosition = mul(_CurrentCameraToPreviousCamera, float4(csPosition, 1.0));
float4 oldSSCoordinate = mul(_ProjectToPixelMatrix, oldCSPosition);
return float3((oldSSCoordinate.xy / oldSSCoordinate.w) * _InvScreenSize, oldCSPosition.z);
}
float4 fragTemporalFilter(v2f i) : SV_Target
{
float2 tsP = i.uv2.xy;
float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, tsP);
float3 csPosition = GetPosition(tsP);
float rayDistance = 0.0;
if (_UseAverageRayDistance) {
rayDistance = tex2D(_AverageRayDistanceBuffer, tsP).r;
} else {
rayDistance = tex2D(_HitPointTexture, tsP).b;
}
// Virtual is the physics sense, not the other 20+ interpretations in CG
float3 virtualReflectionCSPosition = normalize(csPosition) * rayDistance + csPosition;
float3 oldTSP = csPositionToOldNormalizedScreenCoordinate(csPosition);
float3 oldVirtualReflectionTSP = csPositionToOldNormalizedScreenCoordinate(virtualReflectionCSPosition);
float oldCSZ = tex2D(_PreviousCSZBuffer, oldTSP.xy);
float4 currentResult = tex2D(_FinalReflectionTexture, tsP);
float4 oldResult = tex2D(_PreviousReflectionTexture, oldVirtualReflectionTSP.xy);
float zError = abs(oldCSZ - oldTSP.z);
// Start knocking down contribution at 5cm error, go to 0 at 5 more cm later
float fallbackStart = 0.05;
float fallbackEnd = 0.05;
float zAlphaModifier = 1.0 - clamp((zError - fallbackStart) * (1.0 / fallbackEnd), 0.0, 1.0);
float alpha = _TemporalAlpha;
alpha *= zAlphaModifier;
if (_UseTemporalConfidence) {
alpha *= oldResult.w;
}
// Always compress
currentResult.rgb = highlightCompression(currentResult.rgb);
oldResult.rgb = highlightCompression(oldResult.rgb);
float4 resultValue = lerp(currentResult, oldResult, alpha);
resultValue.rgb = highlightDecompression(resultValue.rgb);
return resultValue;
}
float4 fragAverageRayDistance(v2f i) : SV_Target
{
float2 tsP = i.uv2.xy;
float sumRayDistance = tex2D(_HitPointTexture, tsP).b;
float sumWeight = 1.0;
float roughness = 1.0 - tex2D(_CameraGBufferTexture1, tsP).a;
float step = roughness * 3.0;
/*
for (float x = -step; x < step; x += 2 * step) {
for (float y = -step; y < step; y += 2 * step) {
float weight = 0.5;
sumRayDistance += weight * tex2D(_HitPointTexture, (float2(x,y) * _InvScreenSize) + tsP).b;
sumWeight += weight;
}
}
*/
return float4(sumRayDistance / sumWeight, 0.0, 0.0, 0.0);
}
static const int NUM_POISSON_TAPS = 12;
// Same as used in CameraMotionBlur.shader
static const float2 poissonSamples[NUM_POISSON_TAPS] =
{
float2(-0.326212,-0.40581),
float2(-0.840144,-0.07358),
float2(-0.695914,0.457137),
float2(-0.203345,0.620716),
float2(0.96234,-0.194983),
float2(0.473434,-0.480026),
float2(0.519456,0.767022),
float2(0.185461,-0.893124),
float2(0.507431,0.064425),
float2(0.89642,0.412458),
float2(-0.32194,-0.932615),
float2(-0.791559,-0.59771)
};
float4 fragFilterSharpReflections(v2f i) : SV_Target
{
// Could improve perf by not computing blur when we won't be sampling the highest level anyways
float2 tsP = i.uv2.xy;
float4 sum = 0.0;
float sampleRadius = _MainTex_TexelSize.xy * 2.0;
for (int i = 0; i < NUM_POISSON_TAPS; i++) {
float2 p = tsP + poissonSamples[i] * sampleRadius;
float4 tap = tex2Dlod(_MainTex, float4(p, 0, 0));
if (_HighlightSuppression) {
tap.rgb = highlightCompression(tap.rgb);
}
sum += tap;
}
float4 result = sum / float(NUM_POISSON_TAPS);
if (_HighlightSuppression) {
result.rgb = highlightDecompression(result.rgb);
}
return result;
}
ENDCG
SubShader {
ZTest Always Cull Off ZWrite Off
// 0: Raytrace, step size 1
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragRaytrace1
#pragma target 3.0
float4 fragRaytrace1(v2f i) : SV_Target { return fragRaytrace(i, 1); }
ENDCG
}
// 1: Raytrace, step size 2
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragRaytrace2
#pragma target 3.0
float4 fragRaytrace2(v2f i) : SV_Target { return fragRaytrace(i, 2); }
ENDCG
}
// 2: Raytrace, step size 4
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragRaytrace4
#pragma target 3.0
float4 fragRaytrace4(v2f i) : SV_Target { return fragRaytrace(i, 4); }
ENDCG
}
// 3: Raytrace, step size 8
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragRaytrace8
#pragma target 3.0
float4 fragRaytrace8(v2f i) : SV_Target { return fragRaytrace(i, 8); }
ENDCG
}
// 4: Raytrace, step size 16
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragRaytrace16
#pragma target 3.0
float4 fragRaytrace16(v2f i) : SV_Target { return fragRaytrace(i, 16); }
ENDCG
}
// 5: Composite
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragComposite
#pragma target 3.0
ENDCG
}
// 6: GBlur
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragGBlur
#pragma target 3.0
ENDCG
}
// 7: CompositeSSR
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragCompositeSSR
#pragma target 3.0
ENDCG
}
// 8: Simple Blit
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragBlit
#pragma target 3.0
ENDCG
}
// 9: Generate Edge Texture
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragEdge
#pragma target 3.0
ENDCG
}
// 10: Min mip generation
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragMin
#pragma target 3.0
ENDCG
}
// 11: Hit point texture to reflection buffer
Pass {
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragResolveHitPoints
#pragma target 3.0
ENDCG
}
// 12: Pack Bilateral Filter Keys in single buffer
Pass{
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragBilatKeyPack
#pragma target 3.0
ENDCG
}
// 13: Blit depth information as camera space Z
Pass{
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragDepthToCSZ
#pragma target 3.0
ENDCG
}
// 14: Temporally filter buffer
Pass{
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragTemporalFilter
#pragma target 3.0
ENDCG
}
// 15: Generate average ray distance
Pass{
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragAverageRayDistance
#pragma target 3.0
ENDCG
}
// 16: Filter the highest quality reflection buffer
Pass{
CGPROGRAM
#pragma exclude_renderers gles xbox360 ps3
#pragma vertex vert
#pragma fragment fragFilterSharpReflections
#pragma target 3.0
ENDCG
}
}
Fallback off
}
fileFormatVersion: 2
guid: 7e2fcc83af19e744787647ec0ac5d42c
timeCreated: 1449750821
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f73a84220a5b6984686ec290bd808d52
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7e231f503e796c74f9daddf20b60ecb2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace UnityStandardAssets.CinematicEffects
{
[CustomPropertyDrawer(typeof(TonemappingColorGrading.ColorWheelGroup))]
class ColorWheelGroupDrawer : PropertyDrawer
{
private int m_RenderSizePerWheel;
private int m_NumberOfWheels;
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
var wheelAttribute = (TonemappingColorGrading.ColorWheelGroup)attribute;
property.isExpanded = true;
m_NumberOfWheels = property.CountInProperty() - 1;
if (m_NumberOfWheels == 0)
return 0;
m_RenderSizePerWheel = Mathf.FloorToInt((EditorGUIUtility.currentViewWidth) / m_NumberOfWheels) - 30;
m_RenderSizePerWheel = Mathf.Clamp(m_RenderSizePerWheel, wheelAttribute.minSizePerWheel, wheelAttribute.maxSizePerWheel);
return TonemappingColorGradingEditor.ColorWheel.GetColorWheelHeight(m_RenderSizePerWheel);
}
// Draw the property inside the given rect
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
if (m_NumberOfWheels == 0)
return;
var width = position.width;
Rect newPosition = new Rect(position.x, position.y, width / m_NumberOfWheels, position.height);
foreach (SerializedProperty prop in property)
{
if (prop.propertyType == SerializedPropertyType.Color)
prop.colorValue = TonemappingColorGradingEditor.ColorWheel.DoGUI(newPosition, prop.displayName, prop.colorValue, m_RenderSizePerWheel);
newPosition.x += width / m_NumberOfWheels;
}
}
}
[CustomEditor(typeof(TonemappingColorGrading))]
[CanEditMultipleObjects]
class TonemappingColorGradingEditor : Editor
{
static Styles s_Styles;
class Styles
{
public GUIStyle thumb2D = "ColorPicker2DThumb";
public GUIStyle pickerBox = "ColorPickerBox";
public GUIStyle thumbHoriz = "ColorPickerHorizThumb";
public GUIStyle header = "ShurikenModuleTitle";
public GUIStyle headerCheckbox = "ShurikenCheckMark";
public Vector2 thumb2DSize;
internal Styles()
{
thumb2DSize = new Vector2(
!Mathf.Approximately(thumb2D.fixedWidth, 0f) ? thumb2D.fixedWidth : thumb2D.padding.horizontal,
!Mathf.Approximately(thumb2D.fixedHeight, 0f) ? thumb2D.fixedHeight : thumb2D.padding.vertical
);
header.font = (new GUIStyle("Label")).font;
header.border = new RectOffset(15, 7, 4, 4);
header.fixedHeight = 22;
header.contentOffset = new Vector2(20f, -2f);
}
}
// settings group <setting, property reference>
Dictionary<FieldInfo, List<SerializedProperty>> m_GroupFields = new Dictionary<FieldInfo, List<SerializedProperty>>();
private void PopulateMap(FieldInfo group)
{
var searchPath = group.Name + ".";
foreach (var setting in group.FieldType.GetFields(BindingFlags.Instance | BindingFlags.Public))
{
List<SerializedProperty> settingsGroup;
if (!m_GroupFields.TryGetValue(group, out settingsGroup))
{
settingsGroup = new List<SerializedProperty>();
m_GroupFields[group] = settingsGroup;
}
var property = serializedObject.FindProperty(searchPath + setting.Name);
if (property != null)
settingsGroup.Add(property);
}
}
void OnEnable()
{
var settingsGroups = typeof(TonemappingColorGrading).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).Where(x => x.GetCustomAttributes(typeof(TonemappingColorGrading.SettingsGroup), false).Any());
foreach (var settingGroup in settingsGroups)
PopulateMap(settingGroup);
// Histogram
concreteTarget.onFrameEndEditorOnly = OnFrameEnd;
m_CPUHistogram = new CPUHistogram();
m_GPUHistogram = new GPUHistogram(concreteTarget.histogramShader, concreteTarget.histogramComputeShader);
}
// Cleanup
void OnDisable()
{
concreteTarget.onFrameEndEditorOnly = null;
if (m_CPUHistogram != null)
m_CPUHistogram.Destroy();
if (m_GPUHistogram != null)
m_GPUHistogram.Destroy();
}
private bool Header(SerializedProperty group, SerializedProperty enabledField)
{
var display = group == null || group.isExpanded;
var enabled = enabledField != null && enabledField.boolValue;
var title = group == null ? "Unknown Group" : ObjectNames.NicifyVariableName(group.displayName);
Rect rect = GUILayoutUtility.GetRect(16f, 22f, s_Styles.header);
GUI.Box(rect, title, s_Styles.header);
Rect toggleRect = new Rect(rect.x + 4f, rect.y + 4f, 13f, 13f);
if (Event.current.type == EventType.Repaint)
s_Styles.headerCheckbox.Draw(toggleRect, false, false, enabled, false);
Event e = Event.current;
if (e.type == EventType.MouseDown)
{
if (toggleRect.Contains(e.mousePosition) && enabledField != null)
{
enabledField.boolValue = !enabledField.boolValue;
e.Use();
}
else if (rect.Contains(e.mousePosition) && group != null)
{
display = !display;
group.isExpanded = !group.isExpanded;
e.Use();
}
}
return display;
}
private void DrawFields()
{
foreach (var group in m_GroupFields)
{
var enabledField = group.Value.FirstOrDefault(x => x.propertyPath == group.Key.Name + ".enabled");
var groupProperty = serializedObject.FindProperty(group.Key.Name);
GUILayout.Space(5);
bool display = Header(groupProperty, enabledField);
if (!display)
continue;
//Special case for the filmic curve
if (group.Key.GetCustomAttributes(false).Any(x => x.GetType() == typeof(TonemappingColorGrading.DrawFilmicCurveAttribute)))
DrawFilmicCurve(concreteTarget);
GUILayout.BeginHorizontal();
GUILayout.Space(10);
GUILayout.BeginVertical();
GUILayout.Space(3);
foreach (var field in group.Value.Where(x => x.propertyPath != group.Key.Name + ".enabled"))
EditorGUILayout.PropertyField(field);
GUILayout.EndVertical();
GUILayout.EndHorizontal();
}
}
public override void OnInspectorGUI()
{
if (s_Styles == null)
s_Styles = new Styles();
serializedObject.Update();
GUILayout.Label("All following effects will use LDR color buffers", EditorStyles.miniBoldLabel);
var texture = serializedObject.FindProperty("m_UserLutTexture");
//if (TonemappingColorGrading.Mode.GenerateLUT != (TonemappingColorGrading.Mode) mode.enumValueIndex)
EditorGUILayout.PropertyField(texture);
//else
DrawFields();
if (concreteTarget.filmicCurve.enabled)
{
var camera = concreteTarget.GetComponent<Camera>();
if (camera != null && !camera.allowHDR)
EditorGUILayout.HelpBox("The camera is not HDR enabled. This will likely break the Tonemapper.", MessageType.Warning);
else if (!concreteTarget.validRenderTextureFormat)
EditorGUILayout.HelpBox("The input to Tonemapper is not in HDR. Make sure that all effects prior to this are executed in HDR.", MessageType.Warning);
}
serializedObject.ApplyModifiedProperties();
}
public static void DrawFilmicCurve(TonemappingColorGrading target)
{
const int h = 128;
const int h1 = h - 1;
Rect rect;
EditorGUILayout.BeginHorizontal();
{
GUILayout.FlexibleSpace();
rect = GUILayoutUtility.GetRect(Mathf.Min(EditorGUIUtility.currentViewWidth - 50f, 512f), h);
GUILayout.FlexibleSpace();
}
EditorGUILayout.EndHorizontal();
// Background
GUI.Box(rect, GUIContent.none);
// Curve points
int w = Mathf.FloorToInt(rect.width);
Vector3[] c = new Vector3[w];
float lutA = TonemappingColorGrading.GetLutA();
TonemappingColorGrading.SimplePolyFunc polyToe;
TonemappingColorGrading.SimplePolyFunc polyLinear;
TonemappingColorGrading.SimplePolyFunc polyShoulder;
var curveData = target.filmicCurve;
const float gammaSpace = 2.2f;
float x0 = Mathf.Pow(1.0f / 3.0f, gammaSpace);
const float shoulderBase = .7f;
float x1 = Mathf.Pow(shoulderBase, gammaSpace);
float gammaHighY = Mathf.Pow(shoulderBase, 1.0f + (curveData.lutShoulder) * 1.0f);
float y1 = Mathf.Pow(gammaHighY, gammaSpace);
float t = x0 / x1;
float lin = t * y1;
float low = lin * (1.0f - curveData.toe * .5f);
var y0 = low;
float dx = x1 - x0;
float dy = y1 - y0;
float m = 0.0f;
if (dx > 0 && dy > 0)
m = dy / dx;
// Linear section, power is 1, slope is m
polyLinear.x0 = x0;
polyLinear.y0 = y0;
polyLinear.A = m;
polyLinear.B = 1.0f;
polyLinear.signX = 1.0f;
polyLinear.signY = 1.0f;
polyLinear.logA = Mathf.Log(m);
// Toe
polyToe = polyLinear;
polyToe.Initialize(x0, y0, m);
float linearW = target.GetWhitePoint();
// Shoulder, first think about it "backwards"
float offsetX = linearW - x1;
float offsetY = 1.0f - y1;
polyShoulder = polyLinear;
polyShoulder.Initialize(offsetX, offsetY, m);
// Flip horizontal
polyShoulder.signX = -1.0f;
polyShoulder.x0 = -linearW;
// Flip vertical
polyShoulder.signY = -1.0f;
polyShoulder.y0 = 1.0f;
float oneOverDim = 1.0f / (1.0f * w - 1.0f);
for (int i = 0; i < w; i++)
{
float src = (i * 1.0f) * oneOverDim;
float dst = target.EvalFilmicHelper(src, lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW);
dst = Mathf.LinearToGammaSpace(dst);
dst = Mathf.Clamp01(dst);
c[i] = new Vector3(rect.x + i, rect.y + (h - dst * h1), 0f);
}
// Curve drawing
Handles.color = EditorGUIUtility.isProSkin ? Color.white : Color.black;
Handles.DrawAAPolyLine(2f, c);
}
CPUHistogram m_CPUHistogram;
GPUHistogram m_GPUHistogram;
private IHistogram histogram
{
get
{
if (SupportsGPUHistogram())
return m_GPUHistogram;
return m_CPUHistogram;
}
}
public enum HistogramMode
{
Red = 0,
Green = 1,
Blue = 2,
Luminance = 3,
RGB,
}
private bool m_LogHistogram;
private bool m_RefreshHistogramOnPlay;
private HistogramMode m_HistogramMode = HistogramMode.RGB;
private bool SupportsGPUHistogram()
{
return concreteTarget.histogramComputeShader != null
&& SystemInfo.supportsComputeShaders
&& concreteTarget.histogramShader != null
&& concreteTarget.histogramShader.isSupported;
}
TonemappingColorGrading concreteTarget
{
get { return target as TonemappingColorGrading; }
}
public override bool HasPreviewGUI()
{
return targets.Length == 1 && concreteTarget != null && concreteTarget.enabled;
}
Rect m_HistogramRect;
public override void OnPreviewGUI(Rect r, GUIStyle background)
{
serializedObject.Update();
if (Event.current.type == EventType.Repaint)
{
// If m_HistogramRect isn't set the preview was just opened so refresh the render to get the histogram data
if (m_HistogramRect.width == 0 && m_HistogramRect.height == 0)
InternalEditorUtility.RepaintAllViews();
// Sizing
float width = Mathf.Min(512f, r.width);
float height = Mathf.Min(128f, r.height);
m_HistogramRect = new Rect(
Mathf.Floor(r.x + r.width / 2f - width / 2f),
Mathf.Floor(r.y + r.height / 2f - height / 2f),
width, height
);
histogram.DoGUI(m_HistogramRect, m_LogHistogram, m_HistogramMode);
}
// Toolbar
GUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
{
concreteTarget.debugClamp = GUILayout.Toggle(concreteTarget.debugClamp, new GUIContent("Clipping", "Turns all overexposed pixels pink in the game view"), EditorStyles.miniButtonLeft);
m_LogHistogram = GUILayout.Toggle(m_LogHistogram, new GUIContent("Log", "Logarithmic histogram"), EditorStyles.miniButtonMid);
m_RefreshHistogramOnPlay = GUILayout.Toggle(m_RefreshHistogramOnPlay, new GUIContent("Refresh on Play", "Keep refreshing the histogram in play mode; this will impact performances"), EditorStyles.miniButtonRight);
GUILayout.FlexibleSpace();
m_HistogramMode = (HistogramMode)EditorGUILayout.EnumPopup(m_HistogramMode);
}
GUILayout.EndHorizontal();
serializedObject.ApplyModifiedProperties();
if (EditorGUI.EndChangeCheck())
InternalEditorUtility.RepaintAllViews();
}
private void OnFrameEnd(RenderTexture source, Material tonemapMaterial)
{
if (Application.isPlaying && !m_RefreshHistogramOnPlay)
return;
if (Mathf.Approximately(m_HistogramRect.width, 0) || Mathf.Approximately(m_HistogramRect.height, 0))
return;
int pass = (int)(concreteTarget.fastMode ? TonemappingColorGrading.Passes.OneD : TonemappingColorGrading.Passes.ThreeD);
int rw = SupportsGPUHistogram() ? 512 : 160;
RenderTexture rtt = RenderTexture.GetTemporary(rw, rw, 0, RenderTextureFormat.ARGB32);
Graphics.Blit(source, rtt, tonemapMaterial, pass);
histogram.Update(source, m_HistogramRect, m_LogHistogram, m_HistogramMode);
Repaint();
RenderTexture.active = null;
RenderTexture.ReleaseTemporary(rtt);
}
public static class ColorWheel
{
// Constants
const float PI_2 = Mathf.PI / 2f;
const float PI2 = Mathf.PI * 2f;
// Hue Wheel
static Texture2D s_WheelTexture;
static float s_LastDiameter;
private static GUIStyle s_centeredStyle;
public static Color DoGUI(Rect area, string title, Color color, float diameter)
{
var labelrect = area;
labelrect.height = EditorGUIUtility.singleLineHeight;
if (s_centeredStyle == null)
{
s_centeredStyle = new GUIStyle(GUI.skin.GetStyle("Label"))
{
alignment = TextAnchor.UpperCenter
};
}
GUI.Label(labelrect, title, s_centeredStyle);
// figure out the wheel draw area
var wheelDrawArea = area;
wheelDrawArea.y += EditorGUIUtility.singleLineHeight;
wheelDrawArea.height = diameter;
if (wheelDrawArea.width > wheelDrawArea.height)
{
wheelDrawArea.x += (wheelDrawArea.width - wheelDrawArea.height) / 2.0f;
wheelDrawArea.width = area.height;
}
wheelDrawArea.width = wheelDrawArea.height;
var radius = diameter / 2.0f;
Vector3 hsv;
Color.RGBToHSV(color, out hsv.x, out hsv.y, out hsv.z);
if (Event.current.type == EventType.Repaint)
{
if (!Mathf.Approximately(diameter, s_LastDiameter))
{
s_LastDiameter = diameter;
UpdateHueWheel((int)diameter);
}
// Wheel
GUI.DrawTexture(wheelDrawArea, s_WheelTexture);
// Thumb
Vector2 thumbPos = Vector2.zero;
float theta = hsv.x * PI2;
float len = hsv.y * radius;
thumbPos.x = Mathf.Cos(theta + PI_2);
thumbPos.y = Mathf.Sin(theta - PI_2);
thumbPos *= len;
Vector2 thumbSize = s_Styles.thumb2DSize;
Color oldColor = GUI.color;
GUI.color = Color.black;
s_Styles.thumb2D.Draw(new Rect(wheelDrawArea.x + radius + thumbPos.x - thumbSize.x / 2f, wheelDrawArea.y + radius + thumbPos.y - thumbSize.y / 2f, thumbSize.x, thumbSize.y), false, false, false, false);
GUI.color = oldColor;
}
hsv = GetInput(wheelDrawArea, hsv, radius);
var sliderDrawArea = wheelDrawArea;
sliderDrawArea.y = sliderDrawArea.yMax;
sliderDrawArea.height = EditorGUIUtility.singleLineHeight;
hsv.y = GUI.HorizontalSlider(sliderDrawArea, hsv.y, 1e-04f, 1f);
color = Color.HSVToRGB(hsv.x, hsv.y, hsv.z);
return color;
}
static readonly int thumbHash = "colorWheelThumb".GetHashCode();
static Vector3 GetInput(Rect bounds, Vector3 hsv, float radius)
{
Event e = Event.current;
var id = GUIUtility.GetControlID(thumbHash, FocusType.Passive, bounds);
Vector2 mousePos = e.mousePosition;
Vector2 relativePos = mousePos - new Vector2(bounds.x, bounds.y);
if (e.type == EventType.MouseDown && e.button == 0 && GUIUtility.hotControl == 0)
{
if (bounds.Contains(mousePos))
{
Vector2 center = new Vector2(bounds.x + radius, bounds.y + radius);
float dist = Vector2.Distance(center, mousePos);
if (dist <= radius)
{
e.Use();
GetWheelHueSaturation(relativePos.x, relativePos.y, radius, out hsv.x, out hsv.y);
GUIUtility.hotControl = id;
}
}
}
else if (e.type == EventType.MouseDrag && e.button == 0 && GUIUtility.hotControl == id)
{
Vector2 center = new Vector2(bounds.x + radius, bounds.y + radius);
float dist = Vector2.Distance(center, mousePos);
if (dist <= radius)
{
e.Use();
GetWheelHueSaturation(relativePos.x, relativePos.y, radius, out hsv.x, out hsv.y);
}
}
else if (e.type == EventType.MouseUp && e.button == 0 && GUIUtility.hotControl == id)
{
e.Use();
GUIUtility.hotControl = 0;
}
return hsv;
}
static void GetWheelHueSaturation(float x, float y, float radius, out float hue, out float saturation)
{
float dx = (x - radius) / radius;
float dy = (y - radius) / radius;
float d = Mathf.Sqrt((dx * dx + dy * dy));
hue = Mathf.Atan2(dx, -dy);
hue = 1f - ((hue > 0) ? hue : PI2 + hue) / PI2;
saturation = Mathf.Clamp01(d);
}
static void UpdateHueWheel(int diameter)
{
CleanTexture(s_WheelTexture);
s_WheelTexture = MakeTexture(diameter);
var radius = diameter / 2.0f;
Color[] pixels = s_WheelTexture.GetPixels();
for (int y = 0; y < diameter; y++)
{
for (int x = 0; x < diameter; x++)
{
int index = y * diameter + x;
float dx = (x - radius) / radius;
float dy = (y - radius) / radius;
float d = Mathf.Sqrt(dx * dx + dy * dy);
// Out of the wheel, early exit
if (d >= 1f)
{
pixels[index] = new Color(0f, 0f, 0f, 0f);
continue;
}
// Red (0) on top, counter-clockwise (industry standard)
float saturation = d;
float hue = Mathf.Atan2(dx, dy);
hue = 1f - ((hue > 0) ? hue : PI2 + hue) / PI2;
Color color = Color.HSVToRGB(hue, saturation, 1f);
// Quick & dirty antialiasing
color.a = (saturation > 0.99) ? (1f - saturation) * 100f : 1f;
pixels[index] = color;
}
}
s_WheelTexture.SetPixels(pixels);
s_WheelTexture.Apply();
}
static Texture2D MakeTexture(int dimension)
{
Texture2D tex = new Texture2D(dimension, dimension, TextureFormat.ARGB32, false, true)
{
filterMode = FilterMode.Point,
wrapMode = TextureWrapMode.Clamp,
hideFlags = HideFlags.HideAndDontSave,
alphaIsTransparency = true
};
return tex;
}
static void CleanTexture(Texture2D texture)
{
if (texture != null)
DestroyImmediate(texture);
}
public static float GetColorWheelHeight(int renderSizePerWheel)
{
// wheel height + title label + alpha slider
return renderSizePerWheel + 2 * EditorGUIUtility.singleLineHeight;
}
}
interface IHistogram
{
void DoGUI(Rect rect, bool log, HistogramMode mode);
void Update(RenderTexture source, Rect rect, bool log, HistogramMode mode);
void Destroy();
}
private static readonly Color s_MasterCurveColor = new Color(1f, 1f, 1f, 2f);
private static readonly Color s_RedCurveColor = new Color(1f, 0f, 0f, 2f);
private static readonly Color s_GreenCurveColor = new Color(0f, 1f, 0f, 2f);
private static readonly Color s_BlueCurveColor = new Color(0f, 1f, 1f, 2f);
class CPUHistogram : IHistogram
{
int[] m_Histogram = new int[256];
int[] m_HistogramRGB = new int[256 * 3];
Texture2D m_TempTexture;
public void DoGUI(Rect rect, bool log, HistogramMode mode)
{
if (mode == HistogramMode.RGB)
DoGUIrgb(rect, log);
else
DoGUImono(rect, log, mode);
}
void DoGUImono(Rect rect, bool log, HistogramMode mode)
{
// Scale histogram values
int[] scaledHistogram = new int[256];
int max = 0;
for (int i = 0; i < 256; i++)
max = (max < m_Histogram[i]) ? m_Histogram[i] : max;
scaledHistogram = new int[256];
if (log)
{
float factor = rect.height / Mathf.Log10(max);
for (int i = 0; i < 256; i++)
scaledHistogram[i] = (m_Histogram[i] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_Histogram[i]) * factor), 1);
}
else
{
float factor = rect.height / max;
for (int i = 0; i < 256; i++)
scaledHistogram[i] = Mathf.Max(Mathf.RoundToInt(m_Histogram[i] * factor), 1);
}
// Color
if (mode == HistogramMode.Red)
Handles.color = s_RedCurveColor;
else if (mode == HistogramMode.Green)
Handles.color = s_GreenCurveColor;
else if (mode == HistogramMode.Blue)
Handles.color = s_BlueCurveColor;
else
Handles.color = s_MasterCurveColor;
// Base line
Vector2 p1 = new Vector2(rect.x - 1, rect.yMax);
Vector2 p2 = new Vector2(rect.xMax - 1, rect.yMax);
Handles.DrawLine(p1, p2);
// Histogram
for (int i = 0; i < (int)rect.width; i++)
{
float remapI = (float)i / rect.width * 255f;
int index = Mathf.FloorToInt(remapI);
float fract = remapI - (float)index;
float v1 = scaledHistogram[index];
float v2 = scaledHistogram[Mathf.Min(index + 1, 255)];
float h = v1 * (1.0f - fract) + v2 * fract;
Handles.DrawLine(
new Vector2(rect.x + i, rect.yMax),
new Vector2(rect.x + i, rect.yMin + (rect.height - h))
);
}
}
void DoGUIrgb(Rect rect, bool log)
{
// Scale histogram values
Vector3 max = Vector3.zero;
for (int i = 0; i < 256; i++)
{
max.x = (max.x < m_HistogramRGB[i]) ? m_HistogramRGB[i] : max.x;
max.y = (max.y < m_HistogramRGB[i + 256]) ? m_HistogramRGB[i + 256] : max.y;
max.z = (max.z < m_HistogramRGB[i + 512]) ? m_HistogramRGB[i + 512] : max.z;
}
Vector3[] scaledHistogramRGB = new Vector3[256];
if (log)
{
Vector3 factor = new Vector3(
rect.height / Mathf.Log10(max.x),
rect.height / Mathf.Log10(max.y),
rect.height / Mathf.Log10(max.z)
);
for (int i = 0; i < 256; i++)
{
scaledHistogramRGB[i] = new Vector3(
(m_HistogramRGB[i] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_HistogramRGB[i]) * factor.x), 1),
(m_HistogramRGB[i + 256] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_HistogramRGB[i + 256]) * factor.y), 1),
(m_HistogramRGB[i + 512] == 0) ? 0 : Mathf.Max(Mathf.RoundToInt(Mathf.Log10(m_HistogramRGB[i + 512]) * factor.z), 1)
);
}
}
else
{
Vector3 factor = new Vector3(rect.height / max.x, rect.height / max.y, rect.height / max.z);
for (int i = 0; i < 256; i++)
{
scaledHistogramRGB[i] = new Vector3(
Mathf.Max(Mathf.RoundToInt(m_HistogramRGB[i] * factor.x), 1),
Mathf.Max(Mathf.RoundToInt(m_HistogramRGB[i + 256] * factor.y), 1),
Mathf.Max(Mathf.RoundToInt(m_HistogramRGB[i + 512] * factor.z), 1)
);
}
}
// Base line
Handles.color = s_MasterCurveColor;
Vector2 p1 = new Vector2(rect.x - 1, rect.yMax);
Vector2 p2 = new Vector2(rect.xMax - 1, rect.yMax);
Handles.DrawLine(p1, p2);
Color[] colors = { s_RedCurveColor, s_GreenCurveColor, s_BlueCurveColor };
// Histogram
for (int i = 0; i < (int)rect.width; i++)
{
int[] heights = new int[3];
for (int j = 0; j < 3; j++)
{
float remapI = (float)i / rect.width * 255f;
int index = Mathf.FloorToInt(remapI);
float fract = remapI - (float)index;
float v1 = scaledHistogramRGB[index][j];
float v2 = scaledHistogramRGB[Mathf.Min(index + 1, 255)][j];
heights[j] = (int)(v1 * (1.0f - fract) + v2 * fract);
}
int[] indices = { 0, 1, 2 };
Array.Sort<int>(indices, (a, b) => heights[a].CompareTo(heights[b]));
Handles.color = s_MasterCurveColor;
Handles.DrawLine(
new Vector2(rect.x + i, rect.yMax),
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[0]]))
);
Handles.color = colors[indices[2]] + colors[indices[1]];
Handles.DrawLine(
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[0]])),
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[1]]))
);
Handles.color = colors[indices[2]];
Handles.DrawLine(
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[1]])),
new Vector2(rect.x + i, rect.yMin + (rect.height - heights[indices[2]]))
);
}
}
public void Update(RenderTexture source, Rect rect, bool log, HistogramMode mode)
{
if (m_TempTexture == null || m_TempTexture.height != source.height || m_TempTexture.width != source.width)
{
DestroyImmediate(m_TempTexture);
m_TempTexture = new Texture2D(source.width, source.height, TextureFormat.RGB24, false);
m_TempTexture.anisoLevel = 0;
m_TempTexture.wrapMode = TextureWrapMode.Clamp;
m_TempTexture.filterMode = FilterMode.Bilinear;
m_TempTexture.hideFlags = HideFlags.HideAndDontSave;
}
// Grab the screen content for the camera
RenderTexture.active = source;
m_TempTexture.ReadPixels(new Rect(0, 0, source.width, source.height), 0, 0, false);
m_TempTexture.Apply();
RenderTexture.active = null;
// Raw histogram
Color[] pixels = m_TempTexture.GetPixels();
switch (mode)
{
case HistogramMode.Luminance:
Array.Clear(m_Histogram, 0, 256);
for (int i = 0; i < pixels.Length; i++)
{
Color c = pixels[i];
m_Histogram[(int)((c.r * 0.2125f + c.g * 0.7154f + c.b * 0.0721f) * 255)]++;
}
break;
case HistogramMode.RGB:
Array.Clear(m_HistogramRGB, 0, 256 * 3);
for (int i = 0; i < pixels.Length; i++)
{
Color c = pixels[i];
m_HistogramRGB[(int)(c.r * 255)]++;
m_HistogramRGB[(int)(c.g * 255) + 256]++;
m_HistogramRGB[(int)(c.b * 255) + 512]++;
}
break;
case HistogramMode.Red:
Array.Clear(m_Histogram, 0, 256);
for (int i = 0; i < pixels.Length; i++)
m_Histogram[(int)(pixels[i].r * 255)]++;
break;
case HistogramMode.Green:
Array.Clear(m_Histogram, 0, 256);
for (int i = 0; i < pixels.Length; i++)
m_Histogram[(int)(pixels[i].g * 255)]++;
break;
case HistogramMode.Blue:
Array.Clear(m_Histogram, 0, 256);
for (int i = 0; i < pixels.Length; i++)
m_Histogram[(int)(pixels[i].b * 255)]++;
break;
}
}
public void Destroy()
{
if (m_TempTexture != null)
DestroyImmediate(m_TempTexture);
}
}
class GPUHistogram : IHistogram
{
RenderTexture m_RT;
Material m_Material;
Shader m_Shader;
ComputeShader m_ComputeShader;
ComputeBuffer m_Buffer;
public GPUHistogram(Shader shader, ComputeShader computeShader)
{
m_Shader = shader;
m_ComputeShader = computeShader;
}
public void DoGUI(Rect rect, bool log, HistogramMode mode)
{
if (m_RT != null)
GUI.DrawTexture(rect, m_RT);
}
public void Update(RenderTexture source, Rect rect, bool log, HistogramMode mode)
{
if (m_Material == null)
{
m_Material = new Material(m_Shader);
m_Material.hideFlags = HideFlags.HideAndDontSave;
}
if (m_Buffer == null)
m_Buffer = new ComputeBuffer(256, sizeof(uint) << 2);
m_Buffer.SetData(new uint[256 << 2]);
ComputeShader cs = m_ComputeShader;
int kernel = cs.FindKernel("KHistogram");
cs.SetBuffer(kernel, "_Histogram", m_Buffer);
cs.SetTexture(kernel, "_Source", source);
cs.SetInt("_IsLinear", (QualitySettings.activeColorSpace == ColorSpace.Linear) ? 1 : 0);
cs.Dispatch(kernel, source.width >> 4, source.height >> 4, 1);
kernel = cs.FindKernel(log ? "KScale_Log" : "KScale");
cs.SetBuffer(kernel, "_Histogram", m_Buffer);
cs.SetFloat("_Height", rect.height);
cs.Dispatch(kernel, 1, 1, 1);
if (m_RT == null || m_RT.height != rect.height || m_RT.width != rect.width)
{
DestroyImmediate(m_RT);
m_RT = new RenderTexture((int)rect.width, (int)rect.height, 0, RenderTextureFormat.ARGB32);
m_RT.hideFlags = HideFlags.HideAndDontSave;
}
m_Material.SetBuffer("_Histogram", m_Buffer);
m_Material.SetVector("_Size", new Vector2(m_RT.width, m_RT.height));
m_Material.SetColor("_ColorR", s_RedCurveColor);
m_Material.SetColor("_ColorG", s_GreenCurveColor);
m_Material.SetColor("_ColorB", s_BlueCurveColor);
m_Material.SetColor("_ColorL", s_MasterCurveColor);
m_Material.SetInt("_Channel", (int)mode);
Graphics.Blit(m_RT, m_RT, m_Material, (mode == HistogramMode.RGB) ? 1 : 0);
}
public void Destroy()
{
if (m_RT != null)
DestroyImmediate(m_RT);
if (m_Material != null)
DestroyImmediate(m_Material);
if (m_Buffer != null)
m_Buffer.Release();
}
}
}
}
fileFormatVersion: 2
guid: 64bb64b30a05a0d4b8afe58a356fc8fb
timeCreated: 1441354689
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: d8d7b09c1bf4e324c8d0c6c03cc47948
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
RWStructuredBuffer<uint4> _Histogram;
Texture2D<float4> _Source;
half _Height;
uint _IsLinear;
// Linear to sRGB from http://entropymine.com/imageworsener/srgbformula/
// using a bit more precise values than the IEC 61966-2-1 standard
// See http://en.wikipedia.org/wiki/SRGB for more information
half3 sRGB(half3 color)
{
color = (color <= half3(0.0031308, 0.0031308, 0.0031308)) ? color * 12.9232102 : 1.055 * pow(color, 0.41666) - 0.055;
return color;
}
#pragma kernel KHistogram
[numthreads(16,16,1)]
void KHistogram(uint3 id : SV_DispatchThreadID)
{
half3 color = saturate(_Source[id.xy].xyz);
if (_IsLinear > 0) color = sRGB(color);
uint3 idx_c = (uint3)(round(color * 255.0));
uint idx_l = (uint)(round(dot(color.rgb, half3(0.2125, 0.7154, 0.0721)) * 255.0));
InterlockedAdd(_Histogram[idx_c.x].x, 1); // Red
InterlockedAdd(_Histogram[idx_c.y].y, 1); // Green
InterlockedAdd(_Histogram[idx_c.z].z, 1); // Blue
InterlockedAdd(_Histogram[idx_l].w, 1); // Luminance
}
// Naive mono-threaded kernels, compile on all platforms, shouldn't really be an issue as we're only dealing with 256 elements
#pragma kernel KScale
[numthreads(1, 1, 1)]
void KScale(uint3 idx : SV_DispatchThreadID)
{
uint4 maxvalue = uint4(1, 1, 1, 1);
for (int i = 0; i < 256; i++)
maxvalue = max(maxvalue, _Histogram[i]);
half4 factor = _Height / (half4)maxvalue;
for (int j = 0; j < 256; j++)
_Histogram[j] = (uint4)round(_Histogram[j] * factor);
}
#pragma kernel KScale_Log
[numthreads(1, 1, 1)]
void KScale_Log(uint3 idx : SV_DispatchThreadID)
{
uint4 maxvalue = uint4(1, 1, 1, 1);
for (int i = 0; i < 256; i++)
maxvalue = max(maxvalue, _Histogram[i]);
half4 factor = _Height / log10((half)maxvalue);
for (int j = 0; j < 256; j++)
{
// log10(0) = -Infinity
_Histogram[j] = (uint4)round(log10(_Histogram[j]) * factor);
}
}
fileFormatVersion: 2
guid: 5ee4b74fa28a3e74e89423dd49705fc5
timeCreated: 1436170077
licenseType: Store
ComputeShaderImporter:
currentBuildTarget: 5
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Hidden/TonemappingColorGrading"
{
Properties
{
_MainTex ("", 2D) = "black" {}
}
CGINCLUDE
#pragma vertex vert
#include "UnityCG.cginc"
struct v2f {
half4 pos : SV_POSITION;
half2 uv : TEXCOORD0;
};
sampler2D _MainTex;
sampler3D _LutTex;
sampler2D _LutTex1D;
half _LutA;
half4 _LutExposureMult;
half _Vibrance;
v2f vert(appdata_img v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
return o;
}
half4 fragNonAdaptive1D(v2f i) : SV_Target
{
half4 color = tex2D (_MainTex, i.uv);
half3 x = color.rgb;
x *= _LutExposureMult.xyz;
half pad1D = .5f/128.0f;
half scale1D = 127.0f/128.0f;
x = _LutA * (x/(1.0f + x));
half3 padX = x*scale1D + pad1D;
x.r = tex2D(_LutTex1D,half2(padX.r,.5f)).r;
x.g = tex2D(_LutTex1D,half2(padX.g,.5f)).g;
x.b = tex2D(_LutTex1D,half2(padX.b,.5f)).b;
half3 lum = dot(x, half3(0.2125, 0.7154, 0.0721));
color.rgb = lum + (x - lum) * _Vibrance;
return color;
}
half4 fragDebug1D(v2f i) : SV_Target
{
half4 color = fragNonAdaptive1D(i);
half highVal = max(color.x,max(color.y, color.z));
if (highVal >= 254.0f / 255.0f)
color = half4(1.0, .25, 1.0, 1.0);
return color;
}
half4 fragNonAdaptive(v2f i) : SV_Target
{
half4 color = tex2D (_MainTex, i.uv);
half3 x = color.rgb;
x *= _LutExposureMult.xyz;
// offset and scale
half pad = .5f/32.0f;
half scale = 31.0f/(32.0f);
x = _LutA * (x/(1.0f + x));
x = x*scale + pad;
x = tex3D(_LutTex,x).xyz;
color.rgb = x;
return color;
}
half4 fragDebug(v2f i) : SV_Target
{
half4 color = fragNonAdaptive(i);
half highVal = max(color.x,max(color.y, color.z));
if (highVal >= 254.0f / 255.0f)
color = half4(1.0, .25, 1.0, 1.0);
return color;
}
ENDCG
Subshader
{
// 1 - Non-adaptive
Pass
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma fragment fragNonAdaptive
ENDCG
}
// 2 - Non-adaptive 1D
Pass
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma fragment fragNonAdaptive1D
ENDCG
}
// 3 - Debugging
Pass
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma fragment fragDebug
ENDCG
}
// 4 - Debugging 1D
Pass
{
ZTest Always Cull Off ZWrite Off
CGPROGRAM
#pragma fragment fragDebug1D
ENDCG
}
}
Fallback off
}
fileFormatVersion: 2
guid: 964b34bbab7f5e64fa40f37eaccac1ad
timeCreated: 1435513939
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Hidden/TonemappingColorGradingHistogram"
{
SubShader
{
ZTest Always Cull Off ZWrite Off
Fog { Mode off }
CGINCLUDE
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 5.0
#include "UnityCG.cginc"
struct v_data
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
StructuredBuffer<uint4> _Histogram;
half2 _Size;
uint _Channel;
half4 _ColorR;
half4 _ColorG;
half4 _ColorB;
half4 _ColorL;
v_data vert(appdata_img v)
{
v_data o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord;
return o;
}
half4 frag_channel(v_data i) : COLOR
{
const half4 COLORS[4] = { _ColorR, _ColorG, _ColorB, _ColorL };
half remapI = i.uv.x * 255.0;
uint index = floor(remapI);
half delta = frac(remapI);
half v1 = _Histogram[index][_Channel];
half v2 = _Histogram[min(index + 1, 255)][_Channel];
half h = v1 * (1.0 - delta) + v2 * delta;
uint y = (uint)round(i.uv.y * _Size.y);
half4 color = half4(0.0, 0.0, 0.0, 0.0);
half fill = step(y, h);
color = lerp(color, COLORS[_Channel], fill);
return color;
}
half4 frag_rgb(v_data i) : COLOR
{
const half4 COLORS[3] = { _ColorR, _ColorG, _ColorB };
half4 targetColor = half4(0.0, 0.0, 0.0, 0.0);
half4 emptyColor = half4(0.0, 0.0, 0.0, 0.0);
half fill = 0;
for (int j = 0; j < 3; j++)
{
half remapI = i.uv.x * 255.0;
uint index = floor(remapI);
half delta = frac(remapI);
half v1 = _Histogram[index][j];
half v2 = _Histogram[min(index + 1, 255)][j];
half h = v1 * (1.0 - delta) + v2 * delta;
uint y = (uint)round(i.uv.y * _Size.y);
half fill = step(y, h);
half4 color = lerp(emptyColor, COLORS[j], fill);
targetColor += color;
}
return saturate(targetColor);
}
ENDCG
// 0 - Channel
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag_channel
ENDCG
}
// 1 - RGB
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag_rgb
ENDCG
}
}
FallBack off
}
fileFormatVersion: 2
guid: 9a8e838691462194482a43a02e424876
timeCreated: 1436173774
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using System;
using UnityEngine.Events;
namespace UnityStandardAssets.CinematicEffects
{
// TODO: Retina support for the wheels (not sure how Unity handles Retina)
// TODO: Cleanup all the temp stuff
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Image Effects/Color Adjustments/Tonemapping and Color Grading")]
public class TonemappingColorGrading : MonoBehaviour
{
#region Temp stuff, should be removed before release
[NonSerialized] public bool fastMode = false;
public bool debugClamp = false;
#endregion
#if UNITY_EDITOR
// EDITOR ONLY call for allowing the editor to update
// the histogram
public UnityAction<RenderTexture, Material> onFrameEndEditorOnly;
[SerializeField] public ComputeShader histogramComputeShader;
[SerializeField] public Shader histogramShader;
[NonSerialized]
private RenderTexureUtility m_RTU = new RenderTexureUtility();
#endif
[AttributeUsage(AttributeTargets.Field)]
public class SettingsGroup : Attribute
{
}
public class DrawFilmicCurveAttribute : Attribute
{
}
public enum Passes
{
ThreeD = 0,
OneD = 1,
ThreeDDebug = 2,
OneDDebug = 3
}
[Serializable]
public struct FilmicCurve
{
public bool enabled;
// LUT
[Range(-4f, 4f)][Tooltip("Exposure Bias|Adjusts the overall exposure of the scene")] public float exposureBias;
[Range(0f, 2f)][Tooltip("Contrast|Contrast adjustment (log-space)")] public float contrast;
[Range(0f, 1f)][Tooltip("Toe|Toe of the filmic curve; affects the darker areas of the scene")] public float toe;
[Range(0f, 1f)][Tooltip("Shoulder|Shoulder of the filmic curve; brings overexposed highlights back into range")] public float lutShoulder;
public static FilmicCurve defaultFilmicCurve = new FilmicCurve
{
enabled = false,
exposureBias = 0.0f,
contrast = 1.0f,
toe = 0.0f,
lutShoulder = 0.0f
};
}
public class ColorWheelGroup : PropertyAttribute
{
public int minSizePerWheel = 60;
public int maxSizePerWheel = 150;
public ColorWheelGroup()
{
}
public ColorWheelGroup(int minSizePerWheel, int maxSizePerWheel)
{
this.minSizePerWheel = minSizePerWheel;
this.maxSizePerWheel = maxSizePerWheel;
}
}
[Serializable]
public struct ColorGradingColors
{
[Tooltip("Shadows|Shadows color")] public Color shadows;
[Tooltip("Midtones|Midtones color")] public Color midtones;
[Tooltip("Highlights|Highlights color")] public Color highlights;
public static ColorGradingColors defaultGradingColors = new ColorGradingColors
{
shadows = new Color(1, 1, 1),
midtones = new Color(1, 1, 1),
highlights = new Color(1, 1, 1)
};
}
[Serializable]
public struct ColorGrading
{
public bool enabled;
[ColorUsage(false)][Tooltip("White Balance|Adjusts the white color before tonemapping")] public Color whiteBalance;
[Range(0f, 2f)][Tooltip("Vibrance|Pushes the intensity of all colors")] public float saturation;
[Range(0f, 5f)][Tooltip("Gamma|Adjusts the gamma")] public float gamma;
[ColorWheelGroup] public ColorGradingColors lutColors;
public static ColorGrading defaultColorGrading = new ColorGrading
{
whiteBalance = Color.white,
enabled = false,
saturation = 1.0f,
gamma = 1.0f,
lutColors = ColorGradingColors.defaultGradingColors
};
}
[NonSerialized] private bool m_Dirty = true;
public void SetDirty()
{
m_Dirty = true;
}
[SerializeField][SettingsGroup][DrawFilmicCurve] private FilmicCurve m_FilmicCurve = FilmicCurve.defaultFilmicCurve;
public FilmicCurve filmicCurve
{
get { return m_FilmicCurve; }
set
{
m_FilmicCurve = value;
SetDirty();
}
}
[SerializeField][SettingsGroup] private ColorGrading m_ColorGrading = ColorGrading.defaultColorGrading;
public ColorGrading colorGrading
{
get { return m_ColorGrading; }
set
{
m_ColorGrading = value;
SetDirty();
}
}
// called in editor when UI is changed
private void OnValidate()
{
SetDirty();
}
// The actual texture that we build
private Texture3D m_LutTex;
// 1D curves
private Texture2D m_LutCurveTex1D;
private bool isLinearColorSpace
{
get { return QualitySettings.activeColorSpace == ColorSpace.Linear; }
}
[SerializeField][Tooltip("Lookup Texture|Custom lookup texture")] private Texture2D m_UserLutTexture;
public Texture2D userLutTexture
{
get { return m_UserLutTexture; }
set
{
m_UserLutTexture = value;
SetDirty();
}
}
public struct SimplePolyFunc
{
// f(x) = signY * A * (signX * x - x0) ^ b + y0
public float A;
public float B;
public float x0;
public float y0;
public float signX;
public float signY;
public float logA;
public float Eval(float x)
{
// Standard function
//return signY * A * Mathf.Pow(signX * x - x0, B) + y0;
// Slightly more complicated but numerically stable function
return signY * Mathf.Exp(logA + B * Mathf.Log(signX * x - x0)) + y0;
}
// Create a function going from (0,0) to (x_end,y_end) where the
// derivative at x_end is m
public void Initialize(float x_end, float y_end, float m)
{
A = 0.0f;
B = 1.0f;
x0 = 0.0f;
y0 = 0.0f;
signX = 1.0f;
signY = 1.0f;
// Invalid case, slope must be positive and the
// y that we are trying to hit must be positve.
if (m <= 0.0f || y_end <= 0.0f)
{
return;
}
// Also invalid
if (x_end <= 0.0f)
{
return;
}
B = (m * x_end) / y_end;
float p = Mathf.Pow(x_end, B);
A = y_end / p;
logA = Mathf.Log(y_end) - B * Mathf.Log(x_end);
}
};
// Usual & internal stuff
public Shader tonemapShader = null;
public bool validRenderTextureFormat = true;
private Material m_TonemapMaterial;
public Material tonemapMaterial
{
get
{
if (m_TonemapMaterial == null)
m_TonemapMaterial = ImageEffectHelper.CheckShaderAndCreateMaterial(tonemapShader);
return m_TonemapMaterial;
}
}
private int m_UserLutDim = 16;
private Color[] m_UserLutData;
protected void OnEnable()
{
if (tonemapShader == null)
tonemapShader = Shader.Find("Hidden/TonemappingColorGrading");
if (ImageEffectHelper.IsSupported(tonemapShader, false, true, this))
return;
enabled = false;
Debug.LogWarning("The image effect " + ToString() + " has been disabled as it's not supported on the current platform.");
}
float GetHighlightRecovery()
{
return Mathf.Max(0.0f, m_FilmicCurve.lutShoulder * 3.0f);
}
public float GetWhitePoint()
{
return Mathf.Pow(2.0f, Mathf.Max(0.0f, GetHighlightRecovery()));
}
static float LutToLin(float x, float lutA)
{
x = (x >= 1.0f) ? 1.0f : x;
float temp = x / lutA;
return temp / (1.0f - temp);
}
static float LinToLut(float x, float lutA)
{
return Mathf.Sqrt(x / (x + lutA));
}
static float LiftGammaGain(float x, float lift, float invGamma, float gain)
{
float xx = Mathf.Sqrt(x);
float ret = gain * (lift * (1.0f - xx) + Mathf.Pow(xx, invGamma));
return ret * ret;
}
static float LogContrast(float x, float linRef, float contrast)
{
x = Mathf.Max(x, 1e-5f);
float logRef = Mathf.Log(linRef);
float logVal = Mathf.Log(x);
float logAdj = logRef + (logVal - logRef) * contrast;
float dstVal = Mathf.Exp(logAdj);
return dstVal;
}
static Color NormalizeColor(Color c)
{
float sum = (c.r + c.g + c.b) / 3.0f;
if (sum == 0.0f)
return new Color(1.0f, 1.0f, 1.0f, 1.0f);
Color ret = new Color();
ret.r = c.r / sum;
ret.g = c.g / sum;
ret.b = c.b / sum;
ret.a = 1.0f;
return ret;
}
static public float GetLutA()
{
// Our basic function is f(x) = A * x / (x + 1)
// We want the function to actually be able to hit 1.0f (to use
// the full range of the 3D lut) and that's what A is for.
// Tried a bunch numbers and 1.05 seems to work pretty well.
return 1.05f;
}
void SetIdentityLut()
{
int dim = 16;
Color[] newC = new Color[dim * dim * dim];
float oneOverDim = 1.0f / (1.0f * dim - 1.0f);
for (int i = 0; i < dim; i++)
{
for (int j = 0; j < dim; j++)
{
for (int k = 0; k < dim; k++)
{
newC[i + (j * dim) + (k * dim * dim)] = new Color((i * 1.0f) * oneOverDim, (j * 1.0f) * oneOverDim, (k * 1.0f) * oneOverDim, 1.0f);
}
}
}
m_UserLutData = newC;
m_UserLutDim = dim;
}
int ClampLutDim(int src)
{
return Mathf.Clamp(src, 0, m_UserLutDim - 1);
}
Color SampleLutNearest(int r, int g, int b)
{
r = ClampLutDim(r);
g = ClampLutDim(g);
g = ClampLutDim(b);
return m_UserLutData[r + (g * m_UserLutDim) + (b * m_UserLutDim * m_UserLutDim)];
}
// Does the lookup without bounds checking
Color SampleLutNearestUnsafe(int r, int g, int b)
{
return m_UserLutData[r + (g * m_UserLutDim) + (b * m_UserLutDim * m_UserLutDim)];
}
Color SampleLutLinear(float srcR, float srcG, float srcB)
{
float sampleOffset = 0.0f;
float sampleScale = (float)(m_UserLutDim - 1);
float r = srcR * sampleScale + sampleOffset;
float g = srcG * sampleScale + sampleOffset;
float b = srcB * sampleScale + sampleOffset;
int r0 = Mathf.FloorToInt(r);
int g0 = Mathf.FloorToInt(g);
int b0 = Mathf.FloorToInt(b);
r0 = ClampLutDim(r0);
g0 = ClampLutDim(g0);
b0 = ClampLutDim(b0);
int r1 = ClampLutDim(r0 + 1);
int g1 = ClampLutDim(g0 + 1);
int b1 = ClampLutDim(b0 + 1);
float tr = (r) - (float)r0;
float tg = (g) - (float)g0;
float tb = (b) - (float)b0;
Color c000 = SampleLutNearestUnsafe(r0, g0, b0);
Color c001 = SampleLutNearestUnsafe(r0, g0, b1);
Color c010 = SampleLutNearestUnsafe(r0, g1, b0);
Color c011 = SampleLutNearestUnsafe(r0, g1, b1);
Color c100 = SampleLutNearestUnsafe(r1, g0, b0);
Color c101 = SampleLutNearestUnsafe(r1, g0, b1);
Color c110 = SampleLutNearestUnsafe(r1, g1, b0);
Color c111 = SampleLutNearestUnsafe(r1, g1, b1);
Color c00 = Color.Lerp(c000, c001, tb);
Color c01 = Color.Lerp(c010, c011, tb);
Color c10 = Color.Lerp(c100, c101, tb);
Color c11 = Color.Lerp(c110, c111, tb);
Color c0 = Color.Lerp(c00, c01, tg);
Color c1 = Color.Lerp(c10, c11, tg);
Color c = Color.Lerp(c0, c1, tr);
return c;
}
void UpdateUserLut()
{
// Conversion fun: the given 2D texture needs to be of the format
// w * h, wheras h is the 'depth' (or 3d dimension 'dim') and w = dim * dim
if (userLutTexture == null)
{
SetIdentityLut();
return;
}
if (!ValidDimensions(userLutTexture))
{
Debug.LogWarning("The given 2D texture " + userLutTexture.name + " cannot be used as a 3D LUT. Reverting to identity.");
SetIdentityLut();
return;
}
int dim = userLutTexture.height;
Color[] c = userLutTexture.GetPixels();
Color[] newC = new Color[c.Length];
for (int i = 0; i < dim; i++)
{
for (int j = 0; j < dim; j++)
{
for (int k = 0; k < dim; k++)
{
int j_ = dim - j - 1;
Color dst = c[k * dim + i + j_ * dim * dim];
newC[i + (j * dim) + (k * dim * dim)] = dst;
}
}
}
m_UserLutDim = dim;
m_UserLutData = newC;
}
public float EvalFilmicHelper(float src, float lutA,
SimplePolyFunc polyToe,
SimplePolyFunc polyLinear,
SimplePolyFunc polyShoulder,
float x0, float x1, float linearW)
{
// Figure out the linear value of this 3d texel
float dst = LutToLin(src, lutA);
if (m_FilmicCurve.enabled)
{
// We could allow this to be customized, but most people probably
// would not understand it and it would just create complexity.
// 18% grey is the standard film reference grey so let's just go with that.
float linRef = .18f;
dst = LogContrast(dst, linRef, m_FilmicCurve.contrast);
SimplePolyFunc polyR = polyToe;
if (dst >= x0)
polyR = polyLinear;
if (dst >= x1)
polyR = polyShoulder;
dst = Mathf.Min(dst, linearW);
dst = polyR.Eval(dst);
}
return dst;
}
float EvalCurveGradingHelper(float src, float lift, float invGamma, float gain)
{
float dst = src;
if (m_ColorGrading.enabled)
{
// lift/gamma/gain
dst = LiftGammaGain(dst, lift, invGamma, gain);
}
// Max with zero
dst = Mathf.Max(dst, 0.0f);
if (m_ColorGrading.enabled)
{
// Overall gamma
dst = Mathf.Pow(dst, m_ColorGrading.gamma);
}
return dst;
}
void Create3DLut(float lutA,
SimplePolyFunc polyToe,
SimplePolyFunc polyLinear,
SimplePolyFunc polyShoulder,
float x0, float x1, float linearW,
float liftR, float invGammaR, float gainR,
float liftG, float invGammaG, float gainG,
float liftB, float invGammaB, float gainB)
{
int dim = 32;
Color[] newC = new Color[dim * dim * dim];
float oneOverDim = 1.0f / (1.0f * dim - 1.0f);
for (int i = 0; i < dim; i++)
{
for (int j = 0; j < dim; j++)
{
for (int k = 0; k < dim; k++)
{
float srcR = (i * 1.0f) * oneOverDim;
float srcG = (j * 1.0f) * oneOverDim;
float srcB = (k * 1.0f) * oneOverDim;
float dstR = EvalFilmicHelper(srcR, lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW);
float dstG = EvalFilmicHelper(srcG, lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW);
float dstB = EvalFilmicHelper(srcB, lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW);
Color c = SampleLutLinear(dstR, dstG, dstB);
dstR = c.r;
dstG = c.g;
dstB = c.b;
dstR = EvalCurveGradingHelper(dstR, liftR, invGammaR, gainR);
dstG = EvalCurveGradingHelper(dstG, liftG, invGammaG, gainG);
dstB = EvalCurveGradingHelper(dstB, liftB, invGammaB, gainB);
if (m_ColorGrading.enabled)
{
// Saturation
float lum = dstR * 0.2125f + dstG * 0.7154f + dstB * 0.0721f;
dstR = lum + (dstR - lum) * m_ColorGrading.saturation;
dstG = lum + (dstG - lum) * m_ColorGrading.saturation;
dstB = lum + (dstB - lum) * m_ColorGrading.saturation;
}
newC[i + (j * dim) + (k * dim * dim)] = new Color(dstR, dstG, dstB, 1.0f);
}
}
}
if (m_LutTex == null)
{
m_LutTex = new Texture3D(dim, dim, dim, TextureFormat.RGB24, false);
m_LutTex.filterMode = FilterMode.Bilinear;
m_LutTex.wrapMode = TextureWrapMode.Clamp;
m_LutTex.hideFlags = HideFlags.DontSave;
}
m_LutTex.SetPixels(newC);
m_LutTex.Apply();
}
void Create1DLut(float lutA,
SimplePolyFunc polyToe,
SimplePolyFunc polyLinear,
SimplePolyFunc polyShoulder,
float x0, float x1, float linearW,
float liftR, float invGammaR, float gainR,
float liftG, float invGammaG, float gainG,
float liftB, float invGammaB, float gainB)
{
int curveLen = 128;
Color[] newC = new Color[curveLen * 2];
float oneOverDim = 1.0f / (1.0f * curveLen - 1.0f);
for (int i = 0; i < curveLen; i++)
{
float srcR = (i * 1.0f) * oneOverDim;
float srcG = (i * 1.0f) * oneOverDim;
float srcB = (i * 1.0f) * oneOverDim;
float dstR = EvalFilmicHelper(srcR, lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW);
float dstG = EvalFilmicHelper(srcG, lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW);
float dstB = EvalFilmicHelper(srcB, lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW);
Color c = SampleLutLinear(dstR, dstG, dstB);
dstR = c.r;
dstG = c.g;
dstB = c.b;
dstR = EvalCurveGradingHelper(dstR, liftR, invGammaR, gainR);
dstG = EvalCurveGradingHelper(dstG, liftG, invGammaG, gainG);
dstB = EvalCurveGradingHelper(dstB, liftB, invGammaB, gainB);
// Saturation is done in the shader as it can't be baked into color curves
if (isLinearColorSpace)
{
dstR = Mathf.LinearToGammaSpace(dstR);
dstG = Mathf.LinearToGammaSpace(dstG);
dstB = Mathf.LinearToGammaSpace(dstB);
}
newC[i + 0 * curveLen] = new Color(dstR, dstG, dstB, 1.0f);
newC[i + 1 * curveLen] = new Color(dstR, dstG, dstB, 1.0f);
}
if (m_LutCurveTex1D == null)
{
m_LutCurveTex1D = new Texture2D(curveLen, 2, TextureFormat.RGB24, false);
m_LutCurveTex1D.filterMode = FilterMode.Bilinear;
m_LutCurveTex1D.wrapMode = TextureWrapMode.Clamp;
m_LutCurveTex1D.hideFlags = HideFlags.DontSave;
}
m_LutCurveTex1D.SetPixels(newC);
m_LutCurveTex1D.Apply();
}
void UpdateLut()
{
UpdateUserLut();
float lutA = GetLutA();
SimplePolyFunc polyToe;
SimplePolyFunc polyLinear;
SimplePolyFunc polyShoulder;
float gammaSpace = 2.2f;
float x0 = Mathf.Pow(1.0f / 3.0f, gammaSpace);
float shoulderBase = .7f;
float x1 = Mathf.Pow(shoulderBase, gammaSpace);
float gammaHighY = Mathf.Pow(shoulderBase, 1.0f + (m_FilmicCurve.lutShoulder) * 1.0f);
float y1 = Mathf.Pow(gammaHighY, gammaSpace);
float y0;
{
float t = x0 / x1;
float lin = t * y1;
float low = lin * (1.0f - m_FilmicCurve.toe * .5f);
y0 = low;
}
float dx = x1 - x0;
float dy = y1 - y0;
float m = 0.0f;
if (dx > 0 && dy > 0)
m = dy / dx;
// Linear section, power is 1, slope is m
polyLinear.x0 = x0;
polyLinear.y0 = y0;
polyLinear.A = m;
polyLinear.B = 1.0f;
polyLinear.signX = 1.0f;
polyLinear.signY = 1.0f;
polyLinear.logA = Mathf.Log(m);
// Toe
polyToe = polyLinear;
polyToe.Initialize(x0, y0, m);
float linearW = GetWhitePoint();
{
// Shoulder, first think about it "backwards"
float offsetX = linearW - x1;
float offsetY = 1.0f - y1;
polyShoulder = polyLinear;
polyShoulder.Initialize(offsetX, offsetY, m);
// Flip horizontal
polyShoulder.signX = -1.0f;
polyShoulder.x0 = -linearW;
// Flip vertical
polyShoulder.signY = -1.0f;
polyShoulder.y0 = 1.0f;
}
Color normS = NormalizeColor(m_ColorGrading.lutColors.shadows);
Color normM = NormalizeColor(m_ColorGrading.lutColors.midtones);
Color normH = NormalizeColor(m_ColorGrading.lutColors.highlights);
float avgS = (normS.r + normS.g + normS.b) / 3.0f;
float avgM = (normM.r + normM.g + normM.b) / 3.0f;
float avgH = (normH.r + normH.g + normH.b) / 3.0f;
// These are magic numbers
float liftScale = .1f;
float gammaScale = .5f;
float gainScale = .5f;
float liftR = (normS.r - avgS) * liftScale;
float liftG = (normS.g - avgS) * liftScale;
float liftB = (normS.b - avgS) * liftScale;
float gammaR = Mathf.Pow(2.0f, (normM.r - avgM) * gammaScale);
float gammaG = Mathf.Pow(2.0f, (normM.g - avgM) * gammaScale);
float gammaB = Mathf.Pow(2.0f, (normM.b - avgM) * gammaScale);
float gainR = Mathf.Pow(2.0f, (normH.r - avgH) * gainScale);
float gainG = Mathf.Pow(2.0f, (normH.g - avgH) * gainScale);
float gainB = Mathf.Pow(2.0f, (normH.b - avgH) * gainScale);
float minGamma = .01f;
float invGammaR = 1.0f / Mathf.Max(minGamma, gammaR);
float invGammaG = 1.0f / Mathf.Max(minGamma, gammaG);
float invGammaB = 1.0f / Mathf.Max(minGamma, gammaB);
if (!fastMode)
{
Create3DLut(lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW,
liftR, invGammaR, gainR,
liftG, invGammaG, gainG,
liftB, invGammaB, gainB);
}
else
{
// Instad of doing a single 3D lut, I tried doing this as 3x 1D luts. Or rather,
// a single lut with separate curves baked into RGB channels. It wasn't actually faster
// do it's disabled. But there are two reasons why in the future it might be useful:
// 1. If it turns out that 3x 1D luts are faster on some hardware, it might be worth it.
// 2. Updating the 3D LUT is quite slow so you can't change it every frame. If the
// parameters need to lerp than the 1D version might be worthwhile.
Create1DLut(lutA,
polyToe,
polyLinear,
polyShoulder,
x0, x1, linearW,
liftR, invGammaR, gainR,
liftG, invGammaG, gainG,
liftB, invGammaB, gainB);
}
}
public bool ValidDimensions(Texture2D tex2d)
{
if (!tex2d) return false;
int h = tex2d.height;
if (h != Mathf.FloorToInt(Mathf.Sqrt(tex2d.width))) return false;
return true;
}
public void Convert(Texture2D temp2DTex)
{
#if false
// Conversion fun: the given 2D texture needs to be of the format
// w * h, wheras h is the 'depth' (or 3d dimension 'dim') and w = dim * dim
if (temp2DTex)
{
int dim = temp2DTex.width * temp2DTex.height;
dim = temp2DTex.height;
if (!ValidDimensions(temp2DTex))
{
Debug.LogWarning("The given 2D texture " + temp2DTex.name + " cannot be used as a 3D LUT.");
//basedOnTempTex = "";
return;
}
Color[] c = temp2DTex.GetPixels();
Color[] newC = new Color[c.Length];
for (int i = 0; i < dim; i++)
{
for (int j = 0; j < dim; j++)
{
for (int k = 0; k < dim; k++)
{
int j_ = dim - j - 1;
newC[i + (j * dim) + (k * dim * dim)] = c[k * dim + i + j_ * dim * dim];
}
}
}
if (converted3DLut)
DestroyImmediate(converted3DLut);
converted3DLut = new Texture3D(dim, dim, dim, TextureFormat.ARGB32, false);
converted3DLut.SetPixels(newC);
converted3DLut.Apply();
userLutTexName = temp2DTex.name;
}
else
{
// error, something went terribly wrong
//Debug.LogError("Couldn't color correct with 3D LUT texture. Image Effect will be disabled.");
SetIdentityLut();
userLutTexName = "";
}
#endif
}
void OnDisable()
{
if (m_TonemapMaterial)
{
DestroyImmediate(m_TonemapMaterial);
m_TonemapMaterial = null;
}
if (m_LutTex)
{
DestroyImmediate(m_LutTex);
m_LutTex = null;
}
if (m_LutCurveTex1D)
{
DestroyImmediate(m_LutCurveTex1D);
m_LutCurveTex1D = null;
}
#if UNITY_EDITOR
m_RTU.ReleaseAllTemporyRenderTexutres();
#endif
}
// The image filter chain will continue in LDR
[ImageEffectTransformsToLDR]
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
if (tonemapMaterial == null)
{
Graphics.Blit(source, destination);
return;
}
if (m_LutTex == null || m_Dirty)
{
UpdateLut();
m_Dirty = false;
}
#if UNITY_EDITOR
validRenderTextureFormat = true;
if (source.format != RenderTextureFormat.ARGBHalf)
validRenderTextureFormat = false;
#endif
if (fastMode)
tonemapMaterial.SetTexture("_LutTex1D", m_LutCurveTex1D);
else
tonemapMaterial.SetTexture("_LutTex", m_LutTex);
float lutA = GetLutA();
float exposureBias = Mathf.Pow(2.0f, m_FilmicCurve.enabled ? m_FilmicCurve.exposureBias : 0.0f);
Vector4 exposureMult = new Vector4(exposureBias, exposureBias, exposureBias, 1.0f);
Color linWB = new Color(1.0f, 1.0f, 1.0f, 1.0f);
if (m_ColorGrading.enabled)
{
linWB.r = Mathf.Pow(m_ColorGrading.whiteBalance.r, 2.2f);
linWB.g = Mathf.Pow(m_ColorGrading.whiteBalance.g, 2.2f);
linWB.b = Mathf.Pow(m_ColorGrading.whiteBalance.b, 2.2f);
Color normWB = NormalizeColor(linWB);
exposureMult.x *= normWB.r;
exposureMult.y *= normWB.g;
exposureMult.z *= normWB.b;
}
tonemapMaterial.SetFloat("_LutA", lutA);
tonemapMaterial.SetVector("_LutExposureMult", exposureMult);
tonemapMaterial.SetFloat("_Vibrance", m_ColorGrading.enabled ? m_ColorGrading.saturation : 1f);
int pass;
if (debugClamp)
pass = (int)(fastMode ? Passes.OneDDebug : Passes.ThreeDDebug);
else
pass = (int)(fastMode ? Passes.OneD : Passes.ThreeD);
Graphics.Blit(source, destination, tonemapMaterial, pass);
#if UNITY_EDITOR
// if we have an on frame end callabck
// we need to pass a valid result texture
// if destination is null we wrote to the
// backbuffer so we need to copy that out.
// It's slow and not amazing, but editor only
if (onFrameEndEditorOnly != null)
{
if (destination == null)
{
var temp = m_RTU.GetTemporaryRenderTexture(source.width, source.height);
Graphics.Blit(source, temp, tonemapMaterial, pass);
onFrameEndEditorOnly(temp, tonemapMaterial);
m_RTU.ReleaseTemporaryRenderTexture(temp);
}
else
onFrameEndEditorOnly(destination, tonemapMaterial);
}
#endif
}
}
}
fileFormatVersion: 2
guid: 58a7625302996c94ba07a8ca3351f668
timeCreated: 1441719330
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences:
- histogramComputeShader: {fileID: 7200000, guid: 5ee4b74fa28a3e74e89423dd49705fc5,
type: 3}
- histogramShader: {fileID: 4800000, guid: 9a8e838691462194482a43a02e424876, type: 3}
- userLutTex: {instanceID: 0}
- tonemapShader: {fileID: 4800000, guid: 964b34bbab7f5e64fa40f37eaccac1ad, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ee6b229baf1680a4a9bd9fc22c8b3423
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b22e899bf1bc54e42931d6e9fb32dc46
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: fdacfcd8febaa6647b67d48083d1f8b6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: lambert1
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 2800000, guid: a201057f7c8ada445be10c8dfa23d0d5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 98cfea690c486ce4689f526223a10803, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 6fa2bea2d668d814a85e05c80c3d0b16, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 2800000, guid: e7ea2edde70414b4fae49ec9bf15d99c, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 0.28
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
fileFormatVersion: 2
guid: 6dda223642e9058459ae58d35e8e432c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 57ff23ded021fdd43841a2d1c23c5f27
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e7ea2edde70414b4fae49ec9bf15d99c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 98cfea690c486ce4689f526223a10803
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 6fa2bea2d668d814a85e05c80c3d0b16
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: a201057f7c8ada445be10c8dfa23d0d5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
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: 1
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: cd58d3dcc64fc9f4283b557750f3801d
ModelImporter:
serializedVersion: 19300
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 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
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Turn_Move : MonoBehaviour {
public float TurnX;
public float TurnY;
public float TurnZ;
public float MoveX;
public float MoveY;
public float MoveZ;
public bool World;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (World == true) {
transform.Rotate(TurnX * Time.deltaTime,TurnY * Time.deltaTime,TurnZ * Time.deltaTime, Space.World);
transform.Translate(MoveX * Time.deltaTime, MoveY * Time.deltaTime, MoveZ * Time.deltaTime, Space.World);
}else{
transform.Rotate(TurnX * Time.deltaTime,TurnY * Time.deltaTime,TurnZ * Time.deltaTime, Space.Self);
transform.Translate(MoveX * Time.deltaTime, MoveY * Time.deltaTime, MoveZ * Time.deltaTime, Space.Self);
}
}
}
fileFormatVersion: 2
guid: 7b37e471ebed5b446a9ef02d59b2bef0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f65d757aea423a34caded038701e10ad
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
%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: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.23584908, g: 0.23584908, b: 0.23584908, a: 0}
m_AmbientEquatorColor: {r: 0, g: 0, b: 0, a: 0}
m_AmbientGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_AmbientIntensity: 0
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 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: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 5
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 1
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 15200, guid: 0000000000000000f000000000000000,
type: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 2
m_PVRSampling: 1
m_PVRDirectSampleCount: 500
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
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: b93b6a13a2ea1be40840abd310b8040a,
type: 2}
m_UseShadowmask: 0
--- !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
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &151300271
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 151300272}
- component: {fileID: 151300275}
- component: {fileID: 151300274}
- component: {fileID: 151300273}
m_Layer: 0
m_Name: Showcase_base (5)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &151300272
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151300271}
m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -2.2771053, y: -0.62016404, z: -0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1223655066}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &151300273
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151300271}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 49924851be85d38429b411d5f0d239f9, type: 3}
m_Name:
m_EditorClassIdentifier:
wallsColor: {r: 1, g: 1, b: 1, a: 1}
baseColor: {r: 0.4245283, g: 0.4245283, b: 0.4245283, a: 1}
textColor: {r: 1, g: 1, b: 1, a: 1}
baseText: This Matball is Chromed.
lightColor: {r: 1, g: 1, b: 1, a: 1}
lightIntensity: 1.3
--- !u!23 &151300274
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151300271}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7106f0947d0801046a5d830966fd4dd7, type: 2}
- {fileID: 2100000, guid: 0aa302868ebb2314f833d57046287d9a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &151300275
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151300271}
m_Mesh: {fileID: 4300000, guid: 577f53a370eada241a98b3b9e5a94841, type: 3}
--- !u!1001 &205964128
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1223655066}
m_Modifications:
- target: {fileID: 100000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 100000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_Name
value: Showcase_cap (1)
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_LocalPosition.x
value: -3.6571054
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_LocalPosition.y
value: 0.825336
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_LocalPosition.z
value: 0.79990906
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_LocalRotation.x
value: -1.5543122e-15
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_LocalRotation.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_LocalRotation.z
value: 0.000000021855694
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_LocalRotation.w
value: -0.00000010430813
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2300000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
propertyPath: m_CastShadows
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e090c14bda23a354a8941ec5323af01b, type: 3}
--- !u!4 &205964129 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 400000, guid: e090c14bda23a354a8941ec5323af01b,
type: 3}
m_PrefabInstance: {fileID: 205964128}
m_PrefabAsset: {fileID: 0}
--- !u!33 &420346029
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 423424661}
m_Mesh: {fileID: 4300000, guid: 577f53a370eada241a98b3b9e5a94841, type: 3}
--- !u!23 &421380343
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 423424661}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7106f0947d0801046a5d830966fd4dd7, type: 2}
- {fileID: 2100000, guid: 0aa302868ebb2314f833d57046287d9a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!4 &423226425
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 423424661}
m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.67925024, y: -0.62016404, z: -0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1223655066}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &423424661
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 423226425}
- component: {fileID: 420346029}
- component: {fileID: 421380343}
- component: {fileID: 428992919}
m_Layer: 0
m_Name: Showcase_base (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!114 &428992919
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 423424661}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 49924851be85d38429b411d5f0d239f9, type: 3}
m_Name:
m_EditorClassIdentifier:
wallsColor: {r: 1, g: 1, b: 1, a: 1}
baseColor: {r: 0.5188679, g: 0, b: 0, a: 1}
textColor: {r: 1, g: 1, b: 1, a: 1}
baseText: This Matball is Chromed.
lightColor: {r: 1, g: 1, b: 1, a: 1}
lightIntensity: 1.3
--- !u!1 &576361546
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 576361548}
- component: {fileID: 576361547}
m_Layer: 0
m_Name: Base_light (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!108 &576361547
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 576361546}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.3
m_Range: 6.95
m_SpotAngle: 165
m_InnerSpotAngle: 159.24054
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 0.801
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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_ShadowRadius: 5
m_ShadowAngle: 0
--- !u!4 &576361548
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 576361546}
m_LocalRotation: {x: 0.65816957, y: -0, z: -0, w: 0.7528698}
m_LocalPosition: {x: 0.67925024, y: 2.4698358, z: 0.5833902}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 82.32101, y: 0, z: 0}
--- !u!1 &591057949
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 591057954}
- component: {fileID: 591057953}
- component: {fileID: 591057951}
- component: {fileID: 591057950}
- component: {fileID: 591057952}
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 &591057950
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
--- !u!124 &591057951
Behaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
--- !u!114 &591057952
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
m_Name:
m_EditorClassIdentifier:
volumeTrigger: {fileID: 591057954}
volumeLayer:
serializedVersion: 2
m_Bits: 256
stopNaNPropagation: 1
finalBlitToCameraTarget: 0
antialiasingMode: 1
temporalAntialiasing:
jitterSpread: 0.75
sharpness: 0.25
stationaryBlending: 0.95
motionBlending: 0.85
subpixelMorphologicalAntialiasing:
quality: 2
fastApproximateAntialiasing:
fastMode: 0
keepAlpha: 0
fog:
enabled: 1
excludeSkybox: 1
debugLayer:
lightMeter:
width: 512
height: 256
showCurves: 1
histogram:
width: 512
height: 256
channel: 3
waveform:
exposure: 0.12
height: 256
vectorscope:
size: 256
exposure: 0.12
overlaySettings:
linearDepth: 0
motionColorIntensity: 4
motionGridSize: 64
colorBlindnessType: 0
colorBlindnessStrength: 1
m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2}
m_ShowToolkit: 0
m_ShowCustomSorter: 0
breakBeforeColorGrading: 0
m_BeforeTransparentBundles: []
m_BeforeStackBundles: []
m_AfterStackBundles: []
--- !u!20 &591057953
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
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: 1000
field of view: 45
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: 3
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 &591057954
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_LocalRotation: {x: 0, y: 0.92310953, z: 0, w: -0.38453722}
m_LocalPosition: {x: 1.145, y: 1, z: 3.976}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &623366864
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 623366866}
- component: {fileID: 623366865}
m_Layer: 8
m_Name: PostProcessing
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &623366865
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 623366864}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3}
m_Name:
m_EditorClassIdentifier:
sharedProfile: {fileID: 11400000, guid: fb10bece07b6ef14296459b864d31d99, type: 2}
isGlobal: 1
blendDistance: 0
weight: 1
priority: 0
--- !u!4 &623366866
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 623366864}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -6.307193, y: 0.27106413, z: -5.033606}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &950789265
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1223655066}
m_Modifications:
- target: {fileID: 127556, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_LocalPosition.x
value: 5.1028943
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_LocalPosition.y
value: 0.82583594
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_LocalPosition.z
value: 0.79939026
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_LocalRotation.x
value: 0.000000021855694
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2f9795fa03122d3478a4dc1d0b7b712c, type: 3}
--- !u!4 &950789266 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 422306, guid: 2f9795fa03122d3478a4dc1d0b7b712c,
type: 3}
m_PrefabInstance: {fileID: 950789265}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1150091498
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1150091499}
m_Layer: 0
m_Name: "\u706F\u5149"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1150091499
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1150091498}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.6792502, y: 0.62016404, z: 0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1663875434}
- {fileID: 576361548}
- {fileID: 1300370214}
- {fileID: 1598400920}
- {fileID: 2122775686}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1223655065
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1223655066}
m_Layer: 0
m_Name: "\u5C55\u53F0\u6A21\u578B"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &1223655066
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1223655065}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.6792502, y: 0.62016404, z: 0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 423226425}
- {fileID: 950789266}
- {fileID: 205964129}
- {fileID: 151300272}
- {fileID: 1298749437}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1298749436
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1298749437}
- component: {fileID: 1298749440}
- component: {fileID: 1298749439}
- component: {fileID: 1298749438}
m_Layer: 0
m_Name: Showcase_base (6)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &1298749437
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298749436}
m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 3.6328945, y: -0.62016404, z: -0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1223655066}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1298749438
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298749436}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 49924851be85d38429b411d5f0d239f9, type: 3}
m_Name:
m_EditorClassIdentifier:
wallsColor: {r: 1, g: 1, b: 1, a: 1}
baseColor: {r: 0.4245283, g: 0.4245283, b: 0.4245283, a: 1}
textColor: {r: 1, g: 1, b: 1, a: 1}
baseText: This Matball is Chromed.
lightColor: {r: 1, g: 1, b: 1, a: 1}
lightIntensity: 1.3
--- !u!23 &1298749439
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298749436}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7106f0947d0801046a5d830966fd4dd7, type: 2}
- {fileID: 2100000, guid: 0aa302868ebb2314f833d57046287d9a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1298749440
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298749436}
m_Mesh: {fileID: 4300000, guid: 577f53a370eada241a98b3b9e5a94841, type: 3}
--- !u!1 &1300370212
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1300370214}
- component: {fileID: 1300370213}
m_Layer: 0
m_Name: Base_Reflection (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!215 &1300370213
ReflectionProbe:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1300370212}
m_Enabled: 1
serializedVersion: 2
m_Type: 0
m_Mode: 0
m_RefreshMode: 0
m_TimeSlicingMode: 0
m_Resolution: 256
m_UpdateFrequency: 0
m_BoxSize: {x: 10.063652, y: 3.1978645, z: 5.2192793}
m_BoxOffset: {x: 0.0821228, y: 0.3745439, z: 1.4525723}
m_NearClip: 0.3
m_FarClip: 1000
m_ShadowDistance: 100
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_IntensityMultiplier: 1.03
m_BlendDistance: 1
m_HDR: 1
m_BoxProjection: 1
m_RenderDynamicObjects: 0
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!4 &1300370214
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1300370212}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.67925024, y: 0.43702614, z: -0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1322329128
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1968771648}
m_Modifications:
- target: {fileID: -5426758703216422906, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.52425027
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.22
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.44060984
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.x
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.y
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.z
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Name
value: "\u97F3\u7BB1 (1)"
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 1022756723368469893, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 6200443131042155592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
- target: {fileID: 8249115927918959592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cd58d3dcc64fc9f4283b557750f3801d, type: 3}
--- !u!4 &1322329129 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1322329128}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1495209165
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1968771648}
m_Modifications:
- target: {fileID: -5426758703216422906, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.x
value: -2.16075
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.22
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.44060984
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.x
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.y
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.z
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Name
value: "\u97F3\u7BB1 (3)"
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 1022756723368469893, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 6200443131042155592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
- target: {fileID: 8249115927918959592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cd58d3dcc64fc9f4283b557750f3801d, type: 3}
--- !u!4 &1495209166 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1495209165}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1598400918
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1598400920}
- component: {fileID: 1598400919}
m_Layer: 0
m_Name: Base_light (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!108 &1598400919
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1598400918}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.3
m_Range: 12.51
m_SpotAngle: 165
m_InnerSpotAngle: 159.24054
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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_ShadowRadius: 5
m_ShadowAngle: 0
--- !u!4 &1598400920
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1598400918}
m_LocalRotation: {x: -0.048618965, y: 0.9228399, z: -0.12423657, w: -0.3613421}
m_LocalPosition: {x: 4.9592505, y: 1.566836, z: 4.49139}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 111.75699, y: -0.000015258789, z: -0.000015258789}
--- !u!1 &1663875432
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1663875434}
- component: {fileID: 1663875433}
m_Layer: 0
m_Name: Point Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1663875433
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1663875432}
m_Enabled: 1
serializedVersion: 10
m_Type: 2
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 16.33
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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: 2
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_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1663875434
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1663875432}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.2292502, y: 1.498, z: 1.64}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1968771647
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1968771648}
m_Layer: 0
m_Name: "\u6A21\u578B"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &1968771648
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1968771647}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.6792502, y: 0.62016404, z: 0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1495209166}
- {fileID: 1992367576}
- {fileID: 1322329129}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1992367575
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1968771648}
m_Modifications:
- target: {fileID: -5426758703216422906, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.x
value: 3.7292502
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.206
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.44060984
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.x
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.y
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.z
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Name
value: "\u97F3\u7BB1 (2)"
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 1022756723368469893, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_StaticEditorFlags
value: 4294967295
objectReference: {fileID: 0}
- target: {fileID: 6200443131042155592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
- target: {fileID: 8249115927918959592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cd58d3dcc64fc9f4283b557750f3801d, type: 3}
--- !u!4 &1992367576 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1992367575}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2122775684
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2122775686}
- component: {fileID: 2122775685}
m_Layer: 0
m_Name: Base_light (5)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!108 &2122775685
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122775684}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.3
m_Range: 12.51
m_SpotAngle: 165
m_InnerSpotAngle: 159.24054
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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_ShadowRadius: 5
m_ShadowAngle: 0
--- !u!4 &2122775686
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122775684}
m_LocalRotation: {x: 0.06554879, y: 0.88711536, z: -0.13298464, w: 0.43708673}
m_LocalPosition: {x: -4.30075, y: 1.839836, z: 3.9033904}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
fileFormatVersion: 2
guid: fe4b61bdabd659a428943b799cdf8243
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b93b6a13a2ea1be40840abd310b8040a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8c07acd03149a5041859a70d4accfb89
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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: 1
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 3
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
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
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
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: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8cf6bd5691a62ce4793ad04b559c46e7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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: 1
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 3
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
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: 0
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 6
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 2
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: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 743a0bbc8662fd5428e05d8bde1673d9
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 1
seamlessCubemap: 1
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 2
aniso: 0
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
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: 2
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 100
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: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
%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: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0, g: 0, b: 0, a: 0}
m_AmbientEquatorColor: {r: 0, g: 0, b: 0, a: 0}
m_AmbientGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_AmbientIntensity: 0
m_AmbientMode: 3
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: 0}
m_IndirectSpecularColor: {r: 1e-45, g: 0, b: 2.4287684, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 5
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 1
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: 1024
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
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: 112000015, guid: b142d65bd75e58543bbb704007c0a19e,
type: 2}
m_UseShadowmask: 0
--- !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
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &17486749 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1495209165}
m_PrefabAsset: {fileID: 0}
--- !u!114 &17486750
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 17486749}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7b37e471ebed5b446a9ef02d59b2bef0, type: 3}
m_Name:
m_EditorClassIdentifier:
TurnX: 0
TurnY: 20
TurnZ: 0
MoveX: 0
MoveY: 0
MoveZ: 0
World: 0
--- !u!1 &151300271
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 151300272}
- component: {fileID: 151300275}
- component: {fileID: 151300274}
m_Layer: 0
m_Name: Showcase_base (5)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &151300272
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151300271}
m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -2.2771053, y: -0.62016404, z: -0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1223655066}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &151300274
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151300271}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7106f0947d0801046a5d830966fd4dd7, type: 2}
- {fileID: 2100000, guid: 0aa302868ebb2314f833d57046287d9a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &151300275
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151300271}
m_Mesh: {fileID: 4300000, guid: 577f53a370eada241a98b3b9e5a94841, type: 3}
--- !u!1 &370085042 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1322329128}
m_PrefabAsset: {fileID: 0}
--- !u!114 &370085043
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 370085042}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7b37e471ebed5b446a9ef02d59b2bef0, type: 3}
m_Name:
m_EditorClassIdentifier:
TurnX: 0
TurnY: 20
TurnZ: 0
MoveX: 0
MoveY: 0
MoveZ: 0
World: 0
--- !u!33 &420346029
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 423424661}
m_Mesh: {fileID: 4300000, guid: 577f53a370eada241a98b3b9e5a94841, type: 3}
--- !u!23 &421380343
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 423424661}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7106f0947d0801046a5d830966fd4dd7, type: 2}
- {fileID: 2100000, guid: 0aa302868ebb2314f833d57046287d9a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!4 &423226425
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 423424661}
m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.67925024, y: -0.62016404, z: -0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1223655066}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &423424661
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 423226425}
- component: {fileID: 420346029}
- component: {fileID: 421380343}
m_Layer: 0
m_Name: Showcase_base (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!1 &576361546
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 576361548}
- component: {fileID: 576361547}
m_Layer: 0
m_Name: Base_light (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &576361547
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 576361546}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.3
m_Range: 6.95
m_SpotAngle: 165
m_InnerSpotAngle: 159.24054
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 0.801
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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_ShadowRadius: 5
m_ShadowAngle: 0
--- !u!4 &576361548
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 576361546}
m_LocalRotation: {x: 0.65816957, y: -0, z: -0, w: 0.7528698}
m_LocalPosition: {x: 0.67925024, y: 2.4698358, z: 0.5833902}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 82.32101, y: 0, z: 0}
--- !u!1 &591057949
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 591057954}
- component: {fileID: 591057953}
- component: {fileID: 591057951}
- component: {fileID: 591057950}
- component: {fileID: 591057952}
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 &591057950
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
--- !u!124 &591057951
Behaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
--- !u!114 &591057952
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3}
m_Name:
m_EditorClassIdentifier:
volumeTrigger: {fileID: 591057954}
volumeLayer:
serializedVersion: 2
m_Bits: 256
stopNaNPropagation: 1
finalBlitToCameraTarget: 0
antialiasingMode: 1
temporalAntialiasing:
jitterSpread: 0.75
sharpness: 0.25
stationaryBlending: 0.95
motionBlending: 0.85
subpixelMorphologicalAntialiasing:
quality: 2
fastApproximateAntialiasing:
fastMode: 0
keepAlpha: 0
fog:
enabled: 1
excludeSkybox: 1
debugLayer:
lightMeter:
width: 512
height: 256
showCurves: 1
histogram:
width: 512
height: 256
channel: 3
waveform:
exposure: 0.12
height: 256
vectorscope:
size: 256
exposure: 0.12
overlaySettings:
linearDepth: 0
motionColorIntensity: 4
motionGridSize: 64
colorBlindnessType: 0
colorBlindnessStrength: 1
m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2}
m_ShowToolkit: 0
m_ShowCustomSorter: 0
breakBeforeColorGrading: 0
m_BeforeTransparentBundles: []
m_BeforeStackBundles: []
m_AfterStackBundles: []
--- !u!20 &591057953
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
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: 1000
field of view: 45
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: 3
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 &591057954
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 591057949}
m_LocalRotation: {x: 0, y: 0.92310953, z: 0, w: -0.38453722}
m_LocalPosition: {x: 1.145, y: 1, z: 3.976}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &623366864
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 623366866}
- component: {fileID: 623366865}
m_Layer: 8
m_Name: PostProcessing
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &623366865
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 623366864}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3}
m_Name:
m_EditorClassIdentifier:
sharedProfile: {fileID: 11400000, guid: fb10bece07b6ef14296459b864d31d99, type: 2}
isGlobal: 1
blendDistance: 0
weight: 1
priority: 0
--- !u!4 &623366866
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 623366864}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -6.307193, y: 0.27106413, z: -5.033606}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1150091498
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1150091499}
m_Layer: 0
m_Name: "\u706F\u5149"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1150091499
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1150091498}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.6792502, y: 0.62016404, z: 0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1663875434}
- {fileID: 576361548}
- {fileID: 1300370214}
- {fileID: 1598400920}
- {fileID: 2122775686}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1223655065
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1223655066}
m_Layer: 0
m_Name: "\u5C55\u53F0\u6A21\u578B"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1223655066
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1223655065}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.6792502, y: 0.62016404, z: 0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 423226425}
- {fileID: 151300272}
- {fileID: 1298749437}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1298749436
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1298749437}
- component: {fileID: 1298749440}
- component: {fileID: 1298749439}
m_Layer: 0
m_Name: Showcase_base (6)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &1298749437
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298749436}
m_LocalRotation: {x: 0.000000021855694, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 3.6328945, y: -0.62016404, z: -0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1223655066}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &1298749439
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298749436}
m_Enabled: 1
m_CastShadows: 2
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 7106f0947d0801046a5d830966fd4dd7, type: 2}
- {fileID: 2100000, guid: 0aa302868ebb2314f833d57046287d9a, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1298749440
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1298749436}
m_Mesh: {fileID: 4300000, guid: 577f53a370eada241a98b3b9e5a94841, type: 3}
--- !u!1 &1300370212
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1300370214}
- component: {fileID: 1300370213}
m_Layer: 0
m_Name: Base_Reflection (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!215 &1300370213
ReflectionProbe:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1300370212}
m_Enabled: 1
serializedVersion: 2
m_Type: 0
m_Mode: 1
m_RefreshMode: 0
m_TimeSlicingMode: 0
m_Resolution: 256
m_UpdateFrequency: 0
m_BoxSize: {x: 10.063652, y: 3.1978645, z: 5.2192793}
m_BoxOffset: {x: -0.14360428, y: -0.11929965, z: -0.53927207}
m_NearClip: 0.3
m_FarClip: 1000
m_ShadowDistance: 100
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_IntensityMultiplier: 1.03
m_BlendDistance: 1
m_HDR: 1
m_BoxProjection: 1
m_RenderDynamicObjects: 0
m_UseOcclusionCulling: 1
m_Importance: 1
m_CustomBakedTexture: {fileID: 0}
--- !u!4 &1300370214
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1300370212}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.9049773, y: 0.9308697, z: 1.3452346}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1322329128
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1968771648}
m_Modifications:
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.x
value: 0.663
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.22
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.567
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.y
value: -0.01759623
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.w
value: -0.99984527
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -357.984
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.x
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.y
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.z
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Name
value: "\u97F3\u7BB1 (1)"
objectReference: {fileID: 0}
- target: {fileID: 6200443131042155592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
- target: {fileID: 8249115927918959592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cd58d3dcc64fc9f4283b557750f3801d, type: 3}
--- !u!4 &1322329129 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1322329128}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1495209165
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1968771648}
m_Modifications:
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.x
value: -2.34
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.22
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.657
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.x
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.y
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.z
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Name
value: "\u97F3\u7BB1 (3)"
objectReference: {fileID: 0}
- target: {fileID: 6200443131042155592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
- target: {fileID: 8249115927918959592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cd58d3dcc64fc9f4283b557750f3801d, type: 3}
--- !u!4 &1495209166 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1495209165}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1598400918
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1598400920}
- component: {fileID: 1598400919}
m_Layer: 0
m_Name: Base_light (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1598400919
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1598400918}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.3
m_Range: 12.51
m_SpotAngle: 165
m_InnerSpotAngle: 159.24054
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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_ShadowRadius: 5
m_ShadowAngle: 0
--- !u!4 &1598400920
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1598400918}
m_LocalRotation: {x: -0.05957127, y: 0.91261613, z: -0.14382546, w: -0.3780177}
m_LocalPosition: {x: 5.859572, y: 0.6048485, z: 0.81379396}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 15.257001, y: -131.373, z: 1.5500001}
--- !u!1 &1628272044 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1992367575}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1628272045
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1628272044}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7b37e471ebed5b446a9ef02d59b2bef0, type: 3}
m_Name:
m_EditorClassIdentifier:
TurnX: 0
TurnY: 20
TurnZ: 0
MoveX: 0
MoveY: 0
MoveZ: 0
World: 0
--- !u!1 &1663875432
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1663875434}
- component: {fileID: 1663875433}
m_Layer: 0
m_Name: Point Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1663875433
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1663875432}
m_Enabled: 1
serializedVersion: 10
m_Type: 2
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 16.33
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1663875434
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1663875432}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.2292502, y: 1.069836, z: 5.1533904}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1968771647
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1968771648}
m_Layer: 0
m_Name: "\u6A21\u578B"
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1968771648
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1968771647}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.6792502, y: 0.62016404, z: 0.64660984}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1495209166}
- {fileID: 1992367576}
- {fileID: 1322329129}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1992367575
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1968771648}
m_Modifications:
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.x
value: 3.7292502
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.y
value: -0.22
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalPosition.z
value: -0.7
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.x
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.y
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_LocalScale.z
value: 5.3853
objectReference: {fileID: 0}
- target: {fileID: -927199367670048503, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Name
value: "\u97F3\u7BB1 (2)"
objectReference: {fileID: 0}
- target: {fileID: 6200443131042155592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
- target: {fileID: 8249115927918959592, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 6dda223642e9058459ae58d35e8e432c, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: cd58d3dcc64fc9f4283b557750f3801d, type: 3}
--- !u!4 &1992367576 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -4216859302048453862, guid: cd58d3dcc64fc9f4283b557750f3801d,
type: 3}
m_PrefabInstance: {fileID: 1992367575}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2122775684
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2122775686}
- component: {fileID: 2122775685}
m_Layer: 0
m_Name: Base_light (5)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &2122775685
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122775684}
m_Enabled: 1
serializedVersion: 10
m_Type: 0
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1.3
m_Range: 12.51
m_SpotAngle: 165
m_InnerSpotAngle: 159.24054
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
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_ShadowRadius: 5
m_ShadowAngle: 0
--- !u!4 &2122775686
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2122775684}
m_LocalRotation: {x: 0.06554879, y: 0.88711536, z: -0.13298464, w: 0.43708673}
m_LocalPosition: {x: -4.30075, y: 1.839836, z: 3.9033904}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1150091499}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
fileFormatVersion: 2
guid: 5d7557523c8a54349aca22fc1674b430
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment