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:
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:
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:
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:
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:
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:
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:
fileFormatVersion: 2
guid: eb0236f80884a1f4793c96b4d2da5c68
timeCreated: 1446039760
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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:
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:
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:
fileFormatVersion: 2
guid: 5ee4b74fa28a3e74e89423dd49705fc5
timeCreated: 1436170077
licenseType: Store
ComputeShaderImporter:
currentBuildTarget: 5
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 964b34bbab7f5e64fa40f37eaccac1ad
timeCreated: 1435513939
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 9a8e838691462194482a43a02e424876
timeCreated: 1436173774
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ee6b229baf1680a4a9bd9fc22c8b3423
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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