Add AmplifyBloom
9
Assets/AmplifyBloom/Plugins.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 929d54d66cabf2f468e71b1f37e3c82e
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1449660370
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Plugins/AmplifyBloom.dll
Normal file
24
Assets/AmplifyBloom/Plugins/AmplifyBloom.dll.meta
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1344eb354a4f5c84e906b0362a044e38
|
||||||
|
timeCreated: 1454436109
|
||||||
|
licenseType: Store
|
||||||
|
PluginImporter:
|
||||||
|
serializedVersion: 1
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
isPreloaded: 0
|
||||||
|
platformData:
|
||||||
|
Any:
|
||||||
|
enabled: 1
|
||||||
|
settings: {}
|
||||||
|
Editor:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
WindowsStoreApps:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
1133
Assets/AmplifyBloom/Plugins/AmplifyBloomBase.cs
Normal file
12
Assets/AmplifyBloom/Plugins/AmplifyBloomBase.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b553d0142ed085643beceeb17a1cc53f
|
||||||
|
timeCreated: 1450374775
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
12
Assets/AmplifyBloom/Plugins/AmplifyBloomEffect.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
[ExecuteInEditMode]
|
||||||
|
[System.Serializable]
|
||||||
|
[RequireComponent( typeof( Camera ) )]
|
||||||
|
[AddComponentMenu( "Image Effects/Amplify Bloom")]
|
||||||
|
public sealed class AmplifyBloomEffect : AmplifyBloomBase { }
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/AmplifyBloomEffect.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9b8c208e531a26a41a4629789f4a706a
|
||||||
|
timeCreated: 1450374788
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {fileID: 2800000, guid: a01cbbdf250cc3f45a0f180140bb24e0, type: 3}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Plugins/Editor.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4f67db82a022d0a4e8bfbc831c3e26e6
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1447243327
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
86
Assets/AmplifyBloom/Plugins/Editor/About.cs
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public class About : EditorWindow
|
||||||
|
{
|
||||||
|
private const string AboutImagePath = "AmplifyBloom/Textures/About.png";
|
||||||
|
private Vector2 m_scrollPosition = Vector2.zero;
|
||||||
|
private Texture2D m_aboutImage;
|
||||||
|
|
||||||
|
[MenuItem( "Window/Amplify Bloom/About...", false, 20 )]
|
||||||
|
static void Init()
|
||||||
|
{
|
||||||
|
About window = ( About ) GetWindow( typeof( About ), true, "About Amplify Bloom" );
|
||||||
|
window.minSize = new Vector2( 502, 290 );
|
||||||
|
window.maxSize = new Vector2( 502, 290 );
|
||||||
|
window.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnFocus()
|
||||||
|
{
|
||||||
|
string[] guids = AssetDatabase.FindAssets( "About t:Texture" );
|
||||||
|
string asset = "";
|
||||||
|
|
||||||
|
foreach ( string guid in guids )
|
||||||
|
{
|
||||||
|
string path = AssetDatabase.GUIDToAssetPath( guid );
|
||||||
|
if ( path.EndsWith( AboutImagePath ) )
|
||||||
|
{
|
||||||
|
asset = path;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !string.IsNullOrEmpty( asset ) )
|
||||||
|
{
|
||||||
|
TextureImporter importer = AssetImporter.GetAtPath( asset ) as TextureImporter;
|
||||||
|
|
||||||
|
if ( importer.textureType != TextureImporterType.GUI )
|
||||||
|
{
|
||||||
|
importer.textureType = TextureImporterType.GUI;
|
||||||
|
AssetDatabase.ImportAsset( asset );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_aboutImage = AssetDatabase.LoadAssetAtPath( asset, typeof( Texture2D ) ) as Texture2D;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.LogWarning( "[AmplifyBloom] About image not found at " + AboutImagePath );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnGUI()
|
||||||
|
{
|
||||||
|
m_scrollPosition = GUILayout.BeginScrollView( m_scrollPosition );
|
||||||
|
|
||||||
|
GUILayout.BeginVertical();
|
||||||
|
|
||||||
|
GUILayout.Space( 10 );
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
GUILayout.Box( m_aboutImage, GUIStyle.none );
|
||||||
|
|
||||||
|
if ( Event.current.type == EventType.MouseUp && GUILayoutUtility.GetLastRect().Contains( Event.current.mousePosition ) )
|
||||||
|
Application.OpenURL( "http://www.amplify.pt" );
|
||||||
|
|
||||||
|
GUILayout.FlexibleSpace();
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
GUIStyle labelStyle = new GUIStyle( EditorStyles.label );
|
||||||
|
labelStyle.alignment = TextAnchor.MiddleCenter;
|
||||||
|
labelStyle.wordWrap = true;
|
||||||
|
|
||||||
|
GUILayout.Label( "\nAmplify Bloom " + VersionInfo.StaticToString(), labelStyle, GUILayout.ExpandWidth( true ) );
|
||||||
|
|
||||||
|
GUILayout.Label( "\nCopyright (c) Amplify Creations, Lda. All rights reserved.\n", labelStyle, GUILayout.ExpandWidth( true ) );
|
||||||
|
|
||||||
|
GUILayout.EndVertical();
|
||||||
|
|
||||||
|
GUILayout.EndScrollView();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Editor/About.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7f402ae73c9163e45b637430b719b6bb
|
||||||
|
timeCreated: 1449660979
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Plugins/Editor/AmplifyBloomEditor.dll
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e466a10d7a3c1ea40be59051b1ddaeed
|
||||||
|
timeCreated: 1454436112
|
||||||
|
licenseType: Store
|
||||||
|
PluginImporter:
|
||||||
|
serializedVersion: 1
|
||||||
|
iconMap: {}
|
||||||
|
executionOrder: {}
|
||||||
|
isPreloaded: 0
|
||||||
|
platformData:
|
||||||
|
Any:
|
||||||
|
enabled: 0
|
||||||
|
settings: {}
|
||||||
|
Editor:
|
||||||
|
enabled: 1
|
||||||
|
settings:
|
||||||
|
DefaultValueInitialized: true
|
||||||
|
WindowsStoreApps:
|
||||||
|
enabled: 0
|
||||||
|
settings:
|
||||||
|
CPU: AnyCPU
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEditor;
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
[System.Serializable]
|
||||||
|
[CustomEditor( typeof( AmplifyBloomEffect ) )]
|
||||||
|
public sealed class AmplifyBloomEffectEditor : AmplifyBloomEffectEditorBase { }
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d88dd18818d95ed41b9a480993d6c9f9
|
||||||
|
timeCreated: 1450374628
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -0,0 +1,616 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
#if UNITY_5_0 || UNITY_5_1 || UNITY_5_2
|
||||||
|
#define UNITY_PRE_5_3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEditor;
|
||||||
|
#if !UNITY_PRE_5_3
|
||||||
|
using UnityEditor.SceneManagement;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
[System.Serializable]
|
||||||
|
public class AmplifyBloomEffectEditorBase : Editor
|
||||||
|
{
|
||||||
|
private const string IntensityStr = "Intensity";
|
||||||
|
private const string AdvancedSettingsStr = "Advanced Settings";
|
||||||
|
private Rect TemporalCurveRanges = new Rect( 0, 0, 1, 0.999f );
|
||||||
|
private Color TemporalCurveColor = new Color( 0, 1, 0, 1 );
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_bokehAdvancedSettingsFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_ghostsAdvancedSettingsFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_haloAdvancedSettingsFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_lensGlareAdvancedSettingsFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_bloomFoldout = true;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_temporalFilterFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_featuresFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_bokehFilterFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_lensFlareFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_ghostsFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_haloFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_lensGlareFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_lensDirtFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_lensStarburstFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_mipSettingsFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_lensDirtWeightsFoldout = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_lensStarburstWeightsFoldout = false;
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_bloomWeightsFoldout = false;
|
||||||
|
|
||||||
|
|
||||||
|
private GUIStyle m_mainFoldoutStyle;
|
||||||
|
private GUIContent m_highPrecisionGC = new GUIContent( "Precision", "Switch between HDR and LDR Render Texture formats." );
|
||||||
|
private GUIContent m_debugToScreenGC = new GUIContent( "Debug", "Debug each bloom/feature stage to screen." );
|
||||||
|
private GUIContent m_ldrRangeGC = new GUIContent( "Range", "LDR Tweakable range. Use to match HDR results." );
|
||||||
|
private GUIContent m_overallIntensityGC = new GUIContent( IntensityStr, "Overall bloom intensity. Affects all the effects bellow." );
|
||||||
|
private GUIContent m_thresholdGC = new GUIContent( "Threshold", "Luminance threshold to setup what should generate bloom." );
|
||||||
|
private GUIContent m_blurStepGC = new GUIContent( "Blur Step", "Number of blur passes done on bloom results. Higher number provides smoother results but decreases performance." );
|
||||||
|
private GUIContent m_blurRadiusGC = new GUIContent( "Blur Radius", "Blur radius amount" );
|
||||||
|
private GUIContent m_upscaleWeightGC = new GUIContent( "Weight", "Influence of the selected Mip. Only valid when Mip Amount greater than 0." );
|
||||||
|
private GUIContent m_featuresSourceIdGC = new GUIContent( "Features Source Id", "Mip source which will be used to generate features." );
|
||||||
|
private GUIContent m_upscaleQualityGC = new GUIContent( "Technique", "Method which will be used to upscale results. Realistic is visually more robust but less efficient." );
|
||||||
|
private GUIContent m_downscaleAmountGC = new GUIContent( "Mip Count", "Number of resizes done on main RT before performing bloom. Increasing its the number provides finer tweaking but at the loss at performance." );
|
||||||
|
private GUIContent m_upscaleScaleRadiusGC = new GUIContent( "Upscale Blur Radius", "Radius used on the tent filter when upscaling to source size." );
|
||||||
|
private GUIContent m_filterCurveGC = new GUIContent( "Filter Curve", "Range of values which defines temporal filter behaviour." );
|
||||||
|
private GUIContent m_filterValueGC = new GUIContent( "Filter Value", "Position on the filter curve." );
|
||||||
|
private GUIContent m_separateThresholdGC = new GUIContent( "Threshold", "Threshold value for second threshold layer." );
|
||||||
|
private GUIContent m_bokehApplyOnBloomSourceGC = new GUIContent( "Apply on Bloom Source", "Bokeh filtering can either be applied on the bloom source and visually affect it or only affect features (lens flare/glare/dirt/starburst)." );
|
||||||
|
private GUIContent m_bokehApertureShapeGC = new GUIContent( "Aperture Shape", "Type of bokeh filter which will reshape bloom results." );
|
||||||
|
private GUIContent m_bokehSampleRadiusGC = new GUIContent( "Sample Radius", "Bokeh imaginary camera DOF's radius." );
|
||||||
|
private GUIContent m_bokehRotationGC = new GUIContent( "Rotation", "Filter overall rotation." );
|
||||||
|
private GUIContent m_bokehApertureGC = new GUIContent( "Aperture", "Bokeh imaginary camera DOF's aperture." );
|
||||||
|
private GUIContent m_bokehFocalLengthGC = new GUIContent( "Focal Length", "Bokeh imaginary camera DOF's focal length." );
|
||||||
|
private GUIContent m_bokehFocalDistanceGC = new GUIContent( "Focal Distance", "Bokeh imaginary camera DOF's focal distance." );
|
||||||
|
private GUIContent m_bokehMaxCoCDiameterGC = new GUIContent( "Max CoC Diameter", "Bokeh imaginary camera DOF's Max Circle of Confusion diameter." );
|
||||||
|
private GUIContent m_lensFlareIntensityGC = new GUIContent( IntensityStr, "Overall intensity for both halo and ghosts." );
|
||||||
|
private GUIContent m_lensFlareBlurAmountGC = new GUIContent( "Blur amount", "Amount of blur applied on generated halo and ghosts." );
|
||||||
|
private GUIContent m_lensFlareRadialTintGC = new GUIContent( "Radial Tint", "Dynamic tint color applied to halo and ghosts according to its screen position. Left most color on gradient corresponds to screen center." );
|
||||||
|
private GUIContent m_lensFlareGhostsInstensityGC = new GUIContent( IntensityStr, "Ghosts intensity." );
|
||||||
|
private GUIContent m_lensFlareGhostAmountGC = new GUIContent( "Count", "Amount of ghosts generated from each bloom area." );
|
||||||
|
private GUIContent m_lensFlareGhostDispersalGC = new GUIContent( "Dispersal", "Distance between ghost generated from the same bloom area." );
|
||||||
|
private GUIContent m_lensFlareGhostChrmDistortGC = new GUIContent( "Chromatic Distortion", "Amount of chromatic distortion applied on each ghost." );
|
||||||
|
private GUIContent m_lensFlareGhostPowerFactorGC = new GUIContent( "Power Factor", "Base on ghost fade power function." );
|
||||||
|
private GUIContent m_lensFlareGhostPowerFalloffGC = new GUIContent( "Power Falloff", "Exponent on ghost fade power function." );
|
||||||
|
private GUIContent m_lensFlareHalosIntensityGC = new GUIContent( IntensityStr, "Halo intensity." );
|
||||||
|
private GUIContent m_lensFlareHaloWidthGC = new GUIContent( "Width", "Width/Radius of the generated halo." );
|
||||||
|
private GUIContent m_lensFlareHaloChrmDistGC = new GUIContent( "Chromatic Distortion", "Amount of chromatic distortion applied on halo." );
|
||||||
|
private GUIContent m_lensFlareHaloPowerFactorGC = new GUIContent( "Power Factor", "Base on halo fade power function." );
|
||||||
|
private GUIContent m_lensFlareHaloPowerFalloffGC = new GUIContent( "Power Falloff", "Exponent on halo fade power function." );
|
||||||
|
private GUIContent m_lensGlareIntensityGC = new GUIContent( IntensityStr, "Lens Glare intensity." );
|
||||||
|
private GUIContent m_lensGlareOverallStreakScaleGC = new GUIContent( "Streak Scale", "Overall glare streak length modifier." );
|
||||||
|
private GUIContent m_lensGlareOverallTintGC = new GUIContent( "Overall Tint", "Tint applied uniformly across each type of glare." );
|
||||||
|
private GUIContent m_lensGlareTypeGC = new GUIContent( "Type", "Type of glare." );
|
||||||
|
private GUIContent m_lensGlareTintAlongGlareGC = new GUIContent( "Tint Along Glare", "Tint for spectral types along each ray.Leftmost color on the gradient corresponds to sample near bloom source." );
|
||||||
|
private GUIContent m_lensGlarePerPassDispGC = new GUIContent( "Per Pass Displacement", "Distance between samples when creating each ray." );
|
||||||
|
private GUIContent m_lensGlareMaxPerRayGC = new GUIContent( "Max Per Ray Passes", "Max amount of passes used to build each ray. More passes means more defined and propagated rays but decreases performance." );
|
||||||
|
private GUIContent m_lensDirtIntensityGC = new GUIContent( IntensityStr, "Lens Dirt Intensity." );
|
||||||
|
private GUIContent m_lensDirtTextureGC = new GUIContent( "Dirt Texture", "Mask from which dirt is going to be created." );
|
||||||
|
private GUIContent m_lensStarburstIntensityGC = new GUIContent( IntensityStr, "Lens Starburst Intensity." );
|
||||||
|
private GUIContent m_lensStarburstTextureGC = new GUIContent( "Starburst Texture", "Mask from which starburst is going to be created." );
|
||||||
|
private GUIContent m_bloomFoldoutGC = new GUIContent( " Bloom", "Settings for bloom generation, will affect all features." );
|
||||||
|
private GUIContent m_bokehFilterFoldoutGC = new GUIContent( " Bokeh Filter", "Settings for Bokeh filter generation." );
|
||||||
|
private GUIContent m_lensFlareFoldoutGC = new GUIContent( " Lens Flare", "Overall settings for Lens Flare (Halo/Ghosts) generation." );
|
||||||
|
private GUIContent m_ghostsFoldoutGC = new GUIContent( "Ghosts", "Settings for Ghosts generation." );
|
||||||
|
private GUIContent m_halosFoldoutGC = new GUIContent( "Halo", "Settings for Halo generation." );
|
||||||
|
private GUIContent m_lensGlareFoldoutGC = new GUIContent( " Lens Glare", "Settings for Anamorphic Lens Glare generation." );
|
||||||
|
private GUIContent m_lensDirtFoldoutGC = new GUIContent( " Lens Dirt", "Settings for Lens Dirt composition." );
|
||||||
|
private GUIContent m_lensStarburstFoldoutGC = new GUIContent( " Lens Starburst", "Settings for Lens Starburts composition." );
|
||||||
|
private GUIContent m_temporalFilterFoldoutGC = new GUIContent( " Temporal Filter", "Settings for temporal filtering configuration." );
|
||||||
|
private GUIContent m_sepFeaturesThresholdFoldoutGC = new GUIContent( " Features Threshold", "Settings for features threshold." );
|
||||||
|
private GUIContent m_advancedSettingsBokehFoldoutGC = new GUIContent( AdvancedSettingsStr, "Advanced settings for Bokeh filter." );
|
||||||
|
private GUIContent m_advancedSettingsGhostsFoldoutGC = new GUIContent( AdvancedSettingsStr, "Advanced settings for Ghosts." );
|
||||||
|
private GUIContent m_advancedSettingsHalosFoldoutGC = new GUIContent( AdvancedSettingsStr, "Advanced settings for Halo." );
|
||||||
|
private GUIContent m_advancedSettingsLensGlareFoldoutGC = new GUIContent( AdvancedSettingsStr, "Advanced settings for Lens Glare." );
|
||||||
|
private GUIContent m_customGlareIdxGC = new GUIContent( "Current", "Current selected custom glare from array bellow." );
|
||||||
|
private GUIContent m_customGlareSizeGC = new GUIContent( "Size", "Amount of customizable glare definitions." );
|
||||||
|
private GUIContent m_customGlareNameGC = new GUIContent( "Name", "Custom glare name." );
|
||||||
|
private GUIContent m_customGlareStarInclinationGC = new GUIContent( "Initial Offset", "Star angle initial offset." );
|
||||||
|
private GUIContent m_customGlareChromaticAberrationGC = new GUIContent( "Chromatic Amount", "Amount of influence from chromatic gradient." );
|
||||||
|
private GUIContent m_customGlareStarlinesCountGC = new GUIContent( "Star Lines Count", "Amount of generated rays." );
|
||||||
|
private GUIContent m_customGlarePassCountGC = new GUIContent( "Pass Count", "Amount of passes used to generate rays." );
|
||||||
|
private GUIContent m_customGlareSampleLengthGC = new GUIContent( "Sample Length", "Spacing between each sample when generating rays." );
|
||||||
|
private GUIContent m_customGlareAttenuationGC = new GUIContent( "Attenuation", "Attenuation factor along ray." );
|
||||||
|
private GUIContent m_customGlareRotationGC = new GUIContent( "Camera Influence", "Amount of influence camera rotation has on rays." );
|
||||||
|
private GUIContent m_customGlareCustomIncrementGC = new GUIContent( "Custom Increment", "Custom angle increment between rays. They will be evenly rotated if specified a value equal to 0." );
|
||||||
|
private GUIContent m_customGlareLongAttenuationGC = new GUIContent( "Long Attenuation", "Second attenuation factor. Rays will alternate between Attenuation ( Odd numbers) and Long Attenuation ( Even numbers). Only active if specified value is greater than 0." );
|
||||||
|
private GUIContent m_customGlareFoldoutGC = new GUIContent( "Custom Label", "Properties for hovered custom glare." );
|
||||||
|
private GUIContent m_mipSettingGC = new GUIContent( "Mip Settings", "Configurable settings for each mip" );
|
||||||
|
private GUIContent m_lensWeightsFoldoutGC = new GUIContent( "Mip Weights", "Each mip contribution to the Lens Dirt and Starburts feature." );
|
||||||
|
private GUIContent m_lensWeightGC = new GUIContent( "Mip ", "Influence of the selected Mip. Only valid when Mip Amount greater than 0." );
|
||||||
|
private GUIContent[] m_lensWeightGCArr;
|
||||||
|
private GUIContent m_bloomWeightsFoldoutGC = new GUIContent( "Mip Weights", "Each mip contribution to Bloom." );
|
||||||
|
private GUIContent m_showDebugMessagesGC = new GUIContent( "Show Warnings", "Show relevant Amplify Bloom Warnings to Console." );
|
||||||
|
private GUIContent m_mainThresholdSizeGC = new GUIContent( "Source Downscale", "Initial render texture scale on which the Main Threshold will be written." );
|
||||||
|
private GUIContent m_targetTextureGC = new GUIContent( "Target Texture", "Render Bloom to a render texture instead of destination" );
|
||||||
|
private GUIContent m_maskTextureGC = new GUIContent( "Mask Texture", "Render Bloom only on certain areas specifed by mask." );
|
||||||
|
private GUIStyle m_foldoutClosed;
|
||||||
|
private GUIStyle m_foldoutOpened;
|
||||||
|
private GUIStyle m_toggleStyle;
|
||||||
|
private GUIStyle m_mainLabelStyle;
|
||||||
|
private GUIStyle m_disabledToggleStyle;
|
||||||
|
|
||||||
|
|
||||||
|
private GUIContent[] m_bloomWeightsLabelGCArr;
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
m_bloomWeightsLabelGCArr = new GUIContent[ AmplifyBloomBase.MaxDownscales ];
|
||||||
|
for ( int i = 0; i < m_bloomWeightsLabelGCArr.Length; i++ )
|
||||||
|
{
|
||||||
|
m_bloomWeightsLabelGCArr[ i ] = new GUIContent( "Mip " + ( i + 1 ), m_bloomWeightsFoldoutGC.tooltip );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_mainLabelStyle = new GUIStyle( EditorStyles.label );
|
||||||
|
m_mainLabelStyle.fontStyle = FontStyle.Bold;
|
||||||
|
|
||||||
|
m_disabledToggleStyle = new GUIStyle( EditorStyles.toggle );
|
||||||
|
m_disabledToggleStyle.normal = m_disabledToggleStyle.onActive;
|
||||||
|
|
||||||
|
m_foldoutClosed = new GUIStyle( EditorStyles.foldout );
|
||||||
|
m_foldoutClosed.fontStyle = FontStyle.Bold;
|
||||||
|
|
||||||
|
m_foldoutOpened = new GUIStyle( EditorStyles.foldout );
|
||||||
|
m_foldoutOpened.normal = m_foldoutOpened.onActive;
|
||||||
|
m_foldoutOpened.fontStyle = FontStyle.Bold;
|
||||||
|
|
||||||
|
m_mainFoldoutStyle = new GUIStyle( EditorStyles.foldout );
|
||||||
|
m_mainFoldoutStyle.fontStyle = FontStyle.Bold;
|
||||||
|
|
||||||
|
m_toggleStyle = new GUIStyle( EditorStyles.toggle );
|
||||||
|
m_toggleStyle.fontStyle = FontStyle.Bold;
|
||||||
|
|
||||||
|
m_lensWeightGCArr = new GUIContent[ AmplifyBloomBase.MaxDownscales ];
|
||||||
|
for ( int i = 0; i < m_lensWeightGCArr.Length; i++ )
|
||||||
|
{
|
||||||
|
m_lensWeightGCArr[ i ] = new GUIContent( m_lensWeightGC );
|
||||||
|
m_lensWeightGCArr[ i ].text += ( i + 1 ).ToString();
|
||||||
|
}
|
||||||
|
AmplifyBloomBase bloom = ( AmplifyBloomBase ) target;
|
||||||
|
if ( bloom.LensDirtTexture == null )
|
||||||
|
{
|
||||||
|
bloom.LensDirtTexture = AssetDatabase.LoadAssetAtPath<Texture>( "Assets/AmplifyBloom/Samples/Textures/Dirt/DirtHighContrast.png" );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( bloom.LensStardurstTex == null )
|
||||||
|
{
|
||||||
|
bloom.LensStardurstTex = AssetDatabase.LoadAssetAtPath<Texture>( "Assets/AmplifyBloom/Samples/Textures/Starburst/Starburst.png" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CustomFoldout( bool value , GUIContent content, int space = 4)
|
||||||
|
{
|
||||||
|
GUIStyle foldoutStyle = value ? m_foldoutOpened : m_foldoutClosed;
|
||||||
|
m_mainLabelStyle.fontStyle = FontStyle.Normal;
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
{
|
||||||
|
GUILayout.Space( space );
|
||||||
|
if ( GUILayout.Button( string.Empty, foldoutStyle, GUILayout.Width( 10 ) ) )
|
||||||
|
{
|
||||||
|
value = !value;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GUILayout.Button( content, m_mainLabelStyle ) )
|
||||||
|
{
|
||||||
|
value = !value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ToggleFoldout( GUIContent content, ref bool foldoutValue, ref bool toggleValue, bool applyBold, int space = -8, bool specialToggle = false )
|
||||||
|
{
|
||||||
|
GUIStyle foldoutStyle = foldoutValue ? m_foldoutOpened : m_foldoutClosed;
|
||||||
|
m_toggleStyle.fontStyle = foldoutStyle.fontStyle = applyBold ? FontStyle.Bold : FontStyle.Normal;
|
||||||
|
m_mainLabelStyle.fontStyle = m_toggleStyle.fontStyle;
|
||||||
|
EditorGUILayout.BeginHorizontal();
|
||||||
|
{
|
||||||
|
GUILayout.Space( space );
|
||||||
|
if ( GUILayout.Button( string.Empty, foldoutStyle, GUILayout.Width( 10 ) ) )
|
||||||
|
{
|
||||||
|
foldoutValue = !foldoutValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ( specialToggle )
|
||||||
|
{
|
||||||
|
GUI.enabled = false;
|
||||||
|
GUILayout.Button( string.Empty, m_disabledToggleStyle, GUILayout.Width( 10 ) );
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
toggleValue = GUILayout.Toggle( toggleValue, content, m_toggleStyle, GUILayout.Width( 10 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GUILayout.Button( content, m_mainLabelStyle ) )
|
||||||
|
{
|
||||||
|
foldoutValue = !foldoutValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
EditorGUILayout.EndHorizontal();
|
||||||
|
}
|
||||||
|
|
||||||
|
override public void OnInspectorGUI()
|
||||||
|
{
|
||||||
|
Undo.RecordObject( target, "AmplifyBloomInspector" );
|
||||||
|
AmplifyBloomBase bloom = ( AmplifyBloomBase ) target;
|
||||||
|
SerializedObject bloomObj = new SerializedObject( bloom );
|
||||||
|
GUILayout.BeginVertical();
|
||||||
|
{
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
EditorGUILayout.Separator();
|
||||||
|
bool applyBloom = true;
|
||||||
|
ToggleFoldout( m_bloomFoldoutGC, ref m_bloomFoldout, ref applyBloom, true, -8, true );
|
||||||
|
if ( m_bloomFoldout )
|
||||||
|
{
|
||||||
|
bloom.UpscaleQuality = ( UpscaleQualityEnum ) EditorGUILayout.EnumPopup( m_upscaleQualityGC, bloom.UpscaleQuality );
|
||||||
|
bloom.MainThresholdSize = ( MainThresholdSizeEnum ) EditorGUILayout.EnumPopup( m_mainThresholdSizeGC, bloom.MainThresholdSize );
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
float originalLabelWidth = EditorGUIUtility.labelWidth;
|
||||||
|
|
||||||
|
bloom.CurrentPrecisionMode = ( PrecisionModes ) EditorGUILayout.EnumPopup( m_highPrecisionGC, bloom.CurrentPrecisionMode );
|
||||||
|
GUI.enabled = !bloom.HighPrecision;
|
||||||
|
{
|
||||||
|
EditorGUIUtility.labelWidth = 45;
|
||||||
|
bloom.BloomRange = EditorGUILayout.FloatField( m_ldrRangeGC, bloom.BloomRange, GUILayout.MaxWidth( 1300 ) );
|
||||||
|
}
|
||||||
|
EditorGUIUtility.labelWidth = originalLabelWidth;
|
||||||
|
GUI.enabled = true;
|
||||||
|
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
|
||||||
|
bloom.OverallIntensity = EditorGUILayout.FloatField( m_overallIntensityGC, bloom.OverallIntensity );
|
||||||
|
|
||||||
|
bloom.OverallThreshold = EditorGUILayout.FloatField( m_thresholdGC, bloom.OverallThreshold );
|
||||||
|
|
||||||
|
SerializedProperty maskTextureField = bloomObj.FindProperty( "m_maskTexture" );
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
EditorGUILayout.PropertyField( maskTextureField, m_maskTextureGC );
|
||||||
|
if ( EditorGUI.EndChangeCheck() )
|
||||||
|
{
|
||||||
|
bloomObj.ApplyModifiedProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
SerializedProperty targetTextureField = bloomObj.FindProperty( "m_targetTexture" );
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
EditorGUILayout.PropertyField( targetTextureField, m_targetTextureGC );
|
||||||
|
if ( EditorGUI.EndChangeCheck() )
|
||||||
|
{
|
||||||
|
bloomObj.ApplyModifiedProperties();
|
||||||
|
}
|
||||||
|
//bloom.TargetTexture = EditorGUILayout.ObjectField( m_targetTextureGC, bloom.TargetTexture, typeof( RenderTexture ),false ) as RenderTexture;
|
||||||
|
bloom.DebugToScreen = ( DebugToScreenEnum ) EditorGUILayout.EnumPopup( m_debugToScreenGC, bloom.DebugToScreen );
|
||||||
|
bloom.ShowDebugMessages = EditorGUILayout.Toggle( m_showDebugMessagesGC, bloom.ShowDebugMessages );
|
||||||
|
int weightMaxDowsampleCount = Mathf.Max( 1, bloom.BloomDownsampleCount );
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_mipSettingsFoldout = CustomFoldout( m_mipSettingsFoldout, m_mipSettingGC );
|
||||||
|
if ( m_mipSettingsFoldout )
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
bloom.BloomDownsampleCount = EditorGUILayout.IntSlider( m_downscaleAmountGC, bloom.BloomDownsampleCount, AmplifyBloomBase.MinDownscales, bloom.SoftMaxdownscales );
|
||||||
|
bool guiState = bloom.BloomDownsampleCount != 0;
|
||||||
|
|
||||||
|
GUI.enabled = ( bloom.UpscaleQuality == UpscaleQualityEnum.Realistic ) && guiState;
|
||||||
|
{
|
||||||
|
bloom.UpscaleBlurRadius = EditorGUILayout.Slider( m_upscaleScaleRadiusGC, bloom.UpscaleBlurRadius, 1f, 3.0f );
|
||||||
|
}
|
||||||
|
GUI.enabled = guiState;
|
||||||
|
|
||||||
|
int featuresSourceId = bloom.FeaturesSourceId + 1;
|
||||||
|
featuresSourceId = EditorGUILayout.IntSlider( m_featuresSourceIdGC, featuresSourceId, 1, bloom.BloomDownsampleCount );
|
||||||
|
bloom.FeaturesSourceId = featuresSourceId - 1;
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
|
||||||
|
m_bloomWeightsFoldout = CustomFoldout( m_bloomWeightsFoldout, m_bloomWeightsFoldoutGC );
|
||||||
|
if ( m_bloomWeightsFoldout )
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
|
||||||
|
float blurStepSize = 15;
|
||||||
|
float blurRadiusSize = 15;
|
||||||
|
float weightSize = 25;
|
||||||
|
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
GUILayout.Space( 41 );
|
||||||
|
EditorGUILayout.LabelField( m_blurStepGC, GUILayout.MinWidth( blurStepSize ) );
|
||||||
|
GUILayout.Space( -26 );
|
||||||
|
EditorGUILayout.LabelField( m_blurRadiusGC, GUILayout.MinWidth( blurRadiusSize ) );
|
||||||
|
GUILayout.Space( -27 );
|
||||||
|
EditorGUILayout.LabelField( m_upscaleWeightGC, GUILayout.MinWidth( weightSize ) );
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
for ( int i = 0; i < weightMaxDowsampleCount; i++ )
|
||||||
|
{
|
||||||
|
GUILayout.BeginHorizontal();
|
||||||
|
EditorGUILayout.LabelField( m_bloomWeightsLabelGCArr[ i ], GUILayout.Width( 65 ) );
|
||||||
|
GUILayout.Space( -30 );
|
||||||
|
|
||||||
|
bloom.GaussianSteps[ i ] = EditorGUILayout.IntField( string.Empty, bloom.GaussianSteps[ i ], GUILayout.MinWidth( blurStepSize ) );
|
||||||
|
bloom.GaussianSteps[ i ] = Mathf.Clamp( bloom.GaussianSteps[ i ], 0, AmplifyBloomBase.MaxGaussian );
|
||||||
|
|
||||||
|
GUILayout.Space( -27 );
|
||||||
|
bloom.GaussianRadius[ i ] = EditorGUILayout.FloatField( string.Empty, bloom.GaussianRadius[ i ], GUILayout.MinWidth( blurRadiusSize ) );
|
||||||
|
bloom.GaussianRadius[ i ] = Mathf.Max( bloom.GaussianRadius[ i ], 0f );
|
||||||
|
|
||||||
|
GUILayout.Space( -27 );
|
||||||
|
int id = weightMaxDowsampleCount - 1 - i;
|
||||||
|
bloom.UpscaleWeights[ id ] = EditorGUILayout.FloatField( string.Empty, bloom.UpscaleWeights[ id ], GUILayout.MinWidth( weightSize ) );
|
||||||
|
bloom.UpscaleWeights[ id ] = Mathf.Max( bloom.UpscaleWeights[ id ], 0f );
|
||||||
|
|
||||||
|
GUILayout.EndHorizontal();
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
|
||||||
|
bool applyTemporalFilter = bloom.TemporalFilteringActive;
|
||||||
|
ToggleFoldout( m_temporalFilterFoldoutGC, ref m_temporalFilterFoldout, ref applyTemporalFilter, false, 4 );
|
||||||
|
bloom.TemporalFilteringActive = applyTemporalFilter;
|
||||||
|
if ( m_temporalFilterFoldout )
|
||||||
|
{
|
||||||
|
GUI.enabled = bloom.TemporalFilteringActive;
|
||||||
|
{
|
||||||
|
bloom.TemporalFilteringCurve = EditorGUILayout.CurveField( m_filterCurveGC, bloom.TemporalFilteringCurve, TemporalCurveColor, TemporalCurveRanges );
|
||||||
|
bloom.TemporalFilteringValue = EditorGUILayout.Slider( m_filterValueGC, bloom.TemporalFilteringValue, 0.01f, 1f );
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool applySeparateFeatures = bloom.SeparateFeaturesThreshold;
|
||||||
|
ToggleFoldout( m_sepFeaturesThresholdFoldoutGC, ref m_featuresFoldout, ref applySeparateFeatures, false, 4 );
|
||||||
|
bloom.SeparateFeaturesThreshold = applySeparateFeatures;
|
||||||
|
|
||||||
|
if ( m_featuresFoldout )
|
||||||
|
{
|
||||||
|
GUI.enabled = bloom.SeparateFeaturesThreshold;
|
||||||
|
{
|
||||||
|
bloom.FeaturesThreshold = EditorGUILayout.FloatField( m_separateThresholdGC, bloom.FeaturesThreshold );
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool applyLensDirt = bloom.ApplyLensDirt;
|
||||||
|
ToggleFoldout( m_lensDirtFoldoutGC, ref m_lensDirtFoldout, ref applyLensDirt, true );
|
||||||
|
bloom.ApplyLensDirt = applyLensDirt;
|
||||||
|
if ( m_lensDirtFoldout )
|
||||||
|
{
|
||||||
|
GUI.enabled = bloom.ApplyLensDirt;
|
||||||
|
bloom.LensDirtStrength = EditorGUILayout.FloatField( m_lensDirtIntensityGC, bloom.LensDirtStrength );
|
||||||
|
|
||||||
|
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_lensDirtWeightsFoldout = CustomFoldout( m_lensDirtWeightsFoldout, m_lensWeightsFoldoutGC );
|
||||||
|
if ( m_lensDirtWeightsFoldout )
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < bloom.BloomDownsampleCount; i++ )
|
||||||
|
{
|
||||||
|
int id = bloom.BloomDownsampleCount - 1 - i;
|
||||||
|
bloom.LensDirtWeights[ id ] = EditorGUILayout.FloatField( m_lensWeightGCArr[ i ], bloom.LensDirtWeights[ id ] );
|
||||||
|
bloom.LensDirtWeights[ id ] = Mathf.Max( bloom.LensDirtWeights[ id ], 0f );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
bloom.LensDirtTexture = EditorGUILayout.ObjectField( m_lensDirtTextureGC, bloom.LensDirtTexture, typeof( Texture ), false ) as Texture;
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool applyStarburst = bloom.ApplyLensStardurst;
|
||||||
|
ToggleFoldout( m_lensStarburstFoldoutGC, ref m_lensStarburstFoldout, ref applyStarburst, true );
|
||||||
|
bloom.ApplyLensStardurst = applyStarburst;
|
||||||
|
if ( m_lensStarburstFoldout )
|
||||||
|
{
|
||||||
|
GUI.enabled = bloom.ApplyLensStardurst;
|
||||||
|
{
|
||||||
|
bloom.LensStarburstStrength = EditorGUILayout.FloatField( m_lensStarburstIntensityGC, bloom.LensStarburstStrength );
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_lensStarburstWeightsFoldout = CustomFoldout( m_lensStarburstWeightsFoldout, m_lensWeightsFoldoutGC );
|
||||||
|
if ( m_lensStarburstWeightsFoldout )
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < bloom.BloomDownsampleCount; i++ )
|
||||||
|
{
|
||||||
|
int id = bloom.BloomDownsampleCount - 1 - i;
|
||||||
|
bloom.LensStarburstWeights[ id ] = EditorGUILayout.FloatField( m_lensWeightGCArr[ i ], bloom.LensStarburstWeights[ id ] );
|
||||||
|
bloom.LensStarburstWeights[ id ] = Mathf.Max( bloom.LensStarburstWeights[ id ], 0f );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
bloom.LensStardurstTex = EditorGUILayout.ObjectField( m_lensStarburstTextureGC, bloom.LensStardurstTex, typeof( Texture ), false ) as Texture;
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool applyBokeh = bloom.BokehFilterInstance.ApplyBokeh;
|
||||||
|
ToggleFoldout( m_bokehFilterFoldoutGC, ref m_bokehFilterFoldout, ref applyBokeh, true );
|
||||||
|
bloom.BokehFilterInstance.ApplyBokeh = applyBokeh;
|
||||||
|
if ( m_bokehFilterFoldout )
|
||||||
|
{
|
||||||
|
GUI.enabled = bloom.BokehFilterInstance.ApplyBokeh;
|
||||||
|
{
|
||||||
|
bloom.BokehFilterInstance.ApplyOnBloomSource = EditorGUILayout.Toggle( m_bokehApplyOnBloomSourceGC, bloom.BokehFilterInstance.ApplyOnBloomSource );
|
||||||
|
bloom.BokehFilterInstance.ApertureShape = ( ApertureShape ) EditorGUILayout.EnumPopup( m_bokehApertureShapeGC, bloom.BokehFilterInstance.ApertureShape );
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_bokehAdvancedSettingsFoldout = CustomFoldout( m_bokehAdvancedSettingsFoldout, m_advancedSettingsBokehFoldoutGC );
|
||||||
|
if ( m_bokehAdvancedSettingsFoldout )
|
||||||
|
{
|
||||||
|
bloom.BokehFilterInstance.OffsetRotation = EditorGUILayout.Slider( m_bokehRotationGC, bloom.BokehFilterInstance.OffsetRotation, 0, 360 );
|
||||||
|
bloom.BokehFilterInstance.BokehSampleRadius = EditorGUILayout.Slider( m_bokehSampleRadiusGC, bloom.BokehFilterInstance.BokehSampleRadius, 0.01f, 1f );
|
||||||
|
bloom.BokehFilterInstance.Aperture = EditorGUILayout.Slider( m_bokehApertureGC, bloom.BokehFilterInstance.Aperture, 0.01f, 0.05f );
|
||||||
|
bloom.BokehFilterInstance.FocalLength = EditorGUILayout.Slider( m_bokehFocalLengthGC, bloom.BokehFilterInstance.FocalLength, 0.018f, 0.055f );
|
||||||
|
bloom.BokehFilterInstance.FocalDistance = EditorGUILayout.Slider( m_bokehFocalDistanceGC, bloom.BokehFilterInstance.FocalDistance, 0.055f, 3f );
|
||||||
|
bloom.BokehFilterInstance.MaxCoCDiameter = EditorGUILayout.Slider( m_bokehMaxCoCDiameterGC, bloom.BokehFilterInstance.MaxCoCDiameter, 0f, 2f );
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool applyLensFlare = bloom.LensFlareInstance.ApplyLensFlare;
|
||||||
|
ToggleFoldout( m_lensFlareFoldoutGC, ref m_lensFlareFoldout, ref applyLensFlare, true );
|
||||||
|
bloom.LensFlareInstance.ApplyLensFlare = applyLensFlare;
|
||||||
|
if ( m_lensFlareFoldout )
|
||||||
|
{
|
||||||
|
GUI.enabled = bloom.LensFlareInstance.ApplyLensFlare;
|
||||||
|
{
|
||||||
|
bloom.LensFlareInstance.OverallIntensity = EditorGUILayout.FloatField( m_lensFlareIntensityGC, bloom.LensFlareInstance.OverallIntensity );
|
||||||
|
bloom.LensFlareInstance.LensFlareGaussianBlurAmount = EditorGUILayout.IntSlider( m_lensFlareBlurAmountGC, bloom.LensFlareInstance.LensFlareGaussianBlurAmount, 0, 3 );
|
||||||
|
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
SerializedProperty gradientField = bloomObj.FindProperty( "m_lensFlare.m_lensGradient" );
|
||||||
|
EditorGUILayout.PropertyField( gradientField, m_lensFlareRadialTintGC );
|
||||||
|
if ( EditorGUI.EndChangeCheck() )
|
||||||
|
{
|
||||||
|
bloomObj.ApplyModifiedProperties();
|
||||||
|
bloom.LensFlareInstance.TextureFromGradient();
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_ghostsFoldout = CustomFoldout( m_ghostsFoldout, m_ghostsFoldoutGC );
|
||||||
|
if ( m_ghostsFoldout )
|
||||||
|
{
|
||||||
|
bloom.LensFlareInstance.LensFlareNormalizedGhostsIntensity = EditorGUILayout.FloatField( m_lensFlareGhostsInstensityGC, bloom.LensFlareInstance.LensFlareNormalizedGhostsIntensity );
|
||||||
|
bloom.LensFlareInstance.LensFlareGhostAmount = EditorGUILayout.IntSlider( m_lensFlareGhostAmountGC, bloom.LensFlareInstance.LensFlareGhostAmount, 0, AmplifyBloomBase.MaxGhosts );
|
||||||
|
bloom.LensFlareInstance.LensFlareGhostsDispersal = EditorGUILayout.Slider( m_lensFlareGhostDispersalGC, bloom.LensFlareInstance.LensFlareGhostsDispersal, 0.01f, 1.0f );
|
||||||
|
bloom.LensFlareInstance.LensFlareGhostChrDistortion = EditorGUILayout.Slider( m_lensFlareGhostChrmDistortGC, bloom.LensFlareInstance.LensFlareGhostChrDistortion, 0, 10 );
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_ghostsAdvancedSettingsFoldout = CustomFoldout( m_ghostsAdvancedSettingsFoldout, m_advancedSettingsGhostsFoldoutGC ,19);
|
||||||
|
if ( m_ghostsAdvancedSettingsFoldout )
|
||||||
|
{
|
||||||
|
bloom.LensFlareInstance.LensFlareGhostsPowerFactor = EditorGUILayout.Slider( m_lensFlareGhostPowerFactorGC, bloom.LensFlareInstance.LensFlareGhostsPowerFactor, 0, 2 );
|
||||||
|
bloom.LensFlareInstance.LensFlareGhostsPowerFalloff = EditorGUILayout.Slider( m_lensFlareGhostPowerFalloffGC, bloom.LensFlareInstance.LensFlareGhostsPowerFalloff, 1, 128 );
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_haloFoldout = CustomFoldout( m_haloFoldout, m_halosFoldoutGC );
|
||||||
|
if ( m_haloFoldout )
|
||||||
|
{
|
||||||
|
bloom.LensFlareInstance.LensFlareNormalizedHaloIntensity = EditorGUILayout.FloatField( m_lensFlareHalosIntensityGC, bloom.LensFlareInstance.LensFlareNormalizedHaloIntensity );
|
||||||
|
bloom.LensFlareInstance.LensFlareHaloWidth = EditorGUILayout.Slider( m_lensFlareHaloWidthGC, bloom.LensFlareInstance.LensFlareHaloWidth, 0, 1 );
|
||||||
|
bloom.LensFlareInstance.LensFlareHaloChrDistortion = EditorGUILayout.Slider( m_lensFlareHaloChrmDistGC, bloom.LensFlareInstance.LensFlareHaloChrDistortion, 0, 10 );
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_haloAdvancedSettingsFoldout = CustomFoldout( m_haloAdvancedSettingsFoldout, m_advancedSettingsHalosFoldoutGC ,19);
|
||||||
|
if ( m_haloAdvancedSettingsFoldout )
|
||||||
|
{
|
||||||
|
bloom.LensFlareInstance.LensFlareHaloPowerFactor = EditorGUILayout.Slider( m_lensFlareHaloPowerFactorGC, bloom.LensFlareInstance.LensFlareHaloPowerFactor, 1, 2 );
|
||||||
|
bloom.LensFlareInstance.LensFlareHaloPowerFalloff = EditorGUILayout.Slider( m_lensFlareHaloPowerFalloffGC, bloom.LensFlareInstance.LensFlareHaloPowerFalloff, 1, 128 );
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool applyGlare = bloom.LensGlareInstance.ApplyLensGlare;
|
||||||
|
ToggleFoldout( m_lensGlareFoldoutGC, ref m_lensGlareFoldout, ref applyGlare, true );
|
||||||
|
bloom.LensGlareInstance.ApplyLensGlare = applyGlare;
|
||||||
|
if ( m_lensGlareFoldout )
|
||||||
|
{
|
||||||
|
GUI.enabled = bloom.LensGlareInstance.ApplyLensGlare;
|
||||||
|
{
|
||||||
|
bloom.LensGlareInstance.Intensity = EditorGUILayout.FloatField( m_lensGlareIntensityGC, bloom.LensGlareInstance.Intensity );
|
||||||
|
bloom.LensGlareInstance.OverallStreakScale = EditorGUILayout.Slider( m_lensGlareOverallStreakScaleGC, bloom.LensGlareInstance.OverallStreakScale, 0, 2 );
|
||||||
|
bloom.LensGlareInstance.OverallTint = EditorGUILayout.ColorField( m_lensGlareOverallTintGC, bloom.LensGlareInstance.OverallTint );
|
||||||
|
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
|
SerializedProperty gradientField = bloomObj.FindProperty( "m_anamorphicGlare.m_cromaticAberrationGrad" );
|
||||||
|
EditorGUILayout.PropertyField( gradientField, m_lensGlareTintAlongGlareGC );
|
||||||
|
if ( EditorGUI.EndChangeCheck() )
|
||||||
|
{
|
||||||
|
bloomObj.ApplyModifiedProperties();
|
||||||
|
bloom.LensGlareInstance.SetDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
bloom.LensGlareInstance.CurrentGlare = ( GlareLibType ) EditorGUILayout.EnumPopup( m_lensGlareTypeGC, bloom.LensGlareInstance.CurrentGlare );
|
||||||
|
if ( bloom.LensGlareInstance.CurrentGlare == GlareLibType.Custom )
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
bloom.LensGlareInstance.CustomGlareDefAmount = EditorGUILayout.IntSlider( m_customGlareSizeGC, bloom.LensGlareInstance.CustomGlareDefAmount, 0, AmplifyGlare.MaxCustomGlare );
|
||||||
|
if ( bloom.LensGlareInstance.CustomGlareDefAmount > 0 )
|
||||||
|
{
|
||||||
|
bloom.LensGlareInstance.CustomGlareDefIdx = EditorGUILayout.IntSlider( m_customGlareIdxGC, bloom.LensGlareInstance.CustomGlareDefIdx, 0, bloom.LensGlareInstance.CustomGlareDef.Length - 1 );
|
||||||
|
for ( int i = 0; i < bloom.LensGlareInstance.CustomGlareDef.Length; i++ )
|
||||||
|
{
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_customGlareFoldoutGC.text = "[" + i + "] " + bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.StarName;
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].FoldoutValue = CustomFoldout( bloom.LensGlareInstance.CustomGlareDef[ i ].FoldoutValue, m_customGlareFoldoutGC );
|
||||||
|
if ( bloom.LensGlareInstance.CustomGlareDef[ i ].FoldoutValue )
|
||||||
|
{
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.StarName = EditorGUILayout.TextField( m_customGlareNameGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.StarName );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].StarInclinationDeg = EditorGUILayout.Slider( m_customGlareStarInclinationGC, bloom.LensGlareInstance.CustomGlareDef[ i ].StarInclinationDeg, 0, 180 );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].ChromaticAberration = EditorGUILayout.Slider( m_customGlareChromaticAberrationGC, bloom.LensGlareInstance.CustomGlareDef[ i ].ChromaticAberration, 0, 1 );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.StarlinesCount = EditorGUILayout.IntSlider( m_customGlareStarlinesCountGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.StarlinesCount, 1, AmplifyGlare.MaxStarLines );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.PassCount = EditorGUILayout.IntSlider( m_customGlarePassCountGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.PassCount, 1, AmplifyGlare.MaxPasses );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.SampleLength = EditorGUILayout.Slider( m_customGlareSampleLengthGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.SampleLength, 0, 2 );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.Attenuation = EditorGUILayout.Slider( m_customGlareAttenuationGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.Attenuation, 0, 1 );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.CameraRotInfluence = EditorGUILayout.FloatField( m_customGlareRotationGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.CameraRotInfluence ); ;
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.CustomIncrement = EditorGUILayout.Slider( m_customGlareCustomIncrementGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.CustomIncrement, 0, 180 );
|
||||||
|
bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.LongAttenuation = EditorGUILayout.Slider( m_customGlareLongAttenuationGC, bloom.LensGlareInstance.CustomGlareDef[ i ].CustomStarData.LongAttenuation, 0, 1 );
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditorGUI.indentLevel++;
|
||||||
|
m_lensGlareAdvancedSettingsFoldout = CustomFoldout( m_lensGlareAdvancedSettingsFoldout, m_advancedSettingsLensGlareFoldoutGC );
|
||||||
|
if ( m_lensGlareAdvancedSettingsFoldout )
|
||||||
|
{
|
||||||
|
bloom.LensGlareInstance.PerPassDisplacement = EditorGUILayout.Slider( m_lensGlarePerPassDispGC, bloom.LensGlareInstance.PerPassDisplacement, 1, 8 );
|
||||||
|
bloom.LensGlareInstance.GlareMaxPassCount = EditorGUILayout.IntSlider( m_lensGlareMaxPerRayGC, bloom.LensGlareInstance.GlareMaxPassCount, 1, AmplifyGlare.MaxPasses );
|
||||||
|
|
||||||
|
}
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
|
}
|
||||||
|
GUI.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( EditorGUI.EndChangeCheck() )
|
||||||
|
{
|
||||||
|
EditorUtility.SetDirty( bloom );
|
||||||
|
#if !UNITY_PRE_5_3
|
||||||
|
if ( !Application.isPlaying )
|
||||||
|
{
|
||||||
|
EditorSceneManager.MarkSceneDirty( bloom.gameObject.scene );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GUILayout.EndVertical();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 79c2337ab36e39e45b6e521f43eb1b23
|
||||||
|
timeCreated: 1447666167
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Plugins/Editor/Resources.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8bae3645a24e3744fab5ec30f74b9af7
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1449661345
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Plugins/Editor/Resources/effect-icon.tiff
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a01cbbdf250cc3f45a0f180140bb24e0
|
||||||
|
timeCreated: 1449067237
|
||||||
|
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: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 8
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -3
|
||||||
|
maxTextureSize: 64
|
||||||
|
textureSettings:
|
||||||
|
filterMode: 0
|
||||||
|
aniso: 1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 0
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 1
|
||||||
|
textureType: 2
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Plugins/Runtime.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7ce8d57530aad324f817a1747f7942fe
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1449661395
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
243
Assets/AmplifyBloom/Plugins/Runtime/AmplifyBokeh.cs
Normal file
|
@ -0,0 +1,243 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public enum ApertureShape
|
||||||
|
{
|
||||||
|
Square,
|
||||||
|
Hexagon,
|
||||||
|
Octagon,
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class AmplifyBokehData
|
||||||
|
{
|
||||||
|
internal RenderTexture BokehRenderTexture;
|
||||||
|
internal Vector4[] Offsets;
|
||||||
|
|
||||||
|
public AmplifyBokehData( Vector4[] offsets )
|
||||||
|
{
|
||||||
|
Offsets = offsets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
if ( BokehRenderTexture != null )
|
||||||
|
{
|
||||||
|
AmplifyUtils.ReleaseTempRenderTarget( BokehRenderTexture );
|
||||||
|
BokehRenderTexture = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Offsets = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public sealed class AmplifyBokeh : IAmplifyItem, ISerializationCallbackReceiver
|
||||||
|
{
|
||||||
|
//CONSTS
|
||||||
|
private const int PerPassSampleCount = 8;
|
||||||
|
|
||||||
|
//SERIALIZABLE VARIABLES
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_isActive = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_applyOnBloomSource = false;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_bokehSampleRadius = 0.5f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Vector4 m_bokehCameraProperties = new Vector4( 0.05f, 0.018f, 1.34f, 0.18f ); // x - aperture y - Focal Length z - Focal Distance w - Max CoC Diameter
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_offsetRotation = 0;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private ApertureShape m_apertureShape = ApertureShape.Hexagon;
|
||||||
|
|
||||||
|
private List<AmplifyBokehData> m_bokehOffsets;
|
||||||
|
|
||||||
|
public AmplifyBokeh()
|
||||||
|
{
|
||||||
|
m_bokehOffsets = new List<AmplifyBokehData>();
|
||||||
|
CreateBokehOffsets( ApertureShape.Hexagon );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < m_bokehOffsets.Count; i++ )
|
||||||
|
{
|
||||||
|
m_bokehOffsets[ i ].Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreateBokehOffsets( ApertureShape shape )
|
||||||
|
{
|
||||||
|
m_bokehOffsets.Clear();
|
||||||
|
switch ( shape )
|
||||||
|
{
|
||||||
|
case ApertureShape.Square:
|
||||||
|
{
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation ) ) );
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation + 90 ) ) );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ApertureShape.Hexagon:
|
||||||
|
{
|
||||||
|
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation ) ) );
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation - 75 ) ) );
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation + 75 ) ) );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ApertureShape.Octagon:
|
||||||
|
{
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation ) ) );
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation + 65 ) ) );
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation + 90 ) ) );
|
||||||
|
m_bokehOffsets.Add( new AmplifyBokehData( CalculateBokehSamples( PerPassSampleCount, m_offsetRotation + 115 ) ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector4[] CalculateBokehSamples( int sampleCount, float angle )
|
||||||
|
{
|
||||||
|
Vector4[] bokehSamples = new Vector4[ sampleCount ];
|
||||||
|
float angleRad = Mathf.Deg2Rad * angle;
|
||||||
|
float aspectRatio = ( float ) Screen.width / ( float ) Screen.height;
|
||||||
|
Vector4 samplePoint = new Vector4( m_bokehSampleRadius * Mathf.Cos( angleRad ), m_bokehSampleRadius * Mathf.Sin( angleRad ) );
|
||||||
|
samplePoint.x /= aspectRatio;
|
||||||
|
for ( int i = 0; i < sampleCount; i++ )
|
||||||
|
{
|
||||||
|
float sampleInterp = ( float ) i / ( ( float ) sampleCount - 1.0f );
|
||||||
|
bokehSamples[ i ] = Vector4.Lerp( -samplePoint, samplePoint, sampleInterp );
|
||||||
|
}
|
||||||
|
return bokehSamples;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ApplyBokehFilter( RenderTexture source, Material material )
|
||||||
|
{
|
||||||
|
// ALLOCATE RENDER TEXTURES
|
||||||
|
for ( int i = 0; i < m_bokehOffsets.Count; i++ )
|
||||||
|
{
|
||||||
|
m_bokehOffsets[ i ].BokehRenderTexture = AmplifyUtils.GetTempRenderTarget( source.width, source.height );
|
||||||
|
}
|
||||||
|
|
||||||
|
// SET CAMERA PARAMS AND APPLY EACH ROTATIONAL WEIGHTS
|
||||||
|
material.SetVector( AmplifyUtils.BokehParamsId, m_bokehCameraProperties );
|
||||||
|
|
||||||
|
for ( int bId = 0; bId < m_bokehOffsets.Count; bId++ )
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < PerPassSampleCount; i++ )
|
||||||
|
{
|
||||||
|
material.SetVector( AmplifyUtils.AnamorphicGlareWeightsStr[ i ], m_bokehOffsets[ bId ].Offsets[ i ] );
|
||||||
|
}
|
||||||
|
Graphics.Blit( source, m_bokehOffsets[ bId ].BokehRenderTexture, material, ( int ) BloomPasses.BokehWeightedBlur );
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( int bId = 0; bId < m_bokehOffsets.Count - 1; bId++ )
|
||||||
|
{
|
||||||
|
material.SetTexture( AmplifyUtils.AnamorphicRTS[ bId ], m_bokehOffsets[ bId ].BokehRenderTexture );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// FINAL COMPOSITION
|
||||||
|
source.DiscardContents();
|
||||||
|
Graphics.Blit( m_bokehOffsets[ m_bokehOffsets.Count - 1 ].BokehRenderTexture, source, material, ( int ) BloomPasses.BokehComposition2S + ( m_bokehOffsets.Count - 2 ) );
|
||||||
|
|
||||||
|
//RELEASE RENDER TEXTURES
|
||||||
|
for ( int i = 0; i < m_bokehOffsets.Count; i++ )
|
||||||
|
{
|
||||||
|
AmplifyUtils.ReleaseTempRenderTarget( m_bokehOffsets[ i ].BokehRenderTexture );
|
||||||
|
m_bokehOffsets[ i ].BokehRenderTexture = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnAfterDeserialize()
|
||||||
|
{
|
||||||
|
CreateBokehOffsets( m_apertureShape );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnBeforeSerialize()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApertureShape ApertureShape
|
||||||
|
{
|
||||||
|
get { return m_apertureShape; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ( m_apertureShape != value )
|
||||||
|
{
|
||||||
|
m_apertureShape = value;
|
||||||
|
CreateBokehOffsets( value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ApplyBokeh
|
||||||
|
{
|
||||||
|
get { return m_isActive; }
|
||||||
|
set { m_isActive = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool ApplyOnBloomSource
|
||||||
|
{
|
||||||
|
get { return m_applyOnBloomSource; }
|
||||||
|
set { m_applyOnBloomSource = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float BokehSampleRadius
|
||||||
|
{
|
||||||
|
get { return m_bokehSampleRadius; }
|
||||||
|
set { m_bokehSampleRadius = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float OffsetRotation
|
||||||
|
{
|
||||||
|
get { return m_offsetRotation; }
|
||||||
|
set { m_offsetRotation = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector4 BokehCameraProperties
|
||||||
|
{
|
||||||
|
get { return m_bokehCameraProperties; }
|
||||||
|
set { m_bokehCameraProperties = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Aperture
|
||||||
|
{
|
||||||
|
get { return m_bokehCameraProperties.x; }
|
||||||
|
set { m_bokehCameraProperties.x = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float FocalLength
|
||||||
|
{
|
||||||
|
get { return m_bokehCameraProperties.y; }
|
||||||
|
set { m_bokehCameraProperties.y = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float FocalDistance
|
||||||
|
{
|
||||||
|
get { return m_bokehCameraProperties.z; }
|
||||||
|
set { m_bokehCameraProperties.z = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float MaxCoCDiameter
|
||||||
|
{
|
||||||
|
get { return m_bokehCameraProperties.w; }
|
||||||
|
set { m_bokehCameraProperties.w = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Runtime/AmplifyBokeh.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6061e71eef9eba14b8fe1d8a39cec722
|
||||||
|
timeCreated: 1448893808
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
629
Assets/AmplifyBloom/Plugins/Runtime/AmplifyGlare.cs
Normal file
|
@ -0,0 +1,629 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using System;
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// Glare form library
|
||||||
|
public enum GlareLibType
|
||||||
|
{
|
||||||
|
CheapLens = 0,
|
||||||
|
CrossScreen,
|
||||||
|
CrossScreenSpectral,
|
||||||
|
SnowCross,
|
||||||
|
SnowCrossSpectral,
|
||||||
|
SunnyCross,
|
||||||
|
SunnyCrossSpectral,
|
||||||
|
VerticalSlits,
|
||||||
|
HorizontalSlits,
|
||||||
|
Custom
|
||||||
|
};
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class GlareDefData
|
||||||
|
{
|
||||||
|
public bool FoldoutValue = true;
|
||||||
|
[SerializeField]
|
||||||
|
private StarLibType m_starType = StarLibType.Cross;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_starInclination = 0;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_chromaticAberration = 0;
|
||||||
|
[SerializeField]
|
||||||
|
private StarDefData m_customStarData = null;
|
||||||
|
|
||||||
|
public GlareDefData()
|
||||||
|
{
|
||||||
|
m_customStarData = new StarDefData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlareDefData( StarLibType starType, float starInclination, float chromaticAberration )
|
||||||
|
{
|
||||||
|
m_starType = starType;
|
||||||
|
m_starInclination = starInclination;
|
||||||
|
m_chromaticAberration = chromaticAberration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StarLibType StarType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_starType;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_starType = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float StarInclination
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_starInclination;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_starInclination = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float StarInclinationDeg
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_starInclination * Mathf.Rad2Deg;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_starInclination = value * Mathf.Deg2Rad;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float ChromaticAberration
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_chromaticAberration;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_chromaticAberration = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public StarDefData CustomStarData
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_customStarData;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_customStarData = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public sealed class AmplifyGlare : IAmplifyItem
|
||||||
|
{
|
||||||
|
public const int MaxLineSamples = 8;
|
||||||
|
public const int MaxTotalSamples = 16;
|
||||||
|
public const int MaxStarLines = 4;
|
||||||
|
public const int MaxPasses = 4;
|
||||||
|
public const int MaxCustomGlare = 32;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private GlareDefData[] m_customGlareDef;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_customGlareDefIdx = 0;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_customGlareDefAmount = 0;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_applyGlare = true;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Color _overallTint = Color.white;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private UnityEngine.Gradient m_cromaticAberrationGrad;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_glareMaxPassCount = MaxPasses;
|
||||||
|
|
||||||
|
private StarDefData[] m_starDefArr;
|
||||||
|
private GlareDefData[] m_glareDefArr;
|
||||||
|
|
||||||
|
private Matrix4x4[] m_weigthsMat;
|
||||||
|
private Matrix4x4[] m_offsetsMat;
|
||||||
|
|
||||||
|
private Color m_whiteReference;
|
||||||
|
|
||||||
|
private float m_aTanFoV;
|
||||||
|
|
||||||
|
private AmplifyGlareCache m_amplifyGlareCache;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_currentWidth;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_currentHeight;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private GlareLibType m_currentGlareType = GlareLibType.CheapLens;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_currentGlareIdx;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_perPassDisplacement = 4;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_intensity = 0.17f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_overallStreakScale = 1f;
|
||||||
|
|
||||||
|
private bool m_isDirty = true;
|
||||||
|
private RenderTexture[] _rtBuffer;
|
||||||
|
|
||||||
|
public AmplifyGlare()
|
||||||
|
{
|
||||||
|
m_currentGlareIdx = ( int ) m_currentGlareType;
|
||||||
|
|
||||||
|
m_cromaticAberrationGrad = new UnityEngine.Gradient();
|
||||||
|
|
||||||
|
UnityEngine.GradientColorKey[] colorKeys = new UnityEngine.GradientColorKey[] { new UnityEngine.GradientColorKey(Color.white,0f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.blue,0.25f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.green,0.5f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.yellow,0.75f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.red,1f)
|
||||||
|
};
|
||||||
|
UnityEngine.GradientAlphaKey[] alphaKeys = new UnityEngine.GradientAlphaKey[] { new UnityEngine.GradientAlphaKey(1f,0f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,0.25f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,0.5f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,0.75f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,1f)
|
||||||
|
};
|
||||||
|
m_cromaticAberrationGrad.SetKeys( colorKeys, alphaKeys );
|
||||||
|
|
||||||
|
|
||||||
|
_rtBuffer = new RenderTexture[ MaxStarLines * MaxPasses ];
|
||||||
|
|
||||||
|
m_weigthsMat = new Matrix4x4[ 4 ];
|
||||||
|
m_offsetsMat = new Matrix4x4[ 4 ];
|
||||||
|
|
||||||
|
m_amplifyGlareCache = new AmplifyGlareCache();
|
||||||
|
|
||||||
|
m_whiteReference = new Color( 0.63f, 0.63f, 0.63f, 0.0f );
|
||||||
|
m_aTanFoV = Mathf.Atan( Mathf.PI / MaxLineSamples );
|
||||||
|
|
||||||
|
|
||||||
|
m_starDefArr = new StarDefData[] { new StarDefData(StarLibType.Cross, "Cross", 2, 4, 1.0f, 0.85f, 0.0f, 0.5f, -1.0f, 90.0f),
|
||||||
|
new StarDefData(StarLibType.Cross_Filter,"CrossFilter", 2, 4, 1.0f, 0.95f, 0.0f, 0.5f, -1.0f, 90.0f),
|
||||||
|
new StarDefData(StarLibType.Snow_Cross, "snowCross", 3, 4, 1.0f, 0.96f, 0.349f, 0.5f, -1.0f, -1),
|
||||||
|
new StarDefData(StarLibType.Vertical, "Vertical", 1, 4, 1.0f, 0.96f, 0.0f, 0.0f, -1.0f, -1),
|
||||||
|
new StarDefData(StarLibType.Sunny_Cross, "SunnyCross", 4, 4, 1.0f, 0.88f, 0.0f, 0.0f, 0.95f, 45.0f)
|
||||||
|
};
|
||||||
|
|
||||||
|
m_glareDefArr = new GlareDefData[] { new GlareDefData( StarLibType.Cross, 0.00f, 0.5f),//Cheap Lens
|
||||||
|
new GlareDefData( StarLibType.Cross_Filter, 0.44f, 0.5f),//Cross Screen
|
||||||
|
new GlareDefData( StarLibType.Cross_Filter, 1.22f, 1.5f),//Cross Screen Spectral
|
||||||
|
new GlareDefData( StarLibType.Snow_Cross, 0.17f, 0.5f),//Snow Cross
|
||||||
|
new GlareDefData( StarLibType.Snow_Cross, 0.70f, 1.5f),//Snow Cross Spectral
|
||||||
|
new GlareDefData( StarLibType.Sunny_Cross, 0.00f, 0.5f),//Sunny Cross
|
||||||
|
new GlareDefData( StarLibType.Sunny_Cross, 0.79f, 1.5f),//Sunny Cross Spectral
|
||||||
|
new GlareDefData( StarLibType.Vertical, 1.57f, 0.5f),//Vertical Slits
|
||||||
|
new GlareDefData( StarLibType.Vertical, 0.00f, 0.5f) //Horizontal slits
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < m_starDefArr.Length; i++ )
|
||||||
|
{
|
||||||
|
m_starDefArr[ i ].Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_glareDefArr = null;
|
||||||
|
m_weigthsMat = null;
|
||||||
|
m_offsetsMat = null;
|
||||||
|
|
||||||
|
for ( int i = 0; i < _rtBuffer.Length; i++ )
|
||||||
|
{
|
||||||
|
if ( _rtBuffer[ i ] != null )
|
||||||
|
{
|
||||||
|
AmplifyUtils.ReleaseTempRenderTarget( _rtBuffer[ i ] );
|
||||||
|
_rtBuffer[ i ] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_rtBuffer = null;
|
||||||
|
|
||||||
|
m_amplifyGlareCache.Destroy();
|
||||||
|
m_amplifyGlareCache = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetDirty()
|
||||||
|
{
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnRenderFromCache( RenderTexture source, RenderTexture dest, Material material, float glareIntensity, float cameraRotation )
|
||||||
|
{
|
||||||
|
// ALLOCATE RENDER TEXTURES
|
||||||
|
for ( int i = 0; i < m_amplifyGlareCache.TotalRT; i++ )
|
||||||
|
{
|
||||||
|
_rtBuffer[ i ] = AmplifyUtils.GetTempRenderTarget( source.width, source.height );
|
||||||
|
}
|
||||||
|
|
||||||
|
int rtIdx = 0;
|
||||||
|
for ( int d = 0; d < m_amplifyGlareCache.StarDef.StarlinesCount; d++ )
|
||||||
|
{
|
||||||
|
for ( int p = 0; p < m_amplifyGlareCache.CurrentPassCount; p++ )
|
||||||
|
{
|
||||||
|
// APPLY SHADER
|
||||||
|
UpdateMatrixesForPass( material, m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets, m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Weights, glareIntensity, cameraRotation * m_amplifyGlareCache.StarDef.CameraRotInfluence );
|
||||||
|
|
||||||
|
//CREATED WEIGHTED TEXTURE
|
||||||
|
if ( p == 0 )
|
||||||
|
{
|
||||||
|
Graphics.Blit( source, _rtBuffer[ rtIdx ], material, ( int ) BloomPasses.AnamorphicGlare );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Graphics.Blit( _rtBuffer[ rtIdx - 1 ], _rtBuffer[ rtIdx ], material, ( int ) BloomPasses.AnamorphicGlare );
|
||||||
|
}
|
||||||
|
rtIdx += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ADD TO MAIN RT
|
||||||
|
for ( int i = 0; i < m_amplifyGlareCache.StarDef.StarlinesCount; i++ )
|
||||||
|
{
|
||||||
|
material.SetVector( AmplifyUtils.AnamorphicGlareWeightsStr[ i ], m_amplifyGlareCache.AverageWeight );
|
||||||
|
int idx = ( i + 1 ) * m_amplifyGlareCache.CurrentPassCount - 1;
|
||||||
|
material.SetTexture( AmplifyUtils.AnamorphicRTS[ i ], _rtBuffer[ idx ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int passId = ( int ) BloomPasses.WeightedAddPS1 + m_amplifyGlareCache.StarDef.StarlinesCount - 1;
|
||||||
|
dest.DiscardContents();
|
||||||
|
Graphics.Blit( _rtBuffer[ 0 ], dest, material, passId );
|
||||||
|
|
||||||
|
//RELEASE RT's
|
||||||
|
for ( rtIdx = 0; rtIdx < _rtBuffer.Length; rtIdx++ )
|
||||||
|
{
|
||||||
|
AmplifyUtils.ReleaseTempRenderTarget( _rtBuffer[ rtIdx ] );
|
||||||
|
_rtBuffer[ rtIdx ] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateMatrixesForPass( Material material, Vector4[] offsets, Vector4[] weights, float glareIntensity, float rotation )
|
||||||
|
{
|
||||||
|
float cosRot = Mathf.Cos( rotation );
|
||||||
|
float sinRot = Mathf.Sin( rotation );
|
||||||
|
|
||||||
|
for ( int i = 0; i < MaxTotalSamples; i++ )
|
||||||
|
{
|
||||||
|
int matIdx = i >> 2;
|
||||||
|
int vecIdx = i & 3;
|
||||||
|
m_offsetsMat[ matIdx ][ vecIdx, 0 ] = offsets[ i ].x * cosRot - offsets[ i ].y * sinRot;
|
||||||
|
m_offsetsMat[ matIdx ][ vecIdx, 1 ] = offsets[ i ].x * sinRot + offsets[ i ].y * cosRot;
|
||||||
|
|
||||||
|
m_weigthsMat[ matIdx ][ vecIdx, 0 ] = glareIntensity * weights[ i ].x;
|
||||||
|
m_weigthsMat[ matIdx ][ vecIdx, 1 ] = glareIntensity * weights[ i ].y;
|
||||||
|
m_weigthsMat[ matIdx ][ vecIdx, 2 ] = glareIntensity * weights[ i ].z;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( int i = 0; i < 4; i++ )
|
||||||
|
{
|
||||||
|
material.SetMatrix( AmplifyUtils.AnamorphicGlareOffsetsMatStr[ i ], m_offsetsMat[ i ] );
|
||||||
|
material.SetMatrix( AmplifyUtils.AnamorphicGlareWeightsMatStr[ i ], m_weigthsMat[ i ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnRenderImage( Material material, RenderTexture source, RenderTexture dest, float cameraRot )
|
||||||
|
{
|
||||||
|
//NEED TO SET DESTINATION RENDER TARGET TO COMPLETELLY BLACK SO WE CAN SUM ALL THE GLARE/STAR PASSES ON IT
|
||||||
|
Graphics.Blit( Texture2D.blackTexture, dest );
|
||||||
|
|
||||||
|
if ( m_isDirty ||
|
||||||
|
m_currentWidth != source.width ||
|
||||||
|
m_currentHeight != source.height )
|
||||||
|
{
|
||||||
|
m_isDirty = false;
|
||||||
|
m_currentWidth = source.width;
|
||||||
|
m_currentHeight = source.height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnRenderFromCache( source, dest, material, m_intensity, cameraRot );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GlareDefData glareDef = null;
|
||||||
|
bool validCustom = false;
|
||||||
|
if ( m_currentGlareType == GlareLibType.Custom )
|
||||||
|
{
|
||||||
|
if ( m_customGlareDef != null && m_customGlareDef.Length > 0 )
|
||||||
|
{
|
||||||
|
glareDef = m_customGlareDef[ m_customGlareDefIdx ];
|
||||||
|
validCustom = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glareDef = m_glareDefArr[ 0 ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glareDef = m_glareDefArr[ m_currentGlareIdx ];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
m_amplifyGlareCache.GlareDef = glareDef;
|
||||||
|
|
||||||
|
float srcW = source.width;
|
||||||
|
float srcH = source.height;
|
||||||
|
|
||||||
|
StarDefData starDef = ( validCustom ) ? glareDef.CustomStarData : m_starDefArr[ ( int ) glareDef.StarType ];
|
||||||
|
|
||||||
|
|
||||||
|
m_amplifyGlareCache.StarDef = starDef;
|
||||||
|
int currPassCount = ( m_glareMaxPassCount < starDef.PassCount ) ? m_glareMaxPassCount : starDef.PassCount;
|
||||||
|
m_amplifyGlareCache.CurrentPassCount = currPassCount;
|
||||||
|
float radOffset = glareDef.StarInclination + starDef.Inclination;
|
||||||
|
|
||||||
|
for ( int p = 0; p < m_glareMaxPassCount; p++ )
|
||||||
|
{
|
||||||
|
float ratio = ( float ) ( p + 1 ) / ( float ) m_glareMaxPassCount;
|
||||||
|
|
||||||
|
for ( int s = 0; s < MaxLineSamples; s++ )
|
||||||
|
{
|
||||||
|
Color chromaticAberrColor = _overallTint * Color.Lerp( m_cromaticAberrationGrad.Evaluate( ( float ) s / ( float ) ( MaxLineSamples - 1 ) ), m_whiteReference, ratio );
|
||||||
|
m_amplifyGlareCache.CromaticAberrationMat[ p, s ] = Color.Lerp( m_whiteReference, chromaticAberrColor, glareDef.ChromaticAberration );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_amplifyGlareCache.TotalRT = starDef.StarlinesCount * currPassCount;
|
||||||
|
|
||||||
|
for ( int i = 0; i < m_amplifyGlareCache.TotalRT; i++ )
|
||||||
|
{
|
||||||
|
_rtBuffer[ i ] = AmplifyUtils.GetTempRenderTarget( source.width, source.height );
|
||||||
|
}
|
||||||
|
|
||||||
|
int rtIdx = 0;
|
||||||
|
for ( int d = 0; d < starDef.StarlinesCount; d++ )
|
||||||
|
{
|
||||||
|
StarLineData starLine = starDef.StarLinesArr[ d ];
|
||||||
|
float angle = radOffset + starLine.Inclination;
|
||||||
|
float sinAngle = Mathf.Sin( angle );
|
||||||
|
float cosAngle = Mathf.Cos( angle );
|
||||||
|
Vector2 vtStepUV = new Vector2();
|
||||||
|
vtStepUV.x = cosAngle / srcW * ( starLine.SampleLength * m_overallStreakScale );
|
||||||
|
vtStepUV.y = sinAngle / srcH * ( starLine.SampleLength * m_overallStreakScale );
|
||||||
|
|
||||||
|
float attnPowScale = ( m_aTanFoV + 0.1f ) * ( 280.0f ) / ( srcW + srcH ) * 1.2f;
|
||||||
|
|
||||||
|
for ( int p = 0; p < currPassCount; p++ )
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < MaxLineSamples; i++ )
|
||||||
|
{
|
||||||
|
float lum = Mathf.Pow( starLine.Attenuation, attnPowScale * i );
|
||||||
|
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Weights[ i ] = m_amplifyGlareCache.CromaticAberrationMat[ currPassCount - 1 - p, i ] * lum * ( p + 1.0f ) * 0.5f;
|
||||||
|
|
||||||
|
// OFFSET OF SAMPLING COORDINATE
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i ].x = vtStepUV.x * i;
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i ].y = vtStepUV.y * i;
|
||||||
|
if ( Mathf.Abs( m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i ].x ) >= 0.9f ||
|
||||||
|
Mathf.Abs( m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i ].y ) >= 0.9f )
|
||||||
|
{
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i ].x = 0.0f;
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i ].y = 0.0f;
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Weights[ i ] *= 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MIRROR STARLINE
|
||||||
|
for ( int i = MaxLineSamples; i < MaxTotalSamples; i++ )
|
||||||
|
{
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i ] = -m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets[ i - MaxLineSamples ];
|
||||||
|
m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Weights[ i ] = m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Weights[ i - MaxLineSamples ];
|
||||||
|
}
|
||||||
|
|
||||||
|
// APPLY SHADER
|
||||||
|
UpdateMatrixesForPass( material, m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Offsets, m_amplifyGlareCache.Starlines[ d ].Passes[ p ].Weights, m_intensity, starDef.CameraRotInfluence * cameraRot );
|
||||||
|
|
||||||
|
//CREATED WEIGHTED TEXTURE
|
||||||
|
if ( p == 0 )
|
||||||
|
{
|
||||||
|
Graphics.Blit( source, _rtBuffer[ rtIdx ], material, ( int ) BloomPasses.AnamorphicGlare );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Graphics.Blit( _rtBuffer[ rtIdx - 1 ], _rtBuffer[ rtIdx ], material, ( int ) BloomPasses.AnamorphicGlare );
|
||||||
|
}
|
||||||
|
|
||||||
|
rtIdx += 1;
|
||||||
|
vtStepUV *= m_perPassDisplacement;
|
||||||
|
attnPowScale *= m_perPassDisplacement;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ADD TO MAIN RT
|
||||||
|
m_amplifyGlareCache.AverageWeight = Vector4.one / starDef.StarlinesCount;
|
||||||
|
for ( int i = 0; i < starDef.StarlinesCount; i++ )
|
||||||
|
{
|
||||||
|
material.SetVector( AmplifyUtils.AnamorphicGlareWeightsStr[ i ], m_amplifyGlareCache.AverageWeight );
|
||||||
|
int idx = ( i + 1 ) * currPassCount - 1;
|
||||||
|
material.SetTexture( AmplifyUtils.AnamorphicRTS[ i ], _rtBuffer[ idx ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
int passId = ( int ) BloomPasses.WeightedAddPS1 + starDef.StarlinesCount - 1;
|
||||||
|
dest.DiscardContents();
|
||||||
|
Graphics.Blit( _rtBuffer[ 0 ], dest, material, passId );
|
||||||
|
|
||||||
|
//RELEASE RT's
|
||||||
|
for ( rtIdx = 0; rtIdx < _rtBuffer.Length; rtIdx++ )
|
||||||
|
{
|
||||||
|
AmplifyUtils.ReleaseTempRenderTarget( _rtBuffer[ rtIdx ] );
|
||||||
|
_rtBuffer[ rtIdx ] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlareLibType CurrentGlare
|
||||||
|
{
|
||||||
|
get { return m_currentGlareType; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ( m_currentGlareType != value )
|
||||||
|
{
|
||||||
|
m_currentGlareType = value;
|
||||||
|
m_currentGlareIdx = ( int ) value;
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GlareMaxPassCount
|
||||||
|
{
|
||||||
|
get { return m_glareMaxPassCount; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_glareMaxPassCount = value;
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float PerPassDisplacement
|
||||||
|
{
|
||||||
|
get { return m_perPassDisplacement; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_perPassDisplacement = value;
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Intensity
|
||||||
|
{
|
||||||
|
get { return m_intensity; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_intensity = value < 0 ? 0 : value;
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Color OverallTint
|
||||||
|
{
|
||||||
|
get { return _overallTint; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_overallTint = value;
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ApplyLensGlare
|
||||||
|
{
|
||||||
|
get { return m_applyGlare; }
|
||||||
|
set { m_applyGlare = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public UnityEngine.Gradient CromaticColorGradient
|
||||||
|
{
|
||||||
|
get { return m_cromaticAberrationGrad; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_cromaticAberrationGrad = value;
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float OverallStreakScale
|
||||||
|
{
|
||||||
|
get { return m_overallStreakScale; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_overallStreakScale = value;
|
||||||
|
m_isDirty = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlareDefData[] CustomGlareDef
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_customGlareDef;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_customGlareDef = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CustomGlareDefIdx
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_customGlareDefIdx;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_customGlareDefIdx = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CustomGlareDefAmount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_customGlareDefAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if ( value == m_customGlareDefAmount )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( value == 0 )
|
||||||
|
{
|
||||||
|
m_customGlareDef = null;
|
||||||
|
m_customGlareDefIdx = 0;
|
||||||
|
m_customGlareDefAmount = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
GlareDefData[] newArr = new GlareDefData[ value ];
|
||||||
|
for ( int i = 0; i < value; i++ )
|
||||||
|
{
|
||||||
|
if ( i < m_customGlareDefAmount )
|
||||||
|
{
|
||||||
|
newArr[ i ] = m_customGlareDef[ i ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newArr[ i ] = new GlareDefData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_customGlareDefIdx = Mathf.Clamp( m_customGlareDefIdx, 0, value - 1 );
|
||||||
|
m_customGlareDef = newArr;
|
||||||
|
newArr = null;
|
||||||
|
m_customGlareDefAmount = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Runtime/AmplifyGlare.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a1cc5231e48f70c40982a9128e25adca
|
||||||
|
timeCreated: 1447865180
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
99
Assets/AmplifyBloom/Plugins/Runtime/AmplifyGlareCache.cs
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class AmplifyPassCache
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
internal Vector4[] Offsets;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
internal Vector4[] Weights;
|
||||||
|
|
||||||
|
public AmplifyPassCache()
|
||||||
|
{
|
||||||
|
Offsets = new Vector4[ 16 ];
|
||||||
|
Weights = new Vector4[ 16 ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
Offsets = null;
|
||||||
|
Weights = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class AmplifyStarlineCache
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
internal AmplifyPassCache[] Passes;
|
||||||
|
public AmplifyStarlineCache()
|
||||||
|
{
|
||||||
|
Passes = new AmplifyPassCache[ AmplifyGlare.MaxPasses ];
|
||||||
|
for ( int i = 0; i < AmplifyGlare.MaxPasses; i++ )
|
||||||
|
{
|
||||||
|
Passes[ i ] = new AmplifyPassCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < AmplifyGlare.MaxPasses; i++ )
|
||||||
|
{
|
||||||
|
Passes[ i ].Destroy();
|
||||||
|
}
|
||||||
|
Passes = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class AmplifyGlareCache
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
internal AmplifyStarlineCache[] Starlines;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
internal Vector4 AverageWeight;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
internal Vector4[,] CromaticAberrationMat;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
internal int TotalRT;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
internal GlareDefData GlareDef;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
internal StarDefData StarDef;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
internal int CurrentPassCount;
|
||||||
|
|
||||||
|
public AmplifyGlareCache()
|
||||||
|
{
|
||||||
|
Starlines = new AmplifyStarlineCache[ AmplifyGlare.MaxStarLines ];
|
||||||
|
CromaticAberrationMat = new Vector4[ AmplifyGlare.MaxPasses, AmplifyGlare.MaxLineSamples ];
|
||||||
|
for ( int i = 0; i < AmplifyGlare.MaxStarLines; i++ )
|
||||||
|
{
|
||||||
|
Starlines[ i ] = new AmplifyStarlineCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < AmplifyGlare.MaxStarLines; i++ )
|
||||||
|
{
|
||||||
|
Starlines[ i ].Destroy();
|
||||||
|
}
|
||||||
|
Starlines = null;
|
||||||
|
CromaticAberrationMat = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 354066a252ef8f04eae30e7aad2f8348
|
||||||
|
timeCreated: 1448470266
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Plugins/Runtime/AmplifyItem.cs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
interface IAmplifyItem
|
||||||
|
{
|
||||||
|
void Destroy();
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Runtime/AmplifyItem.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 366d7e76b8e8e6040a63ce8209ddc06d
|
||||||
|
timeCreated: 1449052344
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
242
Assets/AmplifyBloom/Plugins/Runtime/AmplifyLensFlare.cs
Normal file
|
@ -0,0 +1,242 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
[System.Serializable]
|
||||||
|
public class AmplifyLensFlare : IAmplifyItem
|
||||||
|
{
|
||||||
|
//CONSTS
|
||||||
|
private const int LUTTextureWidth = 256;
|
||||||
|
|
||||||
|
//SERIALIZABLE VARIABLES
|
||||||
|
[SerializeField]
|
||||||
|
private float m_overallIntensity = 1f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_normalizedGhostIntensity = 0.8f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_normalizedHaloIntensity = 0.1f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_applyLensFlare = true;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_lensFlareGhostAmount = 3;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Vector4 m_lensFlareGhostsParams = new Vector4( 0.8f, 0.228f, 1, 4 );// x - intensity y - Dispersal z - Power Factor w - Power Falloff
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_lensFlareGhostChrDistortion = 2;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private UnityEngine.Gradient m_lensGradient;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Texture2D m_lensFlareGradTexture;
|
||||||
|
|
||||||
|
private Color[] m_lensFlareGradColor = new Color[ LUTTextureWidth ];
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private Vector4 m_lensFlareHaloParams = new Vector4( 0.1f, 0.573f, 1, 128 ); // x - Intensity y - Width z - Power Factor w - Power Falloff
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private float m_lensFlareHaloChrDistortion = 1.51f;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_lensFlareGaussianBlurAmount = 1;
|
||||||
|
|
||||||
|
public AmplifyLensFlare()
|
||||||
|
{
|
||||||
|
m_lensGradient = new UnityEngine.Gradient();
|
||||||
|
|
||||||
|
UnityEngine.GradientColorKey[] colorKeys = new UnityEngine.GradientColorKey[] { new UnityEngine.GradientColorKey(Color.white,0f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.blue,0.25f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.green,0.5f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.yellow,0.75f),
|
||||||
|
new UnityEngine.GradientColorKey(Color.red,1f)
|
||||||
|
};
|
||||||
|
UnityEngine.GradientAlphaKey[] alphaKeys = new UnityEngine.GradientAlphaKey[] { new UnityEngine.GradientAlphaKey(1f,0f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,0.25f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,0.5f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,0.75f),
|
||||||
|
new UnityEngine.GradientAlphaKey(1f,1f)
|
||||||
|
};
|
||||||
|
m_lensGradient.SetKeys( colorKeys, alphaKeys );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
if ( m_lensFlareGradTexture != null )
|
||||||
|
{
|
||||||
|
GameObject.DestroyImmediate( m_lensFlareGradTexture );
|
||||||
|
m_lensFlareGradTexture = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateLUTexture()
|
||||||
|
{
|
||||||
|
m_lensFlareGradTexture = new Texture2D( LUTTextureWidth, 1, TextureFormat.ARGB32, false );
|
||||||
|
m_lensFlareGradTexture.filterMode = FilterMode.Bilinear;
|
||||||
|
TextureFromGradient();
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderTexture ApplyFlare( Material material, RenderTexture source )
|
||||||
|
{
|
||||||
|
RenderTexture dest = AmplifyUtils.GetTempRenderTarget( source.width, source.height );
|
||||||
|
material.SetVector( AmplifyUtils.LensFlareGhostsParamsId, m_lensFlareGhostsParams );
|
||||||
|
material.SetTexture( AmplifyUtils.LensFlareLUTId, m_lensFlareGradTexture );
|
||||||
|
material.SetVector( AmplifyUtils.LensFlareHaloParamsId, m_lensFlareHaloParams );
|
||||||
|
material.SetFloat( AmplifyUtils.LensFlareGhostChrDistortionId, m_lensFlareGhostChrDistortion );
|
||||||
|
material.SetFloat( AmplifyUtils.LensFlareHaloChrDistortionId, m_lensFlareHaloChrDistortion );
|
||||||
|
Graphics.Blit( source, dest, material, ( int ) BloomPasses.LensFlare0 + m_lensFlareGhostAmount );
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TextureFromGradient()
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < LUTTextureWidth; i++ )
|
||||||
|
{
|
||||||
|
m_lensFlareGradColor[ i ] = m_lensGradient.Evaluate( ( float ) i / ( float ) ( LUTTextureWidth - 1 ) );
|
||||||
|
}
|
||||||
|
m_lensFlareGradTexture.SetPixels( m_lensFlareGradColor );
|
||||||
|
m_lensFlareGradTexture.Apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ApplyLensFlare
|
||||||
|
{
|
||||||
|
get { return m_applyLensFlare; }
|
||||||
|
set { m_applyLensFlare = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float OverallIntensity
|
||||||
|
{
|
||||||
|
get { return m_overallIntensity; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_overallIntensity = value < 0 ? 0 : value;
|
||||||
|
m_lensFlareGhostsParams.x = value * m_normalizedGhostIntensity;
|
||||||
|
m_lensFlareHaloParams.x = value * m_normalizedHaloIntensity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public int LensFlareGhostAmount
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGhostAmount; }
|
||||||
|
set { m_lensFlareGhostAmount = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector4 LensFlareGhostsParams
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGhostsParams; }
|
||||||
|
set { m_lensFlareGhostsParams = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareNormalizedGhostsIntensity
|
||||||
|
{
|
||||||
|
get { return m_normalizedGhostIntensity; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_normalizedGhostIntensity = value < 0 ? 0 : value;
|
||||||
|
m_lensFlareGhostsParams.x = m_overallIntensity * m_normalizedGhostIntensity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareGhostsIntensity
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGhostsParams.x; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_lensFlareGhostsParams.x = value < 0 ? 0 : value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareGhostsDispersal
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGhostsParams.y; }
|
||||||
|
set { m_lensFlareGhostsParams.y = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareGhostsPowerFactor
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGhostsParams.z; }
|
||||||
|
set { m_lensFlareGhostsParams.z = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareGhostsPowerFalloff
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGhostsParams.w; }
|
||||||
|
set { m_lensFlareGhostsParams.w = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public UnityEngine.Gradient LensFlareGradient
|
||||||
|
{
|
||||||
|
get { return m_lensGradient; }
|
||||||
|
set { m_lensGradient = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector4 LensFlareHaloParams
|
||||||
|
{
|
||||||
|
get { return m_lensFlareHaloParams; }
|
||||||
|
set { m_lensFlareHaloParams = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareNormalizedHaloIntensity
|
||||||
|
{
|
||||||
|
get { return m_normalizedHaloIntensity; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_normalizedHaloIntensity = value < 0 ? 0 : value;
|
||||||
|
m_lensFlareHaloParams.x = m_overallIntensity * m_normalizedHaloIntensity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareHaloIntensity
|
||||||
|
{
|
||||||
|
get { return m_lensFlareHaloParams.x; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_lensFlareHaloParams.x = value < 0 ? 0 : value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareHaloWidth
|
||||||
|
{
|
||||||
|
get { return m_lensFlareHaloParams.y; }
|
||||||
|
set { m_lensFlareHaloParams.y = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareHaloPowerFactor
|
||||||
|
{
|
||||||
|
get { return m_lensFlareHaloParams.z; }
|
||||||
|
set { m_lensFlareHaloParams.z = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareHaloPowerFalloff
|
||||||
|
{
|
||||||
|
get { return m_lensFlareHaloParams.w; }
|
||||||
|
set { m_lensFlareHaloParams.w = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareGhostChrDistortion
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGhostChrDistortion; }
|
||||||
|
set { m_lensFlareGhostChrDistortion = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LensFlareHaloChrDistortion
|
||||||
|
{
|
||||||
|
get { return m_lensFlareHaloChrDistortion; }
|
||||||
|
set { m_lensFlareHaloChrDistortion = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public int LensFlareGaussianBlurAmount
|
||||||
|
{
|
||||||
|
get { return m_lensFlareGaussianBlurAmount; }
|
||||||
|
set { m_lensFlareGaussianBlurAmount = value; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Runtime/AmplifyLensFlare.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9899e724796c8e246a080699e82fdbc6
|
||||||
|
timeCreated: 1449759082
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
249
Assets/AmplifyBloom/Plugins/Runtime/AmplifyStarData.cs
Normal file
|
@ -0,0 +1,249 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using System;
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
// Star generation
|
||||||
|
|
||||||
|
// Define each line of the star.
|
||||||
|
[Serializable]
|
||||||
|
public class StarLineData
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
internal int PassCount;
|
||||||
|
[SerializeField]
|
||||||
|
internal float SampleLength;
|
||||||
|
[SerializeField]
|
||||||
|
internal float Attenuation;
|
||||||
|
[SerializeField]
|
||||||
|
internal float Inclination;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Star form library
|
||||||
|
public enum StarLibType
|
||||||
|
{
|
||||||
|
Cross = 0,
|
||||||
|
Cross_Filter,
|
||||||
|
Snow_Cross,
|
||||||
|
Vertical,
|
||||||
|
Sunny_Cross
|
||||||
|
};
|
||||||
|
|
||||||
|
// Simple definition of the star.
|
||||||
|
[Serializable]
|
||||||
|
public class StarDefData
|
||||||
|
{
|
||||||
|
[SerializeField]
|
||||||
|
private StarLibType m_starType = StarLibType.Cross;
|
||||||
|
[SerializeField]
|
||||||
|
private string m_starName = string.Empty;
|
||||||
|
[SerializeField]
|
||||||
|
private int m_starlinesCount = 2;
|
||||||
|
[SerializeField]
|
||||||
|
private int m_passCount = 4;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_sampleLength = 1;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_attenuation = 0.85f;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_inclination = 0;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_rotation = 0;
|
||||||
|
[SerializeField]
|
||||||
|
private StarLineData[] m_starLinesArr = null;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_customIncrement = 90;
|
||||||
|
[SerializeField]
|
||||||
|
private float m_longAttenuation = 0;
|
||||||
|
|
||||||
|
public StarDefData(){}
|
||||||
|
|
||||||
|
public void Destroy()
|
||||||
|
{
|
||||||
|
m_starLinesArr = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StarDefData( StarLibType starType, string starName, int starLinesCount, int passCount, float sampleLength, float attenuation, float inclination, float rotation, float longAttenuation = 0, float customIncrement = -1 )
|
||||||
|
{
|
||||||
|
m_starType = starType;
|
||||||
|
|
||||||
|
m_starName = starName;
|
||||||
|
m_passCount = passCount;
|
||||||
|
m_sampleLength = sampleLength;
|
||||||
|
m_attenuation = attenuation;
|
||||||
|
m_starlinesCount = starLinesCount;
|
||||||
|
m_inclination = inclination;
|
||||||
|
m_rotation = rotation;
|
||||||
|
m_customIncrement = customIncrement;
|
||||||
|
m_longAttenuation = longAttenuation;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CalculateStarData()
|
||||||
|
{
|
||||||
|
if ( m_starlinesCount == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_starLinesArr = new StarLineData[ m_starlinesCount ];
|
||||||
|
float fInc = ( m_customIncrement > 0 ) ? m_customIncrement : ( 180.0f / ( float ) m_starlinesCount );
|
||||||
|
fInc *= Mathf.Deg2Rad;
|
||||||
|
for ( int i = 0; i < m_starlinesCount; i++ )
|
||||||
|
{
|
||||||
|
m_starLinesArr[ i ] = new StarLineData();
|
||||||
|
m_starLinesArr[ i ].PassCount = m_passCount;
|
||||||
|
m_starLinesArr[ i ].SampleLength = m_sampleLength;
|
||||||
|
if ( m_longAttenuation > 0 )
|
||||||
|
{
|
||||||
|
m_starLinesArr[ i ].Attenuation = ( ( i % 2 ) == 0 ) ? m_longAttenuation : m_attenuation;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_starLinesArr[ i ].Attenuation = m_attenuation;
|
||||||
|
}
|
||||||
|
m_starLinesArr[ i ].Inclination = fInc * ( float ) i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public StarLibType StarType
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_starType;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_starType = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string StarName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_starName;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_starName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int StarlinesCount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_starlinesCount;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_starlinesCount = value;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public int PassCount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_passCount;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_passCount = value;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public float SampleLength
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_sampleLength;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_sampleLength = value;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public float Attenuation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_attenuation;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_attenuation = value;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Inclination
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_inclination;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_inclination = value;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public float CameraRotInfluence
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_rotation;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_rotation = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public StarLineData[] StarLinesArr
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_starLinesArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public float CustomIncrement
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_customIncrement;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_customIncrement = value;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float LongAttenuation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_longAttenuation;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_longAttenuation = value;
|
||||||
|
CalculateStarData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Runtime/AmplifyStarData.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a83dd0640588dce4aa5d37521ffef61d
|
||||||
|
timeCreated: 1451915691
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
203
Assets/AmplifyBloom/Plugins/Runtime/AmplifyUtils.cs
Normal file
|
@ -0,0 +1,203 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public enum LogType
|
||||||
|
{
|
||||||
|
Normal,
|
||||||
|
Warning,
|
||||||
|
Error
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AmplifyUtils
|
||||||
|
{
|
||||||
|
public static int MaskTextureId;
|
||||||
|
public static int BlurRadiusId;
|
||||||
|
public static string HighPrecisionKeyword = "AB_HIGH_PRECISION";
|
||||||
|
public static string ShaderModeTag = "Mode";
|
||||||
|
public static string ShaderModeValue = "Full";
|
||||||
|
public static string DebugStr = "[ Amplify Bloom ] ";
|
||||||
|
public static int UpscaleContributionId;
|
||||||
|
public static int SourceContributionId;
|
||||||
|
public static int LensStarburstRTId;
|
||||||
|
public static int LensDirtRTId;
|
||||||
|
public static int LensFlareRTId;
|
||||||
|
public static int LensGlareRTId;
|
||||||
|
public static int[] MipResultsRTS;
|
||||||
|
public static int[] AnamorphicRTS;
|
||||||
|
public static int[] AnamorphicGlareWeightsMatStr;
|
||||||
|
public static int[] AnamorphicGlareOffsetsMatStr;
|
||||||
|
public static int[] AnamorphicGlareWeightsStr;
|
||||||
|
public static int[] UpscaleWeightsStr;
|
||||||
|
public static int[] LensDirtWeightsStr;
|
||||||
|
public static int[] LensStarburstWeightsStr;
|
||||||
|
public static int BloomRangeId;
|
||||||
|
public static int LensDirtStrengthId;
|
||||||
|
public static int BloomParamsId;
|
||||||
|
public static int TempFilterValueId;
|
||||||
|
public static int LensFlareStarMatrixId;
|
||||||
|
public static int LensFlareStarburstStrengthId;
|
||||||
|
public static int LensFlareGhostsParamsId;
|
||||||
|
public static int LensFlareLUTId;
|
||||||
|
public static int LensFlareHaloParamsId;
|
||||||
|
public static int LensFlareGhostChrDistortionId;
|
||||||
|
public static int LensFlareHaloChrDistortionId;
|
||||||
|
public static int BokehParamsId = -1;
|
||||||
|
public static RenderTextureFormat CurrentRTFormat = RenderTextureFormat.DefaultHDR;
|
||||||
|
public static FilterMode CurrentFilterMode = FilterMode.Bilinear;
|
||||||
|
public static TextureWrapMode CurrentWrapMode = TextureWrapMode.Clamp;
|
||||||
|
public static RenderTextureReadWrite CurrentReadWriteMode = RenderTextureReadWrite.sRGB;
|
||||||
|
public static bool IsInitialized = false;
|
||||||
|
|
||||||
|
private static List<RenderTexture> _allocatedRT = new List<RenderTexture>();
|
||||||
|
public static void InitializeIds()
|
||||||
|
{
|
||||||
|
IsInitialized = true;
|
||||||
|
MaskTextureId = Shader.PropertyToID( "_MaskTex" );
|
||||||
|
|
||||||
|
MipResultsRTS = new int[]{ Shader.PropertyToID( "_MipResultsRTS0" ),
|
||||||
|
Shader.PropertyToID( "_MipResultsRTS1" ),
|
||||||
|
Shader.PropertyToID( "_MipResultsRTS2" ),
|
||||||
|
Shader.PropertyToID( "_MipResultsRTS3" ),
|
||||||
|
Shader.PropertyToID( "_MipResultsRTS4" ),
|
||||||
|
Shader.PropertyToID( "_MipResultsRTS5" )};
|
||||||
|
|
||||||
|
AnamorphicRTS = new int[]{ Shader.PropertyToID( "_AnamorphicRTS0" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicRTS1" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicRTS2" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicRTS3" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicRTS4" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicRTS5" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicRTS6" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicRTS7" )};
|
||||||
|
|
||||||
|
AnamorphicGlareWeightsMatStr = new int[]{ Shader.PropertyToID( "_AnamorphicGlareWeightsMat0" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeightsMat1" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeightsMat2" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeightsMat3" )};
|
||||||
|
|
||||||
|
|
||||||
|
AnamorphicGlareOffsetsMatStr = new int[]{ Shader.PropertyToID( "_AnamorphicGlareOffsetsMat0" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareOffsetsMat1" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareOffsetsMat2" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareOffsetsMat3" )};
|
||||||
|
|
||||||
|
AnamorphicGlareWeightsStr = new int[]{ Shader.PropertyToID( "_AnamorphicGlareWeights0" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights1" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights2" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights3" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights4" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights5" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights6" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights7" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights8" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights9" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights10" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights11" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights12" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights13" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights14" ),
|
||||||
|
Shader.PropertyToID( "_AnamorphicGlareWeights15" )};
|
||||||
|
|
||||||
|
UpscaleWeightsStr = new int[]{ Shader.PropertyToID( "_UpscaleWeights0" ),
|
||||||
|
Shader.PropertyToID( "_UpscaleWeights1" ),
|
||||||
|
Shader.PropertyToID( "_UpscaleWeights2" ),
|
||||||
|
Shader.PropertyToID( "_UpscaleWeights3" ),
|
||||||
|
Shader.PropertyToID( "_UpscaleWeights4" ),
|
||||||
|
Shader.PropertyToID( "_UpscaleWeights5" ),
|
||||||
|
Shader.PropertyToID( "_UpscaleWeights6" ),
|
||||||
|
Shader.PropertyToID( "_UpscaleWeights7" )};
|
||||||
|
|
||||||
|
LensDirtWeightsStr = new int[]{ Shader.PropertyToID( "_LensDirtWeights0" ),
|
||||||
|
Shader.PropertyToID( "_LensDirtWeights1" ),
|
||||||
|
Shader.PropertyToID( "_LensDirtWeights2" ),
|
||||||
|
Shader.PropertyToID( "_LensDirtWeights3" ),
|
||||||
|
Shader.PropertyToID( "_LensDirtWeights4" ),
|
||||||
|
Shader.PropertyToID( "_LensDirtWeights5" ),
|
||||||
|
Shader.PropertyToID( "_LensDirtWeights6" ),
|
||||||
|
Shader.PropertyToID( "_LensDirtWeights7" )};
|
||||||
|
|
||||||
|
LensStarburstWeightsStr= new int[]{ Shader.PropertyToID( "_LensStarburstWeights0" ),
|
||||||
|
Shader.PropertyToID( "_LensStarburstWeights1" ),
|
||||||
|
Shader.PropertyToID( "_LensStarburstWeights2" ),
|
||||||
|
Shader.PropertyToID( "_LensStarburstWeights3" ),
|
||||||
|
Shader.PropertyToID( "_LensStarburstWeights4" ),
|
||||||
|
Shader.PropertyToID( "_LensStarburstWeights5" ),
|
||||||
|
Shader.PropertyToID( "_LensStarburstWeights6" ),
|
||||||
|
Shader.PropertyToID( "_LensStarburstWeights7" )};
|
||||||
|
|
||||||
|
BloomRangeId = Shader.PropertyToID( "_BloomRange" );
|
||||||
|
LensDirtStrengthId = Shader.PropertyToID( "_LensDirtStrength" );
|
||||||
|
BloomParamsId = Shader.PropertyToID( "_BloomParams" );
|
||||||
|
TempFilterValueId = Shader.PropertyToID( "_TempFilterValue" );
|
||||||
|
LensFlareStarMatrixId = Shader.PropertyToID( "_LensFlareStarMatrix" );
|
||||||
|
LensFlareStarburstStrengthId = Shader.PropertyToID( "_LensFlareStarburstStrength" );
|
||||||
|
LensFlareGhostsParamsId = Shader.PropertyToID( "_LensFlareGhostsParams" );
|
||||||
|
LensFlareLUTId = Shader.PropertyToID( "_LensFlareLUT" );
|
||||||
|
LensFlareHaloParamsId = Shader.PropertyToID( "_LensFlareHaloParams" );
|
||||||
|
LensFlareGhostChrDistortionId = Shader.PropertyToID( "_LensFlareGhostChrDistortion" );
|
||||||
|
LensFlareHaloChrDistortionId = Shader.PropertyToID( "_LensFlareHaloChrDistortion" );
|
||||||
|
BokehParamsId = Shader.PropertyToID( "_BokehParams" );
|
||||||
|
BlurRadiusId = Shader.PropertyToID( "_BlurRadius" );
|
||||||
|
LensStarburstRTId = Shader.PropertyToID( "_LensStarburst" );
|
||||||
|
LensDirtRTId = Shader.PropertyToID( "_LensDirt" );
|
||||||
|
LensFlareRTId = Shader.PropertyToID( "_LensFlare" );
|
||||||
|
LensGlareRTId = Shader.PropertyToID( "_LensGlare" );
|
||||||
|
SourceContributionId = Shader.PropertyToID( "_SourceContribution" );
|
||||||
|
UpscaleContributionId = Shader.PropertyToID( "_UpscaleContribution" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DebugLog( string value , LogType type )
|
||||||
|
{
|
||||||
|
switch ( type )
|
||||||
|
{
|
||||||
|
case LogType.Normal: Debug.Log( DebugStr + value ); break;
|
||||||
|
case LogType.Warning: Debug.LogWarning( DebugStr + value ); break;
|
||||||
|
case LogType.Error: Debug.LogError( DebugStr + value ); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RenderTexture GetTempRenderTarget( int width, int height )
|
||||||
|
{
|
||||||
|
RenderTexture newRT = RenderTexture.GetTemporary( width, height, 0, CurrentRTFormat , CurrentReadWriteMode );
|
||||||
|
newRT.filterMode = CurrentFilterMode;
|
||||||
|
newRT.wrapMode = CurrentWrapMode;
|
||||||
|
_allocatedRT.Add( newRT );
|
||||||
|
return newRT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ReleaseTempRenderTarget( RenderTexture renderTarget )
|
||||||
|
{
|
||||||
|
if ( renderTarget != null && _allocatedRT.Remove( renderTarget ) )
|
||||||
|
{
|
||||||
|
renderTarget.DiscardContents();
|
||||||
|
RenderTexture.ReleaseTemporary( renderTarget );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ReleaseAllRT()
|
||||||
|
{
|
||||||
|
for ( int i = 0; i < _allocatedRT.Count; i++ )
|
||||||
|
{
|
||||||
|
_allocatedRT[ i ].DiscardContents();
|
||||||
|
RenderTexture.ReleaseTemporary( _allocatedRT[ i ] );
|
||||||
|
}
|
||||||
|
_allocatedRT.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void EnsureKeywordEnabled( Material mat, string keyword, bool state )
|
||||||
|
{
|
||||||
|
if ( mat != null )
|
||||||
|
{
|
||||||
|
if ( state && !mat.IsKeywordEnabled( keyword ) )
|
||||||
|
mat.EnableKeyword( keyword );
|
||||||
|
else if ( !state && mat.IsKeywordEnabled( keyword ) )
|
||||||
|
mat.DisableKeyword( keyword );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Runtime/AmplifyUtils.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4d4292e65165fe0459356252af522f26
|
||||||
|
timeCreated: 1448364899
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
63
Assets/AmplifyBloom/Plugins/Runtime/VersionInfo.cs
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
public class VersionInfo
|
||||||
|
{
|
||||||
|
public const byte Major = 1;
|
||||||
|
public const byte Minor = 0;
|
||||||
|
public const byte Release = 8;
|
||||||
|
|
||||||
|
private static string StageSuffix = "_dev001";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static string StaticToString()
|
||||||
|
{
|
||||||
|
return string.Format( "{0}.{1}.{2}", Major, Minor, Release ) + StageSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Format( "{0}.{1}.{2}", m_major, m_minor, m_release ) + StageSuffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Number { get { return m_major * 100 + m_minor * 10 + m_release; } }
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private int m_major;
|
||||||
|
[SerializeField]
|
||||||
|
private int m_minor;
|
||||||
|
[SerializeField]
|
||||||
|
private int m_release;
|
||||||
|
|
||||||
|
VersionInfo()
|
||||||
|
{
|
||||||
|
m_major = Major;
|
||||||
|
m_minor = Minor;
|
||||||
|
m_release = Release;
|
||||||
|
}
|
||||||
|
|
||||||
|
VersionInfo( byte major, byte minor, byte release )
|
||||||
|
{
|
||||||
|
m_major = major;
|
||||||
|
m_minor = minor;
|
||||||
|
m_release = release;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static VersionInfo Current()
|
||||||
|
{
|
||||||
|
return new VersionInfo( Major, Minor, Release );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool Matches( VersionInfo version )
|
||||||
|
{
|
||||||
|
return ( Major == version.m_major ) && ( Minor == version.m_minor ) && ( Release == version.m_release );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Plugins/Runtime/VersionInfo.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1bae0790adcb45b499d918f30293e20d
|
||||||
|
timeCreated: 1449661386
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
76
Assets/AmplifyBloom/Readme.txt
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
About
|
||||||
|
|
||||||
|
Amplify Bloom (c) Amplify Creations, Lda. All rights reserved.
|
||||||
|
|
||||||
|
Amplify Bloom is a complete, fast and powerful Bloom Post-Process extension for Unity
|
||||||
|
|
||||||
|
Redistribution of Amplify Bloom is frowned upon. If you want to share the
|
||||||
|
software, please refer others to the official download page:
|
||||||
|
|
||||||
|
http://amplify.pt/unity/amplify-bloom
|
||||||
|
|
||||||
|
Description
|
||||||
|
|
||||||
|
Amplify Bloom brings industry-level post-process bloom effects into your project.
|
||||||
|
Packed with high quality features that
|
||||||
|
can be turned on/off and completely tweaked
|
||||||
|
to fulfil your project needs.
|
||||||
|
|
||||||
|
Features
|
||||||
|
|
||||||
|
* High quality bloom
|
||||||
|
* High-performance
|
||||||
|
* Highly tweakable
|
||||||
|
* Bokeh filtering
|
||||||
|
* Pseudo Lens Flare with Ghosts and Halos
|
||||||
|
* Anamorphic Glare
|
||||||
|
* Lens Dirt
|
||||||
|
* Lens Starburst
|
||||||
|
|
||||||
|
Supported Platforms
|
||||||
|
|
||||||
|
* All platforms
|
||||||
|
|
||||||
|
Minimum Requirements
|
||||||
|
|
||||||
|
Software
|
||||||
|
|
||||||
|
Unity 5.3.x
|
||||||
|
|
||||||
|
Quick Guide
|
||||||
|
|
||||||
|
Amplify Bloom can be easily set on your project by selecting your game camera object and
|
||||||
|
doing one of the following steps:
|
||||||
|
|
||||||
|
1) Go to 'Component/Image Effects' menu and select the 'Amplify Bloom' option. Note that
|
||||||
|
you need to have a game object selected with a camera component, if not present it will
|
||||||
|
create one
|
||||||
|
|
||||||
|
2) Hit 'Add Component' on the camera Inspector View, type 'Amplify Bloom' on the search
|
||||||
|
box and select the result
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
|
||||||
|
Please refer to the following website for an up-to-date online manual:
|
||||||
|
|
||||||
|
http://amplify.pt/unity/amplify-bloom/manual
|
||||||
|
|
||||||
|
Feedback
|
||||||
|
|
||||||
|
To file error reports, questions or suggestions, you may use
|
||||||
|
our feedback form online:
|
||||||
|
|
||||||
|
http://amplify.pt/contact
|
||||||
|
|
||||||
|
Or contact us directly:
|
||||||
|
|
||||||
|
For general inquiries - info@amplify.pt
|
||||||
|
For technical support - support@amplify.pt (customers only)
|
||||||
|
|
||||||
|
Acknowledgements
|
||||||
|
|
||||||
|
This project was based on previous work by Victor Martins
|
||||||
|
http://pixelnerve.com/v/
|
||||||
|
|
||||||
|
HDR Cubemap from No Emotion HDRs website
|
||||||
|
http://noemotionhdrs.net/
|
8
Assets/AmplifyBloom/Readme.txt.meta
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: db72fe34ea5523c4da5bb0a1a24225e0
|
||||||
|
timeCreated: 1452695704
|
||||||
|
licenseType: Store
|
||||||
|
TextScriptImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Resources.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 478246d8dc0d062449c316bdbd1b29c0
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1448539160
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
378
Assets/AmplifyBloom/Resources/Bloom.shader
Normal file
|
@ -0,0 +1,378 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
Shader "Hidden/AmplifyBloom"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ( " ", 2D ) = "black" {}
|
||||||
|
_AnamorphicRTS0 ( " ",2D ) = "black"{}
|
||||||
|
_AnamorphicRTS1 ( " ",2D ) = "black"{}
|
||||||
|
_AnamorphicRTS2 ( " ",2D ) = "black"{}
|
||||||
|
_AnamorphicRTS3 ( " ",2D ) = "black"{}
|
||||||
|
_AnamorphicRTS4 ( " ",2D ) = "black"{}
|
||||||
|
_AnamorphicRTS5 ( " ",2D ) = "black"{}
|
||||||
|
_AnamorphicRTS6 ( " ",2D ) = "black"{}
|
||||||
|
_AnamorphicRTS7 ( " ",2D ) = "black"{}
|
||||||
|
_LensFlareLUT( " ",2D ) = "black"{}
|
||||||
|
}
|
||||||
|
|
||||||
|
CGINCLUDE
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
#include "BloomLib.cginc"
|
||||||
|
#pragma multi_compile __ AB_HIGH_PRECISION
|
||||||
|
|
||||||
|
uniform float4 _MainTex_TexelSize;// x - 1/width y - 1/height z- width w - height
|
||||||
|
|
||||||
|
struct v2f_img_custom
|
||||||
|
{
|
||||||
|
float4 pos : SV_POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
#if UNITY_UV_STARTS_AT_TOP
|
||||||
|
float4 uv2 : TEXCOORD1;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f_img_custom vert_img_custom ( appdata_img v )
|
||||||
|
{
|
||||||
|
v2f_img_custom o;
|
||||||
|
|
||||||
|
o.pos = mul ( UNITY_MATRIX_MVP, v.vertex );
|
||||||
|
o.uv = float4( v.texcoord.xy, 1, 1 );
|
||||||
|
|
||||||
|
#ifdef UNITY_HALF_TEXEL_OFFSET
|
||||||
|
o.uv.y += _MainTex_TexelSize.y;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if UNITY_UV_STARTS_AT_TOP
|
||||||
|
o.uv2 = float4( v.texcoord.xy, 1, 1 );
|
||||||
|
if ( _MainTex_TexelSize.y < 0.0 )
|
||||||
|
o.uv.y = 1.0 - o.uv.y;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "BloomFrag.cginc"
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
ZTest Always Cull Off ZWrite Off
|
||||||
|
|
||||||
|
Pass//0
|
||||||
|
{
|
||||||
|
Name "frag_threshold"
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_threshold
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//1
|
||||||
|
{
|
||||||
|
Name "frag_thresholdMask"
|
||||||
|
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_thresholdMask
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//2
|
||||||
|
{
|
||||||
|
Name "frag_anamorphicGlare"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_anamorphicGlare
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//3
|
||||||
|
{
|
||||||
|
Name "frag_lensFlare0"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_lensFlare0
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//4
|
||||||
|
{
|
||||||
|
Name "frag_lensFlare1"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_lensFlare1
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//5
|
||||||
|
{
|
||||||
|
Name "frag_lensFlare2"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_lensFlare2
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//6
|
||||||
|
{
|
||||||
|
Name "frag_lensFlare3"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_lensFlare3
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//7
|
||||||
|
{
|
||||||
|
Name "frag_lensFlare4"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_lensFlare4
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//8
|
||||||
|
{
|
||||||
|
Name "frag_lensFlare5"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_lensFlare5
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//9
|
||||||
|
{
|
||||||
|
Name "frag_downsamplerNoWeightedAvg"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_downsamplerNoWeightedAvg
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
Pass//10
|
||||||
|
{
|
||||||
|
Name "frag_downsampler_with_karis"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_downsampler_with_karis
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Pass//11
|
||||||
|
{
|
||||||
|
Name "frag_downsampler_without_karis"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_downsampler_without_karis
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//12
|
||||||
|
{
|
||||||
|
Name "frag_downsampler_temp_filter_with_karis"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_downsampler_temp_filter_with_karis
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Pass//13
|
||||||
|
{
|
||||||
|
Name "frag_downsampler_temp_filter_without_karis"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_downsampler_temp_filter_without_karis
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Pass//14
|
||||||
|
{
|
||||||
|
Name "frag_horizontal_gaussian_blur"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_horizontal_gaussian_blur
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Pass//15
|
||||||
|
{
|
||||||
|
Name "frag_vertical_gaussian_blur"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_vertical_gaussian_blur
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//16
|
||||||
|
{
|
||||||
|
Name "frag_vertical_gaussian_blur_temp_filter"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_vertical_gaussian_blur_temp_filter
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//17
|
||||||
|
{
|
||||||
|
Name "frag_upscaleTentFirstPass"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_upscaleTentFirstPass
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//18
|
||||||
|
{
|
||||||
|
Name "frag_upscaleTent"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_upscaleTent
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//19
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS1"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS1
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//20
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS2"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS2
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//21
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS3"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS3
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//22
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS4"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS4
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//23
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS5"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS5
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//24
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS6"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS6
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//25
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS7"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS7
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//26
|
||||||
|
{
|
||||||
|
Name "frag_weightedAddPS8"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_weightedAddPS8
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//27
|
||||||
|
{
|
||||||
|
Name "frag_BokehFiltering"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_BokehFiltering
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//28
|
||||||
|
{
|
||||||
|
Name "frag_BokehComposition2S"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_BokehComposition2S
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//29
|
||||||
|
{
|
||||||
|
Name "frag_BokehComposition3S"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_BokehComposition3S
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//30
|
||||||
|
{
|
||||||
|
Name "frag_BokehComposition4S"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_BokehComposition4S
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//31
|
||||||
|
{
|
||||||
|
Name "frag_BokehComposition5S"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_BokehComposition5S
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//32
|
||||||
|
{
|
||||||
|
Name "frag_BokehComposition6S"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_BokehComposition6S
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
|
||||||
|
Pass//33
|
||||||
|
{
|
||||||
|
Name "frag_decode"
|
||||||
|
CGPROGRAM
|
||||||
|
#pragma vertex vert_img
|
||||||
|
#pragma fragment frag_decode
|
||||||
|
ENDCG
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
Assets/AmplifyBloom/Resources/Bloom.shader.meta
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4f39db24ff9a0484c9ea5c2fa1c86c1b
|
||||||
|
timeCreated: 1453823249
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures:
|
||||||
|
- _LensDirt: {fileID: 2800000, guid: 7825356d1f1778140ad12b5dfe6b4d41, type: 3}
|
||||||
|
- _LensStarburst: {fileID: 2800000, guid: c2216a0fed1c98742b826a85db28021c, type: 3}
|
||||||
|
- _MainTex: {instanceID: 0}
|
||||||
|
- _LensFlare: {instanceID: 0}
|
||||||
|
- _LensGlare: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS0: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS1: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS2: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS3: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS4: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS5: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS6: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS7: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
414
Assets/AmplifyBloom/Resources/BloomFinal.shader
Normal file
|
@ -0,0 +1,414 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
Shader "Hidden/BloomFinal"
|
||||||
|
{
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_LensDirt ( "Lens Dirt Texture",2D ) = "black"{}
|
||||||
|
_LensStarburst ( "Lens Starburst Texture",2D ) = "black"{}
|
||||||
|
_MainTex ( " ", 2D ) = "black" {}
|
||||||
|
_LensFlare ( " ",2D ) = "black"{}
|
||||||
|
_LensGlare ( " ",2D ) = "black"{}
|
||||||
|
_MipResultsRTS0 ( " ",2D ) = "black"{}
|
||||||
|
_MipResultsRTS1 ( " ",2D ) = "black"{}
|
||||||
|
_MipResultsRTS2 ( " ",2D ) = "black"{}
|
||||||
|
_MipResultsRTS3 ( " ",2D ) = "black"{}
|
||||||
|
_MipResultsRTS4 ( " ",2D ) = "black"{}
|
||||||
|
_MipResultsRTS5 ( " ",2D ) = "black"{}
|
||||||
|
}
|
||||||
|
|
||||||
|
CGINCLUDE
|
||||||
|
#pragma vertex vert_img_custom
|
||||||
|
#pragma fragment frag
|
||||||
|
#pragma target 3.0
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
#include "BloomLib.cginc"
|
||||||
|
#pragma multi_compile __ AB_HIGH_PRECISION
|
||||||
|
uniform half4 _MainTex_TexelSize;// x - 1/width y - 1/height z- width w - height
|
||||||
|
|
||||||
|
uniform sampler2D _MainTex;
|
||||||
|
uniform sampler2D _MipResultsRTS0;
|
||||||
|
uniform sampler2D _MipResultsRTS1;
|
||||||
|
uniform sampler2D _MipResultsRTS2;
|
||||||
|
uniform sampler2D _MipResultsRTS3;
|
||||||
|
uniform sampler2D _MipResultsRTS4;
|
||||||
|
uniform sampler2D _MipResultsRTS5;
|
||||||
|
|
||||||
|
uniform half _UpscaleWeights0;
|
||||||
|
uniform half _UpscaleWeights1;
|
||||||
|
uniform half _UpscaleWeights2;
|
||||||
|
uniform half _UpscaleWeights3;
|
||||||
|
uniform half _UpscaleWeights4;
|
||||||
|
uniform half _UpscaleWeights5;
|
||||||
|
|
||||||
|
uniform half _LensStarburstWeights0;
|
||||||
|
uniform half _LensStarburstWeights1;
|
||||||
|
uniform half _LensStarburstWeights2;
|
||||||
|
uniform half _LensStarburstWeights3;
|
||||||
|
uniform half _LensStarburstWeights4;
|
||||||
|
uniform half _LensStarburstWeights5;
|
||||||
|
|
||||||
|
uniform half _LensDirtWeights0;
|
||||||
|
uniform half _LensDirtWeights1;
|
||||||
|
uniform half _LensDirtWeights2;
|
||||||
|
uniform half _LensDirtWeights3;
|
||||||
|
uniform half _LensDirtWeights4;
|
||||||
|
uniform half _LensDirtWeights5;
|
||||||
|
|
||||||
|
uniform sampler2D _LensDirt;
|
||||||
|
uniform sampler2D _LensStarburst;
|
||||||
|
uniform sampler2D _LensFlare;
|
||||||
|
uniform sampler2D _LensGlare;
|
||||||
|
|
||||||
|
uniform half _LensDirtStrength;
|
||||||
|
uniform half4x4 _LensFlareStarMatrix;
|
||||||
|
uniform half _LensFlareStarburstStrength;
|
||||||
|
|
||||||
|
uniform half _SourceContribution;
|
||||||
|
uniform half _UpscaleContribution;
|
||||||
|
uniform half4 _BloomParams;// x - overallIntensity y - threshold, z - blur radius w - bloom scale
|
||||||
|
|
||||||
|
struct v2f_img_custom
|
||||||
|
{
|
||||||
|
float4 pos : SV_POSITION;
|
||||||
|
half2 uv : TEXCOORD0;
|
||||||
|
#if UNITY_UV_STARTS_AT_TOP
|
||||||
|
half4 uv2 : TEXCOORD1;
|
||||||
|
#endif
|
||||||
|
half2 stereoUV : TEXCOORD2;
|
||||||
|
};
|
||||||
|
|
||||||
|
v2f_img_custom vert_img_custom ( appdata_img v )
|
||||||
|
{
|
||||||
|
v2f_img_custom o;
|
||||||
|
|
||||||
|
o.pos = mul ( UNITY_MATRIX_MVP, v.vertex );
|
||||||
|
o.uv = float4( v.texcoord.xy, 1, 1 );
|
||||||
|
|
||||||
|
#ifdef UNITY_HALF_TEXEL_OFFSET
|
||||||
|
o.uv.y += _MainTex_TexelSize.y;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if UNITY_UV_STARTS_AT_TOP
|
||||||
|
o.uv2 = float4( v.texcoord.xy, 1, 1 );
|
||||||
|
if ( _MainTex_TexelSize.y < 0.0 )
|
||||||
|
o.uv.y = 1.0 - o.uv.y;
|
||||||
|
#endif
|
||||||
|
o.stereoUV = UnityStereoScreenSpaceUVAdjust ( o.uv, _MainTex_ST );
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline half3 CalculateStarburst ( half4 bloomColor, half2 uv ,half3 weightedStarburstColor )
|
||||||
|
{
|
||||||
|
half2 imageCenter = half2( 0.5, 0.5 );
|
||||||
|
half4 starburstColor = tex2D ( _LensStarburst, uv );
|
||||||
|
half2 starburstUV = uv - imageCenter;
|
||||||
|
starburstUV = mul ( _LensFlareStarMatrix, half4( starburstUV, 0, 1 ) ).xy;
|
||||||
|
starburstUV += imageCenter;
|
||||||
|
starburstColor += tex2D ( _LensStarburst, starburstUV );
|
||||||
|
bloomColor.rgb += weightedStarburstColor*starburstColor.rgb*_LensFlareStarburstStrength;
|
||||||
|
return bloomColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline half4 FinalComposition( v2f_img_custom input, const int count, const bool flare, const bool glare, const bool dirt, const bool starburst )
|
||||||
|
{
|
||||||
|
#ifdef UNITY_UV_STARTS_AT_TOP
|
||||||
|
half2 uv = input.uv2;
|
||||||
|
#else
|
||||||
|
half2 uv = input.uv;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
half3 upscaleColor = half3( 0, 0, 0 );
|
||||||
|
half3 weightedDirtColor = half3( 0, 0, 0 );
|
||||||
|
half3 weightedStarburstColor = half3( 0, 0, 0 );
|
||||||
|
|
||||||
|
half3 b0 = 0;
|
||||||
|
half3 b1 = 0;
|
||||||
|
half3 b2 = 0;
|
||||||
|
half3 b3 = 0;
|
||||||
|
half3 b4 = 0;
|
||||||
|
half3 b5 = 0;
|
||||||
|
|
||||||
|
|
||||||
|
b0 = DecodeColor ( tex2D ( _MipResultsRTS0, input.stereoUV ) );
|
||||||
|
if ( count > 1 ) b1 = DecodeColor ( tex2D ( _MipResultsRTS1, input.stereoUV ) );
|
||||||
|
if ( count > 2 ) b2 = DecodeColor ( tex2D ( _MipResultsRTS2, input.stereoUV ) );
|
||||||
|
if ( count > 3 ) b3 = DecodeColor ( tex2D ( _MipResultsRTS3, input.stereoUV ) );
|
||||||
|
if ( count > 4 ) b4 = DecodeColor ( tex2D ( _MipResultsRTS4, input.stereoUV ) );
|
||||||
|
if ( count > 5 ) b5 = DecodeColor ( tex2D ( _MipResultsRTS5, input.stereoUV ) );
|
||||||
|
|
||||||
|
upscaleColor = _UpscaleWeights0 * b0;
|
||||||
|
if ( count > 1 ) upscaleColor += _UpscaleWeights1 * b1;
|
||||||
|
if ( count > 2 ) upscaleColor += _UpscaleWeights2 * b2;
|
||||||
|
if ( count > 3 ) upscaleColor += _UpscaleWeights3 * b3;
|
||||||
|
if ( count > 4 ) upscaleColor += _UpscaleWeights4 * b4;
|
||||||
|
if ( count > 5 ) upscaleColor += _UpscaleWeights5 * b5;
|
||||||
|
|
||||||
|
if ( dirt )
|
||||||
|
{
|
||||||
|
weightedDirtColor = _LensDirtWeights0 * b0;
|
||||||
|
if ( count > 1 ) weightedDirtColor += _LensDirtWeights1 * b1;
|
||||||
|
if ( count > 2 ) weightedDirtColor += _LensDirtWeights2 * b2;
|
||||||
|
if ( count > 3 ) weightedDirtColor += _LensDirtWeights3 * b3;
|
||||||
|
if ( count > 4 ) weightedDirtColor += _LensDirtWeights4 * b4;
|
||||||
|
if ( count > 5 ) weightedDirtColor += _LensDirtWeights5 * b5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( starburst )
|
||||||
|
{
|
||||||
|
weightedStarburstColor = _LensStarburstWeights0 * b0;
|
||||||
|
if ( count > 1 ) weightedStarburstColor += _LensStarburstWeights1 * b1;
|
||||||
|
if ( count > 2 ) weightedStarburstColor += _LensStarburstWeights2 * b2;
|
||||||
|
if ( count > 3 ) weightedStarburstColor += _LensStarburstWeights3 * b3;
|
||||||
|
if ( count > 4 ) weightedStarburstColor += _LensStarburstWeights4 * b4;
|
||||||
|
if ( count > 5 ) weightedStarburstColor += _LensStarburstWeights5 * b5;
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 color = tex2D ( _MainTex, input.stereoUV );
|
||||||
|
half4 originalUpscaleColor = half4( upscaleColor, 1 );
|
||||||
|
half4 bloomColor = _UpscaleContribution*originalUpscaleColor*_BloomParams.x;
|
||||||
|
|
||||||
|
if ( flare )
|
||||||
|
{
|
||||||
|
half4 lensFlareColor = tex2D ( _LensFlare, input.stereoUV );
|
||||||
|
bloomColor += lensFlareColor;
|
||||||
|
originalUpscaleColor += lensFlareColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( glare )
|
||||||
|
{
|
||||||
|
half4 lensGlareColor = tex2D ( _LensGlare, input.stereoUV );
|
||||||
|
bloomColor += lensGlareColor;
|
||||||
|
originalUpscaleColor += lensGlareColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( dirt )
|
||||||
|
bloomColor.rgb += weightedDirtColor*_LensDirtStrength*tex2D ( _LensDirt, input.uv ).rgb;
|
||||||
|
|
||||||
|
if ( starburst )
|
||||||
|
bloomColor.rgb = CalculateStarburst ( bloomColor, input.uv, weightedStarburstColor );
|
||||||
|
|
||||||
|
return _SourceContribution*color + bloomColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
ENDCG
|
||||||
|
|
||||||
|
// HIGH END DEVICES WITH MORE THAN 11 TEXTURE LOOKUP CAPABILITIES
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
ZTest Always Cull Off ZWrite Off
|
||||||
|
Tags{ "Mode"="Full" }
|
||||||
|
// count 1
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target { return FinalComposition( i, 1, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, true, true ); } ENDCG }
|
||||||
|
// count 2
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, true, true ); } ENDCG }
|
||||||
|
// count 3
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, true, true ); } ENDCG }
|
||||||
|
// count 4
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, true, true ); } ENDCG }
|
||||||
|
// count 5
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, true, true, true ); } ENDCG }
|
||||||
|
// count 6
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, true, true, true ); } ENDCG }
|
||||||
|
}
|
||||||
|
// LOW END DEVICES WITH ONLY 8 TEXTURE LOOKUP CAPABILITIES
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
ZTest Always Cull Off ZWrite Off
|
||||||
|
Tags{ "Mode" = "Half" }
|
||||||
|
// count 1
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 1, true, true, true, true ); } ENDCG }
|
||||||
|
// count 2
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 2, true, true, true, true ); } ENDCG }
|
||||||
|
// count 3
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, true, true ); } ENDCG }
|
||||||
|
// count 4
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, true, true ); } ENDCG }
|
||||||
|
// count 5
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, true, true ); } ENDCG }
|
||||||
|
// count 6
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, false, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, false, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, false, true, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 6, true, false, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, false, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, false, true, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 5, true, true, false, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, false, true ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 4, true, true, true, false ); } ENDCG }
|
||||||
|
Pass{ CGPROGRAM half4 frag ( v2f_img_custom i ) : SV_Target{ return FinalComposition ( i, 3, true, true, true, true ); } ENDCG }
|
||||||
|
}
|
||||||
|
}
|
22
Assets/AmplifyBloom/Resources/BloomFinal.shader.meta
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6e4f40cfbd18b3b469b5079288cea652
|
||||||
|
timeCreated: 1455035619
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures:
|
||||||
|
- _LensDirt: {fileID: 2800000, guid: 7825356d1f1778140ad12b5dfe6b4d41, type: 3}
|
||||||
|
- _LensStarburst: {fileID: 2800000, guid: c2216a0fed1c98742b826a85db28021c, type: 3}
|
||||||
|
- _MainTex: {instanceID: 0}
|
||||||
|
- _LensFlare: {instanceID: 0}
|
||||||
|
- _LensGlare: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS0: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS1: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS2: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS3: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS4: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS5: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS6: {instanceID: 0}
|
||||||
|
- _AnamorphicRTS7: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
383
Assets/AmplifyBloom/Resources/BloomFrag.cginc
Normal file
|
@ -0,0 +1,383 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
#ifndef AMPLIFY_BLOOMFRAG_INCLUDED
|
||||||
|
#define AMPLIFY_BLOOMFRAG_INCLUDED
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
uniform sampler2D _CameraDepthTexture;
|
||||||
|
uniform sampler2D _MainTex;
|
||||||
|
uniform sampler2D _MaskTex;
|
||||||
|
|
||||||
|
uniform float _BlurRadius;
|
||||||
|
uniform half4 _BloomParams;// x - overallIntensity y - threshold, z - blur radius w - bloom scale
|
||||||
|
uniform half _TempFilterValue;
|
||||||
|
|
||||||
|
uniform half4x4 _LensFlareStarMatrix;
|
||||||
|
uniform half _LensFlareStarburstStrength;
|
||||||
|
|
||||||
|
uniform half4 _BokehParams;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
half4 frag_decode ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return half4( DecodeColor ( tex2D ( _MainTex, input.uv ) ),1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_threshold ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcThreshold ( _BloomParams.y,input.uv, _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_thresholdMask ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcThresholdWithMask ( _BloomParams.y,input.uv, _MainTex ,_MaskTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
//half4 frag_BokehFiltering ( v2f_img input ) : SV_Target
|
||||||
|
//{
|
||||||
|
// const half bleedingBias = 0.02;
|
||||||
|
//const half bleedingMult = 30;
|
||||||
|
//
|
||||||
|
//half4 centerPixel = tex2D ( _MainTex, input.uv );
|
||||||
|
//half centerDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, input.uv );
|
||||||
|
//
|
||||||
|
//half centerPixelWeight = CalculateBokehWeight ( centerDepth, _BokehParams.x, _BokehParams.y, _BokehParams.z, _ProjectionParams.z, _BokehParams.w );
|
||||||
|
//
|
||||||
|
//half4 color = half4( 0,0,0,0 );
|
||||||
|
//half totalWeight = 0;
|
||||||
|
//
|
||||||
|
//UNITY_UNROLL
|
||||||
|
//for ( int t = 0; t < 8; t++ )
|
||||||
|
//{
|
||||||
|
// half2 sampleCoords = input.uv + _AnamorphicGlareWeights[ t ].xy*centerPixelWeight;
|
||||||
|
// half4 samplePixel = tex2D ( _MainTex, sampleCoords );
|
||||||
|
// half4 sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
// half weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
// weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
// weight = saturate ( weight );
|
||||||
|
// color += samplePixel * weight;
|
||||||
|
// totalWeight += weight;
|
||||||
|
//}
|
||||||
|
//return color / totalWeight;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
half4 frag_BokehFiltering ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
const half bleedingBias = 0.02;
|
||||||
|
const half bleedingMult = 30;
|
||||||
|
|
||||||
|
half4 centerPixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ));
|
||||||
|
half centerDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) );
|
||||||
|
|
||||||
|
half centerPixelWeight = CalculateBokehWeight ( centerDepth, _BokehParams.x, _BokehParams.y, _BokehParams.z, _ProjectionParams.z, _BokehParams.w );
|
||||||
|
|
||||||
|
half4 color = half4( 0,0,0,0 );
|
||||||
|
half totalWeight = 0;
|
||||||
|
|
||||||
|
half2 sampleCoords = half2( 0, 0 );
|
||||||
|
half4 samplePixel = half4( 0,0,0,0 );
|
||||||
|
half4 sampleDepth = half4( 0,0,0,0 );
|
||||||
|
half weight = 0;
|
||||||
|
|
||||||
|
//0
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights0.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ));
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
totalWeight += weight;
|
||||||
|
//1
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights1.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ) );
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
totalWeight += weight;
|
||||||
|
//2
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights2.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ) );
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
totalWeight += weight;
|
||||||
|
//3
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights3.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ) );
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
totalWeight += weight;
|
||||||
|
//4
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights4.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ) );
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
totalWeight += weight;
|
||||||
|
//5
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights5.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ) );
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
totalWeight += weight;
|
||||||
|
//6
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights6.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ) );
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
totalWeight += weight;
|
||||||
|
//7
|
||||||
|
sampleCoords = input.uv + _AnamorphicGlareWeights7.xy*centerPixelWeight;
|
||||||
|
samplePixel = tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( sampleCoords, _MainTex_ST ) );
|
||||||
|
sampleDepth = SAMPLE_DEPTH_TEXTURE ( _CameraDepthTexture, sampleCoords );
|
||||||
|
weight = ( sampleDepth < centerDepth ) ? centerPixelWeight*bleedingMult : 1;
|
||||||
|
weight = ( centerPixelWeight > ( samplePixel.a + bleedingBias ) ) ? weight : 1;
|
||||||
|
weight = saturate ( weight );
|
||||||
|
color += samplePixel * weight;
|
||||||
|
|
||||||
|
|
||||||
|
totalWeight += weight;
|
||||||
|
return color / totalWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_BokehComposition2S ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return min ( tex2D ( _MainTex,UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) , tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_BokehComposition3S ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half4 colorMinA = min ( tex2D ( _MainTex,UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) , tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return min ( colorMinA,tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_BokehComposition4S ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half4 colorMin = min ( tex2D ( _MainTex,UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) , tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return colorMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_BokehComposition5S ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half4 colorMin = min ( tex2D ( _MainTex,UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) , tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS3, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return colorMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_BokehComposition6S ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half4 colorMin = min ( tex2D ( _MainTex,UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) , tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS3, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
colorMin = min ( colorMin, tex2D ( _AnamorphicRTS4, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return colorMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS1 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS2 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights1 * DecodeColor ( tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS3 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights1 * DecodeColor ( tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights2 * DecodeColor ( tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS4 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights1 * DecodeColor ( tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights2 * DecodeColor ( tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights3 * DecodeColor ( tex2D ( _AnamorphicRTS3, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS5 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights1 * DecodeColor ( tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights2 * DecodeColor ( tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights3 * DecodeColor ( tex2D ( _AnamorphicRTS3, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights4 * DecodeColor ( tex2D ( _AnamorphicRTS4, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS6 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights1 * DecodeColor ( tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights2 * DecodeColor ( tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights3 * DecodeColor ( tex2D ( _AnamorphicRTS3, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights4 * DecodeColor ( tex2D ( _AnamorphicRTS4, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights5 * DecodeColor ( tex2D ( _AnamorphicRTS5, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS7 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights1 * DecodeColor ( tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights2 * DecodeColor ( tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights3 * DecodeColor ( tex2D ( _AnamorphicRTS3, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights4 * DecodeColor ( tex2D ( _AnamorphicRTS4, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights5 * DecodeColor ( tex2D ( _AnamorphicRTS5, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights6 * DecodeColor ( tex2D ( _AnamorphicRTS6, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_weightedAddPS8 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half3 vColor = half3( 0,0,0 );
|
||||||
|
vColor += _AnamorphicGlareWeights0 * DecodeColor ( tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights1 * DecodeColor ( tex2D ( _AnamorphicRTS1, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights2 * DecodeColor ( tex2D ( _AnamorphicRTS2, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights3 * DecodeColor ( tex2D ( _AnamorphicRTS3, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights4 * DecodeColor ( tex2D ( _AnamorphicRTS4, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights5 * DecodeColor ( tex2D ( _AnamorphicRTS5, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights6 * DecodeColor ( tex2D ( _AnamorphicRTS6, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
vColor += _AnamorphicGlareWeights7 * DecodeColor ( tex2D ( _AnamorphicRTS7, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
return EncodeColor ( vColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_anamorphicGlare ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return AnamorphicGlareMat ( input.uv,_MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_lensFlare0 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcLensFlare ( 0,_MainTex_TexelSize.xy, input.uv , _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_lensFlare1 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcLensFlare ( 1,_MainTex_TexelSize.xy, input.uv , _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_lensFlare2 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcLensFlare ( 2,_MainTex_TexelSize.xy, input.uv , _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_lensFlare3 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcLensFlare ( 3,_MainTex_TexelSize.xy, input.uv , _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_lensFlare4 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcLensFlare ( 4,_MainTex_TexelSize.xy, input.uv , _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_lensFlare5 ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return CalcLensFlare ( 5,_MainTex_TexelSize.xy, input.uv , _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_downsampler_with_karis ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return DownsampleWithKaris ( input.uv, _MainTex_TexelSize.xy, _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_downsampler_without_karis ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return DownsampleWithoutKaris ( input.uv, _MainTex_TexelSize.xy, _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_downsampler_temp_filter_with_karis ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half4 currentColor = DownsampleWithKaris ( input.uv, _MainTex_TexelSize.xy, _MainTex );
|
||||||
|
half4 prevColor = tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) );
|
||||||
|
return lerp ( currentColor, prevColor, _TempFilterValue );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_downsampler_temp_filter_without_karis ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half4 currentColor = DownsampleWithoutKaris ( input.uv, _MainTex_TexelSize.xy, _MainTex );
|
||||||
|
half4 prevColor = tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) );
|
||||||
|
return lerp ( currentColor, prevColor, _TempFilterValue );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_downsamplerNoWeightedAvg ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return DownsampleNoWeightedAvg ( input.uv, _MainTex_TexelSize.xy, _MainTex );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_horizontal_gaussian_blur ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return NineTapGaussian ( input.uv, _MainTex,float2( _BlurRadius*_MainTex_TexelSize.x, 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_vertical_gaussian_blur ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return NineTapGaussian ( input.uv, _MainTex,float2( 0, _BlurRadius*_MainTex_TexelSize.y ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_vertical_gaussian_blur_temp_filter ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
half4 currentColor = NineTapGaussian ( input.uv, _MainTex, float2( 0, _BlurRadius*_MainTex_TexelSize.y ) );
|
||||||
|
half4 prevColor = tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) );
|
||||||
|
return lerp ( currentColor, prevColor, _TempFilterValue );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_upscaleTentFirstPass ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return FirstPassUpscaleBlurTent ( _MainTex, input.uv, _MainTex_TexelSize.xy, _BloomParams.z );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_upscaleTent ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return UpscaleBlurTent ( _MainTex, _AnamorphicRTS0,input.uv, _MainTex_TexelSize.xy, _BloomParams.z );
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag_add ( v2f_img input ) : SV_Target
|
||||||
|
{
|
||||||
|
return ( tex2D ( _MainTex, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) + tex2D ( _AnamorphicRTS0, UnityStereoScreenSpaceUVAdjust ( input.uv, _MainTex_ST ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
9
Assets/AmplifyBloom/Resources/BloomFrag.cginc.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 665ebe3047c653a49b9e5488b22582d8
|
||||||
|
timeCreated: 1449156532
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
557
Assets/AmplifyBloom/Resources/BloomLib.cginc
Normal file
|
@ -0,0 +1,557 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
#ifndef AMPLIFY_BLOOMLIB_INCLUDED
|
||||||
|
#define AMPLIFY_BLOOMLIB_INCLUDED
|
||||||
|
|
||||||
|
#include "UnityCG.cginc"
|
||||||
|
|
||||||
|
|
||||||
|
uniform half4 _AnamorphicGlareWeights0;
|
||||||
|
uniform half4 _AnamorphicGlareWeights1;
|
||||||
|
uniform half4 _AnamorphicGlareWeights2;
|
||||||
|
uniform half4 _AnamorphicGlareWeights3;
|
||||||
|
uniform half4 _AnamorphicGlareWeights4;
|
||||||
|
uniform half4 _AnamorphicGlareWeights5;
|
||||||
|
uniform half4 _AnamorphicGlareWeights6;
|
||||||
|
uniform half4 _AnamorphicGlareWeights7;
|
||||||
|
|
||||||
|
|
||||||
|
uniform half4x4 _AnamorphicGlareOffsetsMat0;
|
||||||
|
uniform half4x4 _AnamorphicGlareOffsetsMat1;
|
||||||
|
uniform half4x4 _AnamorphicGlareOffsetsMat2;
|
||||||
|
uniform half4x4 _AnamorphicGlareOffsetsMat3;
|
||||||
|
|
||||||
|
uniform half4x4 _AnamorphicGlareWeightsMat0;
|
||||||
|
uniform half4x4 _AnamorphicGlareWeightsMat1;
|
||||||
|
uniform half4x4 _AnamorphicGlareWeightsMat2;
|
||||||
|
uniform half4x4 _AnamorphicGlareWeightsMat3;
|
||||||
|
|
||||||
|
uniform sampler2D _AnamorphicRTS0;
|
||||||
|
uniform sampler2D _AnamorphicRTS1;
|
||||||
|
uniform sampler2D _AnamorphicRTS2;
|
||||||
|
uniform sampler2D _AnamorphicRTS3;
|
||||||
|
uniform sampler2D _AnamorphicRTS4;
|
||||||
|
uniform sampler2D _AnamorphicRTS5;
|
||||||
|
uniform sampler2D _AnamorphicRTS6;
|
||||||
|
uniform sampler2D _AnamorphicRTS7;
|
||||||
|
|
||||||
|
|
||||||
|
uniform float4 _LensFlareGhostsParams;
|
||||||
|
uniform float4 _LensFlareHaloParams;
|
||||||
|
uniform float _LensFlareGhostChrDistortion;
|
||||||
|
uniform float _LensFlareHaloChrDistortion;
|
||||||
|
|
||||||
|
uniform sampler2D _LensFlareLUT;
|
||||||
|
|
||||||
|
half4 _MainTex_ST;
|
||||||
|
|
||||||
|
// Enabling Stereo adjustment in versions prior to 4.5
|
||||||
|
#ifndef UnityStereoScreenSpaceUVAdjust
|
||||||
|
#ifdef UNITY_SINGLE_PASS_STEREO
|
||||||
|
inline float2 UnityStereoScreenSpaceUVAdjustInternal ( float2 uv, float4 scaleAndOffset )
|
||||||
|
{
|
||||||
|
return saturate ( uv.xy ) * scaleAndOffset.xy + scaleAndOffset.zw;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline float4 UnityStereoScreenSpaceUVAdjustInternal ( float4 uv, float4 scaleAndOffset )
|
||||||
|
{
|
||||||
|
return float4( UnityStereoScreenSpaceUVAdjustInternal ( uv.xy, scaleAndOffset ), UnityStereoScreenSpaceUVAdjustInternal ( uv.zw, scaleAndOffset ) );
|
||||||
|
}
|
||||||
|
#define UnityStereoScreenSpaceUVAdjust(x, y) UnityStereoScreenSpaceUVAdjustInternal(x, y)
|
||||||
|
#else
|
||||||
|
#define UnityStereoScreenSpaceUVAdjust(x, y) x
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// TONEMAP
|
||||||
|
inline half rcp ( half x ) { return 1.0 / x; }
|
||||||
|
inline half3 TonemapForward ( half3 c ) { return c * rcp ( 1.0 + Luminance ( c ) ); }
|
||||||
|
inline half3 TonemapInverse ( half3 c ) { return c * rcp ( 1.0 - Luminance ( saturate ( c ) ) ); }
|
||||||
|
|
||||||
|
// ENCODE / DECODE
|
||||||
|
uniform half4 _BloomRange; // x - bloom range y - 1 / bloom range
|
||||||
|
inline half4 EncodeColor ( half3 color )
|
||||||
|
{
|
||||||
|
#ifdef AB_HIGH_PRECISION
|
||||||
|
return half4( color, 0 );
|
||||||
|
#else
|
||||||
|
half4 enc = half4( 0, 0, 0, 0 );
|
||||||
|
color *= _BloomRange.y;
|
||||||
|
enc.a = saturate ( max ( max ( color.r, color.g ), max ( color.b, 1e-6 ) ) );
|
||||||
|
enc.a = ceil ( enc.a * 255.0 ) / 255.0;
|
||||||
|
enc.rgb = color / enc.a;
|
||||||
|
return enc;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
inline half3 DecodeColor ( half4 enc )
|
||||||
|
{
|
||||||
|
#ifdef AB_HIGH_PRECISION
|
||||||
|
return enc.rgb;
|
||||||
|
#else
|
||||||
|
return _BloomRange.x * enc.rgb * enc.a;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// THRESHOLD
|
||||||
|
inline half4 CalcThreshold ( half threshold, float2 uv, sampler2D diffuseMap )
|
||||||
|
{
|
||||||
|
half4 color = tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) );
|
||||||
|
|
||||||
|
#ifdef AB_HIGH_PRECISION
|
||||||
|
return max ( color - threshold, 0 );
|
||||||
|
#else
|
||||||
|
return EncodeColor ( clamp ( color.rgb - threshold.xxx, ( 0 ).xxx, _BloomRange.xxx ) );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline half4 CalcThresholdWithMask ( half threshold, float2 uv, sampler2D diffuseMap, sampler2D maskMap )
|
||||||
|
{
|
||||||
|
half4 color = tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) )*tex2D ( maskMap, uv );
|
||||||
|
|
||||||
|
#ifdef AB_HIGH_PRECISION
|
||||||
|
return max ( color - threshold, 0 );
|
||||||
|
#else
|
||||||
|
return EncodeColor ( clamp ( color.rgb - threshold.xxx, ( 0 ).xxx, _BloomRange.xxx ) );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// BOKEH FILTER
|
||||||
|
inline half CalculateBokehWeight ( half depth, half aperture, half focalLength, half focalDistance, half FarPlane, half MaxCoCDiameter )
|
||||||
|
{
|
||||||
|
half S2 = depth * FarPlane;
|
||||||
|
half c = aperture *( abs ( S2 - focalDistance ) / S2 )*( focalLength / ( focalDistance - focalLength ) );
|
||||||
|
half invSensorHeight = 41.667;
|
||||||
|
half percentOfSensor = c * invSensorHeight;
|
||||||
|
return clamp ( percentOfSensor, 0.0, MaxCoCDiameter );
|
||||||
|
}
|
||||||
|
|
||||||
|
// CHROMATIC ABERRATION
|
||||||
|
inline half3 CalcChromaticAberration ( sampler2D texMap, float2 uv, float2 dir, float3 distortion )
|
||||||
|
{
|
||||||
|
return half3( DecodeColor ( tex2D ( texMap, UnityStereoScreenSpaceUVAdjust ( uv + dir * distortion.r, _MainTex_ST ) ) ).r,
|
||||||
|
DecodeColor ( tex2D ( texMap, UnityStereoScreenSpaceUVAdjust ( uv + dir * distortion.g, _MainTex_ST ) ) ).g,
|
||||||
|
DecodeColor ( tex2D ( texMap, UnityStereoScreenSpaceUVAdjust ( uv + dir * distortion.b, _MainTex_ST ) ) ).b );
|
||||||
|
}
|
||||||
|
|
||||||
|
// PSEUDO - LENS FLARE
|
||||||
|
// Halo Params - x - strength y - width z - factor w - falloff
|
||||||
|
// Ghost Params - x - strength y - dispersal z - factor w - falloff
|
||||||
|
|
||||||
|
inline half4 CalcLensFlare ( const int ghostsAmount, float2 texelSize, float2 uv, sampler2D thresholdMap )
|
||||||
|
{
|
||||||
|
half3 result = half3( 0, 0, 0 );
|
||||||
|
float2 flippedUV = float2( 1, 1 ) - uv;
|
||||||
|
|
||||||
|
//GHOST VECTOR TO IMAGE CENTER
|
||||||
|
float2 imageCenter = float2( 0.5, 0.5 );
|
||||||
|
|
||||||
|
const float imageCenterLength = 0.7071;
|
||||||
|
const float invImageCenterLength = 1.4142;
|
||||||
|
|
||||||
|
float2 ghostVec = ( imageCenter - uv )*_LensFlareGhostsParams.y;
|
||||||
|
|
||||||
|
float uvLen = length ( imageCenter - uv ) * invImageCenterLength;
|
||||||
|
float2 lutUV = float2( frac ( uvLen ), 0 );
|
||||||
|
half3 lutColor = tex2D ( _LensFlareLUT, lutUV );
|
||||||
|
|
||||||
|
float2 chromaticDir = normalize ( ghostVec );
|
||||||
|
float3 chromaticDistVec = float3( -texelSize.x*_LensFlareGhostChrDistortion, 0.0, texelSize.x*_LensFlareGhostChrDistortion );
|
||||||
|
|
||||||
|
// GHOSTS
|
||||||
|
UNITY_UNROLL
|
||||||
|
for ( int i = 0; i < ghostsAmount; i++ )
|
||||||
|
{
|
||||||
|
float2 ghostUV = frac ( uv + ghostVec*( float ) i );
|
||||||
|
float weight = length ( imageCenter - ghostUV ) *invImageCenterLength;
|
||||||
|
weight = pow ( ( 1 - weight )*_LensFlareGhostsParams.z, _LensFlareGhostsParams.w );
|
||||||
|
weight = weight*weight;
|
||||||
|
result += CalcChromaticAberration ( thresholdMap, ghostUV, chromaticDir, chromaticDistVec ).rgb*weight*lutColor*_LensFlareGhostsParams.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
chromaticDistVec = float3( -texelSize.x*_LensFlareHaloChrDistortion, 0.0, texelSize.x*_LensFlareHaloChrDistortion );
|
||||||
|
|
||||||
|
// HALO
|
||||||
|
float2 haloVec = chromaticDir * _LensFlareHaloParams.y;
|
||||||
|
float haloWeight = length ( imageCenter - frac ( uv + haloVec ) )*invImageCenterLength;
|
||||||
|
haloWeight = pow ( ( 1 - haloWeight )*_LensFlareHaloParams.z, _LensFlareHaloParams.w );
|
||||||
|
result += CalcChromaticAberration ( thresholdMap, frac ( uv + haloVec ), chromaticDir, chromaticDistVec ).rgb*haloWeight*_LensFlareHaloParams.x*lutColor;
|
||||||
|
|
||||||
|
return EncodeColor ( result );
|
||||||
|
}
|
||||||
|
|
||||||
|
// ANAMORPHIC GLARE
|
||||||
|
//inline half4 AnamorphicGlareMat ( float2 uv, sampler2D diffuseMap )
|
||||||
|
//{
|
||||||
|
// half3 finalColor = half3( 0, 0, 0 );
|
||||||
|
// UNITY_UNROLL
|
||||||
|
// for ( uint matIdx = 0; matIdx < 4; matIdx++ )
|
||||||
|
// {
|
||||||
|
// UNITY_UNROLL
|
||||||
|
// for ( int vecIdx = 0; vecIdx < 4; vecIdx++ )
|
||||||
|
// {
|
||||||
|
// float2 uvOffset = uv + _AnamorphicGlareOffsetsMat[ matIdx ][ vecIdx ].xy;
|
||||||
|
// half3 mainColor = DecodeColor ( tex2D ( diffuseMap, uvOffset ) );
|
||||||
|
// finalColor.rgb += _AnamorphicGlareWeightsMat[ matIdx ][ vecIdx ].rgb*mainColor.rgb;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return EncodeColor ( finalColor );
|
||||||
|
//}
|
||||||
|
|
||||||
|
inline half4 AnamorphicGlareMat ( float2 uv, sampler2D diffuseMap )
|
||||||
|
{
|
||||||
|
half3 finalColor = half3( 0, 0, 0 );
|
||||||
|
float2 uvOffset = float2( 0, 0 );
|
||||||
|
half3 mainColor = half3( 0, 0, 0 );
|
||||||
|
|
||||||
|
//MatIdx 0
|
||||||
|
{
|
||||||
|
//vecIdx 0
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat0[ 0 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat0[ 0 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 1
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat0[ 1 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat0[ 1 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 2
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat0[ 2 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat0[ 2 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 3
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat0[ 3 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat0[ 3 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//MatIdx 1
|
||||||
|
{
|
||||||
|
//vecIdx 0
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat1[ 0 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat1[ 0 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 1
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat1[ 1 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat1[ 1 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 2
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat1[ 2 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat1[ 2 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 3
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat1[ 3 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat1[ 3 ].rgb*mainColor.rgb;
|
||||||
|
}
|
||||||
|
|
||||||
|
//MatIdx 2
|
||||||
|
{
|
||||||
|
//vecIdx 0
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat2[ 0 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat2[ 0 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 1
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat2[ 1 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat2[ 1 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 2
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat2[ 2 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat2[ 2 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 3
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat2[ 3 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat2[ 3 ].rgb*mainColor.rgb;
|
||||||
|
}
|
||||||
|
|
||||||
|
//MatIdx 3
|
||||||
|
{
|
||||||
|
//vecIdx 0
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat3[ 0 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat3[ 0 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 1
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat3[ 1 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat3[ 1 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 2
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat3[ 2 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat3[ 2 ].rgb*mainColor.rgb;
|
||||||
|
|
||||||
|
//vecIdx 3
|
||||||
|
uvOffset = uv + _AnamorphicGlareOffsetsMat3[ 3 ].xy;
|
||||||
|
mainColor = DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uvOffset, _MainTex_ST ) ) );
|
||||||
|
finalColor.rgb += _AnamorphicGlareWeightsMat3[ 3 ].rgb*mainColor.rgb;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EncodeColor ( finalColor );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// GAUSSIAN FUNCTION
|
||||||
|
inline half4 NineTapGaussian ( float2 uv, sampler2D diffuseMap, float2 stride )
|
||||||
|
{
|
||||||
|
half4 color = half4( 0, 0, 0, 0 );
|
||||||
|
color.rgb += DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) ) ) * 0.227027027;
|
||||||
|
|
||||||
|
float2 d1 = stride * 1.3846153846;
|
||||||
|
color.rgb += DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uv + d1, _MainTex_ST ) ) ) * 0.3162162162;
|
||||||
|
color.rgb += DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uv - d1, _MainTex_ST ) ) ) * 0.3162162162;
|
||||||
|
|
||||||
|
float2 d2 = stride * 3.2307692308;
|
||||||
|
color.rgb += DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uv + d2, _MainTex_ST ) ) ) * 0.0702702703;
|
||||||
|
color.rgb += DecodeColor ( tex2D ( diffuseMap, UnityStereoScreenSpaceUVAdjust ( uv - d2, _MainTex_ST ) ) ) * 0.0702702703;
|
||||||
|
|
||||||
|
return EncodeColor ( color );
|
||||||
|
}
|
||||||
|
|
||||||
|
// UPSCALE FUNCTIONS
|
||||||
|
inline half4 FirstPassUpscaleBlurTent ( sampler2D currentMipRT, float2 uvCoords, float2 oneOverTexSize, float BlurRadius )
|
||||||
|
{
|
||||||
|
float2 TexelOffsets[ 9 ] =
|
||||||
|
{
|
||||||
|
float2( -1, -1 ),
|
||||||
|
float2( 0, -1 ),
|
||||||
|
float2( 1, -1 ),
|
||||||
|
float2( -1, 0 ),
|
||||||
|
float2( 0, 0 ),
|
||||||
|
float2( 1, 0 ),
|
||||||
|
float2( -1, 1 ),
|
||||||
|
float2( 0, 1 ),
|
||||||
|
float2( 1, 1 )
|
||||||
|
};
|
||||||
|
|
||||||
|
half Weights[ 9 ] =
|
||||||
|
{
|
||||||
|
0.0625,
|
||||||
|
0.125,
|
||||||
|
0.0625,
|
||||||
|
0.125,
|
||||||
|
0.25,
|
||||||
|
0.125,
|
||||||
|
0.0625,
|
||||||
|
0.125,
|
||||||
|
0.0625
|
||||||
|
};
|
||||||
|
|
||||||
|
half4 color = half4( 0.0, 0.0, 0.0, 0.0 );
|
||||||
|
|
||||||
|
UNITY_UNROLL
|
||||||
|
for ( int i = 0; i < 9; i++ )
|
||||||
|
{
|
||||||
|
float2 uv = uvCoords + TexelOffsets[ i ] * oneOverTexSize * BlurRadius;
|
||||||
|
color.rgb += DecodeColor ( tex2D ( currentMipRT, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) ) ) * Weights[ i ];
|
||||||
|
}
|
||||||
|
|
||||||
|
return EncodeColor ( color );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline half4 UpscaleBlurTent ( sampler2D currentMipRT, sampler2D previousUpscale, float2 uvCoords, float2 oneOverTexSize, float BlurRadius )
|
||||||
|
{
|
||||||
|
float2 TexelOffsets[ 9 ] =
|
||||||
|
{
|
||||||
|
float2( -1, -1 ),
|
||||||
|
float2( 0, -1 ),
|
||||||
|
float2( 1, -1 ),
|
||||||
|
float2( -1, 0 ),
|
||||||
|
float2( 0, 0 ),
|
||||||
|
float2( 1, 0 ),
|
||||||
|
float2( -1, 1 ),
|
||||||
|
float2( 0, 1 ),
|
||||||
|
float2( 1, 1 )
|
||||||
|
};
|
||||||
|
|
||||||
|
half Weights[ 9 ] =
|
||||||
|
{
|
||||||
|
0.0625,
|
||||||
|
0.125,
|
||||||
|
0.0625,
|
||||||
|
0.125,
|
||||||
|
0.25,
|
||||||
|
0.125,
|
||||||
|
0.0625,
|
||||||
|
0.125,
|
||||||
|
0.0625
|
||||||
|
};
|
||||||
|
|
||||||
|
half4 color = half4( 0.0, 0.0, 0.0, 0.0 );
|
||||||
|
|
||||||
|
UNITY_UNROLL
|
||||||
|
for ( int i = 0; i < 9; i++ )
|
||||||
|
{
|
||||||
|
float2 uv = uvCoords + TexelOffsets[ i ] * oneOverTexSize * BlurRadius;
|
||||||
|
color.rgb += DecodeColor ( tex2D ( currentMipRT, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) ) ) * Weights[ i ];
|
||||||
|
}
|
||||||
|
color.rgb += DecodeColor ( tex2D ( previousUpscale, UnityStereoScreenSpaceUVAdjust ( uvCoords, _MainTex_ST ) ) );
|
||||||
|
|
||||||
|
return EncodeColor ( color );
|
||||||
|
}
|
||||||
|
|
||||||
|
// DOWNSAMPLING FUNCTIONS
|
||||||
|
inline half4 DownsampleWithKaris ( float2 texcoord, float2 oneOverTextureSize, sampler2D DiffuseMap )
|
||||||
|
{
|
||||||
|
const int NUM_SAMPLES = 13;
|
||||||
|
float2 TexelOffsets[ NUM_SAMPLES ] =
|
||||||
|
{
|
||||||
|
float2( -1.0,-1.0 ),
|
||||||
|
float2( 1.0,-1.0 ),
|
||||||
|
float2( 1.0,1.0 ),
|
||||||
|
float2( -1.0,1.0 ),
|
||||||
|
float2( -2.0,-2.0 ),
|
||||||
|
float2( 0.0,-2.0 ),
|
||||||
|
float2( 2.0,-2.0 ),
|
||||||
|
float2( -2.0,0.0 ),
|
||||||
|
float2( 0.0,0.0 ),
|
||||||
|
float2( 2.0,0.0 ),
|
||||||
|
float2( -2.0,2.0 ),
|
||||||
|
float2( 0.0,2.0 ),
|
||||||
|
float2( 2.0,2.0 )
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
half4 redSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 yellowSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 greenSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 blueSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 purpleSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 texels[ NUM_SAMPLES ];
|
||||||
|
|
||||||
|
|
||||||
|
half4 sum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
UNITY_UNROLL
|
||||||
|
for ( int i = 0; i < NUM_SAMPLES; ++i )
|
||||||
|
{
|
||||||
|
float2 uv = texcoord + ( TexelOffsets[ i ] * oneOverTextureSize );
|
||||||
|
texels[ i ].rgb = DecodeColor ( tex2D ( DiffuseMap, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
redSum = ( texels[ 0 ] + texels[ 1 ] + texels[ 2 ] + texels[ 3 ] ) * 0.25;
|
||||||
|
yellowSum = ( texels[ 7 ] + texels[ 8 ] + texels[ 10 ] + texels[ 11 ] ) * 0.25;
|
||||||
|
greenSum = ( texels[ 8 ] + texels[ 9 ] + texels[ 11 ] + texels[ 12 ] ) * 0.25;
|
||||||
|
blueSum = ( texels[ 5 ] + texels[ 6 ] + texels[ 8 ] + texels[ 9 ] ) * 0.25;
|
||||||
|
purpleSum = ( texels[ 4 ] + texels[ 5 ] + texels[ 7 ] + texels[ 8 ] ) * 0.25;
|
||||||
|
|
||||||
|
redSum.rgb = TonemapForward ( redSum.rgb );
|
||||||
|
yellowSum.rgb = TonemapForward ( yellowSum.rgb );
|
||||||
|
greenSum.rgb = TonemapForward ( greenSum.rgb );
|
||||||
|
blueSum.rgb = TonemapForward ( blueSum.rgb );
|
||||||
|
purpleSum.rgb = TonemapForward ( purpleSum.rgb );
|
||||||
|
|
||||||
|
sum = ( redSum * 0.5 ) + ( ( yellowSum + greenSum + blueSum + purpleSum ) * 0.125 );
|
||||||
|
|
||||||
|
return EncodeColor ( sum.rgb );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline half4 DownsampleWithoutKaris ( float2 texcoord, float2 oneOverTextureSize, sampler2D DiffuseMap )
|
||||||
|
{
|
||||||
|
const int NUM_SAMPLES = 13;
|
||||||
|
float2 TexelOffsets[ NUM_SAMPLES ] =
|
||||||
|
{
|
||||||
|
float2( -1.0,-1.0 ),
|
||||||
|
float2( 1.0,-1.0 ),
|
||||||
|
float2( 1.0,1.0 ),
|
||||||
|
float2( -1.0,1.0 ),
|
||||||
|
float2( -2.0,-2.0 ),
|
||||||
|
float2( 0.0,-2.0 ),
|
||||||
|
float2( 2.0,-2.0 ),
|
||||||
|
float2( -2.0,0.0 ),
|
||||||
|
float2( 0.0,0.0 ),
|
||||||
|
float2( 2.0,0.0 ),
|
||||||
|
float2( -2.0,2.0 ),
|
||||||
|
float2( 0.0,2.0 ),
|
||||||
|
float2( 2.0,2.0 )
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
half4 redSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 yellowSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 greenSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 blueSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 purpleSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 texels[ NUM_SAMPLES ];
|
||||||
|
|
||||||
|
|
||||||
|
half4 sum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
UNITY_UNROLL
|
||||||
|
for ( int i = 0; i < NUM_SAMPLES; ++i )
|
||||||
|
{
|
||||||
|
float2 uv = texcoord + ( TexelOffsets[ i ] * oneOverTextureSize );
|
||||||
|
texels[ i ].rgb = DecodeColor ( tex2D ( DiffuseMap, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
redSum = ( texels[ 0 ] + texels[ 1 ] + texels[ 2 ] + texels[ 3 ] ) * 0.25;
|
||||||
|
yellowSum = ( texels[ 7 ] + texels[ 8 ] + texels[ 10 ] + texels[ 11 ] ) * 0.25;
|
||||||
|
greenSum = ( texels[ 8 ] + texels[ 9 ] + texels[ 11 ] + texels[ 12 ] ) * 0.25;
|
||||||
|
blueSum = ( texels[ 5 ] + texels[ 6 ] + texels[ 8 ] + texels[ 9 ] ) * 0.25;
|
||||||
|
purpleSum = ( texels[ 4 ] + texels[ 5 ] + texels[ 7 ] + texels[ 8 ] ) * 0.25;
|
||||||
|
sum = ( redSum * 0.5 ) + ( ( yellowSum + greenSum + blueSum + purpleSum ) * 0.125 );
|
||||||
|
return EncodeColor ( sum.rgb );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline half4 DownsampleNoWeightedAvg ( float2 texcoord, float2 oneOverTextureSize, sampler2D DiffuseMap )
|
||||||
|
{
|
||||||
|
const int NUM_SAMPLES = 13;
|
||||||
|
float2 TexelOffsets[ NUM_SAMPLES ] =
|
||||||
|
{
|
||||||
|
float2( -1.0, -1.0 ),
|
||||||
|
float2( 1.0, -1.0 ),
|
||||||
|
float2( 1.0, 1.0 ),
|
||||||
|
float2( -1.0, 1.0 ),
|
||||||
|
float2( -2.0, -2.0 ),
|
||||||
|
float2( 0.0, -2.0 ),
|
||||||
|
float2( 2.0, -2.0 ),
|
||||||
|
float2( -2.0, 0.0 ),
|
||||||
|
float2( 0.0, 0.0 ),
|
||||||
|
float2( 2.0, 0.0 ),
|
||||||
|
float2( -2.0, 2.0 ),
|
||||||
|
float2( 0.0, 2.0 ),
|
||||||
|
float2( 2.0, 2.0 )
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
half4 redSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 yellowSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 greenSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 blueSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 purpleSum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
half4 texels[ NUM_SAMPLES ];
|
||||||
|
|
||||||
|
|
||||||
|
half4 sum = half4( 1.0, 1.0, 1.0, 1.0 );
|
||||||
|
UNITY_UNROLL
|
||||||
|
for ( int i = 0; i < NUM_SAMPLES; ++i )
|
||||||
|
{
|
||||||
|
float2 uv = texcoord + ( TexelOffsets[ i ] * oneOverTextureSize );
|
||||||
|
texels[ i ].rgb = DecodeColor ( tex2D ( DiffuseMap, UnityStereoScreenSpaceUVAdjust ( uv, _MainTex_ST ) ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
redSum = ( texels[ 0 ] + texels[ 1 ] + texels[ 2 ] + texels[ 3 ] ) * 0.25;
|
||||||
|
yellowSum = ( texels[ 7 ] + texels[ 8 ] + texels[ 10 ] + texels[ 11 ] ) * 0.25;
|
||||||
|
greenSum = ( texels[ 8 ] + texels[ 9 ] + texels[ 11 ] + texels[ 12 ] ) * 0.25;
|
||||||
|
blueSum = ( texels[ 5 ] + texels[ 6 ] + texels[ 8 ] + texels[ 9 ] ) * 0.25;
|
||||||
|
purpleSum = ( texels[ 4 ] + texels[ 5 ] + texels[ 7 ] + texels[ 8 ] ) * 0.25;
|
||||||
|
|
||||||
|
sum = ( redSum * 0.5 ) + ( ( yellowSum + greenSum + blueSum + purpleSum ) * 0.125 );
|
||||||
|
|
||||||
|
return EncodeColor ( sum.rgb );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
9
Assets/AmplifyBloom/Resources/BloomLib.cginc.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f782f1bec37d58142b7029703e01e475
|
||||||
|
timeCreated: 1447410955
|
||||||
|
licenseType: Store
|
||||||
|
ShaderImporter:
|
||||||
|
defaultTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 758c62954f07d2c42845029d2cfc2eca
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1447238913
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples/Demo.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 00375e445d1673b46994eeac5abd65f9
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1453485190
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
551
Assets/AmplifyBloom/Samples/Demo/Demo.unity
Normal file
|
@ -0,0 +1,551 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!29 &1
|
||||||
|
SceneSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PVSData:
|
||||||
|
m_PVSObjectsArray: []
|
||||||
|
m_PVSPortalsArray: []
|
||||||
|
m_OcclusionBakeSettings:
|
||||||
|
smallestOccluder: 5
|
||||||
|
smallestHole: .25
|
||||||
|
backfaceThreshold: 100
|
||||||
|
--- !u!104 &2
|
||||||
|
RenderSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Fog: 0
|
||||||
|
m_FogColor: {r: .5, g: .5, b: .5, a: 1}
|
||||||
|
m_FogMode: 3
|
||||||
|
m_FogDensity: .00999999978
|
||||||
|
m_LinearFogStart: 0
|
||||||
|
m_LinearFogEnd: 300
|
||||||
|
m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1}
|
||||||
|
m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1}
|
||||||
|
m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1}
|
||||||
|
m_AmbientIntensity: 1
|
||||||
|
m_AmbientMode: 0
|
||||||
|
m_SkyboxMaterial: {fileID: 2100000, guid: a654bcf02970eab4491147c5e2256af5, type: 2}
|
||||||
|
m_HaloStrength: .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}
|
||||||
|
--- !u!157 &3
|
||||||
|
LightmapSettings:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 5
|
||||||
|
m_GIWorkflowMode: 0
|
||||||
|
m_LightmapsMode: 1
|
||||||
|
m_GISettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_BounceScale: 1
|
||||||
|
m_IndirectOutputScale: 1
|
||||||
|
m_AlbedoBoost: 1
|
||||||
|
m_TemporalCoherenceThreshold: 1
|
||||||
|
m_EnvironmentLightingMode: 0
|
||||||
|
m_EnableBakedLightmaps: 1
|
||||||
|
m_EnableRealtimeLightmaps: 1
|
||||||
|
m_LightmapEditorSettings:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_Resolution: 2
|
||||||
|
m_BakeResolution: 40
|
||||||
|
m_TextureWidth: 1024
|
||||||
|
m_TextureHeight: 1024
|
||||||
|
m_AOMaxDistance: 1
|
||||||
|
m_Padding: 2
|
||||||
|
m_CompAOExponent: 0
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_TextureCompression: 1
|
||||||
|
m_FinalGather: 0
|
||||||
|
m_FinalGatherRayCount: 1024
|
||||||
|
m_LightmapSnapshot: {fileID: 0}
|
||||||
|
m_RuntimeCPUUsage: 25
|
||||||
|
--- !u!196 &4
|
||||||
|
NavMeshSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_BuildSettings:
|
||||||
|
serializedVersion: 2
|
||||||
|
agentRadius: .5
|
||||||
|
agentHeight: 2
|
||||||
|
agentSlope: 45
|
||||||
|
agentClimb: .400000006
|
||||||
|
ledgeDropHeight: 0
|
||||||
|
maxJumpAcrossDistance: 0
|
||||||
|
accuratePlacement: 0
|
||||||
|
minRegionArea: 2
|
||||||
|
cellSize: .166666672
|
||||||
|
manualCellSize: 0
|
||||||
|
m_NavMeshData: {fileID: 0}
|
||||||
|
--- !u!127 &5
|
||||||
|
LevelGameManager:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
--- !u!1 &460346662
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Component:
|
||||||
|
- 4: {fileID: 460346664}
|
||||||
|
- 108: {fileID: 460346663}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: Directional light
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!108 &460346663
|
||||||
|
Light:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 460346662}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Type: 1
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_Intensity: .270000011
|
||||||
|
m_Range: 10
|
||||||
|
m_SpotAngle: 30
|
||||||
|
m_CookieSize: 10
|
||||||
|
m_Shadows:
|
||||||
|
m_Type: 0
|
||||||
|
m_Resolution: -1
|
||||||
|
m_Strength: 1
|
||||||
|
m_Bias: .0500000007
|
||||||
|
m_NormalBias: .400000006
|
||||||
|
m_Cookie: {fileID: 0}
|
||||||
|
m_DrawHalo: 0
|
||||||
|
m_Flare: {fileID: 0}
|
||||||
|
m_RenderMode: 0
|
||||||
|
m_CullingMask:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Bits: 4294967295
|
||||||
|
m_Lightmapping: 4
|
||||||
|
m_BounceIntensity: 1
|
||||||
|
m_ShadowRadius: 0
|
||||||
|
m_ShadowAngle: 0
|
||||||
|
m_AreaSize: {x: 1, y: 1}
|
||||||
|
--- !u!4 &460346664
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 460346662}
|
||||||
|
m_LocalRotation: {x: .0437849686, y: .0222284645, z: -.000974444905, w: .998793185}
|
||||||
|
m_LocalPosition: {x: -.131645009, y: -.329999924, z: .527892172}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1213239283}
|
||||||
|
m_RootOrder: 0
|
||||||
|
--- !u!1 &1213239278
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Component:
|
||||||
|
- 4: {fileID: 1213239283}
|
||||||
|
- 20: {fileID: 1213239282}
|
||||||
|
- 92: {fileID: 1213239281}
|
||||||
|
- 124: {fileID: 1213239280}
|
||||||
|
- 81: {fileID: 1213239279}
|
||||||
|
- 114: {fileID: 1213239285}
|
||||||
|
- 114: {fileID: 1213239284}
|
||||||
|
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 &1213239279
|
||||||
|
AudioListener:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1213239278}
|
||||||
|
m_Enabled: 1
|
||||||
|
--- !u!124 &1213239280
|
||||||
|
Behaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1213239278}
|
||||||
|
m_Enabled: 1
|
||||||
|
--- !u!92 &1213239281
|
||||||
|
Behaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1213239278}
|
||||||
|
m_Enabled: 1
|
||||||
|
--- !u!20 &1213239282
|
||||||
|
Camera:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1213239278}
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_ClearFlags: 1
|
||||||
|
m_BackGroundColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_NormalizedViewPortRect:
|
||||||
|
serializedVersion: 2
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: 1
|
||||||
|
height: 1
|
||||||
|
near clip plane: .300000012
|
||||||
|
far clip plane: 100
|
||||||
|
field of view: 60
|
||||||
|
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_HDR: 1
|
||||||
|
m_OcclusionCulling: 1
|
||||||
|
m_StereoConvergence: 10
|
||||||
|
m_StereoSeparation: .0219999999
|
||||||
|
m_StereoMirrorMode: 0
|
||||||
|
--- !u!4 &1213239283
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1213239278}
|
||||||
|
m_LocalRotation: {x: 0, y: -.031672433, z: 0, w: .999498308}
|
||||||
|
m_LocalPosition: {x: 0, y: 5, z: 9.60000038}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_Children:
|
||||||
|
- {fileID: 460346664}
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 0
|
||||||
|
--- !u!114 &1213239284
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1213239278}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 9b8c208e531a26a41a4629789f4a706a, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_maskTexture: {fileID: 0}
|
||||||
|
m_targetTexture: {fileID: 0}
|
||||||
|
m_showDebugMessages: 1
|
||||||
|
m_softMaxdownscales: 6
|
||||||
|
m_debugToScreen: 0
|
||||||
|
m_highPrecision: 0
|
||||||
|
m_bloomRange: {x: 500, y: .00200000009, z: 0, w: 0}
|
||||||
|
m_overallThreshold: .529999971
|
||||||
|
m_bloomParams: {x: .800000012, y: .529999971, z: 1, w: 1}
|
||||||
|
m_temporalFilteringActive: 0
|
||||||
|
m_temporalFilteringValue: .0500000007
|
||||||
|
m_bloomDownsampleCount: 6
|
||||||
|
m_temporalFilteringCurve:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Curve:
|
||||||
|
- time: 0
|
||||||
|
value: 0
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
- time: 1
|
||||||
|
value: .999000013
|
||||||
|
inSlope: 0
|
||||||
|
outSlope: 0
|
||||||
|
tangentMode: 0
|
||||||
|
m_PreInfinity: 2
|
||||||
|
m_PostInfinity: 2
|
||||||
|
m_separateFeaturesThreshold: 0
|
||||||
|
m_featuresThreshold: .0500000007
|
||||||
|
m_lensFlare:
|
||||||
|
m_overallIntensity: 1
|
||||||
|
m_normalizedGhostIntensity: .800000012
|
||||||
|
m_normalizedHaloIntensity: .100000001
|
||||||
|
m_applyLensFlare: 1
|
||||||
|
m_lensFlareGhostAmount: 3
|
||||||
|
m_lensFlareGhostsParams: {x: .800000012, y: .228, z: 1, w: 4}
|
||||||
|
m_lensFlareGhostChrDistortion: 2
|
||||||
|
m_lensGradient:
|
||||||
|
key0:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294967295
|
||||||
|
key1:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294901760
|
||||||
|
key2:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4278255360
|
||||||
|
key3:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4278512639
|
||||||
|
key4:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4278190335
|
||||||
|
key5:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 0
|
||||||
|
key6:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 0
|
||||||
|
key7:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 0
|
||||||
|
ctime0: 0
|
||||||
|
ctime1: 16384
|
||||||
|
ctime2: 32768
|
||||||
|
ctime3: 49151
|
||||||
|
ctime4: 65535
|
||||||
|
ctime5: 0
|
||||||
|
ctime6: 0
|
||||||
|
ctime7: 0
|
||||||
|
atime0: 0
|
||||||
|
atime1: 16384
|
||||||
|
atime2: 32768
|
||||||
|
atime3: 49151
|
||||||
|
atime4: 65535
|
||||||
|
atime5: 0
|
||||||
|
atime6: 0
|
||||||
|
atime7: 0
|
||||||
|
m_NumColorKeys: 5
|
||||||
|
m_NumAlphaKeys: 5
|
||||||
|
m_lensFlareGradTexture: {fileID: 1618320027}
|
||||||
|
m_lensFlareHaloParams: {x: .100000001, y: .573000014, z: 1, w: 128}
|
||||||
|
m_lensFlareHaloChrDistortion: 1.50999999
|
||||||
|
m_lensFlareGaussianBlurAmount: 1
|
||||||
|
m_applyLensDirt: 1
|
||||||
|
m_lensDirtStrength: 2
|
||||||
|
m_lensDirtTexture: {fileID: 2800000, guid: 7825356d1f1778140ad12b5dfe6b4d41, type: 3}
|
||||||
|
m_applyLensStardurst: 1
|
||||||
|
m_lensStardurstTex: {fileID: 2800000, guid: c2216a0fed1c98742b826a85db28021c, type: 3}
|
||||||
|
m_lensStarburstStrength: 2
|
||||||
|
m_anamorphicGlare:
|
||||||
|
m_customGlareDef: []
|
||||||
|
m_customGlareDefIdx: 0
|
||||||
|
m_customGlareDefAmount: 0
|
||||||
|
m_applyGlare: 1
|
||||||
|
_overallTint: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_cromaticAberrationGrad:
|
||||||
|
key0:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294967295
|
||||||
|
key1:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294901760
|
||||||
|
key2:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4278255360
|
||||||
|
key3:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4278512639
|
||||||
|
key4:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4278190335
|
||||||
|
key5:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 0
|
||||||
|
key6:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 0
|
||||||
|
key7:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 0
|
||||||
|
ctime0: 0
|
||||||
|
ctime1: 16384
|
||||||
|
ctime2: 32768
|
||||||
|
ctime3: 49151
|
||||||
|
ctime4: 65535
|
||||||
|
ctime5: 0
|
||||||
|
ctime6: 0
|
||||||
|
ctime7: 0
|
||||||
|
atime0: 0
|
||||||
|
atime1: 16384
|
||||||
|
atime2: 32768
|
||||||
|
atime3: 49151
|
||||||
|
atime4: 65535
|
||||||
|
atime5: 0
|
||||||
|
atime6: 0
|
||||||
|
atime7: 0
|
||||||
|
m_NumColorKeys: 5
|
||||||
|
m_NumAlphaKeys: 5
|
||||||
|
m_glareMaxPassCount: 4
|
||||||
|
m_currentWidth: 539
|
||||||
|
m_currentHeight: 366
|
||||||
|
m_currentGlareType: 0
|
||||||
|
m_currentGlareIdx: 0
|
||||||
|
m_perPassDisplacement: 4
|
||||||
|
m_intensity: .170000002
|
||||||
|
m_overallStreakScale: 1
|
||||||
|
m_bokehFilter:
|
||||||
|
m_isActive: 0
|
||||||
|
m_applyOnBloomSource: 0
|
||||||
|
m_bokehSampleRadius: .5
|
||||||
|
m_bokehCameraProperties: {x: .0500000007, y: .0179999992, z: 1.34000003, w: .180000007}
|
||||||
|
m_offsetRotation: 0
|
||||||
|
m_apertureShape: 1
|
||||||
|
m_upscaleWeights:
|
||||||
|
- .0842000023
|
||||||
|
- .128199995
|
||||||
|
- .164800003
|
||||||
|
- .219699994
|
||||||
|
- .219699994
|
||||||
|
- .1831
|
||||||
|
m_gaussianRadius:
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
- 1
|
||||||
|
m_gaussianSteps: 010000000100000001000000010000000100000001000000
|
||||||
|
m_lensDirtWeights:
|
||||||
|
- .0670000017
|
||||||
|
- .101999998
|
||||||
|
- .131099999
|
||||||
|
- .174899995
|
||||||
|
- .233199999
|
||||||
|
- .300000012
|
||||||
|
m_lensStarburstWeights:
|
||||||
|
- .0670000017
|
||||||
|
- .101999998
|
||||||
|
- .131099999
|
||||||
|
- .174899995
|
||||||
|
- .233199999
|
||||||
|
- .300000012
|
||||||
|
m_downscaleSettingsFoldout: 000000000000
|
||||||
|
m_featuresSourceId: 0
|
||||||
|
m_upscaleQuality: 0
|
||||||
|
m_mainThresholdSize: 0
|
||||||
|
--- !u!114 &1213239285
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1213239278}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 282a52626d19cf748a6759f335e58ee0, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
moveSpeed: 1
|
||||||
|
yawSpeed: 3
|
||||||
|
pitchSpeed: 3
|
||||||
|
--- !u!1001 &1231976998
|
||||||
|
Prefab:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Modification:
|
||||||
|
m_TransformParent: {fileID: 0}
|
||||||
|
m_Modifications:
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_LocalPosition.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.x
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.z
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_LocalRotation.w
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 452210, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_RootOrder
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22469430, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22422930, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22494758, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22406944, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22440432, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22481936, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22470800, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 22489816, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
propertyPath: m_AnchorMax.y
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
|
m_RemovedComponents: []
|
||||||
|
m_ParentPrefab: {fileID: 100100000, guid: 4dea98012db10d74e997f99b3d806cf7, type: 2}
|
||||||
|
m_IsPrefabParent: 0
|
||||||
|
--- !u!28 &1618320027
|
||||||
|
Texture2D:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_ImageContentsHash:
|
||||||
|
serializedVersion: 2
|
||||||
|
Hash: 00000000000000000000000000000000
|
||||||
|
m_Width: 256
|
||||||
|
m_Height: 1
|
||||||
|
m_CompleteImageSize: 1024
|
||||||
|
m_TextureFormat: 5
|
||||||
|
m_MipMap: 0
|
||||||
|
m_IsReadable: 1
|
||||||
|
m_ReadAllowed: 1
|
||||||
|
m_AlphaIsTransparency: 0
|
||||||
|
m_ImageCount: 1
|
||||||
|
m_TextureDimension: 2
|
||||||
|
m_TextureSettings:
|
||||||
|
m_FilterMode: 1
|
||||||
|
m_Aniso: 1
|
||||||
|
m_MipBias: 0
|
||||||
|
m_WrapMode: 0
|
||||||
|
m_LightmapFormat: 0
|
||||||
|
m_ColorSpace: 1
|
||||||
|
image data: 1024
|
||||||
|
_typelessdata: fffffffffffbfbfffff7f7fffff3f3ffffefefffffebebffffe7e7ffffe3e3ffffdfdfffffdbdbffffd7d7ffffd3d3ffffcfcfffffcbcbffffc7c7ffffc3c3ffffbfbfffffbbbbffffb7b7ffffb3b3ffffafafffffababffffa7a7ffffa3a3ffff9f9fffff9b9bffff9797ffff9393ffff8f8fffff8b8bffff8787ffff8383ffff7f7fffff7b7bffff7777ffff7373ffff6f6fffff6b6bffff6767ffff6363ffff5f5fffff5b5bffff5757ffff5353ffff4f4fffff4b4bffff4747ffff4343ffff3f3fffff3b3bffff3737ffff3333ffff2f2fffff2b2bffff2727ffff2323ffff1f1fffff1b1bffff1717ffff1313ffff0f0fffff0b0bffff0707ffff0303ffff0000feff0004faff0008f6ff000cf2ff0010eeff0014eaff0018e6ff001ce2ff0020deff0024daff0028d6ff002cd2ff0030ceff0034caff0038c6ff003cc2ff0040beff0044baff0048b6ff004cb2ff0050aeff0054aaff0058a6ff005ca2ff00609eff00649aff006896ff006c92ff00708eff00748aff007886ff007c82ff00807eff00847aff008876ff008c72ff00906eff00946aff009866ff009c62ff00a05eff00a45aff00a856ff00ac52ff00b04eff00b44aff00b846ff00bc42ff00c03eff00c43aff00c836ff00cc32ff00d02eff00d42aff00d826ff00dc22ff00e01eff00e41aff00e816ff00ec12ff00f00eff00f40aff00f806ff00fc02ff01fe00ff05fe00ff09fe00ff0dfd00ff11fd00ff15fd00ff19fc00ff1dfc00ff21fc00ff25fc00ff29fb00ff2dfb00ff31fb00ff35fa00ff39fa00ff3dfa00ff41f901ff45f901ff49f901ff4df801ff51f801ff55f801ff59f701ff5df701ff61f701ff65f701ff69f601ff6df601ff71f601ff75f501ff79f501ff7df501ff81f402ff85f402ff89f402ff8df302ff91f302ff95f302ff99f202ff9df202ffa1f202ffa5f202ffa9f102ffadf102ffb1f102ffb5f002ffb9f002ffbdf002ffc1ef03ffc5ef03ffc9ef03ffcdee03ffd1ee03ffd5ee03ffd9ed03ffdded03ffe1ed03ffe5ed03ffe9ec03ffedec03fff1ec03fff5eb03fff9eb03fffdeb03ffffe803ffffe403ffffe003ffffdd03ffffd903ffffd503ffffd203ffffce03ffffca03ffffc703ffffc303ffffbf03ffffbc03ffffb803ffffb403ffffb103ffffad02ffffa902ffffa602ffffa202ffff9e02ffff9b02ffff9702ffff9302ffff9002ffff8c02ffff8802ffff8502ffff8102ffff7d02ffff7a02ffff7602ffff7201ffff6f01ffff6b01ffff6701ffff6401ffff6001ffff5c01ffff5901ffff5501ffff5101ffff4e01ffff4a01ffff4601ffff4301ffff3f01ffff3b01ffff3700ffff3400ffff3000ffff2c00ffff2900ffff2500ffff2100ffff1e00ffff1a00ffff1600ffff1300ffff0f00ffff0b00ffff0800ffff0400ffff0000
|
8
Assets/AmplifyBloom/Samples/Demo/Demo.unity.meta
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7a79888e414cb434e9c0f3c2145157e3
|
||||||
|
timeCreated: 1452012171
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples/Demo/HDR.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7abff15f538815e49adc1ccdaf63fc67
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1452011013
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Demo/HDR/NightEnvironment.hdr
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e842223bc31d70446bcda34d75264d2d
|
||||||
|
timeCreated: 1452016407
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName:
|
||||||
|
8900000: generatedCubemap
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 6
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 1024
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: 3
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples/Demo/Materials.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 97e1fd4ba8f7c8c47b9f570f4855f98c
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1447239564
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
199
Assets/AmplifyBloom/Samples/Demo/Materials/HDRSkyBox.mat
Normal file
|
@ -0,0 +1,199 @@
|
||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 6
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_Name: HDRSkyBox
|
||||||
|
m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_ShaderKeywords:
|
||||||
|
m_LightmapFlags: 5
|
||||||
|
m_CustomRenderQueue: 1000
|
||||||
|
stringTagMap: {}
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 2
|
||||||
|
m_TexEnvs:
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _MainTex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _BumpMap
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _DetailNormalMap
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Tex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 8900000, guid: e842223bc31d70446bcda34d75264d2d, type: 3}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _ParallaxMap
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _OcclusionMap
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _EmissionMap
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _DetailMask
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _DetailAlbedoMap
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _MetallicGlossMap
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _FrontTex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _BackTex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _LeftTex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _RightTex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _UpTex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _DownTex
|
||||||
|
second:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Floats:
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _SrcBlend
|
||||||
|
second: 1
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _DstBlend
|
||||||
|
second: 0
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Cutoff
|
||||||
|
second: 0.5
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Exposure
|
||||||
|
second: 0.28
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Parallax
|
||||||
|
second: 0.02
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _ZWrite
|
||||||
|
second: 1
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Glossiness
|
||||||
|
second: 0.5
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _BumpScale
|
||||||
|
second: 1
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _OcclusionStrength
|
||||||
|
second: 1
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _DetailNormalMapScale
|
||||||
|
second: 1
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _UVSec
|
||||||
|
second: 0
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Mode
|
||||||
|
second: 0
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Metallic
|
||||||
|
second: 0
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Rotation
|
||||||
|
second: 0
|
||||||
|
m_Colors:
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _EmissionColor
|
||||||
|
second: {r: 0, g: 0, b: 0, a: 1}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Color
|
||||||
|
second: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
data:
|
||||||
|
first:
|
||||||
|
name: _Tint
|
||||||
|
second: {r: 1, g: 1, b: 1, a: 1}
|
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a654bcf02970eab4491147c5e2256af5
|
||||||
|
timeCreated: 1452011182
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples/Demo/Prefabs.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f7afc990066e9724c96b7cbd52483120
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1452012107
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
5070
Assets/AmplifyBloom/Samples/Demo/Prefabs/DemoMainUI.prefab
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4dea98012db10d74e997f99b3d806cf7
|
||||||
|
timeCreated: 1452012112
|
||||||
|
licenseType: Store
|
||||||
|
NativeFormatImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples/Demo/Scripts.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f6375a116bab6b1448aebae387de06f7
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1447754018
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
120
Assets/AmplifyBloom/Samples/Demo/Scripts/DemoCameraMovement.cs
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public class DemoCameraMovement : MonoBehaviour
|
||||||
|
{
|
||||||
|
|
||||||
|
private const string X_AXIS_KEYBOARD = "Mouse X";
|
||||||
|
private const string Y_AXIS_KEYBOARD = "Mouse Y";
|
||||||
|
|
||||||
|
private const string X_AXIS_GAMEPAD = "Horizontal";
|
||||||
|
private const string Y_AXIS_GAMEPAD = "Vertical";
|
||||||
|
|
||||||
|
private bool m_gamePadMode = false;
|
||||||
|
|
||||||
|
public float moveSpeed = 1f;
|
||||||
|
public float yawSpeed = 3;
|
||||||
|
public float pitchSpeed = 3;
|
||||||
|
|
||||||
|
private float _yaw = 0;
|
||||||
|
private float _pitch = 0;
|
||||||
|
|
||||||
|
private Transform _transform;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
_transform = transform;
|
||||||
|
|
||||||
|
_pitch = _transform.localEulerAngles.x;
|
||||||
|
_yaw = _transform.localEulerAngles.y;
|
||||||
|
|
||||||
|
#if UNITY_IOS || UNITY_ANDROID
|
||||||
|
m_gamePadMode = false;
|
||||||
|
#else
|
||||||
|
if ( Input.GetJoystickNames().Length > 0 )
|
||||||
|
{
|
||||||
|
m_gamePadMode = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
#if UNITY_IOS || UNITY_ANDROID
|
||||||
|
|
||||||
|
if ( !EventSystem.current.IsPointerOverGameObject() )
|
||||||
|
{
|
||||||
|
if ( Input.touchCount > 0 )
|
||||||
|
{
|
||||||
|
Vector2 deltaPos = Input.GetTouch( 0 ).deltaPosition;
|
||||||
|
ChangeYaw( deltaPos.x * yawSpeed );
|
||||||
|
ChangePitch( -deltaPos.y * pitchSpeed );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
if ( m_gamePadMode )
|
||||||
|
{
|
||||||
|
ChangeYaw( Input.GetAxisRaw( X_AXIS_GAMEPAD ) * yawSpeed );
|
||||||
|
ChangePitch( -Input.GetAxisRaw( Y_AXIS_GAMEPAD ) * pitchSpeed );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( Input.GetMouseButton( 0 ) && !EventSystem.current.IsPointerOverGameObject() )
|
||||||
|
{
|
||||||
|
ChangeYaw( Input.GetAxisRaw( X_AXIS_KEYBOARD ) * yawSpeed );
|
||||||
|
ChangePitch( -Input.GetAxisRaw( Y_AXIS_KEYBOARD ) * pitchSpeed );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveForwards( float delta )
|
||||||
|
{
|
||||||
|
_transform.position += delta * _transform.forward;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Strafe( float delta )
|
||||||
|
{
|
||||||
|
transform.position += delta * _transform.right;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChangeYaw( float delta )
|
||||||
|
{
|
||||||
|
_yaw += delta;
|
||||||
|
WrapAngle( ref _yaw );
|
||||||
|
_transform.localEulerAngles = new Vector3( _pitch, _yaw, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChangePitch( float delta )
|
||||||
|
{
|
||||||
|
_pitch += delta;
|
||||||
|
WrapAngle( ref _pitch );
|
||||||
|
_transform.localEulerAngles = new Vector3( _pitch, _yaw, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
public void WrapAngle( ref float angle )
|
||||||
|
{
|
||||||
|
if ( angle < 0 )
|
||||||
|
angle = 360 + angle;
|
||||||
|
|
||||||
|
if ( angle > 360 )
|
||||||
|
angle = angle - 360;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool GamePadMode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return m_gamePadMode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 282a52626d19cf748a6759f335e58ee0
|
||||||
|
timeCreated: 1448905484
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
50
Assets/AmplifyBloom/Samples/Demo/Scripts/DemoFPSCounter.cs
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public class DemoFPSCounter : MonoBehaviour
|
||||||
|
{
|
||||||
|
public float UpdateInterval = 0.5F;
|
||||||
|
private Text m_fpsText;
|
||||||
|
|
||||||
|
private float m_accum = 0; // FPS accumulated over the interval
|
||||||
|
private int m_frames = 0; // Frames drawn over the interval
|
||||||
|
private float m_timeleft; // Left time for current interval
|
||||||
|
private float m_fps;
|
||||||
|
private string m_format;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
m_fpsText = GetComponent<Text>();
|
||||||
|
m_timeleft = UpdateInterval;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
m_timeleft -= Time.deltaTime;
|
||||||
|
m_accum += Time.timeScale / Time.deltaTime;
|
||||||
|
++m_frames;
|
||||||
|
if ( m_timeleft <= 0.0 )
|
||||||
|
{
|
||||||
|
m_fps = m_accum / m_frames;
|
||||||
|
m_format = System.String.Format( "{0:F2} FPS", m_fps );
|
||||||
|
m_fpsText.text = m_format;
|
||||||
|
|
||||||
|
if ( m_fps < 50 )
|
||||||
|
m_fpsText.color = Color.yellow;
|
||||||
|
else
|
||||||
|
if ( m_fps < 30 )
|
||||||
|
m_fpsText.color = Color.red;
|
||||||
|
else
|
||||||
|
m_fpsText.color = Color.green;
|
||||||
|
|
||||||
|
m_timeleft = UpdateInterval;
|
||||||
|
m_accum = 0.0F;
|
||||||
|
m_frames = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5f572620d698e1c449ab110744a2208d
|
||||||
|
timeCreated: 1452778446
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
277
Assets/AmplifyBloom/Samples/Demo/Scripts/DemoMainUI.cs
Normal file
|
@ -0,0 +1,277 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
using UnityEditor;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public class DemoMainUI : MonoBehaviour
|
||||||
|
{
|
||||||
|
private const string VERTICAL_GAMEPAD = "Vertical";
|
||||||
|
private const string HORIZONTAL_GAMEPAD = "Horizontal";
|
||||||
|
private const string SUBMIT_BUTTON = "Submit";
|
||||||
|
|
||||||
|
public Toggle BloomToggle;
|
||||||
|
public Toggle HighPrecision;
|
||||||
|
public Toggle UpscaleType;
|
||||||
|
public Toggle TemporalFilter;
|
||||||
|
public Toggle BokehToggle;
|
||||||
|
public Toggle LensFlareToggle;
|
||||||
|
public Toggle LensGlareToggle;
|
||||||
|
public Toggle LensDirtToggle;
|
||||||
|
public Toggle LensStarburstToggle;
|
||||||
|
public Slider ThresholdSlider;
|
||||||
|
public Slider DownscaleAmountSlider;
|
||||||
|
public Slider IntensitySlider;
|
||||||
|
public Slider ThresholdSizeSlider;
|
||||||
|
private AmplifyBloomEffect _amplifyBloomEffect;
|
||||||
|
private Camera _camera;
|
||||||
|
|
||||||
|
private DemoUIElement[] m_uiElements;
|
||||||
|
|
||||||
|
private bool m_gamePadMode = false;
|
||||||
|
|
||||||
|
private int m_currentOption = 0;
|
||||||
|
private int m_lastOption = 0;
|
||||||
|
|
||||||
|
private int m_lastAxisValue = 0;
|
||||||
|
|
||||||
|
void Awake()
|
||||||
|
{
|
||||||
|
_camera = Camera.main;
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if ( PlayerSettings.colorSpace == ColorSpace.Gamma )
|
||||||
|
{
|
||||||
|
Debug.LogWarning("Detected Gamma Color Space. For better visual results please switch to Linear Color Space by going to Player Settings > Other Settings > Rendering Path > Color Space > Linear.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !_camera.hdr )
|
||||||
|
{
|
||||||
|
Debug.LogWarning( "Detected LDR on camera. For better visual results please switch to HDR by hitting the HDR toggle on the Camera component." );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
_amplifyBloomEffect = _camera.GetComponent<AmplifyBloomEffect>();
|
||||||
|
|
||||||
|
BloomToggle.isOn = _amplifyBloomEffect.enabled;
|
||||||
|
HighPrecision.isOn = _amplifyBloomEffect.HighPrecision;
|
||||||
|
UpscaleType.isOn = (_amplifyBloomEffect.UpscaleQuality == UpscaleQualityEnum.Realistic);
|
||||||
|
TemporalFilter.isOn = _amplifyBloomEffect.TemporalFilteringActive;
|
||||||
|
BokehToggle.isOn = _amplifyBloomEffect.BokehFilterInstance.ApplyBokeh;
|
||||||
|
LensFlareToggle.isOn = _amplifyBloomEffect.LensFlareInstance.ApplyLensFlare;
|
||||||
|
LensGlareToggle.isOn = _amplifyBloomEffect.LensGlareInstance.ApplyLensGlare;
|
||||||
|
LensDirtToggle.isOn = _amplifyBloomEffect.ApplyLensDirt;
|
||||||
|
LensStarburstToggle.isOn = _amplifyBloomEffect.ApplyLensStardurst;
|
||||||
|
|
||||||
|
BloomToggle.onValueChanged.AddListener( OnBloomToggle );
|
||||||
|
HighPrecision.onValueChanged.AddListener( OnHighPrecisionToggle );
|
||||||
|
UpscaleType.onValueChanged.AddListener( OnUpscaleTypeToogle );
|
||||||
|
TemporalFilter.onValueChanged.AddListener( OnTemporalFilterToggle );
|
||||||
|
BokehToggle.onValueChanged.AddListener( OnBokehFilterToggle );
|
||||||
|
LensFlareToggle.onValueChanged.AddListener( OnLensFlareToggle );
|
||||||
|
LensGlareToggle.onValueChanged.AddListener( OnLensGlareToggle );
|
||||||
|
LensDirtToggle.onValueChanged.AddListener( OnLensDirtToggle );
|
||||||
|
LensStarburstToggle.onValueChanged.AddListener( OnLensStarburstToggle );
|
||||||
|
|
||||||
|
ThresholdSlider.value = _amplifyBloomEffect.OverallThreshold;
|
||||||
|
ThresholdSlider.onValueChanged.AddListener( OnThresholdSlider );
|
||||||
|
|
||||||
|
DownscaleAmountSlider.value = _amplifyBloomEffect.BloomDownsampleCount;
|
||||||
|
DownscaleAmountSlider.onValueChanged.AddListener( OnDownscaleAmount );
|
||||||
|
|
||||||
|
IntensitySlider.value = _amplifyBloomEffect.OverallIntensity;
|
||||||
|
IntensitySlider.onValueChanged.AddListener( OnIntensitySlider );
|
||||||
|
|
||||||
|
ThresholdSizeSlider.value = ( float ) _amplifyBloomEffect.MainThresholdSize;
|
||||||
|
ThresholdSizeSlider.onValueChanged.AddListener( OnThresholdSize );
|
||||||
|
|
||||||
|
if ( Input.GetJoystickNames().Length > 0 )
|
||||||
|
{
|
||||||
|
m_gamePadMode = true;
|
||||||
|
m_uiElements = new DemoUIElement[ 13 ];
|
||||||
|
m_uiElements[ 0 ] = BloomToggle.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 1 ] = HighPrecision.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 2 ] = UpscaleType.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 3 ] = TemporalFilter.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 4 ] = BokehToggle.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 5 ] = LensFlareToggle.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 6 ] = LensGlareToggle.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 7 ] = LensDirtToggle.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 8 ] = LensStarburstToggle.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 9 ] = ThresholdSlider.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 10 ] = DownscaleAmountSlider.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 11 ] = IntensitySlider.GetComponent<DemoUIElement>();
|
||||||
|
m_uiElements[ 12 ] = ThresholdSizeSlider.GetComponent<DemoUIElement>();
|
||||||
|
|
||||||
|
for ( int i = 0; i < m_uiElements.Length; i++ )
|
||||||
|
{
|
||||||
|
m_uiElements[ i ].Init();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_uiElements[ m_currentOption ].Select = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnThresholdSize( float selection )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.MainThresholdSize = ( MainThresholdSizeEnum ) selection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnThresholdSlider( float value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.OverallThreshold = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDownscaleAmount( float value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.BloomDownsampleCount = ( int ) value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnIntensitySlider( float value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.OverallIntensity = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnBloomToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.enabled = BloomToggle.isOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnHighPrecisionToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.HighPrecision = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnUpscaleTypeToogle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.UpscaleQuality = (value)? UpscaleQualityEnum.Realistic:UpscaleQualityEnum.Natural;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnTemporalFilterToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.TemporalFilteringActive = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnBokehFilterToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.BokehFilterInstance.ApplyBokeh = BokehToggle.isOn;
|
||||||
|
}
|
||||||
|
public void OnLensFlareToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.LensFlareInstance.ApplyLensFlare = LensFlareToggle.isOn;
|
||||||
|
}
|
||||||
|
public void OnLensGlareToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.LensGlareInstance.ApplyLensGlare = LensGlareToggle.isOn;
|
||||||
|
}
|
||||||
|
public void OnLensDirtToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.ApplyLensDirt = LensDirtToggle.isOn;
|
||||||
|
}
|
||||||
|
public void OnLensStarburstToggle( bool value )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.ApplyLensStardurst = LensStarburstToggle.isOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnQuitButton()
|
||||||
|
{
|
||||||
|
Application.Quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if ( m_gamePadMode )
|
||||||
|
{
|
||||||
|
int axisValue = ( int ) Input.GetAxis( VERTICAL_GAMEPAD );
|
||||||
|
if ( axisValue != m_lastAxisValue )
|
||||||
|
{
|
||||||
|
m_lastAxisValue = axisValue;
|
||||||
|
|
||||||
|
if ( axisValue == 1 )
|
||||||
|
{
|
||||||
|
m_currentOption = ( m_currentOption + 1 ) % m_uiElements.Length;
|
||||||
|
}
|
||||||
|
else if ( axisValue == -1 )
|
||||||
|
{
|
||||||
|
m_currentOption = ( m_currentOption == 0 ) ? ( m_uiElements.Length - 1 ) : ( m_currentOption - 1 );
|
||||||
|
}
|
||||||
|
m_uiElements[ m_lastOption ].Select = false;
|
||||||
|
m_uiElements[ m_currentOption ].Select = true;
|
||||||
|
m_lastOption = m_currentOption;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Input.GetButtonDown( SUBMIT_BUTTON ) )
|
||||||
|
{
|
||||||
|
m_uiElements[ m_currentOption ].DoAction( DemoUIElementAction.Press );
|
||||||
|
}
|
||||||
|
|
||||||
|
float slideValue = Input.GetAxis( HORIZONTAL_GAMEPAD );
|
||||||
|
if ( Mathf.Abs( slideValue ) > 0 )
|
||||||
|
{
|
||||||
|
m_uiElements[ m_currentOption ].DoAction( DemoUIElementAction.Slide, slideValue * Time.deltaTime );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_uiElements[ m_currentOption ].Idle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( Input.GetKey( KeyCode.LeftAlt ) && Input.GetKey( KeyCode.Q ) )
|
||||||
|
{
|
||||||
|
OnQuitButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Input.GetKeyDown( KeyCode.Alpha0 ) )
|
||||||
|
{
|
||||||
|
_camera.orthographic = !_camera.orthographic;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Input.GetKeyDown( KeyCode.Alpha1 ) )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.enabled = BloomToggle.isOn = !BloomToggle.isOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
BokehToggle.interactable =
|
||||||
|
LensFlareToggle.interactable =
|
||||||
|
LensGlareToggle.interactable =
|
||||||
|
LensDirtToggle.interactable =
|
||||||
|
LensStarburstToggle.interactable =
|
||||||
|
ThresholdSlider.interactable =
|
||||||
|
DownscaleAmountSlider.interactable =
|
||||||
|
HighPrecision.interactable =
|
||||||
|
IntensitySlider.interactable = BloomToggle.isOn;
|
||||||
|
|
||||||
|
if ( BloomToggle.isOn )
|
||||||
|
{
|
||||||
|
if ( Input.GetKeyDown( KeyCode.Alpha2 ) )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.BokehFilterInstance.ApplyBokeh = BokehToggle.isOn = !BokehToggle.isOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Input.GetKeyDown( KeyCode.Alpha3 ) )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.LensFlareInstance.ApplyLensFlare = LensFlareToggle.isOn = !LensFlareToggle.isOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Input.GetKeyDown( KeyCode.Alpha4 ) )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.LensGlareInstance.ApplyLensGlare = LensGlareToggle.isOn = !LensGlareToggle.isOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Input.GetKeyDown( KeyCode.Alpha5 ) )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.ApplyLensDirt = LensDirtToggle.isOn = !LensDirtToggle.isOn;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( Input.GetKeyDown( KeyCode.Alpha6 ) )
|
||||||
|
{
|
||||||
|
_amplifyBloomEffect.ApplyLensStardurst = LensStarburstToggle.isOn = !LensStarburstToggle.isOn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
Assets/AmplifyBloom/Samples/Demo/Scripts/DemoMainUI.cs.meta
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2fe004816b94e2d4fb88359d1b543905
|
||||||
|
timeCreated: 1452003864
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
48
Assets/AmplifyBloom/Samples/Demo/Scripts/DemoUIElement.cs
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public enum DemoUIElementAction
|
||||||
|
{
|
||||||
|
Press = 0,
|
||||||
|
Slide
|
||||||
|
};
|
||||||
|
|
||||||
|
public class DemoUIElement : MonoBehaviour
|
||||||
|
{
|
||||||
|
private bool m_isSelected = false;
|
||||||
|
private Text m_text;
|
||||||
|
private Color m_selectedColor = new Color( 1, 1, 1 );
|
||||||
|
private Color m_unselectedColor;
|
||||||
|
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
m_text = transform.GetComponentInChildren<Text>();
|
||||||
|
m_unselectedColor = m_text.color;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual public void DoAction( DemoUIElementAction action, params object[] vars )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual public void Idle()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Select
|
||||||
|
{
|
||||||
|
get { return m_isSelected; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
m_isSelected = value;
|
||||||
|
m_text.color = value ? m_selectedColor : m_unselectedColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f796ec024277c3946b375c14da383de6
|
||||||
|
timeCreated: 1452700701
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
58
Assets/AmplifyBloom/Samples/Demo/Scripts/DemoUISlider.cs
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
public sealed class DemoUISlider : DemoUIElement
|
||||||
|
{
|
||||||
|
public bool SingleStep = false;
|
||||||
|
private Slider m_slider;
|
||||||
|
private bool m_lastStep = false;
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
m_slider = GetComponent<Slider>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DoAction( DemoUIElementAction action, params object[] vars )
|
||||||
|
{
|
||||||
|
if ( !m_slider.IsInteractable() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( action == DemoUIElementAction.Slide )
|
||||||
|
{
|
||||||
|
float slideAmount = ( float ) vars[ 0 ];
|
||||||
|
if ( SingleStep )
|
||||||
|
{
|
||||||
|
if ( m_lastStep )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_lastStep = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_slider.wholeNumbers )
|
||||||
|
{
|
||||||
|
if ( slideAmount > 0 )
|
||||||
|
{
|
||||||
|
m_slider.value += 1;
|
||||||
|
}
|
||||||
|
else if ( slideAmount < 0 )
|
||||||
|
{
|
||||||
|
m_slider.value -= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_slider.value += slideAmount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Idle()
|
||||||
|
{
|
||||||
|
m_lastStep = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2b6843cc0fe106f468c72d877a73ab53
|
||||||
|
timeCreated: 1452705062
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
29
Assets/AmplifyBloom/Samples/Demo/Scripts/DemoUIToggle.cs
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Amplify Bloom - Advanced Bloom Post-Effect for Unity
|
||||||
|
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
|
||||||
|
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace AmplifyBloom
|
||||||
|
{
|
||||||
|
|
||||||
|
public sealed class DemoUIToggle : DemoUIElement
|
||||||
|
{
|
||||||
|
private Toggle m_toggle;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
m_toggle = GetComponent<Toggle>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DoAction( DemoUIElementAction action, params object[] vars )
|
||||||
|
{
|
||||||
|
if ( !m_toggle.IsInteractable() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( action == DemoUIElementAction.Press )
|
||||||
|
{
|
||||||
|
m_toggle.isOn = !m_toggle.isOn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 92428448a5b483b40a4c3b0b505fffe8
|
||||||
|
timeCreated: 1452705052
|
||||||
|
licenseType: Store
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples/Textures.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0096d0d95d7c6f24aa3fc0b7803663f2
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1447695137
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
9
Assets/AmplifyBloom/Samples/Textures/Dirt.meta
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 42e8ebf19a3c75a4b850eec65a5458c8
|
||||||
|
folderAsset: yes
|
||||||
|
timeCreated: 1452622397
|
||||||
|
licenseType: Store
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/DirtHighContrast.png
Normal file
After Width: | Height: | Size: 828 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7825356d1f1778140ad12b5dfe6b4d41
|
||||||
|
timeCreated: 1450091865
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 1024
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/DirtLowContrast.png
Normal file
After Width: | Height: | Size: 749 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c0575617e448bb14396354527b9f5b68
|
||||||
|
timeCreated: 1450091865
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 1024
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_1.png
Normal file
After Width: | Height: | Size: 898 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8fe8fae6feccd7947af36b04d69c4470
|
||||||
|
timeCreated: 1453216696
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_2.png
Normal file
After Width: | Height: | Size: 829 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6940980a0023f844ebb70a72a5e1b157
|
||||||
|
timeCreated: 1453216692
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_3.png
Normal file
After Width: | Height: | Size: 974 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 68d976f013539264aaf3ef3de23ea30d
|
||||||
|
timeCreated: 1453216692
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_4.png
Normal file
After Width: | Height: | Size: 887 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2d2a24e6ba394474c8eeb4e803c86ece
|
||||||
|
timeCreated: 1453216690
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_5.png
Normal file
After Width: | Height: | Size: 952 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 69d7195054ec55345a0558bc64bb5b73
|
||||||
|
timeCreated: 1453216693
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_6.png
Normal file
After Width: | Height: | Size: 784 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 87b6dffc85cfc0740832426e1ad87025
|
||||||
|
timeCreated: 1453216694
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_7.png
Normal file
After Width: | Height: | Size: 954 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a19b0cd735dd895469fd4b002642e65a
|
||||||
|
timeCreated: 1453832180
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_8.png
Normal file
After Width: | Height: | Size: 553 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a45a421fb0aa30a448304155b840362d
|
||||||
|
timeCreated: 1453832180
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/AmplifyBloom/Samples/Textures/Dirt/Dirt_Simple_9.png
Normal file
After Width: | Height: | Size: 1.1 MiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 71b07509a44fb6541b7d82946456007c
|
||||||
|
timeCreated: 1453832179
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
After Width: | Height: | Size: 763 KiB |
|
@ -0,0 +1,57 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0514dfa2df1b0a5478052591a9dcc01b
|
||||||
|
timeCreated: 1453216684
|
||||||
|
licenseType: Store
|
||||||
|
TextureImporter:
|
||||||
|
fileIDToRecycleName: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
mipmaps:
|
||||||
|
mipMapMode: 0
|
||||||
|
enableMipMap: 1
|
||||||
|
linearTexture: 0
|
||||||
|
correctGamma: 0
|
||||||
|
fadeOut: 0
|
||||||
|
borderMipMap: 0
|
||||||
|
mipMapFadeDistanceStart: 1
|
||||||
|
mipMapFadeDistanceEnd: 3
|
||||||
|
bumpmap:
|
||||||
|
convertToNormalMap: 0
|
||||||
|
externalNormalMap: 0
|
||||||
|
heightScale: 0.25
|
||||||
|
normalMapFilter: 0
|
||||||
|
isReadable: 0
|
||||||
|
grayScaleToAlpha: 0
|
||||||
|
generateCubemap: 0
|
||||||
|
cubemapConvolution: 0
|
||||||
|
cubemapConvolutionSteps: 7
|
||||||
|
cubemapConvolutionExponent: 1.5
|
||||||
|
seamlessCubemap: 0
|
||||||
|
textureFormat: -1
|
||||||
|
maxTextureSize: 2048
|
||||||
|
textureSettings:
|
||||||
|
filterMode: -1
|
||||||
|
aniso: -1
|
||||||
|
mipBias: -1
|
||||||
|
wrapMode: 1
|
||||||
|
nPOTScale: 1
|
||||||
|
lightmap: 0
|
||||||
|
rGBM: 0
|
||||||
|
compressionQuality: 50
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
spriteMode: 0
|
||||||
|
spriteExtrude: 1
|
||||||
|
spriteMeshType: 1
|
||||||
|
alignment: 0
|
||||||
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
spritePixelsToUnits: 100
|
||||||
|
alphaIsTransparency: 0
|
||||||
|
textureType: -1
|
||||||
|
buildTargetSettings: []
|
||||||
|
spriteSheet:
|
||||||
|
sprites: []
|
||||||
|
outline: []
|
||||||
|
spritePackingTag:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
After Width: | Height: | Size: 534 KiB |