This commit is contained in:
2024-09-20 20:30:10 +02:00
commit 4fabf1a6fd
29169 changed files with 1706941 additions and 0 deletions

View File

@@ -0,0 +1,200 @@
using System.IO;
using UnityEngine;
using UnityEngine.Rendering;
namespace UnityEditor.Rendering
{
/// <summary>
/// Editor for LensFlareComponentSRP: Lens Flare Data-Driven which can be added on any GameObject
/// </summary>
[CanEditMultipleObjects]
[CustomEditorForRenderPipeline(typeof(LensFlareComponentSRP), typeof(UnityEngine.Rendering.RenderPipelineAsset))]
class LensFlareComponentSRPEditor : Editor
{
SerializedProperty m_LensFlareData;
SerializedProperty m_Intensity;
SerializedProperty m_Scale;
SerializedProperty m_MaxAttenuationDistance;
SerializedProperty m_MaxAttenuationScale;
SerializedProperty m_DistanceAttenuationCurve;
SerializedProperty m_ScaleByDistanceCurve;
SerializedProperty m_AttenuationByLightShape;
SerializedProperty m_RadialScreenAttenuationCurve;
SerializedProperty m_UseOcclusion;
SerializedProperty m_BackgroundCloudOcclusion;
SerializedProperty m_OcclusionRadius;
SerializedProperty m_SamplesCount;
SerializedProperty m_OcclusionOffset;
SerializedProperty m_AllowOffScreen;
SerializedProperty m_VolumetricCloudOcclusion;
SerializedProperty m_OcclusionRemapTextureCurve;
SerializedProperty m_OcclusionRemapCurve;
void MakeTextureDirtyCallback()
{
LensFlareComponentSRP comp = target as LensFlareComponentSRP;
comp.occlusionRemapCurve.SetDirty();
}
void OnEnable()
{
PropertyFetcher<LensFlareComponentSRP> entryPoint = new PropertyFetcher<LensFlareComponentSRP>(serializedObject);
m_LensFlareData = entryPoint.Find("m_LensFlareData");
m_Intensity = entryPoint.Find(x => x.intensity);
m_Scale = entryPoint.Find(x => x.scale);
m_MaxAttenuationDistance = entryPoint.Find(x => x.maxAttenuationDistance);
m_DistanceAttenuationCurve = entryPoint.Find(x => x.distanceAttenuationCurve);
m_MaxAttenuationScale = entryPoint.Find(x => x.maxAttenuationScale);
m_ScaleByDistanceCurve = entryPoint.Find(x => x.scaleByDistanceCurve);
m_AttenuationByLightShape = entryPoint.Find(x => x.attenuationByLightShape);
m_RadialScreenAttenuationCurve = entryPoint.Find(x => x.radialScreenAttenuationCurve);
m_UseOcclusion = entryPoint.Find(x => x.useOcclusion);
m_BackgroundCloudOcclusion = entryPoint.Find(x => x.useBackgroundCloudOcclusion);
m_OcclusionRadius = entryPoint.Find(x => x.occlusionRadius);
m_SamplesCount = entryPoint.Find(x => x.sampleCount);
m_OcclusionOffset = entryPoint.Find(x => x.occlusionOffset);
m_AllowOffScreen = entryPoint.Find(x => x.allowOffScreen);
m_VolumetricCloudOcclusion = entryPoint.Find(x => x.volumetricCloudOcclusion);
m_OcclusionRemapTextureCurve = entryPoint.Find(x => x.occlusionRemapCurve);
m_OcclusionRemapCurve = m_OcclusionRemapTextureCurve.FindPropertyRelative("m_Curve");
Undo.undoRedoPerformed += MakeTextureDirtyCallback;
}
void OnDisable()
{
Undo.undoRedoPerformed -= MakeTextureDirtyCallback;
}
/// <summary>
/// Implement this function to make a custom inspector
/// </summary>
public override void OnInspectorGUI()
{
LensFlareComponentSRP lensFlareData = m_Intensity.serializedObject.targetObject as LensFlareComponentSRP;
bool attachedToLight = false;
bool lightIsDirLight = false;
Light light = null;
if (lensFlareData != null &&
(light = lensFlareData.GetComponent<Light>()) != null)
{
attachedToLight = true;
if (light.type == LightType.Directional)
lightIsDirLight = true;
}
EditorGUI.BeginChangeCheck();
EditorGUILayout.LabelField(Styles.generalData.text, EditorStyles.boldLabel);
{
using (new EditorGUILayout.HorizontalScope())
{
bool showCopy = m_LensFlareData.objectReferenceValue != null;
int buttonWidth = showCopy ? 45 : 60;
EditorGUILayout.PropertyField(m_LensFlareData, Styles.lensFlareData);
if (GUILayout.Button(Styles.newButton, showCopy ? EditorStyles.miniButtonLeft : EditorStyles.miniButton, GUILayout.Width(buttonWidth)))
{
// By default, try to put assets in a folder next to the currently active
// scene file. If the user isn't a scene, put them in root instead.
var actualTarget = target as LensFlareComponentSRP;
var targetName = actualTarget.name + " Lens Flare (SRP)";
var scene = actualTarget.gameObject.scene;
var asset = LensFlareEditorUtils.CreateLensFlareDataSRPAsset(scene, targetName);
m_LensFlareData.objectReferenceValue = asset;
}
if (showCopy && GUILayout.Button(Styles.cloneButton, EditorStyles.miniButtonRight, GUILayout.Width(buttonWidth)))
{
// Duplicate the currently assigned profile and save it as a new profile
var origin = m_LensFlareData.objectReferenceValue;
var path = AssetDatabase.GetAssetPath(m_LensFlareData.objectReferenceValue);
path = CoreEditorUtils.IsAssetInReadOnlyPackage(path)
// We may be in a read only package, in that case we need to clone the volume profile in an
// editable area, such as the root of the project.
? AssetDatabase.GenerateUniqueAssetPath(Path.Combine("Assets", Path.GetFileName(path)))
// Otherwise, duplicate next to original asset.
: AssetDatabase.GenerateUniqueAssetPath(path);
var asset = Instantiate(origin);
AssetDatabase.CreateAsset(asset, path);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
m_LensFlareData.objectReferenceValue = asset;
}
}
EditorGUILayout.PropertyField(m_Intensity, Styles.intensity);
EditorGUILayout.PropertyField(m_Scale, Styles.scale);
if (!lightIsDirLight)
{
if (attachedToLight)
EditorGUILayout.PropertyField(m_AttenuationByLightShape, Styles.attenuationByLightShape);
EditorGUILayout.PropertyField(m_MaxAttenuationDistance, Styles.maxAttenuationDistance);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(m_DistanceAttenuationCurve, Styles.distanceAttenuationCurve);
--EditorGUI.indentLevel;
EditorGUILayout.PropertyField(m_MaxAttenuationScale, Styles.maxAttenuationScale);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(m_ScaleByDistanceCurve, Styles.scaleByDistanceCurve);
--EditorGUI.indentLevel;
}
EditorGUILayout.PropertyField(m_RadialScreenAttenuationCurve, Styles.radialScreenAttenuationCurve);
}
EditorGUILayout.LabelField(Styles.occlusionData.text, EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_UseOcclusion, Styles.enableOcclusion);
if (m_UseOcclusion.boolValue)
{
++EditorGUI.indentLevel;
if (RenderPipelineManager.currentPipeline is ICloudBackground)
EditorGUILayout.PropertyField(m_BackgroundCloudOcclusion, Styles.backgroundCloudOcclusion);
if (RenderPipelineManager.currentPipeline is IVolumetricCloud volumetricCloud && volumetricCloud.IsVolumetricCloudUsable())
EditorGUILayout.PropertyField(m_VolumetricCloudOcclusion, Styles.volumetricCloudOcclusion);
EditorGUILayout.PropertyField(m_OcclusionRadius, Styles.occlusionRadius);
EditorGUILayout.PropertyField(m_SamplesCount, Styles.sampleCount);
EditorGUILayout.PropertyField(m_OcclusionOffset, Styles.occlusionOffset);
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_OcclusionRemapCurve, Styles.occlusionRemapCurve);
if (EditorGUI.EndChangeCheck())
{
LensFlareComponentSRP comp = target as LensFlareComponentSRP;
comp.occlusionRemapCurve.SetDirty();
}
--EditorGUI.indentLevel;
}
EditorGUILayout.PropertyField(m_AllowOffScreen, Styles.allowOffScreen);
if (EditorGUI.EndChangeCheck())
{
m_LensFlareData.serializedObject.ApplyModifiedProperties();
}
}
static class Styles
{
static public readonly GUIContent generalData = EditorGUIUtility.TrTextContent("General");
static public readonly GUIContent occlusionData = EditorGUIUtility.TrTextContent("Occlusion");
static public readonly GUIContent lensFlareData = EditorGUIUtility.TrTextContent("Lens Flare Data", "Specifies the SRP Lens Flare Data asset this component uses.");
static public readonly GUIContent newButton = EditorGUIUtility.TrTextContent("New", "Create a new SRP Lens Flare Data asset.");
static public readonly GUIContent cloneButton = EditorGUIUtility.TrTextContent("Clone", "Create a new SRP Lens Flare Data asset and copy the content of the currently assigned data.");
static public readonly GUIContent intensity = EditorGUIUtility.TrTextContent("Intensity", "Sets the intensity of the lens flare.");
static public readonly GUIContent scale = EditorGUIUtility.TrTextContent("Scale", "Sets the scale of the lens flare.");
static public readonly GUIContent maxAttenuationDistance = EditorGUIUtility.TrTextContent("Attenuation Distance", "Sets the distance, in meters, between the start and the end of the Distance Attenuation Curve.");
static public readonly GUIContent distanceAttenuationCurve = EditorGUIUtility.TrTextContent("Attenuation Distance Curve", "Specifies the curve that reduces the effect of the lens flare based on the distance between the GameObject this asset is attached to and the Camera.");
static public readonly GUIContent maxAttenuationScale = EditorGUIUtility.TrTextContent("Scale Distance", "Sets the distance, in meters, between the start and the end of the Scale Attenuation Curve.");
static public readonly GUIContent scaleByDistanceCurve = EditorGUIUtility.TrTextContent("Scale Distance Curve", "Specifies the curve used to calculate the size of the lens flare based on the distance between the GameObject this asset is attached to, and the Camera.");
static public readonly GUIContent attenuationByLightShape = EditorGUIUtility.TrTextContent("Attenuation By Light Shape", "When enabled, if the component is attached to a light, automatically reduces the effect of the lens flare based on the type and shape of the light.");
static public readonly GUIContent radialScreenAttenuationCurve = EditorGUIUtility.TrTextContent("Screen Attenuation Curve", "Specifies the curve that modifies the intensity of the lens flare based on its distance from the edge of the screen.");
static public readonly GUIContent enableOcclusion = EditorGUIUtility.TrTextContent("Enable", "When enabled, the renderer uses the depth buffer to occlude (partially or completely) the lens flare. Partial occlusion also occurs when the lens flare is partially offscreen.");
static public readonly GUIContent backgroundCloudOcclusion = EditorGUIUtility.TrTextContent("Background Clouds", "When enabled, the occlusion is attenuated by the Background Clouds used on the Visual Environnement (Cloud layer).");
static public readonly GUIContent occlusionRadius = EditorGUIUtility.TrTextContent("Occlusion Radius", "Sets the radius, in meters, around the light used to compute the occlusion of the lens flare. If this area is half occluded by geometry (or half off-screen), the intensity of the lens flare is cut by half.");
static public readonly GUIContent sampleCount = EditorGUIUtility.TrTextContent("Sample Count", "Sets the number of random samples used inside the Occlusion Radius area. A higher sample count gives a smoother attenuation when occluded.");
static public readonly GUIContent occlusionOffset = EditorGUIUtility.TrTextContent("Occlusion Offset", "Sets the offset of the occlusion area in meters between the GameObject this asset is attached to, and the Camera. A positive value moves the occlusion area closer to the Camera.");
static public readonly GUIContent occlusionRemapCurve = EditorGUIUtility.TrTextContent("Occlusion Remap Curve", "Specifies the curve used to remap the occlusion of the flare. By default, the occlusion is linear, between 0 and 1. This can be specifically useful to occlude flare more drastically when behind clouds.");
static public readonly GUIContent allowOffScreen = EditorGUIUtility.TrTextContent("Allow Off Screen", "When enabled, allows the lens flare to affect the scene even when it is outside the Camera's field of view.");
static public readonly GUIContent volumetricCloudOcclusion = EditorGUIUtility.TrTextContent("Volumetric Clouds", "When enabled, HDRP uses the Volumetric Clouds texture (in screen space) for the occlusion.");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8147550de37fb934ca443edbf044e01e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 90a396453bc7183469e9497f37393dcb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,34 @@
using UnityEditor;
namespace UnityEngine
{
/// <summary>
/// Editor for Flare (builtin): Editor to show an error message
/// </summary>
[CustomEditorForRenderPipeline(typeof(UnityEngine.Flare), typeof(Rendering.RenderPipelineAsset))]
class FlareEditor : Editor
{
/// <summary>
/// Implement this function to make a custom inspector
/// </summary>
public override void OnInspectorGUI()
{
EditorGUILayout.HelpBox("This asset doesn't work on SRP, use Lens Flare (SRP) instead.", MessageType.Error);
}
}
/// <summary>
/// Editor for Lens Flare (builtin): Editor to show an error message
/// </summary>
[CustomEditorForRenderPipeline(typeof(UnityEngine.LensFlare), typeof(Rendering.RenderPipelineAsset))]
class LensFlareEditor : Editor
{
/// <summary>
/// Implement this function to make a custom inspector
/// </summary>
public override void OnInspectorGUI()
{
EditorGUILayout.HelpBox("This component doesn't work on SRP, use Lens Flare (SRP) instead.", MessageType.Error);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f9c70a18f33000140b98877df32d3c63
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,48 @@
using System.IO;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
namespace UnityEditor.Rendering
{
static class LensFlareEditorUtils
{
internal static class Icons
{
const string k_IconFolder = @"Packages/com.unity.render-pipelines.core/Editor/PostProcessing/LensFlareResource/";
public static readonly Texture2D circle = CoreEditorUtils.LoadIcon(k_IconFolder, "CircleFlareThumbnail", forceLowRes: false);
public static readonly Texture2D polygon = CoreEditorUtils.LoadIcon(k_IconFolder, "PolygonFlareThumbnail", forceLowRes: false);
public static readonly Texture2D generic = CoreEditorUtils.LoadIcon(k_IconFolder, "Flare128", forceLowRes: false);
}
#region Asset Factory
class LensFlareDataSRPCreator : UnityEditor.ProjectWindowCallback.EndNameEditAction
{
public override void Action(int instanceId, string pathName, string resourceFile)
{
LensFlareDataSRP asset = ScriptableObject.CreateInstance<LensFlareDataSRP>();
UnityEngine.Assertions.Assert.IsNotNull(asset, $"failed to create instance of {nameof(LensFlareDataSRP)}");
pathName = AssetDatabase.GenerateUniqueAssetPath(pathName);
asset.name = Path.GetFileName(pathName);
AssetDatabase.CreateAsset(asset, pathName);
ProjectWindowUtil.ShowCreatedAsset(asset);
}
}
[MenuItem("Assets/Create/Lens Flare (SRP)", priority = UnityEngine.Rendering.CoreUtils.Priorities.srpLensFlareMenuPriority)]
internal static void CreateLensFlareDataSRPAsset()
{
const string relativePath = "New Lens Flare (SRP).asset";
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, ScriptableObject.CreateInstance<LensFlareDataSRPCreator>(), relativePath, Icons.generic, null);
}
internal static LensFlareDataSRP CreateLensFlareDataSRPAsset(Scene scene, string targetName)
{
return CoreEditorUtils.CreateAssetAt<LensFlareDataSRP>(scene, targetName);
}
#endregion
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8e384b0630d041a48ac1d9b3681506ac
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 60a1717848495ca41888e02864f0f645
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 80b74a073fa3027458f3b3ff5346f10b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 37e93113453ac0d46863acd4090899c8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 128
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: d7b90718ad2a7af4aab8546a0897d5db
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,142 @@
Shader "Hidden/Core/LensFlareDataDrivenPreview"
{
// Note: For UI as we don't have command buffer for UI we need to have one shader per usage
// instead of permutation like for rendering
// Keep the order as the same order of SRPLensFlareType
SubShader
{
// Image
Pass
{
Name "ForwardUnlit"
Tags{ "LightMode" = "Forward" "RenderQueue" = "Transparent" }
Blend One One
ZWrite Off
Cull Off
ZTest Always
HLSLPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma exclude_renderers gles
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#define FLARE_PREVIEW
#include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
ENDHLSL
}
// Circle
Pass
{
Name "ForwardUnlit"
Tags{ "LightMode" = "Forward" "RenderQueue" = "Transparent" }
Blend One One
ZWrite Off
Cull Off
ZTest Always
HLSLPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma exclude_renderers gles
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#define FLARE_PREVIEW
#define FLARE_CIRCLE
#include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
ENDHLSL
}
// Polygon
Pass
{
Name "ForwardUnlit"
Tags{ "LightMode" = "Forward" "RenderQueue" = "Transparent" }
Blend One One
ZWrite Off
Cull Off
ZTest Always
HLSLPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma exclude_renderers gles
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#define FLARE_PREVIEW
#define FLARE_POLYGON
#include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
ENDHLSL
}
// Circle Inverse
Pass
{
Name "ForwardUnlit"
Tags{ "LightMode" = "Forward" "RenderQueue" = "Transparent" }
Blend One One
ZWrite Off
Cull Off
ZTest Always
HLSLPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma exclude_renderers gles
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#define FLARE_PREVIEW
#define FLARE_CIRCLE
#define FLARE_INVERSE_SDF
#include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
ENDHLSL
}
// Polygon Inverse
Pass
{
Name "ForwardUnlit"
Tags{ "LightMode" = "Forward" "RenderQueue" = "Transparent" }
Blend One One
ZWrite Off
Cull Off
ZTest Always
HLSLPROGRAM
#pragma target 3.0
#pragma vertex vert
#pragma fragment frag
#pragma exclude_renderers gles
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#define FLARE_PREVIEW
#define FLARE_POLYGON
#define FLARE_INVERSE_SDF
#include "Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/Shaders/LensFlareCommon.hlsl"
ENDHLSL
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 19dfbb09098c9584a83c956fbd6c5d79
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: f0326f07dd50365439f552e7f29218e5
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 0047263fa58f91d49a61936e94358829
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 128
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: