diff --git a/Assets/Plugins/HighlightPlus/Runtime.meta b/Assets/HighlightPlus.meta similarity index 62% rename from Assets/Plugins/HighlightPlus/Runtime.meta rename to Assets/HighlightPlus.meta index c95baa0..a4805b0 100644 --- a/Assets/Plugins/HighlightPlus/Runtime.meta +++ b/Assets/HighlightPlus.meta @@ -1,6 +1,8 @@ fileFormatVersion: 2 -guid: a233cc5176ac642f89469b5d4c676c89 +guid: 5db7164e964ae4c6b82d2283320ad13d folderAsset: yes +timeCreated: 1557315954 +licenseType: Pro DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/HighlightPlus/Demo.meta b/Assets/HighlightPlus/Demo.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Demo.meta rename to Assets/HighlightPlus/Demo.meta index c699cd3..5604e49 100644 --- a/Assets/Plugins/HighlightPlus/Demo.meta +++ b/Assets/HighlightPlus/Demo.meta @@ -2,7 +2,7 @@ fileFormatVersion: 2 guid: b0c676f447c26429db5c9404720e279c folderAsset: yes timeCreated: 1542876294 -licenseType: Store +licenseType: Pro DefaultImporter: userData: assetBundleName: diff --git a/Assets/Plugins/HighlightPlus/Demo/Demo1_HighlightExample.unity b/Assets/HighlightPlus/Demo/Demo1_HighlightExample.unity similarity index 95% rename from Assets/Plugins/HighlightPlus/Demo/Demo1_HighlightExample.unity rename to Assets/HighlightPlus/Demo/Demo1_HighlightExample.unity index 05cdaee..698bc03 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Demo1_HighlightExample.unity +++ b/Assets/HighlightPlus/Demo/Demo1_HighlightExample.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44717538, g: 0.49709505, b: 0.5751526, a: 1} + m_IndirectSpecularColor: {r: 0.4471771, g: 0.4970975, b: 0.57515424, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &4 LightmapSettings: @@ -97,7 +97,7 @@ LightmapSettings: m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 - m_LightingDataAsset: {fileID: 112000000, guid: 334c1ca31d9f941d69425982909406b3, + m_LightingDataAsset: {fileID: 112000014, guid: 039bfaf33d1112a4d904b7d393a6e9bb, type: 2} m_UseShadowmask: 0 --- !u!196 &5 @@ -257,6 +257,36 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 181859160} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &271039439 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 271039440} + m_Layer: 0 + m_Name: --- Other Scene Stuff --- + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &271039440 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 271039439} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -4.729038, y: -3.3103254, z: -4.729038} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &472769855 GameObject: m_ObjectHideFlags: 0 @@ -268,7 +298,6 @@ GameObject: m_Component: - component: {fileID: 472769856} - component: {fileID: 472769857} - - component: {fileID: 472769858} m_Layer: 0 m_Name: DirectionalLight m_TagString: Untagged @@ -284,13 +313,13 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 472769855} - m_LocalRotation: {x: -0.5596046, y: 0.71660864, z: -0.3668599, w: -0.19679597} + m_LocalRotation: {x: 0.4144551, y: -0.7420336, z: 0.5253307, w: -0.040507175} m_LocalPosition: {x: 0, y: 2, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 48.249, y: 168.87, z: -80.97} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!108 &472769857 Light: m_ObjectHideFlags: 0 @@ -310,12 +339,12 @@ Light: m_InnerSpotAngle: 21.802082 m_CookieSize: 10 m_Shadows: - m_Type: 1 + m_Type: 2 m_Resolution: -1 m_CustomResolution: -1 - m_Strength: 0.5 - m_Bias: 1 - m_NormalBias: 1 + m_Strength: 1 + m_Bias: 0.01 + m_NormalBias: 0.4 m_NearPlane: 0.2 m_CullingMatrixOverride: e00: 1 @@ -353,19 +382,6 @@ Light: m_UseBoundingSphereOverride: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 ---- !u!114 &472769858 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 472769855} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UsePipelineSettings: 1 --- !u!1 &567592204 GameObject: m_ObjectHideFlags: 0 @@ -531,10 +547,7 @@ MonoBehaviour: m_Text: 'HIGHLIGHT PLUS (OUTLINE, GLOW AND SEE-THROUGH) DEMO Click - or hover spheres to show effect. Press C to randomize glow color on gold sphere. - - This - asset requires Universal Rendering Pipeline. Please check README for setup instructions.' + or hover spheres to show effect. Press C to randomize glow color on gold sphere.' --- !u!222 &613470779 CanvasRenderer: m_ObjectHideFlags: 0 @@ -573,12 +586,12 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 617211756} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -1, y: 0.325, z: 0} m_LocalScale: {x: 0.65, y: 0.65, z: 0.65} m_Children: [] - m_Father: {fileID: 1202089666} - m_RootOrder: 2 + m_Father: {fileID: 0} + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &617211758 MonoBehaviour: @@ -609,6 +622,7 @@ MonoBehaviour: ignoreObjectVisibility: 0 reflectionProbes: 0 GPUInstancing: 1 + depthClip: 0 normalsOption: 0 ignore: 0 _highlighted: 0 @@ -626,16 +640,16 @@ MonoBehaviour: overlayTextureScale: 1 outline: 1 outlineColor: {r: 0, g: 0, b: 0, a: 1} - outlineWidth: 0.62 + outlineWidth: 0.5 outlineQuality: 0 outlineDownsampling: 2 outlineVisibility: 0 - glowBlendMode: 0 + outlineOptimalBlit: 1 outlineBlitDebug: 0 outlineIndependent: 0 - glow: 1.71 - glowWidth: 0.14 - glowQuality: 1 + glow: 1 + glowWidth: 0.89 + glowQuality: 2 glowDownsampling: 2 glowHQColor: {r: 1, g: 0.52205884, b: 0.52205884, a: 1} glowDithering: 1 @@ -643,6 +657,7 @@ MonoBehaviour: glowMagicNumber2: 0.5 glowAnimationSpeed: 1 glowVisibility: 0 + glowOptimalBlit: 1 glowBlitDebug: 0 glowBlendPasses: 1 glowPasses: @@ -669,7 +684,7 @@ MonoBehaviour: targetFXRotationSpeed: 30 targetFXInitialScale: 2 targetFXEndScale: 1.1 - targetFXScaleToRenderBounds: 0 + targetFXScaleToRenderBounds: 1 targetFXAlignToGround: 0 targetFXFadePower: 32 targetFXGroundMaxDistance: 10 @@ -793,6 +808,36 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 617211756} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &640476129 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 640476130} + m_Layer: 0 + m_Name: --- Sample Spheres --- + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &640476130 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 640476129} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -4.729038, y: -3.3103254, z: -4.729038} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &656694097 GameObject: m_ObjectHideFlags: 0 @@ -824,12 +869,12 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 656694097} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.85, y: 0.325, z: 0.14} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.85, y: 0.325, z: 0} m_LocalScale: {x: 0.65, y: 0.65, z: 0.65} m_Children: - {fileID: 1837449480} - m_Father: {fileID: 1202089666} + m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &656694099 @@ -857,15 +902,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: profile: {fileID: 0} - profileSync: 0 + profileSync: 1 previewInEditor: 1 camerasLayerMask: serializedVersion: 2 m_Bits: 4294967295 - effectGroup: 0 + effectGroup: 1 effectGroupLayer: serializedVersion: 2 - m_Bits: 4294967295 + m_Bits: 18 effectNameFilter: combineMeshes: 0 alphaCutOff: 0 @@ -873,40 +918,42 @@ MonoBehaviour: ignoreObjectVisibility: 0 reflectionProbes: 0 GPUInstancing: 1 + depthClip: 0 normalsOption: 0 ignore: 0 _highlighted: 0 fadeInDuration: 0 - fadeOutDuration: 0 + fadeOutDuration: 0.5 flipY: 0 constantWidth: 1 subMeshMask: -1 - overlay: 0.488 + overlay: 0.5 overlayColor: {r: 1, g: 0.92156863, b: 0.015686275, a: 1} overlayAnimationSpeed: 1 - overlayMinIntensity: 0 + overlayMinIntensity: 0.5 overlayBlending: 1 overlayTexture: {fileID: 0} overlayTextureScale: 1 outline: 1 outlineColor: {r: 0, g: 0, b: 0, a: 1} - outlineWidth: 0.62 + outlineWidth: 0.4 outlineQuality: 0 - outlineDownsampling: 1 + outlineDownsampling: 2 outlineVisibility: 0 - glowBlendMode: 0 + outlineOptimalBlit: 1 outlineBlitDebug: 0 outlineIndependent: 0 - glow: 1.71 - glowWidth: 4.5 + glow: 1.78 + glowWidth: 3.42 glowQuality: 2 - glowDownsampling: 1 - glowHQColor: {r: 0.6392157, g: 1, b: 0, a: 1} + glowDownsampling: 2 + glowHQColor: {r: 0.64, g: 1, b: 0, a: 1} glowDithering: 1 glowMagicNumber1: 0.75 glowMagicNumber2: 0.5 - glowAnimationSpeed: 1 + glowAnimationSpeed: 0.2 glowVisibility: 0 + glowOptimalBlit: 1 glowBlitDebug: 0 glowBlendPasses: 1 glowPasses: @@ -930,7 +977,7 @@ MonoBehaviour: targetFXTexture: {fileID: 2800000, guid: 1de3c566a6c8c405b9f6f453137273ec, type: 3} targetFXColor: {r: 1, g: 1, b: 1, a: 1} targetFXCenter: {fileID: 0} - targetFXRotationSpeed: 50 + targetFXRotationSpeed: 30 targetFXInitialScale: 4 targetFXEndScale: 1.5 targetFXScaleToRenderBounds: 1 @@ -1069,7 +1116,6 @@ GameObject: - component: {fileID: 965526244} - component: {fileID: 965526243} - component: {fileID: 965526240} - - component: {fileID: 965526241} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -1086,37 +1132,6 @@ AudioListener: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 965526239} m_Enabled: 1 ---- !u!114 &965526241 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 965526239} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_RenderPostProcessing: 0 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 --- !u!20 &965526243 Camera: m_ObjectHideFlags: 0 @@ -1146,16 +1161,16 @@ Camera: field of view: 40 orthographic: 0 orthographic size: 5 - m_Depth: 0 + m_Depth: -1 m_CullingMask: serializedVersion: 2 - m_Bits: 4294967295 + m_Bits: 4294963199 m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 m_TargetEye: 3 m_HDR: 1 - m_AllowMSAA: 1 + m_AllowMSAA: 0 m_AllowDynamicResolution: 0 m_ForceIntoRT: 0 m_OcclusionCulling: 1 @@ -1174,7 +1189,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1165184420 GameObject: @@ -1374,41 +1389,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1179472412} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1202089665 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 190392, guid: d7720c2417695eb45bd70f6d10a17068, - type: 2} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1202089666} - m_Layer: 0 - m_Name: SampleSpheres - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1202089666 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 470018, guid: d7720c2417695eb45bd70f6d10a17068, - type: 2} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1202089665} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: - - {fileID: 1392572691} - - {fileID: 656694098} - - {fileID: 617211757} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1392572690 GameObject: m_ObjectHideFlags: 0 @@ -1439,12 +1419,12 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1392572690} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0.325, z: 1} m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} m_Children: [] - m_Father: {fileID: 1202089666} - m_RootOrder: 0 + m_Father: {fileID: 0} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1392572692 MonoBehaviour: @@ -1475,6 +1455,7 @@ MonoBehaviour: ignoreObjectVisibility: 0 reflectionProbes: 0 GPUInstancing: 1 + depthClip: 0 normalsOption: 0 ignore: 0 _highlighted: 0 @@ -1492,16 +1473,16 @@ MonoBehaviour: overlayTextureScale: 1 outline: 1 outlineColor: {r: 1, g: 1, b: 1, a: 1} - outlineWidth: 0.62 + outlineWidth: 0.4 outlineQuality: 0 outlineDownsampling: 2 outlineVisibility: 0 - glowBlendMode: 0 + outlineOptimalBlit: 1 outlineBlitDebug: 0 outlineIndependent: 0 - glow: 5 - glowWidth: 0.14 - glowQuality: 1 + glow: 1.32 + glowWidth: 3 + glowQuality: 2 glowDownsampling: 2 glowHQColor: {r: 0.19117647, g: 0.36409733, b: 1, a: 1} glowDithering: 1 @@ -1509,6 +1490,7 @@ MonoBehaviour: glowMagicNumber2: 0.5 glowAnimationSpeed: 1 glowVisibility: 0 + glowOptimalBlit: 1 glowBlitDebug: 0 glowBlendPasses: 1 glowPasses: @@ -1535,7 +1517,7 @@ MonoBehaviour: targetFXRotationSpeed: 50 targetFXInitialScale: 2 targetFXEndScale: 1.5 - targetFXScaleToRenderBounds: 0 + targetFXScaleToRenderBounds: 1 targetFXAlignToGround: 0 targetFXFadePower: 32 targetFXGroundMaxDistance: 10 @@ -1545,7 +1527,7 @@ MonoBehaviour: targetFXTransitionDuration: 0.5 targetFXStayDuration: 2 targetFXVisibility: 1 - seeThrough: 2 + seeThrough: 0 seeThroughOccluderMask: serializedVersion: 2 m_Bits: 4294967295 @@ -1965,7 +1947,7 @@ Transform: - {fileID: 165230858} - {fileID: 567592205} m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1819248541 GameObject: @@ -2059,7 +2041,7 @@ RectTransform: m_Children: - {fileID: 1605869163} m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} diff --git a/Assets/Plugins/HighlightPlus/Demo/Demo1_HighlightExample.unity.meta b/Assets/HighlightPlus/Demo/Demo1_HighlightExample.unity.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Demo1_HighlightExample.unity.meta rename to Assets/HighlightPlus/Demo/Demo1_HighlightExample.unity.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Demo2_SelectionExample.unity b/Assets/HighlightPlus/Demo/Demo2_SelectionExample.unity similarity index 96% rename from Assets/Plugins/HighlightPlus/Demo/Demo2_SelectionExample.unity rename to Assets/HighlightPlus/Demo/Demo2_SelectionExample.unity index fd99b70..453153d 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Demo2_SelectionExample.unity +++ b/Assets/HighlightPlus/Demo/Demo2_SelectionExample.unity @@ -122,50 +122,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &54660272 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 54660274} - - component: {fileID: 54660273} - m_Layer: 0 - m_Name: ManualSelectionExample - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &54660273 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 54660272} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9dfa112658ab74560a6251002174910b, type: 3} - m_Name: - m_EditorClassIdentifier: - objectToSelect: {fileID: 656694098} ---- !u!4 &54660274 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 54660272} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 7.5509014, y: -4.251323, z: 28.678097} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 11 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &165230857 GameObject: m_ObjectHideFlags: 0 @@ -202,49 +158,6 @@ Transform: m_Father: {fileID: 1694850532} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &171019437 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 171019439} - - component: {fileID: 171019438} - m_Layer: 0 - m_Name: EventsExample - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &171019438 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 171019437} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dbe1fcf5ef14345779fec3adb4479bc3, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!4 &171019439 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 171019437} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 7.5509014, y: -4.251323, z: 28.678097} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 10 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &181859160 GameObject: m_ObjectHideFlags: 0 @@ -344,36 +257,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 181859160} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &207714439 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 207714440} - m_Layer: 0 - m_Name: --- SCENE --- - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &207714440 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 207714439} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &472769855 GameObject: m_ObjectHideFlags: 0 @@ -469,6 +352,50 @@ Light: m_UseBoundingSphereOverride: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 +--- !u!1 &500965638 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 500965640} + - component: {fileID: 500965639} + m_Layer: 0 + m_Name: ManualSelectionExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &500965639 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 500965638} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ae556bec7040546f0a8bcc625513a0d2, type: 3} + m_Name: + m_EditorClassIdentifier: + objectToSelect: {fileID: 656694098} +--- !u!4 &500965640 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 500965638} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &613470776 GameObject: m_ObjectHideFlags: 0 @@ -541,8 +468,8 @@ MonoBehaviour: m_Text: 'HIGHLIGHT PLUS SELECTION DEMO (USES HIGHLIGHT MANAGER) Click - on spheres to select them. Click outside to clear selection. Press 1/2/3 keys - to select, toggle and unselect gold sphere.' + on spheres to select them. Press 1/2/3 keys to select, toggle and unselect gold + sphere.' --- !u!222 &613470779 CanvasRenderer: m_ObjectHideFlags: 0 @@ -748,7 +675,7 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 656694097} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &900649477 +--- !u!1 &790488496 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -756,23 +683,23 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 900649478} + - component: {fileID: 790488497} m_Layer: 0 - m_Name: --- DEMO SCRIPTS --- + m_Name: --- SAMPLE SCRIPTS --- m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!4 &900649478 +--- !u!4 &790488497 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 900649477} + m_GameObject: {fileID: 790488496} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0.34594363, y: 11.744718, z: -2.455723} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -790,7 +717,6 @@ GameObject: - component: {fileID: 965526244} - component: {fileID: 965526243} - component: {fileID: 965526240} - - component: {fileID: 965526241} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -807,37 +733,6 @@ AudioListener: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 965526239} m_Enabled: 1 ---- !u!114 &965526241 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 965526239} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_RenderPostProcessing: 0 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 --- !u!20 &965526243 Camera: m_ObjectHideFlags: 0 @@ -897,6 +792,49 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &965747734 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 965747736} + - component: {fileID: 965747735} + m_Layer: 0 + m_Name: EventsExample + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &965747735 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 965747734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e03a4fb11e1844a42b2becf08e18b9e2, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &965747736 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 965747734} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 199.50073, y: 46.180042, z: 195.3383} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1016798143 GameObject: m_ObjectHideFlags: 0 @@ -963,6 +901,36 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1044967304 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1044967305} + m_Layer: 0 + m_Name: --- HIGHLIGHT MANAGER --- + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1044967305 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1044967304} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.34594363, y: 11.744718, z: -2.455723} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1165184420 GameObject: m_ObjectHideFlags: 0 @@ -1549,7 +1517,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 0} + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 @@ -1641,6 +1609,7 @@ MonoBehaviour: ignoreObjectVisibility: 0 reflectionProbes: 0 GPUInstancing: 1 + depthClip: 0 normalsOption: 0 ignore: 0 _highlighted: 0 @@ -1663,6 +1632,7 @@ MonoBehaviour: outlineDownsampling: 2 outlineVisibility: 0 glowBlendMode: 0 + outlineOptimalBlit: 1 outlineBlitDebug: 0 outlineIndependent: 0 glow: 0 @@ -1675,6 +1645,7 @@ MonoBehaviour: glowMagicNumber2: 0.5 glowAnimationSpeed: 1 glowVisibility: 0 + glowOptimalBlit: 1 glowBlitDebug: 0 glowBlendPasses: 1 glowPasses: @@ -1831,7 +1802,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} m_Name: m_EditorClassIdentifier: - m_UiScaleMode: 1 + m_UiScaleMode: 0 m_ReferencePixelsPerUnit: 100 m_ScaleFactor: 1 m_ReferenceResolution: {x: 800, y: 600} @@ -1946,7 +1917,7 @@ ReflectionProbe: m_UseOcclusionCulling: 0 m_Importance: 1 m_CustomBakedTexture: {fileID: 0} ---- !u!1 &1925176807 +--- !u!1 &2017446011 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1954,25 +1925,25 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1925176808} + - component: {fileID: 2017446012} m_Layer: 0 - m_Name: --- HIGHLIGHT MANAGER --- + m_Name: --- SCENE --- m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 0 ---- !u!4 &1925176808 +--- !u!4 &2017446012 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1925176807} + m_GameObject: {fileID: 2017446011} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/HighlightPlus/Demo/Demo2_SelectionExample.unity.meta b/Assets/HighlightPlus/Demo/Demo2_SelectionExample.unity.meta new file mode 100644 index 0000000..4faa1fb --- /dev/null +++ b/Assets/HighlightPlus/Demo/Demo2_SelectionExample.unity.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 96cd4e40d2f234b9e95987f9f953d17c +timeCreated: 1542877475 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Demo/Demo3_HitFXExample.unity b/Assets/HighlightPlus/Demo/Demo3_HitFXExample.unity similarity index 98% rename from Assets/Plugins/HighlightPlus/Demo/Demo3_HitFXExample.unity rename to Assets/HighlightPlus/Demo/Demo3_HitFXExample.unity index 3d7ddb3..28d0db1 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Demo3_HitFXExample.unity +++ b/Assets/HighlightPlus/Demo/Demo3_HitFXExample.unity @@ -622,6 +622,7 @@ MonoBehaviour: ignoreObjectVisibility: 0 reflectionProbes: 0 GPUInstancing: 1 + depthClip: 0 normalsOption: 0 ignore: 0 _highlighted: 0 @@ -643,6 +644,7 @@ MonoBehaviour: outlineQuality: 0 outlineDownsampling: 2 outlineVisibility: 0 + outlineOptimalBlit: 1 outlineBlitDebug: 0 outlineIndependent: 0 glow: 1 @@ -655,6 +657,7 @@ MonoBehaviour: glowMagicNumber2: 0.5 glowAnimationSpeed: 1 glowVisibility: 0 + glowOptimalBlit: 1 glowBlitDebug: 0 glowBlendPasses: 1 glowPasses: @@ -914,6 +917,7 @@ MonoBehaviour: ignoreObjectVisibility: 0 reflectionProbes: 0 GPUInstancing: 1 + depthClip: 0 normalsOption: 0 ignore: 0 _highlighted: 0 @@ -922,12 +926,12 @@ MonoBehaviour: flipY: 0 constantWidth: 1 subMeshMask: -1 - overlay: 0.05 + overlay: 0.01 overlayColor: {r: 1, g: 0.92156863, b: 0.015686275, a: 1} overlayAnimationSpeed: 0 overlayMinIntensity: 0.5 overlayBlending: 1 - overlayTexture: {fileID: 2800000, guid: aeb7aff1c8c1241ee8bfdfc05e9a9e92, type: 3} + overlayTexture: {fileID: 2800000, guid: 6f4d7782c600f4fa1859b8f3c092189d, type: 3} overlayTextureScale: 1 outline: 1 outlineColor: {r: 0, g: 0, b: 0, a: 1} @@ -935,6 +939,7 @@ MonoBehaviour: outlineQuality: 0 outlineDownsampling: 2 outlineVisibility: 0 + outlineOptimalBlit: 1 outlineBlitDebug: 0 outlineIndependent: 0 glow: 1.78 @@ -947,6 +952,7 @@ MonoBehaviour: glowMagicNumber2: 0.5 glowAnimationSpeed: 0.2 glowVisibility: 0 + glowOptimalBlit: 1 glowBlitDebug: 0 glowBlendPasses: 1 glowPasses: @@ -1006,7 +1012,7 @@ MonoBehaviour: hitFxMode: 2 hitFxFadeOutDuration: 0.25 hitFxColor: {r: 0.93333334, g: 1.1058824, b: 2, a: 1} - hitFxRadius: 0.5 + hitFxRadius: 0.1 --- !u!114 &656694101 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1109,7 +1115,6 @@ GameObject: - component: {fileID: 965526244} - component: {fileID: 965526243} - component: {fileID: 965526240} - - component: {fileID: 965526241} m_Layer: 0 m_Name: Camera m_TagString: MainCamera @@ -1126,37 +1131,6 @@ AudioListener: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 965526239} m_Enabled: 1 ---- !u!114 &965526241 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 965526239} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_RenderPostProcessing: 0 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 --- !u!20 &965526243 Camera: m_ObjectHideFlags: 0 @@ -1480,6 +1454,7 @@ MonoBehaviour: ignoreObjectVisibility: 0 reflectionProbes: 0 GPUInstancing: 1 + depthClip: 0 normalsOption: 0 ignore: 0 _highlighted: 0 @@ -1501,6 +1476,7 @@ MonoBehaviour: outlineQuality: 0 outlineDownsampling: 2 outlineVisibility: 0 + outlineOptimalBlit: 1 outlineBlitDebug: 0 outlineIndependent: 0 glow: 1.32 @@ -1513,6 +1489,7 @@ MonoBehaviour: glowMagicNumber2: 0.5 glowAnimationSpeed: 1 glowVisibility: 0 + glowOptimalBlit: 1 glowBlitDebug: 0 glowBlendPasses: 1 glowPasses: @@ -2096,10 +2073,10 @@ MonoBehaviour: m_GameObject: {fileID: 2118005892} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b2533fb71c5d747c58192bcd7d6cd276, type: 3} + m_Script: {fileID: 11500000, guid: 53883b254655d44479b3d33caba0be58, type: 3} m_Name: m_EditorClassIdentifier: - hitSound: {fileID: 8300000, guid: 9c2f7decce97e409a8ecfc1181535dc2, type: 3} + hitSound: {fileID: 8300000, guid: 0cf993a8419a44000883892928cbdd4d, type: 3} --- !u!4 &2118005894 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/HighlightPlus/Demo/Demo3_HitFXExample.unity.meta b/Assets/HighlightPlus/Demo/Demo3_HitFXExample.unity.meta new file mode 100644 index 0000000..d1b4947 --- /dev/null +++ b/Assets/HighlightPlus/Demo/Demo3_HitFXExample.unity.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1c609762d2aa646c7a9fe426b06d8eee +timeCreated: 1542877475 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials.meta b/Assets/HighlightPlus/Demo/Materials.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Materials.meta rename to Assets/HighlightPlus/Demo/Materials.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Floor.mat b/Assets/HighlightPlus/Demo/Materials/Floor.mat similarity index 60% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Floor.mat rename to Assets/HighlightPlus/Demo/Materials/Floor.mat index 22d5d63..7bf73bc 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Materials/Floor.mat +++ b/Assets/HighlightPlus/Demo/Materials/Floor.mat @@ -1,44 +1,24 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!114 &-8558442800701317947 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 5 --- !u!21 &2100000 Material: - serializedVersion: 8 + serializedVersion: 6 m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} m_Name: Floor - m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} - m_ValidKeywords: - - _NORMALMAP - m_InvalidKeywords: [] + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _NORMALMAP + _UVSEC_UV1 m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 2000 - stringTagMap: - RenderType: Opaque + m_CustomRenderQueue: -1 + stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 2800000, guid: 13ea04b5d27644ccba761e09947624da, type: 3} - m_Scale: {x: 2, y: 2} - m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 2800000, guid: d398536e88a354ed3b3825173a7e092a, type: 3} m_Scale: {x: 1, y: 1} @@ -83,33 +63,13 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] m_Floats: - - _AlphaClip: 0 - _AlphaTestRef: 0.5 - - _Blend: 0 - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 0.02 - _DstBlend: 0 - _EmissionScaleUI: 1 - - _EnvironmentReflections: 1 - _GlossMapScale: 0.538 - _Glossiness: 0.34 - _GlossyReflections: 1 @@ -118,22 +78,15 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.0104 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.34 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _Surface: 0 - _UVSec: 0 - - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 0.99999994} - _EmissionColorUI: {r: 0, g: 0, b: 0, a: 1} - _EmissionColorWithMapUI: {r: 1, g: 1, b: 1, a: 1} - _SpecColor: {r: 1, g: 1, b: 1, a: 1} - _SpecularColor: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Floor.mat.meta b/Assets/HighlightPlus/Demo/Materials/Floor.mat.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Floor.mat.meta rename to Assets/HighlightPlus/Demo/Materials/Floor.mat.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Gold.mat b/Assets/HighlightPlus/Demo/Materials/Gold.mat similarity index 56% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Gold.mat rename to Assets/HighlightPlus/Demo/Materials/Gold.mat index 83a23b4..1b93eb9 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Materials/Gold.mat +++ b/Assets/HighlightPlus/Demo/Materials/Gold.mat @@ -1,43 +1,23 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!114 &-5610605729892836785 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 5 --- !u!21 &2100000 Material: - serializedVersion: 8 + serializedVersion: 6 m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} m_Name: Gold - m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} - m_ValidKeywords: [] - m_InvalidKeywords: [] + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _UVSEC_UV1 m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 2000 - stringTagMap: - RenderType: Opaque + m_CustomRenderQueue: -1 + stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -82,33 +62,13 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] m_Floats: - - _AlphaClip: 0 - _AlphaTestRef: 0.5 - - _Blend: 0 - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DstBlend: 0 - _EmissionScaleUI: 0 - - _EnvironmentReflections: 1 - _GlossMapScale: 1 - _Glossiness: 0.9 - _GlossyReflections: 1 @@ -117,22 +77,14 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.9 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _Surface: 0 - _UVSec: 0 - - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.96078426, g: 0.8392157, b: 0.47450978, a: 1} - - _Color: {r: 0.96078426, g: 0.8392157, b: 0.47450978, a: 1} + - _Color: {r: 0.9607843, g: 0.8392157, b: 0.4745098, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} - _EmissionColorUI: {r: 0, g: 0, b: 0, a: 1} - _EmissionColorWithMapUI: {r: 1, g: 1, b: 1, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecularColor: {r: 0.8088235, g: 0.6295969, b: 0.3033088, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Gold.mat.meta b/Assets/HighlightPlus/Demo/Materials/Gold.mat.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Gold.mat.meta rename to Assets/HighlightPlus/Demo/Materials/Gold.mat.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/PlasticGlossy.mat b/Assets/HighlightPlus/Demo/Materials/PlasticGlossy.mat similarity index 57% rename from Assets/Plugins/HighlightPlus/Demo/Materials/PlasticGlossy.mat rename to Assets/HighlightPlus/Demo/Materials/PlasticGlossy.mat index ac1ac3f..734c564 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Materials/PlasticGlossy.mat +++ b/Assets/HighlightPlus/Demo/Materials/PlasticGlossy.mat @@ -1,43 +1,24 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!114 &-2992342339722848979 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 5 --- !u!21 &2100000 Material: - serializedVersion: 8 + serializedVersion: 6 m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} m_Name: PlasticGlossy - m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME + _UVSEC_UV1 + m_LightmapFlags: 1 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 2000 - stringTagMap: - RenderType: Opaque + m_CustomRenderQueue: -1 + stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -82,33 +63,13 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] m_Floats: - - _AlphaClip: 0 - _AlphaTestRef: 0.5 - - _Blend: 0 - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DstBlend: 0 - _EmissionScaleUI: 0 - - _EnvironmentReflections: 1 - _GlossMapScale: 1 - _Glossiness: 0.8 - _GlossyReflections: 1 @@ -117,22 +78,14 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.8 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _Surface: 0 - _UVSec: 0 - - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0, g: 0.78942597, b: 0.79607844, a: 1} - _Color: {r: 0, g: 0.78942597, b: 0.79607844, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} - _EmissionColorUI: {r: 0, g: 0, b: 0, a: 1} - _EmissionColorWithMapUI: {r: 1, g: 1, b: 1, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecularColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/PlasticGlossy.mat.meta b/Assets/HighlightPlus/Demo/Materials/PlasticGlossy.mat.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Materials/PlasticGlossy.mat.meta rename to Assets/HighlightPlus/Demo/Materials/PlasticGlossy.mat.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Silk.mat b/Assets/HighlightPlus/Demo/Materials/Silk.mat similarity index 56% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Silk.mat rename to Assets/HighlightPlus/Demo/Materials/Silk.mat index bb5bd74..a598850 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Materials/Silk.mat +++ b/Assets/HighlightPlus/Demo/Materials/Silk.mat @@ -2,29 +2,23 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: - serializedVersion: 8 + serializedVersion: 6 m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} m_Name: Silk - m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} - m_ValidKeywords: [] - m_InvalidKeywords: [] - m_LightmapFlags: 4 + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _EMISSION _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME + _UVSEC_UV1 + m_LightmapFlags: 1 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 2000 - stringTagMap: - RenderType: Opaque + m_CustomRenderQueue: -1 + stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} @@ -69,33 +63,13 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] m_Floats: - - _AlphaClip: 0 - _AlphaTestRef: 0.5 - - _Blend: 0 - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 1 - _DstBlend: 0 - _EmissionScaleUI: 0 - - _EnvironmentReflections: 1 - _GlossMapScale: 1 - _Glossiness: 0.6 - _GlossyReflections: 1 @@ -104,35 +78,14 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.02 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.6 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _Surface: 0 - _UVSec: 0 - - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.49411762, g: 0.145098, b: 0.16470584, a: 1} - - _Color: {r: 0.49411762, g: 0.14509797, b: 0.16470581, a: 1} + - _Color: {r: 0.49411765, g: 0.14509805, b: 0.16470589, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} - _EmissionColorUI: {r: 0, g: 0, b: 0, a: 1} - _EmissionColorWithMapUI: {r: 1, g: 1, b: 1, a: 1} - - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - _SpecularColor: {r: 0.74264705, g: 0.20750435, b: 0.216731, a: 1} - m_BuildTextureStacks: [] ---- !u!114 &7254247028269435741 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 5 diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Silk.mat.meta b/Assets/HighlightPlus/Demo/Materials/Silk.mat.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Silk.mat.meta rename to Assets/HighlightPlus/Demo/Materials/Silk.mat.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Wall.mat b/Assets/HighlightPlus/Demo/Materials/Wall.mat similarity index 61% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Wall.mat rename to Assets/HighlightPlus/Demo/Materials/Wall.mat index e9c855a..ff651fb 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Materials/Wall.mat +++ b/Assets/HighlightPlus/Demo/Materials/Wall.mat @@ -1,46 +1,24 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!114 &-6803998695329737601 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 5 --- !u!21 &2100000 Material: - serializedVersion: 8 + serializedVersion: 6 m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} m_Name: Wall - m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} - m_ValidKeywords: - - _NORMALMAP - - _OCCLUSIONMAP - - _PARALLAXMAP - m_InvalidKeywords: [] + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME _NORMALMAP + _PARALLAXMAP _SPECGLOSSMAP _UVSEC_UV1 m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 - m_CustomRenderQueue: 2000 - stringTagMap: - RenderType: Opaque + m_CustomRenderQueue: -1 + stringTagMap: {} disabledShaderPasses: [] m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: - m_Texture: {fileID: 2800000, guid: dc645ec4f4eba40dd8f0e8b0c21b99b0, type: 3} - m_Scale: {x: 3, y: 3} - m_Offset: {x: 0, y: 0} - _BumpMap: m_Texture: {fileID: 2800000, guid: ebcd1fde239ed44bc808f7c571d8a6a9, type: 3} m_Scale: {x: 1, y: 1} @@ -85,33 +63,13 @@ Material: m_Texture: {fileID: 2800000, guid: a1d43acc22aa4427f89ca56382ce5272, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - unity_Lightmaps: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_LightmapsInd: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - unity_ShadowMasks: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Ints: [] m_Floats: - - _AlphaClip: 0 - _AlphaTestRef: 0.5 - - _Blend: 0 - _BumpScale: 1 - - _ClearCoatMask: 0 - - _ClearCoatSmoothness: 0 - - _Cull: 2 - _Cutoff: 0.5 - - _DetailAlbedoMapScale: 1 - _DetailNormalMapScale: 0.02 - _DstBlend: 0 - _EmissionScaleUI: 1 - - _EnvironmentReflections: 1 - _GlossMapScale: 0.325 - _Glossiness: 0.311 - _GlossyReflections: 1 @@ -120,22 +78,15 @@ Material: - _Mode: 0 - _OcclusionStrength: 1 - _Parallax: 0.0203 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.311 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _Surface: 0 - _UVSec: 0 - - _WorkflowMode: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 0.99999994} - _EmissionColorUI: {r: 0, g: 0, b: 0, a: 1} - _EmissionColorWithMapUI: {r: 1, g: 1, b: 1, a: 1} - _SpecColor: {r: 1, g: 1, b: 1, a: 1} - _SpecularColor: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Plugins/HighlightPlus/Demo/Materials/Wall.mat.meta b/Assets/HighlightPlus/Demo/Materials/Wall.mat.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Materials/Wall.mat.meta rename to Assets/HighlightPlus/Demo/Materials/Wall.mat.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Profiles.meta b/Assets/HighlightPlus/Demo/Profiles.meta similarity index 77% rename from Assets/Plugins/HighlightPlus/Demo/Profiles.meta rename to Assets/HighlightPlus/Demo/Profiles.meta index bbe2259..c031e7e 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Profiles.meta +++ b/Assets/HighlightPlus/Demo/Profiles.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 57d6d25f642564dc6a34dfaebd77480c +guid: 5ea7a654ed5444ecd828eb05ba66a572 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/HighlightPlus/Demo/Profiles/Selected.asset b/Assets/HighlightPlus/Demo/Profiles/Selected.asset similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Profiles/Selected.asset rename to Assets/HighlightPlus/Demo/Profiles/Selected.asset diff --git a/Assets/Plugins/HighlightPlus/Demo/Profiles/Selected.asset.meta b/Assets/HighlightPlus/Demo/Profiles/Selected.asset.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Profiles/Selected.asset.meta rename to Assets/HighlightPlus/Demo/Profiles/Selected.asset.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset b/Assets/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset rename to Assets/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset diff --git a/Assets/Plugins/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset.meta b/Assets/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset.meta rename to Assets/HighlightPlus/Demo/Profiles/SelectedAndHighlighted.asset.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts.meta b/Assets/HighlightPlus/Demo/Scripts.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Scripts.meta rename to Assets/HighlightPlus/Demo/Scripts.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/HitFxDemo.cs b/Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/HitFxDemo.cs rename to Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta b/Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta similarity index 83% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta rename to Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta index 5915f95..d786bcb 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta +++ b/Assets/HighlightPlus/Demo/Scripts/HitFxDemo.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b2533fb71c5d747c58192bcd7d6cd276 +guid: 53883b254655d44479b3d33caba0be58 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs b/Assets/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs rename to Assets/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs.meta b/Assets/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs.meta similarity index 83% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs.meta rename to Assets/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs.meta index 37019e9..2020a5a 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs.meta +++ b/Assets/HighlightPlus/Demo/Scripts/ManualSelectionDemo.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9dfa112658ab74560a6251002174910b +guid: ae556bec7040546f0a8bcc625513a0d2 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs b/Assets/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs rename to Assets/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs.meta b/Assets/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs.meta rename to Assets/HighlightPlus/Demo/Scripts/SphereHighlightEventExample.cs.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs b/Assets/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs rename to Assets/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs diff --git a/Assets/Plugins/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs.meta b/Assets/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs.meta similarity index 69% rename from Assets/Plugins/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs.meta rename to Assets/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs.meta index e0e58b2..46cd1db 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs.meta +++ b/Assets/HighlightPlus/Demo/Scripts/SphereSelectionEventsExample.cs.meta @@ -1,7 +1,8 @@ fileFormatVersion: 2 -guid: dbe1fcf5ef14345779fec3adb4479bc3 +guid: e03a4fb11e1844a42b2becf08e18b9e2 +timeCreated: 1544692056 +licenseType: Pro MonoImporter: - externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/Plugins/HighlightPlus/Demo/Sounds.meta b/Assets/HighlightPlus/Demo/Sounds.meta similarity index 77% rename from Assets/Plugins/HighlightPlus/Demo/Sounds.meta rename to Assets/HighlightPlus/Demo/Sounds.meta index bca913c..88d6e31 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Sounds.meta +++ b/Assets/HighlightPlus/Demo/Sounds.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 94906fdd445a54f2badd67d0d36a3d55 +guid: 952080b4610a343de8a56483df1aaf6b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/HighlightPlus/Demo/Sounds/metalHit.wav b/Assets/HighlightPlus/Demo/Sounds/metalHit.wav similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Sounds/metalHit.wav rename to Assets/HighlightPlus/Demo/Sounds/metalHit.wav diff --git a/Assets/Plugins/HighlightPlus/Demo/Sounds/metalHit.wav.meta b/Assets/HighlightPlus/Demo/Sounds/metalHit.wav.meta similarity index 91% rename from Assets/Plugins/HighlightPlus/Demo/Sounds/metalHit.wav.meta rename to Assets/HighlightPlus/Demo/Sounds/metalHit.wav.meta index a5b51f8..862ac00 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Sounds/metalHit.wav.meta +++ b/Assets/HighlightPlus/Demo/Sounds/metalHit.wav.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9c2f7decce97e409a8ecfc1181535dc2 +guid: 0cf993a8419a44000883892928cbdd4d AudioImporter: externalObjects: {} serializedVersion: 6 diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures.meta b/Assets/HighlightPlus/Demo/Textures.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures.meta rename to Assets/HighlightPlus/Demo/Textures.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png b/Assets/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png rename to Assets/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png.meta b/Assets/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png.meta rename to Assets/HighlightPlus/Demo/Textures/floor_tiles_06_diff_1k.png.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png b/Assets/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png rename to Assets/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png.meta b/Assets/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png.meta rename to Assets/HighlightPlus/Demo/Textures/floor_tiles_06_nor_1k.png.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/overlaySampleTex.png b/Assets/HighlightPlus/Demo/Textures/overlaySampleTex.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/overlaySampleTex.png rename to Assets/HighlightPlus/Demo/Textures/overlaySampleTex.png diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/overlaySampleTex.png.meta b/Assets/HighlightPlus/Demo/Textures/overlaySampleTex.png.meta similarity index 58% rename from Assets/Plugins/HighlightPlus/Demo/Textures/overlaySampleTex.png.meta rename to Assets/HighlightPlus/Demo/Textures/overlaySampleTex.png.meta index 59a80b2..866a0a0 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Textures/overlaySampleTex.png.meta +++ b/Assets/HighlightPlus/Demo/Textures/overlaySampleTex.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: aeb7aff1c8c1241ee8bfdfc05e9a9e92 +guid: 6f4d7782c600f4fa1859b8f3c092189d TextureImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -48,7 +48,7 @@ TextureImporter: spritePixelsToUnits: 100 spriteBorder: {x: 0, y: 0, z: 0, w: 0} spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 + alphaUsage: 0 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 @@ -71,6 +71,54 @@ TextureImporter: overridden: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 sprites: [] diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png.meta b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png.meta rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_AO_1k.png.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png.meta b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png.meta rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_Nor_1k.png.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png.meta b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png.meta rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_bump_1k.png.meta diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png diff --git a/Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png.meta b/Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png.meta similarity index 100% rename from Assets/Plugins/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png.meta rename to Assets/HighlightPlus/Demo/Textures/red_brick_plaster_patch_02_diff_1k.png.meta diff --git a/Assets/Plugins/HighlightPlus/Documentation.meta b/Assets/HighlightPlus/Documentation.meta similarity index 62% rename from Assets/Plugins/HighlightPlus/Documentation.meta rename to Assets/HighlightPlus/Documentation.meta index 640bc9b..f8522e0 100644 --- a/Assets/Plugins/HighlightPlus/Documentation.meta +++ b/Assets/HighlightPlus/Documentation.meta @@ -1,6 +1,8 @@ fileFormatVersion: 2 -guid: d6b6ed63a44dd4e0b9e9de96d34d9930 +guid: 0b800828db32d4d3db02036d0637b878 folderAsset: yes +timeCreated: 1578838656 +licenseType: Pro DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/HighlightPlus/Documentation/Documentation.pdf b/Assets/HighlightPlus/Documentation/Documentation.pdf similarity index 63% rename from Assets/Plugins/HighlightPlus/Documentation/Documentation.pdf rename to Assets/HighlightPlus/Documentation/Documentation.pdf index 9058953..498c476 100644 --- a/Assets/Plugins/HighlightPlus/Documentation/Documentation.pdf +++ b/Assets/HighlightPlus/Documentation/Documentation.pdf @@ -1,125 +1,96 @@ -USER GUIDE FOR UNIVERSAL RENDERING PIPELINE +USER GUIDE 1 Contents Introduction ............................................................................................................................................3 -Setup ......................................................................................................................................................3 +Quick Start and Demo Scenes...................................................................................................................3 -Quick Start and Demo Scenes...................................................................................................................4 +How to use the asset in your project.........................................................................................................4 +Option 1: Highlighting/customizing gameobjects .............................................................................................................4 +Option 2: Highlighting/customizing ANY gameobject automatically ................................................................................4 +Ignoring specific gameobjects from highlighting...............................................................................................................4 -Highlighting: how to use the asset in your project......................................................................................5 -Option 1: Highlighting/customizing gameobjects .............................................................................................................5 -Option 2: Highlighting/customizing ANY gameobject automatically ................................................................................5 -Ignoring specific gameobjects from highlighting...............................................................................................................5 +Highlighting vs Selection ..........................................................................................................................5 +Highlighting ........................................................................................................................................................................5 +Selection............................................................................................................................................................................. 5 -Highlighting vs Selection ..........................................................................................................................6 -Highlighting ........................................................................................................................................................................6 -Selection............................................................................................................................................................................. 6 +Full list of options in Highlight Effect component .......................................................................................6 +General Settings.................................................................................................................................................................6 +Highlight Options ...............................................................................................................................................................6 +Outline Effect Options .......................................................................................................................................................7 +Outer Glow Effect Options.................................................................................................................................................8 +Inner Glow Effect Options..................................................................................................................................................9 +Overlay Effect Options .......................................................................................................................................................9 +Target Effect Options .........................................................................................................................................................9 +See-Through Effect Options.............................................................................................................................................10 +Hit-FX Effect Options........................................................................................................................................................11 -Full list of options in Highlight Effect component .......................................................................................7 -General Settings.................................................................................................................................................................7 -Highlight Options ...............................................................................................................................................................7 -Outline Effect Options .......................................................................................................................................................8 -Outer Glow Effect Options.................................................................................................................................................9 -Inner Glow Effect Options................................................................................................................................................10 -Overlay Effect Options .....................................................................................................................................................10 -Target Effect Options .......................................................................................................................................................10 -See-Through Effect Options.............................................................................................................................................11 -Hit-FX Effect Options........................................................................................................................................................12 +Scripting support ...................................................................................................................................12 +Using scripting to add effects ..........................................................................................................................................12 +Setting profile at runtime ................................................................................................................................................12 +Changing properties at runtime.......................................................................................................................................12 +Executing a Hit FX effect ..................................................................................................................................................12 +Starting the Target FX on demand...................................................................................................................................12 +Changing the target of highlight using scripting..............................................................................................................13 +Events / reacting to highlighting......................................................................................................................................13 +Events / reacting to selection ..........................................................................................................................................14 -Scripting Support...................................................................................................................................13 -Using scripting to add effects ..........................................................................................................................................13 -Setting profile at runtime ................................................................................................................................................13 -Changing properties at runtime.......................................................................................................................................13 -Executing a Hit FX effect ..................................................................................................................................................13 -Starting the Target FX on demand...................................................................................................................................13 -Changing the target of highlight using scripting..............................................................................................................14 -Events / reacting to highlighting......................................................................................................................................14 -Events / reacting to selection ..........................................................................................................................................15 + Using the Highlight Manager ......................................................................................................................................14 + Using the Highlight Trigger .........................................................................................................................................14 +Messages..........................................................................................................................................................................15 +Manually selecting/toggling/unselecting objects with Highlight Manager.....................................................................15 - Using the Highlight Manager ......................................................................................................................................15 - Using the Highlight Trigger .........................................................................................................................................15 -Messages..........................................................................................................................................................................16 -Manually selecting/toggling/unselecting objects with Highlight Manager.....................................................................16 - -Advanced Topics and Notes....................................................................................................................17 -Quick help & tips..............................................................................................................................................................17 -Normals option ................................................................................................................................................................17 -Highlight when entering a volume ..................................................................................................................................17 +Advanced Topics and Notes....................................................................................................................16 +Quick help & tips..............................................................................................................................................................16 +Normals Option................................................................................................................................................................16 +Highlight when entering a volume ..................................................................................................................................16 +Depth Clip option .............................................................................................................................................................16 +Compatibility of transparent objects with depth clip option ..........................................................................................17 Compatibility of see-through effect with transparent shaders.......................................................................................17 Masking UI .......................................................................................................................................................................17 -Static batching .................................................................................................................................................................18 -Cancelling see-through effect behind certain objects.....................................................................................................18 +Static batching .................................................................................................................................................................17 +Cancelling see-through effect behind certain objects.....................................................................................................17 Excluding submeshes .......................................................................................................................................................18 Custom Vertex Transformations......................................................................................................................................18 +Controlling which objects can be selected ......................................................................................................................18 Custom sorting.................................................................................................................................................................19 -Solving stencil buffer compatibility issues with other shaders .......................................................................................19 -Effects appear in SceneView but not in GameView ........................................................................................................19 +Universal Rendering Pipeline compatibility.....................................................................................................................19 2 Introduction Thank you for purchasing! -Highlight Plus is a powerful package for adding outline, glow and other effects to your gameobjects. +Highlight Plus is a simple yet powerful package for adding outline, glow and other effects to your +gameobjects. We hope you find the asset easy and fun to use. Feel free to contact us for any enquiry. Visit our Support Forum on https://kronnect.com for help and access to the latest beta releases. Kronnect Technologies +Email: contact@kronnect.com Support Forum: https://www.kronnect.com/support -Email (non support): contact@kronnect.com -Setup +Quick Start and Demo Scenes -Requisites -This package is designed for URP. It requires Unity 2019.3 and URP 7.1.6 or later. -Please make sure an URP asset is present in Project Settings/Quality and/or Project Settings/Graphics. -Configuration -To install the plugin correctly, you need to add the “Highlight Plus Render Feature” to the URP asset: -1) Double click the Universal Rendering Pipeline asset to select it (do this for all URP assets assigned in your -Project Settings / Quality and Graphics). -2) Double click the Forward Renderer asset. -3) Click "+" to add the Highlight Plus Renderer Feature to the list of the Forward Renderer Features. -Note: URP assets can be assigned to Project Settings / Graphics and Project Settings / Quality. Check both -sections! -(You can also find a Universal Rendering Pipeline asset and HighlightPlusForwardRenderer asset ready to use -in the Highlight Plus / Pipelines / URP folder. Make sure the Highlight Plus Scriptable Renderer Feature is -listed in the Renderer Features of the Forward Renderer in the pipeline asset). -Important: on Unity 2021, Depth Priming Mode must be set to “Forced” in the URP asset in order to work -on Android, iOS and WebGL. -Video instructions: https://youtu.be/EgyBs8v9aRI + 1. Import the asset into your project or create an empty project. + 2. Go to Demo folder and run the demo scenes to quickly test the asset effects. + 3. Examine the code behind the script attached to the Demo game object in demo scene 1. +The Demo scenes contains 3 spheres with a Highlight Effect and Highlight Trigger scripts attached to each +one. Each sphere has: + - The Highlight Effect script contains all the settings and appearance properties for the effects. If you + + activate the “Highlighted” checkbox, the effects will be rendered immediately. + - The Highlight Trigger component checks the position of the pointer and detected when it passes over + + the gameobject. When this occurs, it activates the “Highlighted” checkbox of the previous component + and disables it when the pointer exits the gameobject. + +Alternatively, you can create a “Highlight Manager” from the top menu GameObject -> Effects -> Highlight +Plus -> Create Manager. This command will create a gameobject with the Highlight Manager script attached, +responsible for detecting mouse interaction with any gameobject that matches the layer and other settings +in the manager and highlight it accordingly. 3 - Quick Start and Demo Scenes - -Demo1_HighlightExample Scene -Run the scene to to quickly test the asset effects. -This demo scene contains 3 spheres with a Highlight Effect and Highlight Trigger scripts attached to each -one. Each sphere has: - - - The Highlight Effect script contains all the settings and appearance properties for the effects. If you - activate the “Highlighted” checkbox, the effects will be rendered immediately. - - - The Highlight Trigger component checks the position of the pointer and detected when it passes over - the gameobject. When this occurs, it activates the “Highlighted” checkbox of the previous - component and disables it when the pointer exits the gameobject. - -(Instead of adding a HighlightTrigger to each sphere, you can create a “Highlight Manager” from the top -menu GameObject -> Effects -> Highlight Plus -> Create Manager. This command will create a gameobject -with the Highlight Manager script attached, responsible for detecting mouse interaction with any -gameobject that matches the layer and other settings in the manager and highlight it accordingly). -Inspecting the scene: - - 1. Select any of the spheres – you will see the Highlight Effect in the inspector (it will also display any - warning if there’s any missing or wrong setup related to URP). - - 2. Examine the code behind the script attached to the “GoldSphere” gameobject. - -Demo2_SelectionExample -This demo scene is an example of the selection features of Highlight Plus. -Click the sphere to permanently select or deselect them. - - 4 - Highlighting: how to use the asset in your project + How to use the asset in your project Option 1: Highlighting/customizing gameobjects ▪ Add HighlightEffect.cs script to any gameobject. Customize the appearance options. @@ -145,19 +116,19 @@ Ignoring specific gameobjects from highlighting the gameobject that you don’t want to be highlighted and activate the “Ignore” checkbox. If you’re using the Highlight Manager, it also provides some filter options like Layer Mask. - 5 + 4 Highlighting vs Selection -Highlight Plus also includes a “Selection” feature in the Highlight Manager. You can select any number of -objects by clicking on them. This Selection feature only works with the Highlight Manager in the scene. +Highlight Plus offers a Selection feature integrated in the Highlight Manager, which can draw objects +differently depending if they’re selected or not. You can select any number of objects by clicking on them. Highlighting Refers to the temporary effect that causes an object to show an outline, glow or other kind of effect. For example, when using the Highlight Trigger or Highlight Manager components, and the “Highlight On Hover” checkbox is activated, the asset will “highlight” any target automatically when the pointer is positioned over that target. When you move the pointer out of the object, the highlight disappears. -Note that you can also use scripting to toggle the highlight on / off by calling SetHighlighted() or setting the -highlighted property of the HighlightEffect component without using the Highlight Manager at all. +You can also use scripting to toggle the highlight on / off by calling SetHighlighted() or setting the highlighted +property of the HighlightEffect component. The demo scene 1 provides an example of highlighting spheres. Selection @@ -177,7 +148,7 @@ Use the SelectObject, ToggleObject and UnselectObject methods of the Highlight M control the selection state of any object in the scene using scripting. The demo scene 2 provides an example of selection by clicking on spheres. - 6 + 5 Full list of options in Highlight Effect component The Highlight Effect component provides many options. This section covers each one of them: @@ -186,12 +157,15 @@ The Highlight Effect component provides many options. This section covers each o General Settings + - Preview In Editor: enabling this option will render the effects while in Edit mode. Note that most + effects won’t be visible unless the “Highlighted” checkbox is enabled. + - Cameras Layer Mask: let you specify which cameras can render the effects. By default, every camera. - - Reflection Probes: enable to render the effects on reflection probe cameras. - Ignore Object Visibility: by default, Highlight Plus won’t render the effects if the object is not visible in screen. If you’re using some tool that uses GPU instancing to render the object directly on the GPU and not using the regular renderer component, enable this option to force the effects to be rendered. + - Reflection Probes: enable to render the effects on reflection probe cameras. - Normals Option: several options to smooth or reorient normals of the geometry of the object. Only used in outline and glow effects when rendering in Fast, Average or High quality mode (mesh-based effects, not used in Highest quality modes or screen-space mode). @@ -201,16 +175,20 @@ General Settings Highlight Options + - Ignore: let you disable any effect on this object. If you use the Highlight Manager, it will still use this + highlight effect component values. + - Include: this option let you specify which other objects will also be highlighted. It’s extremely useful as you can using a single highlight effect on the root of a group of objects for example, and include all the children. The outline and glow effects will be combined and show a single contour around the entire group if they overlap. - o Object Name Filter: let’s you specify which objects will be included (according to the Include + + 6 + o Object Name Filter: let’s you specify which objects will be included (according to the Include option) by filtering their names. For example, if you have 5 children, you could use a prefix or suffix to specify which of them will be highlighted. - 7 - o Combine Meshes: this option is useful for objects that do not rotate individually. Highlight + o Combine Meshes: this option is useful for objects that do not rotate individually. Highlight Plus will automatically combine the meshes of the group, reducing the number of draw calls dramatically. @@ -223,14 +201,17 @@ Highlight Options - Constant Width: keeps the outline or glow width constant regardless of the distance of the object to the camera. + - Depth Clip: performs a depth buffer clipping so effects are correctly hidden behind solid geometry. Outline Effect Options + The outline shows a usually thin colored line around the object. - Outline: controls the transparency of the outline. A value of 0 deactivates completely this effect. - Width: the width of the outline. The “Constant Width” option in the previous section can affect the actual visible width. + - Color: the color for the outline. - Quality: there’re 4 quality modes: fast, average, high and highest. The first 3 quality modes use a mesh-based rendering technique which is usually faster. The Highest quality mode uses a screen- @@ -238,16 +219,17 @@ The outline shows a usually thin colored line around the object. depending on the characteristic of the highlighted object so don’t hesitate to use the mode that looks or perform better in your case, regardless of the name. For example, the “Fast” quality mode usually works best for simple objects. - - Color: the color for the outline. - Visibility: controls the z-buffer testing for the outline. Let you specify if the outline should be visible on top of everything, only when the object is occluded (check also see-through effect for more options) or normal, which means the outline will be visible when the object is visible as well. + - Optimal Blit: when in Highest Quality mode, performs a blit over the affected region of the screen, + instead of using a full-screen blit. This option will improve performance. - Independent: this option forces the outline to show completely ignoring other highlighted objects that could overlap on the screen. By default, Highlight Effect will merge the outlines of overlapping objects, showing a continuous outline around the mixed group. By enabling the Independent option you ensure that the outline is visible around each group separately. - 8 + 7 Outer Glow Effect Options The outer glow effect shows a bright glow or bloom-like effect, usually wider than the outline, around the object. @@ -271,7 +253,7 @@ object. To quickly change the glow color using scripting, you can call SetGlowColor(color) method on the HighlightEffect component. Check demo scene 1 for an example. - 9 + 8 Inner Glow Effect Options The Inner Glow renders a rim-like effect over the object. @@ -304,7 +286,7 @@ The Target effect adds an animated object floating over the highlighted target. - Rotation Speed: the speed at which the object rotates. Enter 0 to disable rotation. - Initial / End Scale: used to create a zoom / pulsating effect. - 10 + 9 - Scale To Object Bound: the scale of the target image will be relative to the object screen bounds (if object grows, the target effect will also expand). Note that if object rotates and its bounds change, the target effect will also change its size. This can produce a strange result so you may prefer to have @@ -319,7 +301,7 @@ The Target effect adds an animated object floating over the highlighted target. elevation. - Stay Duration: how long the overlay texture will be displayed when the object is no longer highlighted - until it fades out. + until it fades out. A value of 0 keeps the effect visible until it’s deactivated. - Visibility: controls the z-buffer testing for the effect. Let you specify if the glow should be visible on top of everything, only when the object is occluded or normal, which means the glow will be visible @@ -354,7 +336,7 @@ walls. - Border When Hidden: this option let you show an additional outline but only when see-through is active. - 11 + 10 - Ordered: when enabled, it will respect the relative distance to camera when rendering see-through effect. @@ -370,43 +352,47 @@ This effect is only usable in play mode. It let you show a “punch” effect by briefly. In play mode you can test it: Please refer to the “Executing a Hit-FX effect” in the next section for sample code. - - 12 - Scripting Support + 11 + Scripting support Using scripting to add effects -Use GetComponent() to get a reference to the component of your gameobject. -Most properties shown in the inspector can be accessed through code, for example: - using HighlightPlus; - … - HighlightEffect effect = myGameObject.GetComponent(); - effect.outline = true; - effect.outlineColor = Color.blue; - effect.SetGlowColor(Color.yellow); - effect.UpdateMaterialProperties(); + Use GetComponent() to get a reference to the component of your gameobject. + Most properties shown in the inspector can be accessed through code, for example: -Important! If you change the hierarchy of your object (change its parent or attach it to another object), -you need to call effect.Refresh() to make Highlight Plus update its internal data. + using HighlightPlus; + … + HighlightEffect effect = myGameObject.GetComponetn(); + effect.outline = true; + effect.outlineColor = Color.blue; + effect.SetGlowColor(Color.yellow); + effect.UpdateMaterialProperties(); + + To control the state of the highlight, use: + effect.SetHighlighted(true/false) or effect.highlighted = true/false. + + Important! If you change the hierarchy of your object (change its parent or attach it to another + object), you need to call effect.Refresh() to make Highlight Plus update its internal data. Setting profile at runtime -Call ProfileLoad() or ProfileReload() methods of the HighlightEffect component and pass your highlight -profile object. + Call ProfileLoad() or ProfileReload() methods of the HighlightEffect component and pass your + highlight profile object. Changing properties at runtime -When changing specific script properties at runtime, call UpdateMaterialProperties() to ensure those -changes are applied immediately. + When changing specific script properties at runtime, call UpdateMaterialProperties() to ensure + those changes are applied immediately. Executing a Hit FX effect -The HitFX effect is a fast flash overlay effect which is used from code. Just call HitFX and pass the desired -parameters: - using HighlightPlus; - … - HighlightEffect effect = myGameObject.GetComponetn(); - effect.HitFX(color, duration, initial_intensity); + The HitFX effect is a fast flash overlay effect which is used from code. Just call HitFX and pass the + desired parameters: + + using HighlightPlus; + … + HighlightEffect effect = myGameObject.GetComponetn(); + effect.HitFX(color, duration, initial_intensity); Starting the Target FX on demand @@ -414,16 +400,19 @@ Starting the Target FX on demand Note: if you change target fx properties using scripting, you may need to call UpdateMaterialProperties() so the new values get reflected in new target fx executions. - 13 + 12 Changing the target of highlight using scripting + The objects to be highlighted by the script are those configured by the “Include” option in the Highlight Options section. However, you can override this selection using scripting in two ways: + effect.SetTarget(transform) will instruct the script to execute the effects on the given object. effect.SetTarget(transform, Renderer[] additionalObjects) will do the same but also will include any number of other renderers. Useful when you want to highlight a set of objects defined by a script. Events / reacting to highlighting + Note: check SphereHighlightEventExample.cs script in the demo scene. The Highlight Effect script exposes two events (OnObjectHighlightStart and OnObjectHighlightEnd) which fire when the object highlight starts or ends. @@ -455,7 +444,7 @@ OnObjectHighlightEnd, OnObjectSelected, OnObjectUnselected events: HighlightManager.instance.OnObjectHighlightStart += MyEventHandler; - 14 + 13 Events / reacting to selection Selection events OnObjectSelected and OnObjectUnSelected are provided by the @@ -523,28 +512,29 @@ Using the Highlight Trigger } } - 15 + 14 Messages -Highlight Effect will send the “HighlightStart” and “HighlightEnd” to any script attached to the gameobject -when its highlighted (or highlight ends). You can get those messages using the following code: + Highlight Effect will send the “HighlightStart” and “HighlightEnd” to any script attached to the + gameobject when its highlighted (or highlight ends). You can get those messages using the + following code: -using UnityEngine; -using HighlightPlus; + using UnityEngine; + using HighlightPlus; -public class MyBehaviour : MonoBehaviour { + public class MyBehaviour : MonoBehaviour { - void HighlightStart () { - Debug.Log ("Object highlighted!"); + void HighlightStart () { + Debug.Log ("Object highlighted!"); - } + } - void HighlightEnd () { - Debug.Log ("Object not highlighted!"); + void HighlightEnd () { + Debug.Log ("Oject not highlighted!"); - } + } -} + } Manually selecting/toggling/unselecting objects with Highlight Manager @@ -583,47 +573,71 @@ Manually selecting/toggling/unselecting objects with Highlight Manager } } - 16 + 15 Advanced Topics and Notes Quick help & tips -Highlight Plus has been designed to be used without having to read a long manual. Hover the mouse over -the label of any option in the inspector to reveal a tooltip with a short explanation of that option. + Highlight Plus has been designed to be used without having to read a long manual. Hover the mouse + over the label of any option in the inspector to reveal a tooltip with a short explanation of that option. -This section contains specific instructions or notes about certain features. + This section contains specific instructions or notes about specific features or issues. -Normals option +Normals Option -Highlight Plus can automatically optimize mesh normal to provide a better result. The available options are: + Highlight Plus can automatically optimize mesh normal to provide a better result. The available options + are: - - Smooth: this will improve the outline effect when using the Fast or High-quality level (not with - Highest). + - Smooth: this will improve the outline effect when using the Fast or High-quality level (not with + Highest). - - Preserve Original: in some circumstances you may want to modify your mesh dynamically and also - want Highlight Plus to avoid caching that mesh – enable “Preserve Original Mesh” to force Highlight - Plus to use the original mesh always. + - Preserve Original: in some circumstances you may want to modify your mesh dynamically and + also want Highlight Plus to avoid caching that mesh – enable “Preserve Original Mesh” to force + Highlight Plus to use the original mesh always. - - Reorient: this will replace existing normal with a vector pointing out from the center of the object. - Useful for some 2D geometry or objects without normals. + - Reorient: this will replace existing normal with a vector pointing out from the center of the object. + Useful for some 2D geometry or objects without normals. -Note that Highlight Plus won’t never change the original mesh of your objects so these are safe operations. + Note that Highlight Plus won’t never change the original mesh of your objects so these are safe + operations. Highlight when entering a volume -It’s possible to automatically enable/disable highlight effects when object enters/exits a volume. Add a -HighlightTrigger component to the object and select “Volume” as trigger mode. + It’s possible to automatically enable/disable highlight effects when object enters/exits a volume. Add + a HighlightTrigger component to the object and select “Volume” as trigger mode. -The script uses the OnTriggerEnter / OnTriggerExit events. The volume must have a collider marked as -IsTrigger and static. Also, the object entering the volume must have a rigidbody in order for the events to -trigger. + The script uses the OnTriggerEnter / OnTriggerExit events. The volume must have a collider marked + as IsTrigger and static. Also, the object entering the volume must have a rigidbody in order for the + events to trigger. + +Depth Clip option + + When using Outline or Outer Glow in high quality mode, the asset relies on the depth buffer to + perform proper depth cull or depth clipping. However, when MSAA (integrated antialias) is enabled, + the depth buffer is not available at the stage Highlight Plus renders. If you need MSAA in your project + and wants depth clipping/culling, you can enable the “Depth Clip” option in the Highlight inspector. + This option only is used when Outline or Outer Glow is set to High Quality (the other quality modes + work differently and do not require special treatment). + + 16 + Compatibility of transparent objects with depth clip option + + The Depth Clip option is only available for Outline and Outer Glow in High Quality modes. When + enabled, the special _CameraDepthTexture buffer is used to clip the effect. This option is useful if + you need to use MSAA since enabling MSAA disables depth checking in high quality mode. + Transparent objects do not write to this special texture unless you use this option in GameObject -> + Effects -> Highlight Plus -> “Make Transparent Object Compatible With Depth Clip”. + Once you add this feature to your transparent object, make sure you also have “Depth Clip” option + enabled in the objects to be highlighted using Outline or Outer Glow in HQ mode. Compatibility of see-through effect with transparent shaders -If you want the See-Through effect to be seen through other transparent objects, their shaders need to be -modified so they write to depth buffer (by default transparent objects do not write to z-buffer). To do so, -select top menu GameObject -> Effects -> Highlight Plus -> “Add Depth To Transparent Object”. -Note that forcing a transparent object to write to depth buffer will cause issues with transparency. + If you want the See-Through effect be seen through other transparent objects, their shaders need to + be modified so they write to depth buffer (by default transparent objects do not write to z-buffer). + To do so, select top menu GameObject -> Effects -> Highlight Plus -> “Add Depth To Transparent + Object”. + Note that forcing a transparent object to write to depth buffer will cause issues with transparency. + Masking UI To avoid Highlight Plus effects show on top of any UI or sprite element, there’re a few options: @@ -634,9 +648,7 @@ Masking UI and the “UI camera” accordingly (so the UI camera only renders the UI) and set the UI Camera clear flag to “Depth only”. Make sure the “Depth” value of the UI camera is greater than the - - 17 - regular camera so the UI camera renders after the main camera. This setup is easy and ensures + regular camera so the UI camera renders after the main camera. This setup is easy and ensures the world-space UI renders on top of any highlight plus effect. c) Create a panel on your UI and assign the material HighlightUIMask found in HighlightPlus/Resources/Materials. This special material will write to stencil buffers and will @@ -645,45 +657,73 @@ Masking UI Static batching -Objects marked as "static" need a MeshCollider in order to be highlighted (other collider types won’t work). -This required because Unity combines the meshes of static objects so it's not possible to access to the -individual meshes of non-batched objects. -Note: the MeshCollider can be disabled. The only purpose of this collider is to allow Highlight Effect to get -access to the original mesh before the merge performed by Unity when scene starts. + Objects marked as "static" need a MeshCollider to be highlighted (other collider types won’t work). + This required because Unity combines the meshes of static objects so it's not possible to access to + the individual meshes of non-batched objects. + Note: the MeshCollider can be disabled. The only purpose of this collider is to allow Highlight Effect + to get access to the original mesh before the merge performed by Unity when scene starts. Cancelling see-through effect behind certain objects -Add HighlightSeeThroughOccluder script to the object you want to block see-through effects. -The HighlightEffect.isSeeThroughOccluded will return true if any occluder using raycast mode is covering -the highlighted object. + Add HighlightSeeThroughOccluder script to the object you want to block see-through effects. + The HighlightEffect.isSeeThroughOccluded will return true if any occluder using raycast mode is + covering the highlighted object. -Excluding submeshes + 17 + Excluding submeshes -Use the SubMesh Mash property to specify which submeshes will be affected by the effect. + Use the SubMesh Mash property to specify which submeshes will be affected by the effect. -By default, a value of -1 means all submeshes. This is a component mask field. The effect does the -following test to determine if the submesh will be included: + By default, a value of -1 means all submeshes. This is a component mask field. The effect does the + following test to determine if the submesh will be included: -(1< (); + manager.OnObjectSelected += ValidateSelection; + + } + + bool ValidateSelection(GameObject obj) { + // Used to fine-control if the object can be selected; return false to cancel + + selection + return true; + + } + + } 18 Custom sorting - Highlight Plus effects are sorted to camera distance before being rendered. However, you can + Highlight Plus effects render after transparent queue by default in any order. However, you can control ordering of the effects by adding this script to the scene: using UnityEngine; @@ -710,13 +750,9 @@ Please note that any addition or change to this file will be lost if you upgrade In this case, the effects will be sorted by the z position. Feel free to sort the “effects” list above according to your needs. -Solving stencil buffer compatibility issues with other shaders -Some third-party assets also use stencil buffers. This can cause compatibility issues like outline or glow not -visible. If you’re facing this problem, enable the “Clear Stencil” option in the Highlight Render Feature. - -Effects appear in SceneView but not in GameView -This issue can occur if Depth Priming Mode is disabled in the URP asset under certain circumstances (like -having other render features). In this case, try setting Depth Priming Mode to Forced. +Universal Rendering Pipeline compatibility +URP support is limited in this package. A version of Highlight Plus designed for URP can be found in the same +asset (just import it from the URP folder). 19 diff --git a/Assets/HighlightPlus/Documentation/Documentation.pdf.meta b/Assets/HighlightPlus/Documentation/Documentation.pdf.meta new file mode 100644 index 0000000..71b14a2 --- /dev/null +++ b/Assets/HighlightPlus/Documentation/Documentation.pdf.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 63c764939b9ea4aecacd8c4d7c76e19c +timeCreated: 1578838656 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HighlightPlus/Documentation/Kronnect Assets.pdf b/Assets/HighlightPlus/Documentation/Kronnect Assets.pdf new file mode 100644 index 0000000..3962137 --- /dev/null +++ b/Assets/HighlightPlus/Documentation/Kronnect Assets.pdf @@ -0,0 +1,234 @@ +Don’t miss these other cool assets brought to you by + + BEAUTIFY 2 is an acclaimed full-screen image processing effect that improves the image quality in real time + + producing incredibly crisp and vivid scenes. Compatible with built-in, LWRP and URP pipelines. + In addition to this unique image enhancement filter, you will find in Beautify additional effects like high quality Bloom, + dirty lens effect, vignetting, night & thermal vision and more! + Get it on the Asset Store: + + https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/beautify-61730?aid=1101lGsd + + DYNAMIC FOG & MIST 2 is a full-screen image effect that adds live, moving Fog, Mist and Sky Haze to your scenes + + making them less dull and boring. Compatible with built-in and URP pipelines. + Get it on the Asset Store: + + https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/dynamic-fog-mist-48200?aid=1101lGsd + + VOLUMETRIC FOG & MIST 2 is the enhanced version of Dynamic Fog & Mist (which is also included in the package) + + and has been designed to provide a better-looking fog and cloud formations with support of lighting and glow effects. + Compatible with built-in and URP pipelines. + It’s feature-rich with options like fog of war, Sun tracking, better transparent and sprite support, sun shafts and more. + Get it on the Asset Store: + + https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/volumetric-fog-mist-49858?aid=1101lGsd + WORLD POLITICAL MAP SERIES is a collection of professional mapping assets for Unity (2D and Globe Editions). Used by + + many companies and agencies across the world to visualize data, resources, interact with the user, etc. + Compatible with built-in and URP pipelines. + + Get it on the Asset Store (Globe Edition): + + https://assetstore.unity.com/packages/tools/gui/world-map-globe-edition-41890?aid=1101lGsd + + Get it on the Asset Store (2D Edition): + + https://assetstore.unity.com/packages/tools/gui/world-map-2d-edition-43180?aid=1101lGsd + +WORLD MAP STRATEGY KIT 2 is a complete framework for building AAA strategy games, including all world countries + +and provinces, +7000 cities, cool 3D PBS dynamic viewport for map, hexagonal grid, pathfinding, real elevation, and much +more. +Compatible with built-in and URP pipelines. + +Get it on the Asset Store: + +https://assetstore.unity.com/packages/templates/systems/world-map-strategy-kit-55121?aid=1101lGsd + + WORLD MAPS PRO BUNDLE 2 is our most complete and professional suite of maps for Unity platform for the best price. + + Compatible with built-in and URP pipelines. + This bundle contains: + - World Political Map Globe Edition + - World Political Map 2D Edition + - World Map Strategy Kit + - World Flags and Weather Icons + + Purchase this bundle and save $$$! + + https://assetstore.unity.com/packages/tools/gui/world-maps-pro-bundle-80125?aid=1101lGsd + SHINY SSRR is our Screen Space Raytraced Reflections solution optimized for both forward and deferred rendering + +path. As with Beautify, this effect gives an instant boost to your scene by making light bounce on shiny surfaces, casting +gorgeous reflections on all kind of reflective surfaces. Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/slug/188638?aid=1101lGsd + +SKYBOX PLUS is an artist-driven replacement for Unity default skybox. Includes a lovely blend of procedural haze and + +hand-drawn clouds which mimic the style of Studio Ghibli. +Supports full day/night transition with moon, stars, several cloud layers with custom animation and lot of customization +options. . Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/2d/textures-materials/sky/skybox-plus-182966?aid=1101lGsd + +VOLUMETRIC LIGHTS is a powerful asset to add scattering effect to any number of Unity lights. Supports spot, point + +and area light types. Directional lights are also supported for localized areas. Includes advanced options like dust lit +particles and shadow occlusion. Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/vfx/shaders/volumetric-lights-164149?aid=1101lGsd + COMPASS NAVIGATOR PRO adds a “Skyrim”-like compass bar to your UI, including smooth fade in/out, various bar + +designs, +11 icons in two variations (+22 icons) and nice features like minimap and beam lights! +Compatible with all render pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/tools/gui/compass-navigator-pro-59519?aid=1101lGsd + +X-FRAME FPS ACCELERATOR provides you extra frames per second in your mobile games (iOS and Android). It takes + +advantage of the huge screen resolution of these devices to sacrifice some pixels in Exchange of performance with flexible +and dynamic quality options. Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/tools/camera/x-frame-fps-accelerator-63965?aid=1101lGsd + +SHADER CONTROL is a tiny but powerful tool that will allow you to identify and manage shader keywords usage in your + +project, taking more control over the build size and compilation time. Compatible with all render pipelines. +Quickly locates and helps you disable keywords not needed, learn about the shaders used in your project and their keywords! +Get it on the Asset Store: + +https://assetstore.unity.com/packages/vfx/shaders/shader-control-74817?aid=1101lGsd + TERRAIN GRID SYSTEM is an advanced grid generator and territory/cell highlighter/fader for both Terrain and 2D grids. + + Compatible with all render pipelines. It can generate Voronoi, hexagonal and boxed grids dynamically on your terrain, with + flexible position options . Compatible with built-in and URP pipelines. + Get it on the Asset Store: + + https://assetstore.unity.com/packages/tools/terrain/terrain-grid-system-47215?aid=1101lGsd + +GRIDS 2D is similar to Terrain Grid System but only for flat 2D grids. It’s fast, convenient and easy to use. + +Compatible with all render pipelines. It can also generate Voronoi, hexagonal and boxed grids dynamically on your terrain, with +flexible API to integrate with your game. Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/tools/sprite-management/grids-2d-59981?aid=1101lGsd + +HEXASPHERE GRID SYSTEM leverages shader technologies like texture arrays and geometry shaders to render hundreds + +of thousands of interactive and customizable tiles in a spherical/hexagonal grid. +Fully interactive, with VR support and super-fast. Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/tools/modeling/hexasphere-grid-system-89112?aid=1101lGsd + TUNNEL FX 2 is a full-screen post image effect that creates stunning, colorful 3D animated tunnels. It does not create any + +real tunnel but just draw the tunnel as a post-effect behind any geometry or UI. +Compatible with built-in and URP pipelines. + +Get it on the Asset Store: + +https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/tunnel-fx-68564?aid=1101lGsd + +GLOBAL SNOW renders your existing scene into a winter landscape with a couple of clicks. Just add a single script to your + +camera and customize the results. +Supports relief mapping for realistic snow effect + human footprints + terrain marks with automatic collision detection and +more! +Get it on the Asset Store: + +https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/global-snow-79795?aid=1101lGsd + +HIGHLIGHT PLUS adds outline, glow and see-through effects to any 3D object in the scene. + +It’s performant and designed for all platforms, including built-in and URP rendering pipelines. + +Get it on the Asset Store: + +https://assetstore.unity.com/packages/tools/particles-effects/highlight-plus-134149?aid=1101lGsd + VOXEL PLAY is a procedural, fast environment based on cubes. It leverages highly optimized code, including + +geometry shaders and texture arrays, to generate beautiful, rich, vast infinite worlds which can be customized and +modified in many ways. Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/templates/systems/voxel-play-106618?aid=1101lGsd + +PIRATES OF VOXEL PLAY is a multiplayer game template built with Mirror and Voxel Play. It’s the perfect + +sample project to learn how to implement multiplayer games using these two frameworks. +Includes animated characters, a fully populated tropical island with 3 biomes, wild beasts, weapons, loots, cute +music and sound effects and of course plenty of commented code, documentation and video tutorials! +Get it on the Asset Store: + +https://assetstore.unity.com/packages/slug/189096?aid=1101lGsd + LIQUID VOLUME is a powerful and highly customizable shader that simulates realistic and animated liquid + +containers. Can be used in 3D scenes and 2D UI (demos included). +Liquid Volume is super easy and fun to use: just add the main script to any primitive (sphere, box, cylinder and +similar shape models) to convert it into a liquid container! +Get it on the Asset Store: + +https://assetstore.unity.com/packages/vfx/shaders/liquid-volume-70992?aid=1101lGsd + +LIQUID VOLUME PRO 2 includes all features of Liquid Volume and adds additional advanced options plus + +improved compatibility with more platforms. +Among the new options are multiple liquid layers support, miscible liquids, bubbles, better mesh options and full +WebGL support! Compatible with built-in and URP pipelines. +Get it on the Asset Store: + +https://assetstore.unity.com/packages/vfx/shaders/liquid-volume-pro-129967?aid=1101lGsd + HIGHLIGHT PLUS 2D adds outline, glow, see-through and other effects to any sprite in the scene. + +It’s performant and designed for all platforms, including standard and URP rendering pipelines. +Get it on the Asset Store: +https://assetstore.unity.com/packages/tools/particles-effects/highlight-plus-2d-138383?aid=1101lGsd + +TRAILS FX renders smooth, mesmerizing trails behind moving objects and characters. + +It’s performant thanks to the use of GPU instancing and use correct transparency order producing a fascinating effect. +Compatible with built-in and URP pipelines. +Get it on the Asset Store: +https://assetstore.unity.com/packages/tools/particles-effects/highlight-plus-2d-138383?aid=1101lGsd + +COLOR STUDIO is an Editor Extension that allows you to create awesome color palettes and recolor objects, sprites and scenes + +easily in editor and runtime. Compatible with all render pipelines. +It comes with an interactive color wheel editor and a complete set of tools that let you also export color palettes as LUTs, +transform existing textures or specific colors from object materials. +Get it on the Asset Store: +https://assetstore.unity.com/packages/tools/painting/color-studio-151892?aid=1101lGsd + LUT PACK is a collection of +200 cinematic and artistic LUTs plus tints for Beautify. They can dramatically change the mood + +and look of your game scenes. Beautify includes a LUT Browser that let you quickly text each one of the included LUT in this +package. +Get it on the Asset Store: +https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/lut-pack-for-beautify-202502?aid=1101lGsd + +FRAME PACK is a collection of +75 film mattes and artistic borders that can be used with Beautify or Unity UI. This p + +Get it on the Asset Store: +https://assetstore.unity.com/packages/2d/gui/frame-pack-204058?aid=1101lGsd + + MILITARY UNITS – THE STYLIZED ART COLLECTION includes +100 hand-painted, stylized portraits of military units + + from ancient warriors to modern ships and aircraft. Great for decorating your game screens, unit sheets, icons, or prototyping. + Get it on the Asset Store: + https://assetstore.unity.com/packages/2d/textures-materials/military-units-the-stylized-art-collection- + 187769?aid=1101lGsd + PICKUPS VOL. 1 includes near 100 3D prefabs that can be used in a wide range of games in many ways: inventory icons, + +3D pickups in the scene, decoration or prototyping. + +Get it on the Asset Store: +https://assetstore.unity.com/packages/3d/props/pickups-vol-1-204581?aid=1101lGsd + diff --git a/Assets/Plugins/HighlightPlus/Documentation/Kronnect Assets.pdf.meta b/Assets/HighlightPlus/Documentation/Kronnect Assets.pdf.meta similarity index 59% rename from Assets/Plugins/HighlightPlus/Documentation/Kronnect Assets.pdf.meta rename to Assets/HighlightPlus/Documentation/Kronnect Assets.pdf.meta index 90d0c87..8b055f0 100644 --- a/Assets/Plugins/HighlightPlus/Documentation/Kronnect Assets.pdf.meta +++ b/Assets/HighlightPlus/Documentation/Kronnect Assets.pdf.meta @@ -1,5 +1,7 @@ fileFormatVersion: 2 -guid: 782ce379ea1624a349b1c53de1f90c95 +guid: 44f7a64d904454f09a455fc561dbce2e +timeCreated: 1578838663 +licenseType: Pro DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/HighlightPlus/Editor.meta b/Assets/HighlightPlus/Editor.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Editor.meta rename to Assets/HighlightPlus/Editor.meta index dbe7402..39a01a2 100644 --- a/Assets/Plugins/HighlightPlus/Editor.meta +++ b/Assets/HighlightPlus/Editor.meta @@ -2,7 +2,7 @@ fileFormatVersion: 2 guid: c1cfaabf0583f44b4871807a898aaf31 folderAsset: yes timeCreated: 1542886534 -licenseType: Store +licenseType: Pro DefaultImporter: userData: assetBundleName: diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightEffectEditor.cs b/Assets/HighlightPlus/Editor/HighlightEffectEditor.cs similarity index 88% rename from Assets/Plugins/HighlightPlus/Editor/HighlightEffectEditor.cs rename to Assets/HighlightPlus/Editor/HighlightEffectEditor.cs index 4d8d2d7..0c6e9fa 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightEffectEditor.cs +++ b/Assets/HighlightPlus/Editor/HighlightEffectEditor.cs @@ -1,8 +1,6 @@ -using System.Collections.Generic; +using System.Collections.Generic; using UnityEditor; using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Rendering.Universal; namespace HighlightPlus { @@ -13,12 +11,11 @@ namespace HighlightPlus { #pragma warning disable 0618 SerializedProperty profile, profileSync, camerasLayerMask, ignoreObjectVisibility, reflectionProbes, GPUInstancing; - SerializedProperty ignore, previewInEditor, effectGroup, effectGroupLayer, effectNameFilter, combineMeshes, alphaCutOff, cullBackFaces, normalsOption; - SerializedProperty highlighted, fadeInDuration, fadeOutDuration, flipY, constantWidth, subMeshMask; + SerializedProperty ignore, previewInEditor, effectGroup, effectGroupLayer, effectNameFilter, combineMeshes, alphaCutOff, cullBackFaces, depthClip, normalsOption, subMeshMask; + SerializedProperty highlighted, fadeInDuration, fadeOutDuration, flipY, constantWidth; SerializedProperty overlay, overlayColor, overlayAnimationSpeed, overlayMinIntensity, overlayBlending, overlayTexture, overlayTextureScale; - SerializedProperty outline, outlineColor, outlineWidth, outlineQuality, outlineDownsampling, outlineVisibility, outlineBlitDebug, outlineIndependent; - SerializedProperty glow, glowWidth, glowQuality, glowDownsampling, glowHQColor, glowDithering, glowMagicNumber1, glowMagicNumber2, glowAnimationSpeed; - SerializedProperty glowBlendPasses, glowPasses, glowVisibility, glowBlendMode, glowBlitDebug, glowIgnoreMask; + SerializedProperty outline, outlineColor, outlineWidth, outlineQuality, outlineDownsampling, outlineVisibility, outlineOptimalBlit, outlineBlitDebug, outlineIndependent; + SerializedProperty glow, glowWidth, glowQuality, glowDownsampling, glowHQColor, glowDithering, glowMagicNumber1, glowMagicNumber2, glowAnimationSpeed, glowBlendPasses, glowPasses, glowVisibility, glowBlendMode, glowOptimalBlit, glowBlitDebug, glowIgnoreMask; SerializedProperty innerGlow, innerGlowWidth, innerGlowColor, innerGlowVisibility; SerializedProperty seeThrough, seeThroughOccluderMask, seeThroughOccluderMaskAccurate, seeThroughOccluderThreshold, seeThroughOccluderCheckInterval, seeThroughOccluderCheckIndividualObjects, seeThroughDepthOffset, seeThroughMaxDepth; SerializedProperty seeThroughIntensity, seeThroughTintAlpha, seeThroughTintColor, seeThroughNoise, seeThroughBorder, seeThroughBorderWidth, seeThroughBorderColor, seeThroughOrdered, seeThroughBorderOnly; @@ -26,10 +23,9 @@ namespace HighlightPlus { SerializedProperty targetFXAlignToGround, targetFXFadePower, targetFXGroundMaxDistance, targetFXGroundLayerMask, targetFXTransitionDuration, targetFXStayDuration, targetFXVisibility; SerializedProperty hitFxInitialIntensity, hitFxMode, hitFxFadeOutDuration, hitFxColor, hitFxRadius; SerializedProperty cameraDistanceFade, cameraDistanceFadeNear, cameraDistanceFadeFar; + HighlightEffect thisEffect; bool profileChanged, enableProfileApply; - - UniversalRenderPipelineAsset pipe; bool expandGeneralSettings, expandHighlightOptions; bool showCurrentOccluders; const string HP_GENERAL_SETTINGS = "HPGeneralSettings"; @@ -43,10 +39,11 @@ namespace HighlightPlus { profile = serializedObject.FindProperty("profile"); profileSync = serializedObject.FindProperty("profileSync"); camerasLayerMask = serializedObject.FindProperty("camerasLayerMask"); - ignoreObjectVisibility = serializedObject.FindProperty("ignoreObjectVisibility"); reflectionProbes = serializedObject.FindProperty("reflectionProbes"); - normalsOption = serializedObject.FindProperty("normalsOption"); + ignoreObjectVisibility = serializedObject.FindProperty("ignoreObjectVisibility"); GPUInstancing = serializedObject.FindProperty("GPUInstancing"); + normalsOption = serializedObject.FindProperty("normalsOption"); + subMeshMask = serializedObject.FindProperty("subMeshMask"); ignore = serializedObject.FindProperty("ignore"); previewInEditor = serializedObject.FindProperty("previewInEditor"); effectGroup = serializedObject.FindProperty("effectGroup"); @@ -55,12 +52,12 @@ namespace HighlightPlus { combineMeshes = serializedObject.FindProperty("combineMeshes"); alphaCutOff = serializedObject.FindProperty("alphaCutOff"); cullBackFaces = serializedObject.FindProperty("cullBackFaces"); + depthClip = serializedObject.FindProperty("depthClip"); highlighted = serializedObject.FindProperty("_highlighted"); fadeInDuration = serializedObject.FindProperty("fadeInDuration"); fadeOutDuration = serializedObject.FindProperty("fadeOutDuration"); flipY = serializedObject.FindProperty("flipY"); constantWidth = serializedObject.FindProperty("constantWidth"); - subMeshMask = serializedObject.FindProperty("subMeshMask"); overlay = serializedObject.FindProperty("overlay"); overlayColor = serializedObject.FindProperty("overlayColor"); overlayAnimationSpeed = serializedObject.FindProperty("overlayAnimationSpeed"); @@ -72,13 +69,15 @@ namespace HighlightPlus { outlineColor = serializedObject.FindProperty("outlineColor"); outlineWidth = serializedObject.FindProperty("outlineWidth"); outlineQuality = serializedObject.FindProperty("outlineQuality"); + outlineDownsampling = serializedObject.FindProperty("outlineDownsampling"); outlineVisibility = serializedObject.FindProperty("outlineVisibility"); + outlineOptimalBlit = serializedObject.FindProperty("outlineOptimalBlit"); outlineBlitDebug = serializedObject.FindProperty("outlineBlitDebug"); outlineIndependent = serializedObject.FindProperty("outlineIndependent"); - outlineDownsampling = serializedObject.FindProperty("outlineDownsampling"); glow = serializedObject.FindProperty("glow"); glowWidth = serializedObject.FindProperty("glowWidth"); glowQuality = serializedObject.FindProperty("glowQuality"); + glowDownsampling = serializedObject.FindProperty("glowDownsampling"); glowHQColor = serializedObject.FindProperty("glowHQColor"); glowAnimationSpeed = serializedObject.FindProperty("glowAnimationSpeed"); glowBlendPasses = serializedObject.FindProperty("glowBlendPasses"); @@ -89,9 +88,9 @@ namespace HighlightPlus { glowPasses = serializedObject.FindProperty("glowPasses"); glowVisibility = serializedObject.FindProperty("glowVisibility"); glowBlendMode = serializedObject.FindProperty("glowBlendMode"); + glowOptimalBlit = serializedObject.FindProperty("glowOptimalBlit"); glowBlitDebug = serializedObject.FindProperty("glowBlitDebug"); - glowIgnoreMask = serializedObject.FindProperty("glowIgnoreMask"); - glowDownsampling = serializedObject.FindProperty("glowDownsampling"); + glowIgnoreMask = serializedObject.FindProperty("glowIgnoreMask"); innerGlow = serializedObject.FindProperty("innerGlow"); innerGlowColor = serializedObject.FindProperty("innerGlowColor"); innerGlowWidth = serializedObject.FindProperty("innerGlowWidth"); @@ -141,39 +140,14 @@ namespace HighlightPlus { thisEffect.Refresh(); } - private void OnDisable() { EditorPrefs.SetBool(HP_GENERAL_SETTINGS, expandGeneralSettings); EditorPrefs.SetBool(HP_HIGHLIGHT_OPTIONS, expandHighlightOptions); } - public override void OnInspectorGUI() { - - EditorGUILayout.Separator(); - - // URP setup helpers - pipe = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset; - if (pipe == null) { - EditorGUILayout.HelpBox("You must assign the Universal Rendering Pipeline asset in Project Settings / Graphics. Then, add the Highlight Plus Scriptable Render Feature to the list of Renderer Features of the Forward Renderer.", MessageType.Error); - if (GUILayout.Button("Watch Setup Video Tutorial")) { - Application.OpenURL("https://youtu.be/EgyBs8v9aRI"); - } - return; - } - - if (!HighlightPlusRenderPassFeature.installed) { - EditorGUILayout.HelpBox("Highlight Plus Render Feature must be added to the list of features of the Forward Renderer in the Universal Rendering Pipeline asset.", MessageType.Warning); - if (GUILayout.Button("Watch Setup Video Tutorial")) { - Application.OpenURL("https://youtu.be/EgyBs8v9aRI"); - } - if (GUILayout.Button("Go to Universal Rendering Pipeline Asset")) { - Selection.activeObject = pipe; - } - EditorGUILayout.Separator(); - } - bool isManager = IsDefaultEffectUsedByManager(); + EditorGUILayout.Separator(); serializedObject.Update(); if (foldoutBold == null) { @@ -203,7 +177,8 @@ namespace HighlightPlus { if (GUILayout.Button(new GUIContent("Load", "Updates settings with the profile configuration."), GUILayout.Width(60))) { profileChanged = true; } - GUI.enabled = enableProfileApply; + if (!enableProfileApply) + GUI.enabled = false; if (GUILayout.Button(new GUIContent("Save", "Updates profile configuration with changes in this inspector."), GUILayout.Width(60))) { enableProfileApply = false; profileChanged = false; @@ -250,6 +225,7 @@ namespace HighlightPlus { EditorGUILayout.PropertyField(reflectionProbes); EditorGUILayout.PropertyField(normalsOption); + EditorGUILayout.PropertyField(subMeshMask); EditorGUILayout.PropertyField(GPUInstancing); EditorGUILayout.Separator(); } @@ -283,7 +259,8 @@ namespace HighlightPlus { EditorGUILayout.PropertyField(effectGroupLayer, new GUIContent("Layer")); EditorGUI.indentLevel--; } - if (effectGroup.intValue != (int)TargetOptions.OnlyThisObject && effectGroup.intValue != (int)TargetOptions.Scripting) { + bool usesHQEffects = (outlineQuality.intValue == (int)QualityLevel.Highest && outline.floatValue > 0) || (glowQuality.intValue == (int)QualityLevel.Highest && glow.floatValue > 0); + if (effectGroup.intValue != (int)TargetOptions.OnlyThisObject) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(effectNameFilter, new GUIContent("Object Name Filter")); EditorGUILayout.PropertyField(combineMeshes); @@ -300,13 +277,18 @@ namespace HighlightPlus { EditorGUILayout.PropertyField(cameraDistanceFadeFar, new GUIContent("Far Distance")); EditorGUI.indentLevel--; } - if ((PlayerSettings.virtualRealitySupported && ((outlineQuality.intValue == (int)QualityLevel.Highest && outline.floatValue > 0) || (glowQuality.intValue == (int)QualityLevel.Highest && glow.floatValue > 0)))) { - EditorGUILayout.PropertyField(flipY, new GUIContent("Flip Y Fix", "Flips outline/glow effect to fix bug introduced in Unity 2019.1.0 when VR is enabled.")); + if (usesHQEffects) { + EditorGUILayout.PropertyField(depthClip); + if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS || EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android) { + EditorGUILayout.HelpBox("On mobile, consider enabling 'Depth Clip' option for better results.", MessageType.Info); + } + if (VRCheck.IsActive()) { + EditorGUILayout.PropertyField(flipY, new GUIContent("Flip Y Fix", "Flips outline/glow effect to fix bug introduced in Unity 2019.1.0 when VR is enabled.")); + } } if (glowQuality.intValue != (int)QualityLevel.Highest || outlineQuality.intValue != (int)QualityLevel.Highest) { EditorGUILayout.PropertyField(constantWidth, new GUIContent("Constant Width", "Compensates outline/glow width with depth increase.")); } - EditorGUILayout.PropertyField(subMeshMask); EditorGUILayout.PropertyField(outlineIndependent, new GUIContent("Independent", "Do not combine outline or glow with other highlighted objects.")); } } @@ -331,20 +313,25 @@ namespace HighlightPlus { EditorGUILayout.EndHorizontal(); CheckVRSupport(outlineQuality.intValue); if (outlineQuality.intValue == (int)QualityLevel.Highest) { - CheckDepthTextureSupport("Highest Quality"); EditorGUILayout.PropertyField(outlineDownsampling, new GUIContent("Downsampling")); - } - if (outlineQuality.intValue == (int)QualityLevel.Highest) { - EditorGUILayout.PropertyField(outlineBlitDebug, new GUIContent("Debug View", "Shows the blitting rectangle on the screen.")); - if (!Application.isPlaying && outlineBlitDebug.boolValue && (!previewInEditor.boolValue || !highlighted.boolValue)) { - EditorGUILayout.HelpBox("Enable \"Preview In Editor\" and \"Highlighted\" to display the outline Debug View.", MessageType.Warning); + EditorGUILayout.PropertyField(outlineOptimalBlit, new GUIContent("Optimal Blit", "Blits result over a section of the screen instead of rendering to the full screen buffer.")); + if (outlineOptimalBlit.boolValue) { + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(outlineBlitDebug, new GUIContent("Debug View", "Shows the blitting rectangle on the screen.")); + if (outlineBlitDebug.boolValue && (!previewInEditor.boolValue || !highlighted.boolValue)) { + EditorGUILayout.HelpBox("Enable \"Preview In Editor\" and \"Highlighted\" to display the outline Debug View.", MessageType.Warning); + } + EditorGUI.indentLevel--; } } - if (outlineQuality.intValue == (int)QualityLevel.Highest && (glow.floatValue > 0 && glowQuality.intValue == (int)QualityLevel.Highest)) { - outlineVisibility.intValue = glowVisibility.intValue; + GUI.enabled = outlineQuality.intValue != (int)QualityLevel.Highest || CheckForwardMSAA(); + if (outlineQuality.intValue == (int)QualityLevel.Highest && glowQuality.intValue == (int)QualityLevel.Highest && glow.floatValue > 0) { + EditorGUILayout.PropertyField(glowVisibility, new GUIContent("Visibility")); + } else { + EditorGUILayout.PropertyField(outlineVisibility, new GUIContent("Visibility")); } - EditorGUILayout.PropertyField(outlineVisibility, new GUIContent("Visibility")); + GUI.enabled = true; EditorGUI.indentLevel--; } @@ -365,20 +352,25 @@ namespace HighlightPlus { EditorGUILayout.EndHorizontal(); CheckVRSupport(glowQuality.intValue); if (glowQuality.intValue == (int)QualityLevel.Highest) { - CheckDepthTextureSupport("Highest Quality"); EditorGUILayout.PropertyField(glowDownsampling, new GUIContent("Downsampling")); EditorGUILayout.PropertyField(glowHQColor, new GUIContent("Color")); - } - EditorGUILayout.PropertyField(glowAnimationSpeed, new GUIContent("Animation Speed")); - if (glowQuality.intValue == (int)QualityLevel.Highest) { - EditorGUILayout.PropertyField(glowBlitDebug, new GUIContent("Debug View", "Shows the blitting rectangle on the screen.")); - if (!Application.isPlaying && glowBlitDebug.boolValue && (!previewInEditor.boolValue || !highlighted.boolValue)) { - EditorGUILayout.HelpBox("Enable \"Preview In Editor\" and \"Highlighted\" to display the glow Debug View.", MessageType.Warning); + EditorGUILayout.PropertyField(glowOptimalBlit, new GUIContent("Optimal Blit", "Blits result over a section of the screen instead of rendering to the full screen buffer.")); + if (glowOptimalBlit.boolValue) { + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(glowBlitDebug, new GUIContent("Debug View", "Shows the blitting rectangle on the screen.")); + if (glowBlitDebug.boolValue && (!previewInEditor.boolValue || !highlighted.boolValue)) { + EditorGUILayout.HelpBox("Enable \"Preview In Editor\" and \"Highlighted\" to display the glow Debug View.", MessageType.Warning); + } + EditorGUI.indentLevel--; } + GUI.enabled = glowQuality.intValue != (int)QualityLevel.Highest || CheckForwardMSAA(); EditorGUILayout.PropertyField(glowVisibility, new GUIContent("Visibility")); EditorGUILayout.PropertyField(glowBlendMode, new GUIContent("Blend Mode")); + GUI.enabled = true; } else { + GUI.enabled = glowQuality.intValue != (int)QualityLevel.Highest || CheckForwardMSAA(); EditorGUILayout.PropertyField(glowVisibility, new GUIContent("Visibility")); + GUI.enabled = true; EditorGUILayout.PropertyField(glowDithering, new GUIContent("Dithering")); if (glowDithering.boolValue) { EditorGUI.indentLevel++; @@ -399,6 +391,7 @@ namespace HighlightPlus { } EditorGUILayout.PropertyField(glowPasses, true); } + EditorGUILayout.PropertyField(glowAnimationSpeed, new GUIContent("Animation Speed")); EditorGUILayout.PropertyField(glowIgnoreMask, new GUIContent("Ignore Mask")); EditorGUI.indentLevel--; } @@ -444,7 +437,6 @@ namespace HighlightPlus { EditorGUILayout.PropertyField(targetFXScaleToRenderBounds, new GUIContent("Scale To Object Bounds")); EditorGUILayout.PropertyField(targetFXAlignToGround, new GUIContent("Align To Ground")); if (targetFXAlignToGround.boolValue) { - CheckDepthTextureSupport("Align To Ground option"); EditorGUI.indentLevel++; if (thisEffect.includedObjectsCount > 1 && targetFXCenter.objectReferenceValue == null && effectGroup.intValue != (int)TargetOptions.OnlyThisObject) { EditorGUILayout.HelpBox("It's recommended to specify in the 'Center' property above, the specific object used to position the target fx image (will be rendered under that object on the ground).", MessageType.Info); @@ -466,7 +458,6 @@ namespace HighlightPlus { EditorGUILayout.EndVertical(); } - EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.PropertyField(seeThrough); if (seeThrough.intValue != (int)SeeThroughMode.Never) { @@ -516,9 +507,6 @@ namespace HighlightPlus { } EditorGUILayout.PropertyField(seeThroughDepthOffset, new GUIContent("Depth Offset" + ((seeThroughDepthOffset.floatValue > 0) ? " •" : ""))); EditorGUILayout.PropertyField(seeThroughMaxDepth, new GUIContent("Max Depth" + ((seeThroughMaxDepth.floatValue > 0) ? " •" : ""))); - if (seeThroughDepthOffset.floatValue > 0 || seeThroughMaxDepth.floatValue > 0) { - CheckDepthTextureSupport("See-Through Depth Options"); - } EditorGUILayout.PropertyField(seeThroughIntensity, new GUIContent("Intensity")); EditorGUILayout.PropertyField(seeThroughTintColor, new GUIContent("Color")); EditorGUILayout.PropertyField(seeThroughTintAlpha, new GUIContent("Color Blend")); @@ -533,6 +521,7 @@ namespace HighlightPlus { } EditorGUILayout.PropertyField(seeThroughOrdered, new GUIContent("Ordered")); + EditorGUI.indentLevel--; } EditorGUILayout.EndVertical(); @@ -561,6 +550,7 @@ namespace HighlightPlus { } EditorGUILayout.EndVertical(); + if (serializedObject.ApplyModifiedProperties() || profileChanged || Event.current.commandName == "UndoRedoPerformed") { if (thisEffect.profile != null) { if (profileChanged) { @@ -583,22 +573,21 @@ namespace HighlightPlus { } void CheckVRSupport(int qualityLevel) { - if (qualityLevel == (int)QualityLevel.Highest && PlayerSettings.virtualRealitySupported) { + if (qualityLevel == (int)QualityLevel.Highest && VRCheck.IsActive()) { if (PlayerSettings.stereoRenderingPath != StereoRenderingPath.MultiPass) { EditorGUILayout.HelpBox("Highest Quality only supports VR Multi-Pass as CommandBuffers do not support this VR mode yet. Either switch to 'High Quality' or change VR Stereo mode to Multi-Pass.", MessageType.Error); } } } - void CheckDepthTextureSupport(string feature) { - if (pipe == null) return; - if (!pipe.supportsCameraDepthTexture) { - EditorGUILayout.HelpBox(feature + " requires Depth Texture support and currently it's not enabled in the Rendering Pipeline asset.", MessageType.Error); - if (pipe != null && GUILayout.Button("Go to Universal Rendering Pipeline Asset")) { - Selection.activeObject = pipe; + bool CheckForwardMSAA() { + if (QualitySettings.antiAliasing > 1) { + if (Camera.main != null && Camera.main.allowMSAA && !depthClip.boolValue) { + EditorGUILayout.HelpBox("Effect will be shown always on top due to MSAA. To enable depth clipping enable 'Depth Clip' option above OR disable MSAA in Quality Settings OR choose a different quality level.", MessageType.Info); + return false; } - EditorGUILayout.Separator(); } + return true; } static readonly int[] qualityValues = { 0, 3, 1, 2 }; diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightEffectEditor.cs.meta b/Assets/HighlightPlus/Editor/HighlightEffectEditor.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Editor/HighlightEffectEditor.cs.meta rename to Assets/HighlightPlus/Editor/HighlightEffectEditor.cs.meta index 4c1a7dc..7bceb10 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightEffectEditor.cs.meta +++ b/Assets/HighlightPlus/Editor/HighlightEffectEditor.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: be287539f47634552a716f0705710448 timeCreated: 1542886545 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightManagerEditor.cs b/Assets/HighlightPlus/Editor/HighlightManagerEditor.cs similarity index 83% rename from Assets/Plugins/HighlightPlus/Editor/HighlightManagerEditor.cs rename to Assets/HighlightPlus/Editor/HighlightManagerEditor.cs index d5b39f7..0885e2d 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightManagerEditor.cs +++ b/Assets/HighlightPlus/Editor/HighlightManagerEditor.cs @@ -53,16 +53,16 @@ namespace HighlightPlus { [MenuItem("GameObject/Effects/Highlight Plus/Create Manager", false, 10)] - static void CreateManager (MenuCommand menuCommand) { - HighlightManager manager = FindObjectOfType (); - if (manager == null) { - GameObject managerGO = new GameObject ("HighlightPlusManager"); - manager = managerGO.AddComponent (); - // Register root object for undo. - Undo.RegisterCreatedObjectUndo (manager, "Create Highlight Plus Manager"); - } - Selection.activeObject = manager; - } + static void CreateManager(MenuCommand menuCommand) { + HighlightManager manager = FindObjectOfType(); + if (manager == null) { + GameObject managerGO = new GameObject("HighlightPlusManager"); + manager = managerGO.AddComponent(); + // Register root object for undo. + Undo.RegisterCreatedObjectUndo(manager, "Create Highlight Plus Manager"); + } + Selection.activeObject = manager; + } } diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightManagerEditor.cs.meta b/Assets/HighlightPlus/Editor/HighlightManagerEditor.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Editor/HighlightManagerEditor.cs.meta rename to Assets/HighlightPlus/Editor/HighlightManagerEditor.cs.meta index 7edb76b..54195ce 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightManagerEditor.cs.meta +++ b/Assets/HighlightPlus/Editor/HighlightManagerEditor.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: ace58d1d278d649c98e5a2b5a066b3cd timeCreated: 1548711355 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightProfileEditor.cs b/Assets/HighlightPlus/Editor/HighlightProfileEditor.cs similarity index 94% rename from Assets/Plugins/HighlightPlus/Editor/HighlightProfileEditor.cs rename to Assets/HighlightPlus/Editor/HighlightProfileEditor.cs index e764ff9..312fedb 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightProfileEditor.cs +++ b/Assets/HighlightPlus/Editor/HighlightProfileEditor.cs @@ -1,4 +1,6 @@ -using UnityEditor; +using System.Collections; +using System.Collections.Generic; +using UnityEditor; using UnityEngine; namespace HighlightPlus { @@ -7,12 +9,11 @@ namespace HighlightPlus { [CanEditMultipleObjects] public class HighlightProfileEditor : Editor { - SerializedProperty effectGroup, effectGroupLayer, effectNameFilter, combineMeshes, alphaCutOff, cullBackFaces; + SerializedProperty effectGroup, effectGroupLayer, effectNameFilter, combineMeshes, alphaCutOff, cullBackFaces, depthClip, normalsOption; SerializedProperty overlay, overlayColor, overlayAnimationSpeed, overlayMinIntensity, overlayTexture, overlayTextureScale, overlayBlending; - SerializedProperty fadeInDuration, fadeOutDuration, constantWidth, normalsOption; - SerializedProperty outline, outlineColor, outlineWidth, outlineQuality, outlineDownsampling, outlineVisibility, outlineIndependent; - SerializedProperty glow, glowWidth, glowQuality, glowDownsampling, glowHQColor, glowDithering, glowMagicNumber1, glowMagicNumber2, glowAnimationSpeed; - SerializedProperty glowBlendPasses, glowVisibility, glowBlendMode, glowPasses, glowIgnoreMask; + SerializedProperty fadeInDuration, fadeOutDuration, constantWidth; + SerializedProperty outline, outlineColor, outlineWidth, outlineQuality, outlineDownsampling, outlineOptimalBlit, outlineVisibility, outlineIndependent; + SerializedProperty glow, glowWidth, glowQuality, glowOptimalBlit, glowDownsampling, glowHQColor, glowDithering, glowMagicNumber1, glowMagicNumber2, glowAnimationSpeed, glowVisibility, glowBlendMode, glowBlendPasses, glowPasses, glowIgnoreMask; SerializedProperty innerGlow, innerGlowWidth, innerGlowColor, innerGlowVisibility; SerializedProperty targetFX, targetFXTexture, targetFXColor, targetFXRotationSpeed, targetFXInitialScale, targetFXEndScale, targetFXScaleToRenderBounds; SerializedProperty targetFXAlignToGround, targetFXFadePower, targetFXGroundMaxDistance, targetFXGroundLayerMask, targetFXTransitionDuration, targetFXStayDuration, targetFXVisibility; @@ -28,6 +29,7 @@ namespace HighlightPlus { combineMeshes = serializedObject.FindProperty("combineMeshes"); alphaCutOff = serializedObject.FindProperty("alphaCutOff"); cullBackFaces = serializedObject.FindProperty("cullBackFaces"); + depthClip = serializedObject.FindProperty("depthClip"); normalsOption = serializedObject.FindProperty("normalsOption"); fadeInDuration = serializedObject.FindProperty("fadeInDuration"); fadeOutDuration = serializedObject.FindProperty("fadeOutDuration"); @@ -43,12 +45,14 @@ namespace HighlightPlus { outlineColor = serializedObject.FindProperty("outlineColor"); outlineWidth = serializedObject.FindProperty("outlineWidth"); outlineQuality = serializedObject.FindProperty("outlineQuality"); + outlineOptimalBlit = serializedObject.FindProperty("outlineOptimalBlit"); outlineDownsampling = serializedObject.FindProperty("outlineDownsampling"); outlineVisibility = serializedObject.FindProperty("outlineVisibility"); outlineIndependent = serializedObject.FindProperty("outlineIndependent"); glow = serializedObject.FindProperty("glow"); glowWidth = serializedObject.FindProperty("glowWidth"); glowQuality = serializedObject.FindProperty("glowQuality"); + glowOptimalBlit = serializedObject.FindProperty("glowOptimalBlit"); glowDownsampling = serializedObject.FindProperty("glowDownsampling"); glowHQColor = serializedObject.FindProperty("glowHQColor"); glowAnimationSpeed = serializedObject.FindProperty("glowAnimationSpeed"); @@ -108,8 +112,6 @@ namespace HighlightPlus { public override void OnInspectorGUI() { - serializedObject.Update(); - EditorGUILayout.Separator(); EditorGUILayout.LabelField("Highlight Options", EditorStyles.boldLabel); EditorGUILayout.PropertyField(effectGroup, new GUIContent("Include")); @@ -127,6 +129,7 @@ namespace HighlightPlus { EditorGUILayout.PropertyField(alphaCutOff); EditorGUILayout.PropertyField(cullBackFaces); EditorGUILayout.PropertyField(normalsOption); + EditorGUILayout.PropertyField(depthClip); EditorGUILayout.PropertyField(fadeInDuration); EditorGUILayout.PropertyField(fadeOutDuration); EditorGUILayout.PropertyField(cameraDistanceFade); @@ -151,12 +154,14 @@ namespace HighlightPlus { HighlightEffectEditor.QualityPropertyField(outlineQuality); if (outlineQuality.intValue == (int)QualityLevel.Highest) { EditorGUILayout.PropertyField(outlineDownsampling, new GUIContent("Downsampling")); + EditorGUILayout.PropertyField(outlineOptimalBlit, new GUIContent("Optimal Blit", "Blits result over a section of the screen instead of rendering to the full screen buffer.")); } if (outlineQuality.intValue == (int)QualityLevel.Highest && glowQuality.intValue == (int)QualityLevel.Highest) { EditorGUILayout.PropertyField(glowVisibility, new GUIContent("Visibility")); } else { EditorGUILayout.PropertyField(outlineVisibility, new GUIContent("Visibility")); } + EditorGUI.indentLevel--; } EditorGUILayout.EndVertical(); @@ -170,6 +175,7 @@ namespace HighlightPlus { if (glowQuality.intValue == (int)QualityLevel.Highest) { EditorGUILayout.PropertyField(glowDownsampling, new GUIContent("Downsampling")); EditorGUILayout.PropertyField(glowHQColor, new GUIContent("Color")); + EditorGUILayout.PropertyField(glowOptimalBlit, new GUIContent("Optimal Blit", "Blits result over a section of the screen instead of rendering to the full screen buffer.")); } EditorGUILayout.PropertyField(glowAnimationSpeed, new GUIContent("Animation Speed")); EditorGUILayout.PropertyField(glowVisibility, new GUIContent("Visibility")); @@ -270,7 +276,6 @@ namespace HighlightPlus { EditorGUI.indentLevel--; } EditorGUILayout.PropertyField(seeThroughOrdered, new GUIContent("Ordered")); - EditorGUI.indentLevel--; } EditorGUILayout.EndVertical(); diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightProfileEditor.cs.meta b/Assets/HighlightPlus/Editor/HighlightProfileEditor.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Editor/HighlightProfileEditor.cs.meta rename to Assets/HighlightPlus/Editor/HighlightProfileEditor.cs.meta index dfa2e44..ca1f349 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightProfileEditor.cs.meta +++ b/Assets/HighlightPlus/Editor/HighlightProfileEditor.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: b3b0e551d6f4f4f3987e8e5be2e89285 timeCreated: 1542886545 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs b/Assets/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs similarity index 87% rename from Assets/Plugins/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs rename to Assets/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs index 6b5ec62..75b72fe 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs +++ b/Assets/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs @@ -5,7 +5,7 @@ namespace HighlightPlus { [CustomEditor (typeof(HighlightSeeThroughOccluder))] public class HighlightSeeThroughOccluderEditor : Editor { - public override void OnInspectorGUI () { + public override void OnInspectorGUI () { EditorGUILayout.Separator (); EditorGUILayout.HelpBox ("This object will occlude any see-through effect.", MessageType.Info); DrawDefaultInspector (); diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs.meta b/Assets/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs.meta rename to Assets/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs.meta index 0edc1b0..c75b07a 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs.meta +++ b/Assets/HighlightPlus/Editor/HighlightSeeThroughOccluderEditor.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 11e725ecbe4d74569b232e1a0d57efba timeCreated: 1548711355 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightTriggerEditor.cs b/Assets/HighlightPlus/Editor/HighlightTriggerEditor.cs similarity index 87% rename from Assets/Plugins/HighlightPlus/Editor/HighlightTriggerEditor.cs rename to Assets/HighlightPlus/Editor/HighlightTriggerEditor.cs index a9c6fdf..ad40db5 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightTriggerEditor.cs +++ b/Assets/HighlightPlus/Editor/HighlightTriggerEditor.cs @@ -29,12 +29,12 @@ namespace HighlightPlus { public override void OnInspectorGUI() { - serializedObject.Update (); + serializedObject.Update(); - if (trigger.triggerMode == TriggerMode.RaycastOnThisObjectAndChildren) { - if (trigger.colliders == null || trigger.colliders.Length == 0) { - EditorGUILayout.HelpBox ("No collider found on this object or any of its children. Add colliders to allow automatic highlighting.", MessageType.Warning); - } + if (trigger.triggerMode == TriggerMode.RaycastOnThisObjectAndChildren) { + if (trigger.colliders == null || trigger.colliders.Length == 0) { + EditorGUILayout.HelpBox("No collider found on this object or any of its children. Add colliders to allow automatic highlighting.", MessageType.Warning); + } } else { #if ENABLE_INPUT_SYSTEM if (trigger.triggerMode == TriggerMode.ColliderEventsOnlyOnThisObject) { @@ -42,7 +42,7 @@ namespace HighlightPlus { } #endif if (trigger.GetComponent() == null) { - EditorGUILayout.HelpBox ("No collider found on this object. Add a collider to allow automatic highlighting.", MessageType.Error); + EditorGUILayout.HelpBox("No collider found on this object. Add a collider to allow automatic highlighting.", MessageType.Error); } } diff --git a/Assets/Plugins/HighlightPlus/Editor/HighlightTriggerEditor.cs.meta b/Assets/HighlightPlus/Editor/HighlightTriggerEditor.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Editor/HighlightTriggerEditor.cs.meta rename to Assets/HighlightPlus/Editor/HighlightTriggerEditor.cs.meta index fa1a714..8ed2128 100644 --- a/Assets/Plugins/HighlightPlus/Editor/HighlightTriggerEditor.cs.meta +++ b/Assets/HighlightPlus/Editor/HighlightTriggerEditor.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: eaf7f56fbcfa343efb5081d4309cb76b timeCreated: 1548711355 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/HighlightPlus/Editor/TransparentWithDepth.cs b/Assets/HighlightPlus/Editor/TransparentWithDepth.cs new file mode 100644 index 0000000..932f801 --- /dev/null +++ b/Assets/HighlightPlus/Editor/TransparentWithDepth.cs @@ -0,0 +1,132 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEditor; + +namespace HighlightPlus { + + public class TransparentWithDepth { + + static Material bmDepthOnly; + static Material bmDepthClipping; + + + [MenuItem ("GameObject/Effects/Highlight Plus/Add Depth To Transparent Object", false, 100)] + static void AddDepthOption () { + Renderer renderer = GetRenderer (); + if (renderer == null) + return; + + if (!EditorUtility.DisplayDialog("Add Depth to Transparent Object", "This option will force the transparent object to write to the depth buffer by adding a new special material to the renderer (existing materials are preserved) so it can occlude and allow See-Through effect.\nOnly use on transparent objects.\n\nProceed?", "Yes", "No")) { + return; + } + + Material[] materials = renderer.sharedMaterials; + for (int k = 0; k < materials.Length; k++) { + if (materials [k] == bmDepthOnly) { + EditorUtility.DisplayDialog ("Depth Support", "Already set! Nothing to do.", "Ok"); + return; + } + } + if (materials == null) { + renderer.sharedMaterial = bmDepthOnly; + } else { + List newMaterials = new List (materials); + newMaterials.Insert (0, bmDepthOnly); + renderer.sharedMaterials = newMaterials.ToArray (); + } + } + + + [MenuItem("GameObject/Effects/Highlight Plus/Make Transparent Object Compatible with Depth Clipping", false, 101)] + static void AddDepthClippingOption() { + Renderer renderer = GetRenderer(); + if (renderer == null) + return; + + if (!EditorUtility.DisplayDialog("Make Transparent Object Compatible with Depth Clipping", "This option will force the transparent object to write to _CameraDepthBuffer which is used by depth clip option (existing materials are preserved) so it can occlude outline and glow effects in High Quality mode.\nOnly use on transparent objects which need to occlude other outline / glow effects in high quality mode.\n\nProceed?", "Yes", "No")) { + return; + } + + Material[] materials = renderer.sharedMaterials; + for (int k = 0; k < materials.Length; k++) { + if (materials[k] == bmDepthClipping) { + EditorUtility.DisplayDialog("Depth Clipping Support", "Already set! Nothing to do.", "Ok"); + return; + } + } + if (materials == null) { + renderer.sharedMaterial = bmDepthClipping; + } else { + List newMaterials = new List(materials); + newMaterials.Insert(0, bmDepthClipping); + renderer.sharedMaterials = newMaterials.ToArray(); + } + } + + + [MenuItem("GameObject/Effects/Highlight Plus/Remove Depth Compatibility", false, 102)] + static void RemoveDepthOption() { + + Renderer renderer = GetRenderer(); + if (renderer == null) + return; + + bool found = false; + Material[] materials = renderer.sharedMaterials; + for (int k = 0; k < materials.Length; k++) { + if (materials[k] == bmDepthOnly || materials[k] == bmDepthClipping) { + materials[k] = null; + found = true; + } + } + if (found) { + List newMaterials = new List(); + for (int k = 0; k < materials.Length; k++) { + if (materials[k] != null) { + newMaterials.Add(materials[k]); + } + } + renderer.sharedMaterials = newMaterials.ToArray(); + return; + } + + EditorUtility.DisplayDialog("Depth Support", "This object was not previously modified! Nothing to do.", "Ok"); + } + + + static Renderer GetRenderer() { + + if (Selection.activeGameObject == null) { + EditorUtility.DisplayDialog("Depth Support", "This option can only be used on GameObjects.", "Ok"); + return null; + } + Renderer renderer = Selection.activeGameObject.GetComponent(); + if (renderer == null) { + EditorUtility.DisplayDialog("Depth Support", "This option can only be used on GameObjects with a Renderer component attached.", "Ok"); + return null; + } + + if (bmDepthOnly == null) { + bmDepthOnly = Resources.Load("HighlightPlus/HighlightPlusDepthWrite"); + if (bmDepthOnly == null) { + EditorUtility.DisplayDialog("Depth Support", "HighlightPlusDepthWrite material not found!", "Ok"); + return null; + } + } + + if (bmDepthClipping == null) { + bmDepthClipping = Resources.Load("HighlightPlus/HighlightPlusDepthClipComp"); + if (bmDepthClipping == null) { + EditorUtility.DisplayDialog("Depth Clipping Support", "HighlightPlusDepthClipComp material not found!", "Ok"); + return null; + } + } + + return renderer; + } + + + } +} \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Editor/TransparentWithDepth.cs.meta b/Assets/HighlightPlus/Editor/TransparentWithDepth.cs.meta similarity index 93% rename from Assets/Plugins/HighlightPlus/Editor/TransparentWithDepth.cs.meta rename to Assets/HighlightPlus/Editor/TransparentWithDepth.cs.meta index 7221edb..dcdeb20 100644 --- a/Assets/Plugins/HighlightPlus/Editor/TransparentWithDepth.cs.meta +++ b/Assets/HighlightPlus/Editor/TransparentWithDepth.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: be6e3be6d17ed49a3bd16d816815d6fd timeCreated: 1515683694 -licenseType: Store +licenseType: Pro MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/HighlightPlus/Editor/VRCheck.cs b/Assets/HighlightPlus/Editor/VRCheck.cs new file mode 100644 index 0000000..cb900b5 --- /dev/null +++ b/Assets/HighlightPlus/Editor/VRCheck.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; +using UnityEngine.XR; + +namespace HighlightPlus { + public static class VRCheck { + +#if UNITY_2019_3_OR_NEWER + + static List displaysDescs = new List(); + static List displays = new List(); + + public static bool IsActive() { + displaysDescs.Clear(); + SubsystemManager.GetSubsystemDescriptors(displaysDescs); + + // If there are registered display descriptors that is a good indication that VR is most likely "enabled" + return displaysDescs.Count > 0; + } + + public static bool IsVrRunning() { + bool vrIsRunning = false; + displays.Clear(); + SubsystemManager.GetInstances(displays); + foreach (var displaySubsystem in displays) { + if (displaySubsystem.running) { + vrIsRunning = true; + break; + } + } + + return vrIsRunning; + } +#else + public static bool IsActive() { + return PlayerSettings.virtualRealitySupported; + } + + public static bool IsVrRunning() { + return Application.isPlaying && PlayerSettings.virtualRealitySupported; + } +#endif + + } + +} \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusRenderPassFeature.cs.meta b/Assets/HighlightPlus/Editor/VRCheck.cs.meta similarity index 83% rename from Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusRenderPassFeature.cs.meta rename to Assets/HighlightPlus/Editor/VRCheck.cs.meta index 3af9ec8..9ff75fa 100644 --- a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusRenderPassFeature.cs.meta +++ b/Assets/HighlightPlus/Editor/VRCheck.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 473a86c9e274347dfbdde619584cebe9 +guid: e692cbce37dc14e29b436d0c876f45dc MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/HighlightPlus/README.txt b/Assets/HighlightPlus/README.txt similarity index 55% rename from Assets/Plugins/HighlightPlus/README.txt rename to Assets/HighlightPlus/README.txt index ee0d6fb..3266faa 100644 --- a/Assets/Plugins/HighlightPlus/README.txt +++ b/Assets/HighlightPlus/README.txt @@ -1,30 +1,10 @@ -************************************** +************************************** * HIGHLIGHT PLUS * * Created by Ramiro Oliva (Kronnect) * * README FILE * ************************************** -Notice about Universal Rendering Pipeline ------------------------------------------ -This package is designed for URP. -It requires Unity 2019.3 and URP 7.1.6 or later -To install the plugin correctly: - -1) Make sure you have Universal Rendering Pipeline asset installed (from Package Manager). -2) Go to Project Settings / Graphics. -3) Double click the Universal Rendering Pipeline asset. -4) Double click the Forward Renderer asset. -5) Click "+" to add the Highlight Plus Renderer Feature to the list of the Forward Renderer Features. - -Note: URP assets can be assigned to Settings / Graphics and also Settings / Quality. Check both sections! - -You can also find a HighlightPlusForwardRenderer asset in the Highlight Plus / Pipelines / URP folder. -Make sure the Highlight Plus Scriptable Renderer Feature is listed in the Renderer Features of the Forward Renderer in the pipeline asset. - -Video instructions: https://youtu.be/EgyBs8v9aRI - - Quick help: how to use this asset? ---------------------------------- @@ -52,7 +32,6 @@ Quick help: how to use this asset? - Help & Support Forum -------------------- @@ -67,6 +46,14 @@ If you like Highlight Plus, please rate it on the Asset Store. It encourages us +Universal Rendering Pipeline +---------------------------- + +Customers can download a specific version of Highlight Plus designed for Universal Rendering Pipeline for free from our support forum on https://kronnect.com +Please sign up on the forum and send a pm to "Kronnect" or email to contact@kronnect.com to get access to the private board. + +The Unity Asset Store currently does not allow you to select which package according to the pipeline to download so we have to offer this way so you can download it. + Future updates -------------- @@ -97,15 +84,14 @@ Version 8.5 - Improved outline effect when combining "Independent" option with many elements in "Children" selection - Improved see-through border only effect -Version 8.4.1 -- [Fix] Fixed unnecessary memory allocation in the render feature - Version 8.4 - Added "Border Only" option to See-Through effect +- Outline/glow shape now properly cuts when partially occluded (instead of following the shape of the occluder) - Adding a Highlight Effect component to a parent no longer deactivates highlighted children Version 8.3 -- Upgraded to Unity 2020.3.16 as minimum +- Upgraded to Unity 2020.3.16 +- [Fix] Fixed outline/glow render issue when MSAA is enabled Version 8.2 - Added "Ignore Mask" option to glow. Can be used to render the glow effect alone @@ -114,18 +100,12 @@ Version 8.2 Version 8.1 - Selection state is now visible in inspector (used only by trigger and manager components) -- [Fix] Fixed outer glow not showing in higher quality with visibility set to normal and orthographic camera - [Fix] Fixed mobile input using the new input system - [Fix] Fixed outline settings mismatch when using a combination of Highlight Trigger and Manager Version 8.0 - Added SelectObject / ToggleObject / UnselectObject methods to Highlight Manager -- Added ability to apply custom sorting to effects (check documentation: Custom sorting section) -- Independent option is now moved to Highlight Options section and affects both outline and glow -- Added "Clear Stencil" option to Highlight Plus Render Feature (useful to solve compatibility with other assets that use stencil buffers) - -Version 7.9.2 -- [Fix] Fixed an issue in Unity 2021.2 when using MSAA and High Quality outline/glow +- Added ability to control rendering order of effects (check documentation: Custom sorting section) Version 7.9.1 - Default values for all effects are now 0 (disabled) except outline so desired effects must be enabled. This option allows you to ensure no extra/undesired effects are activated by mistake @@ -159,9 +139,6 @@ Version 7.6 Version 7.5.2 - [Fix] See-through is now visible when using glow/outline/inner glow with Always Visible option -Version 7.5.1 -- [Fix] Fixed regression bug with Outline in High Quality mode - Version 7.5 - Added new HitFX style: "Local Hit" - Added new demo scene showcasing the HitFx variations @@ -177,16 +154,18 @@ Version 7.1 Version 7.0.2 - Memory optimizations +Version 7.0.1 +- [Fix] Highest quality outline/glow fixes on mobile + Version 7.0 - Added support for Single Pass Instanced - Internal improvements and fixes Version 6.9 -- Added "Ordered" option to see-through -- Removed "Non Overlap" option from see-through as now it pervents overdraw by default +- Internal improvements to see-through Version 6.8 -- Improvements to see-through rendering order +- Changed see-through effect rendering order to improve support with other stencil effects - [Fix] Fixed properties not being reflected in scene immediately when invoking Undo Version 6.7 @@ -198,9 +177,6 @@ Version 6.6 - Added "SeeThrough Non Overlap" option. Enable it only if the see-through effect produces flickering due to overlapping geometry in the hidden object - [Fix] Fixed properties not being reflected in scene immediately when invoking Undo -Version 6.5.2 -- Added inspector tooltips and improved documentation - Version 6.5.1 - Calling ProfileLoad() method will now assign that profile to the highlight effect component in addition to loading its values - Prevents _Time overflow which can cause glitching on some Android devices @@ -235,49 +211,48 @@ Version 6.0 - Inspector: sections can be now collapsed to reduce screen space - API: added OnObjectSelected / OnObjectUnSelected events -Version 5.5 4/Apr/2021 -- [Fix] Fixed glow overlay when MSAA is disabled on Windows +Version 5.5 +- Added "Planar" mode to Normals option. Best choice for highlighting 2D meshes (quad/planes) Version 5.4 5/Feb/2021 - Added Visibility option to targete effect - Stencil mask is no longer computed when only overlay or inner glow is used improving performance -Version 5.3.4 22/01/2021 +Version 5.3.5 22/Jan/2021 +- Added "CustomVertexTransform.cginc" file which can be used to include user-defined vertex transformations - Optimizations to material setters -- [Fix] Fixed outline color issue with quality level set to medium + +Version 5.3.4 +- Improvements to combine meshes option Version 5.3.3 - Effects now reflect object transform changes when combines meshes option is enabled +Version 5.3.2 +- Memory optimizations + +Version 5.3.1 +- Optimizations and fixes + Version 5.3 - Added "Combine Meshes" option to profile -- Optimizations and fixes Version 5.2 - Added "Object Name Filter" option to profile -Version 5.1 -- Added "Border When Hidden" effect (outline when see-through triggers) - -Version 5.0.1 -- Added support for Unity 2020.2 beta - Version 5.0 - API: added "TargetFX" method to programmatically start the target effect -- Added support for double-sided shader effects +- [Fix] Depth Clip option can now be used on mobile even with visibility set to Always On Top Version 4.9 - Added "Medium" quality level -Version 4.8.2 -- [Fix] Fixed issue with outline set to fastest and glow using highest in latest URP version - Version 4.8.1 -- [Fix] Fixed issue with outline/glow when overlay cameras are present on the stack +- [Fix] Fixed outline/glow issue on iOS when using Highest Quality mode in Unity 2010.1 Version 4.8 - Added "Outer Glow Blend Passes" option -- [Fix] Fixed outline & glow issue with alpha cutout when using non-highest quality mode +- Added support for HDR colors Version 4.7 - Added "Normals Option" with Smooth, Preserve and Reorient variants to improve results @@ -288,34 +263,189 @@ Version 4.6 - Added "SubMesh Mask" which allows to exclude certain submeshes - [Fix] Fixed shader compilation issue with Single Pass Instanced mode enabled +Version 4.5 +- Added "Preserve Original Mesh" option to inspector and profile + Version 4.4 -- Exposed "Smooth Normals" option in inspector. - -Version 4.3.2 - Added HitFX effect +- Improved quality of outer glow when using Highest Quality mode - Improvements to SeeThrough Occluder when Detection Mode is set to RayCast - -Version 4.3.1 -- [Fix] Fixed issue with Highlight Effect Occluder script - -Version 4.3 -- Added GPU instancing support for outline / outer glow effects - -Version 4.2.2 -- [Fix] Fixed effect being rendered when object is outside of frustum camera - -Version 4.2.1 -- Profile: added "Constant Width" property -- Enabled HDR color picker to Color properties -- [Fix] Fixed missing outline with flat surfaces like quads under certain angles +- API: added SetTargets(transform, renderers) +- API: added static method HighlightEffect.DrawEffectsNow() to force render all effects on demand Version 4.2 -- Glow/Outline downsampling option added to profiles -- [Fix] Removed VR API usage console warning +- Added GPU Instancing support for outline / glow effects +- Highlight Trigger: added volume collision detection + +Version 4.1.1 +- [Fix] Fixed issue with grouped objects when independent option is enabled and Highest Quality outer glow or outline is used Version 4.1 -- Added Outline Independent option -- [Fix] Fixed error when highlight script is added to an empty gameobject +- Improved "Outline Independent" option for Highest Quality Mode +- Consistency: enabling "Outline Independent" in Highest Quality Mode now also affects Outer Glow is used Version 4.0 -- Support for URP Scriptable Rendering Feature +- Start up peformance & memory allocation optimizations +- Added "Independent" support to outline in Highest Quality mode +- Added "Make Transparent Object Compatible With Depth Clip" option + +Version 3.9 +- Added "Depth Clip" option (only applies to HQ outline/glow effects) + +Version 3.8 +- Glow/Outline downsampling and glow blend mode option added to profiles +- [Fix] Fixed an issue which marked the scene as dirty +- [Fix] Removed VR API usage console warning + +Version 3.7 +- See Through: added "Occluder Mask" option. When set to a custom layer, it performs a BoxCast check to ensure only objects in the specific layers are occluding the target. Customize this behaviour using the Radius Threshold and Check Interval settings. +- Added "Max Distance" to Highlight Trigger +- Reduced allocations when averaging normals +- [Fix] Fixed flickering of outer glow when used in Highest quality with thin objects + +Version 3.6 +- Added "Outline Independent" option. Shows full outline regardless of any other highlighted object behind. + +Version 3.5 +- Improved quality of Outline effect when quality level is set to Highest +- Added "SeeThrough Border" feature +- Added "Blend Mode" option to Outer Glow for highest quality level +- [Fix] Fixed issue during Prefab editor mode + +Version 3.4.4 +- Added option in occluder script to use raycast instead of stencil buffer to cancel see-through (useful for avoiding terrain triggering see-through effect) +- [Fix] Fixed see-through in deferred rendering path + +Version 3.4.2 +- [Fix] Fixed an issue when adding the effect at runtime with outline/glow in higuest quality + +Version 3.4.1 +- [Fix] Fixed occluder objects removing glow effect when placed in the background +- [Fix] Added missing SeeThrough noise option to Highlight Profile asset + +Version 3.4 +- Added LayerInChildren option to "Include" filter +- Improved occluder system +- [Fix] Prevent an error when the mesh normals count does not match the vertex count + +Version 3.3 +- Outline, Glow and Inner Glow "Always On Top" option expanded to "Normal", "Always On Top" or "Only When Occluded" +- Added Noise slider to See-Through effect + +Version 3.2.4 +- [Fix] Fixed flickering issue when combining mesh & skinned mesh renderers + +Version 3.2.3 +- General improvements and fixes + +Version 3.2.2 +- [Fix] Fixed issue when trying to read normals from a non-readable mesh + +Version 3.2.1 +- [Fix] Fixed glow disappearing when object crosses camera near clip + +Version 3.2 +- Added "Reflection Probes" option +- Internal improvements and fixes + +Version 3.1 +- Added "Constant Width" option to Glow/Outline in Fastest/High quality level +- Added "Optimal Blit" option to Glow/Outline with Debug View + +Version 3.0.2 +- API: added proxy methods ProfileLoad, ProfileReload, ProfileSaveChanges to load/store profile settings at runtime. You can also load/save changes between effect and profile using the Load/Save methods on the profile object itself. + +Version 3.0.1 +- [Fix] Fixed an exception when glow was enabled, outline disabled in highest quality level + +Version 3.0 +- Added HQ Highest quality glow and outline options +- Added "Include" option to choose which objects are affected by the effects (same gameobject, children, root to children, or many objects in layer) +- Added "Alpha CutOff" + +Version 2.6.1 +- Minor internal improvements + +Version 2.6 +- Added Target effect +- Improved performance on Skinned Mesh Renderers. Slightly improved performance on normal renderers. + +Version 2.5.2 +- [Fix] Fixed issue with HQ Outer Glow not showing when there's multiple selected objects parented to the same object + +Version 2.5.1 +- Added support for orthographic camera + +Version 2.5 +- Added support for VR Single Pass Instanced +- Minor improvements and fixes + +Version 2.4 +- New HighlightSeeThroughOccluder script. Add it to any object to cancel any see-through effect +- Added "Fade In Duration" / "Fade Out Duration" to create smooth transition states +- Added "Glow HQ" to produce better outer glow on certain shapes +- Added "OnRendererHighlightStart" event +- API: added "OverlayOnShot" method for impact effects + +Version 2.3 +- Added "Raycast Source" to Highlight Trigger and Manager components +- Added "Skinned Mesh Bake Mode" to optimize highlight on many models + +Version 2.2 +- Added "Always On Top" option to Outline, Outer and Inner Glow +- Added "Trigger Mode" to Highlight Trigger to support complex objects + +Version 2.1 +- Added "Outline HQ" to inspector. Creates a better outline on certain shapes +- Added "Ignore Object Visibility" to enable effects on disabled renderers or hidden objects + +Version 2.0 +- Profiles. Store/load/share settings across different objects. +- [Fix] Fixed issue when copying component values between two objects +- [Fix] Fixed effects ignoring culling mask on additional cameras + +Version 1.5 +- Added "Inner Glow" effect + +Version 1.4 +- Added "Overlay Min Intensity" and "Overlay Blending" options +- Added "Ignore" option +- Minor improvements & fixes + +Version 1.3 +- Added option to add depth compatibility for transparent shaders + +Version 1.2.4 +- [Fix] Fix for multiple skinned models +- [Fix] Fix for scaled skinned models + +Version 1.2.3 +- [Fix] Fixes for Steam VR + +Version 1.2.1 +- Internal improvements and fixes + +Version 1.2.1 +- [Fix] Fixed script execution order issue with scripts changing transform in LateUpdate() + +Version 1.2 +- Support for LOD groups + +Version 1.1 +- Redesigned editor inspector +- Minor improvements + +Version 1.0.4 +- Supports meshes with negative scales + +Version 1.0.3 +- Support for multiple submeshes + +Version 1.0.2 +- [Fix] Fixed scale issue with grouped objects + +Version 1.0.1 +- Supports combined meshes + +Version 1.0 - Nov/2018 +- Initial release diff --git a/Assets/Plugins/HighlightPlus/README.txt.meta b/Assets/HighlightPlus/README.txt.meta similarity index 89% rename from Assets/Plugins/HighlightPlus/README.txt.meta rename to Assets/HighlightPlus/README.txt.meta index a386b10..66f5cba 100644 --- a/Assets/Plugins/HighlightPlus/README.txt.meta +++ b/Assets/HighlightPlus/README.txt.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 53265a9967ed548efaf71f5807638781 timeCreated: 1542901568 -licenseType: Store +licenseType: Pro TextScriptImporter: userData: assetBundleName: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources.meta b/Assets/HighlightPlus/Resources.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources.meta rename to Assets/HighlightPlus/Resources.meta index 7a6440c..7c6c2dc 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources.meta +++ b/Assets/HighlightPlus/Resources.meta @@ -2,7 +2,7 @@ fileFormatVersion: 2 guid: 3a476022645d74299b862c36d0daa1df folderAsset: yes timeCreated: 1542876301 -licenseType: Store +licenseType: Pro DefaultImporter: userData: assetBundleName: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus.meta b/Assets/HighlightPlus/Resources/HighlightPlus.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus.meta rename to Assets/HighlightPlus/Resources/HighlightPlus.meta index 85f2d99..e3104c5 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus.meta @@ -2,7 +2,7 @@ fileFormatVersion: 2 guid: 6bd97436761b94109a0785ed6823647c folderAsset: yes timeCreated: 1542893576 -licenseType: Store +licenseType: Pro DefaultImporter: userData: assetBundleName: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/CustomVertexTransform.cginc b/Assets/HighlightPlus/Resources/HighlightPlus/CustomVertexTransform.cginc similarity index 100% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/CustomVertexTransform.cginc rename to Assets/HighlightPlus/Resources/HighlightPlus/CustomVertexTransform.cginc diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/CustomVertexTransform.cginc.meta b/Assets/HighlightPlus/Resources/HighlightPlus/CustomVertexTransform.cginc.meta similarity index 80% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/CustomVertexTransform.cginc.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/CustomVertexTransform.cginc.meta index 00350b8..62d91ea 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/CustomVertexTransform.cginc.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/CustomVertexTransform.cginc.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 26b31a85c4f4c4b11850968651dddfeb +guid: e25b1281ec6724b028e33a5df5a3f266 ShaderImporter: externalObjects: {} defaultTextures: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightAddDepth.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepth.shader similarity index 100% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightAddDepth.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepth.shader diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightAddDepth.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepth.shader.meta similarity index 91% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightAddDepth.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepth.shader.meta index 1857474..123e669 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightAddDepth.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepth.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 058a572e30b2d446bade2dda32bcef0f timeCreated: 1515682635 -licenseType: Store +licenseType: Pro ShaderImporter: externalObjects: {} defaultTextures: [] diff --git a/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepthClip.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepthClip.shader new file mode 100644 index 0000000..a7961f2 --- /dev/null +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepthClip.shader @@ -0,0 +1,43 @@ +Shader "HighlightPlus/Geometry/DepthClipComp" +{ + Properties + { + } + SubShader + { + Pass { + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 2.0 + #pragma multi_compile_shadowcaster + #pragma multi_compile_instancing + #include "UnityCG.cginc" + + struct v2f { + V2F_SHADOW_CASTER; + UNITY_VERTEX_OUTPUT_STEREO + }; + + v2f vert( appdata_base v ) { + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + TRANSFER_SHADOW_CASTER_NORMALOFFSET(o) + return o; + } + + float4 frag( v2f i ) : SV_Target { + SHADOW_CASTER_FRAGMENT(i) + } + ENDCG + + } + + } + +} + diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughBorder.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepthClip.shader.meta similarity index 67% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughBorder.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepthClip.shader.meta index 202bec6..ad6f592 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughBorder.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightAddDepthClip.shader.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: fe0a98aa774224cf1bc4a800a586a33a +guid: 0917f634da79a4983ad78bac83d5a715 ShaderImporter: externalObjects: {} defaultTextures: [] - nonModifiableTextures: [] userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurGlow.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurGlow.shader similarity index 80% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurGlow.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurGlow.shader index 338b5dc..aba3ecf 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurGlow.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurGlow.shader @@ -1,5 +1,6 @@ Shader "HighlightPlus/Geometry/BlurGlow" { Properties { + _MainTex ("Texture", Any) = "white" {} _Color ("Color", Color) = (1,1,0) // not used; dummy property to avoid inspector warning "material has no _Color property" _BlurScale("Blur Scale", Float) = 2.0 _Speed("Speed", Float) = 1 @@ -17,7 +18,6 @@ Properties { float4 _MainTex_TexelSize; float4 _MainTex_ST; float _BlurScale, _Speed; - float _AspectRatio; struct appdata { float4 vertex : POSITION; @@ -41,13 +41,15 @@ Properties { UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.pos = v.vertex; - o.pos.y *= _ProjectionParams.x; - - o.uv = v.texcoord; - float3 offsets = _MainTex_TexelSize.xyx * float3(1, _AspectRatio, -1); - + o.pos = UnityObjectToClipPos(v.vertex); + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) { + // Texture is inverted WRT the main texture + v.texcoord.y = 1.0 - v.texcoord.y; + } + #endif + o.uv = v.texcoord; + float3 offsets = _MainTex_TexelSize.xyx * float3(1,1,-1); o.uv1 = v.texcoord - offsets.xy; o.uv2 = v.texcoord - offsets.zy; o.uv3 = v.texcoord + offsets.zy; @@ -61,10 +63,13 @@ Properties { UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.pos = v.vertex; - o.pos.y *= _ProjectionParams.x; - + o.pos = UnityObjectToClipPos(v.vertex); + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) { + // Texture is inverted WRT the main texture + v.texcoord.y = 1.0 - v.texcoord.y; + } + #endif float animatedWidth = _BlurScale * (1.0 + 0.25 * sin(_Time.w * _Speed)); o.uv = v.texcoord; float2 inc = float2(_MainTex_TexelSize.x * 1.3846153846 * animatedWidth, 0); @@ -81,11 +86,14 @@ Properties { UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.pos = v.vertex; - o.pos.y *= _ProjectionParams.x; - - float animatedWidth = _AspectRatio * _BlurScale * (1.0 + 0.25 * sin(_Time.w * _Speed)); + o.pos = UnityObjectToClipPos(v.vertex); + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) { + // Texture is inverted WRT the main texture + v.texcoord.y = 1.0 - v.texcoord.y; + } + #endif + float animatedWidth = _BlurScale * (1.0 + 0.25 * sin(_Time.w * _Speed)); o.uv = v.texcoord; float2 inc = float2(0, _MainTex_TexelSize.y * 1.3846153846 * animatedWidth); o.uv1 = v.texcoord - inc; diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurGlow.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurGlow.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurGlow.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurGlow.shader.meta index 32335c2..365d4fc 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurGlow.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurGlow.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 84c84ee93ec484bdda371ffbdebfcc7c timeCreated: 1556874239 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurOutline.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurOutline.shader similarity index 73% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurOutline.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurOutline.shader index 5cc8499..4e07846 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurOutline.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurOutline.shader @@ -1,34 +1,36 @@ Shader "HighlightPlus/Geometry/BlurOutline" { Properties { + _MainTex ("Texture", Any) = "white" {} _Color ("Color", Color) = (1,1,0) // not used; dummy property to avoid inspector warning "material has no _Color property" _BlurScale("Blur Scale", Float) = 2.0 } SubShader { + Tags { "Queue"="Transparent+100" "RenderType"="Transparent" } ZTest Always ZWrite Off Cull Off CGINCLUDE - #include "UnityCG.cginc" + #include "UnityCG.cginc" - UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); - float4 _MainTex_TexelSize; - float4 _MainTex_ST; + UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); + float4 _MainTex_TexelSize; + float4 _MainTex_ST; float _BlurScale; - float _AspectRatio; struct appdata { - float4 vertex : POSITION; - float2 texcoord : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID + float4 vertex : POSITION; + float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID }; - struct v2fCross { - float4 pos : SV_POSITION; - float2 uv: TEXCOORD0; - float2 uv1: TEXCOORD1; - float2 uv2: TEXCOORD2; + + struct v2fCross { + float4 pos : SV_POSITION; + float2 uv: TEXCOORD0; + float2 uv1: TEXCOORD1; + float2 uv2: TEXCOORD2; float2 uv3: TEXCOORD3; float2 uv4: TEXCOORD4; UNITY_VERTEX_INPUT_INSTANCE_ID @@ -40,12 +42,15 @@ Properties { UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.pos = v.vertex; - o.pos.y *= _ProjectionParams.x; - - o.uv = v.texcoord; - float3 offsets = _MainTex_TexelSize.xyx * float3(1, _AspectRatio, -1); + o.pos = UnityObjectToClipPos(v.vertex); + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) { + // Texture is inverted WRT the main texture + v.texcoord.y = 1.0 - v.texcoord.y; + } + #endif + o.uv = v.texcoord; + float3 offsets = _MainTex_TexelSize.xyx * float3(1,1,-1); o.uv1 = v.texcoord - offsets.xy; o.uv2 = v.texcoord - offsets.zy; o.uv3 = v.texcoord + offsets.zy; @@ -59,11 +64,14 @@ Properties { UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.pos = v.vertex; - o.pos.y *= _ProjectionParams.x; + o.pos = UnityObjectToClipPos(v.vertex); + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) { + // Texture is inverted WRT the main texture + v.texcoord.y = 1.0 - v.texcoord.y; + } + #endif o.uv = v.texcoord; - float2 inc = float2(_MainTex_TexelSize.x * 1.3846153846 * _BlurScale, 0); o.uv1 = v.texcoord - inc; o.uv2 = v.texcoord + inc; @@ -78,10 +86,13 @@ Properties { UNITY_SETUP_INSTANCE_ID(v); UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - o.pos = v.vertex; - o.pos.y *= _ProjectionParams.x; - + o.pos = UnityObjectToClipPos(v.vertex); + #if UNITY_UV_STARTS_AT_TOP + if (_MainTex_TexelSize.y < 0) { + // Texture is inverted WRT the main texture + v.texcoord.y = 1.0 - v.texcoord.y; + } + #endif o.uv = v.texcoord; float2 inc = float2(0, _MainTex_TexelSize.y * 1.3846153846 * _BlurScale); o.uv1 = v.texcoord - inc; @@ -141,6 +152,5 @@ Properties { ENDCG } - - } + } } \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurOutline.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurOutline.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurOutline.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurOutline.shader.meta index 31a942b..93ce1e8 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightBlurOutline.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightBlurOutline.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 74f3491dcf1224f0c91238381c035439 timeCreated: 1556874239 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightClearStencil.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightClearStencil.shader similarity index 95% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightClearStencil.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightClearStencil.shader index b8c0c99..f719316 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightClearStencil.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightClearStencil.shader @@ -15,7 +15,7 @@ Cull Off ColorMask 0 - Pass // clear stencil full screen + Pass // Ordered full screen { CGPROGRAM #pragma vertex vert @@ -53,7 +53,7 @@ ENDCG } - Pass // clear stencil object-space + Pass // Ordered object-space { CGPROGRAM #pragma vertex vert diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightClearStencil.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightClearStencil.shader.meta similarity index 67% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightClearStencil.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightClearStencil.shader.meta index 3915251..d7237e9 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightClearStencil.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightClearStencil.shader.meta @@ -1,9 +1,8 @@ fileFormatVersion: 2 -guid: 844773224daae4c31a9160897f833c5b +guid: 632d26701d1f14d9ab2950021e6fed87 ShaderImporter: externalObjects: {} defaultTextures: [] - nonModifiableTextures: [] userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeGlow.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeGlow.shader similarity index 94% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeGlow.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeGlow.shader index 99450e5..3bb5e69 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeGlow.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeGlow.shader @@ -12,7 +12,7 @@ Properties { } SubShader { - Tags { "Queue"="Transparent+102" "RenderType"="Transparent" "DisableBatching" = "True" } + Tags { "Queue"="Transparent+102" "RenderType"="Transparent" } Blend [_BlendSrc] [_BlendDst] // Compose effect on camera target @@ -25,8 +25,8 @@ Properties { Ref 2 Comp [_GlowStencilComp] Pass keep - ReadMask 2 - WriteMask 2 + ReadMask 2 + WriteMask 2 } CGPROGRAM @@ -50,7 +50,6 @@ Properties { { float4 pos: SV_POSITION; float4 scrPos: TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; @@ -59,7 +58,6 @@ Properties { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_OUTPUT(v2f, o); - UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = UnityObjectToClipPos(v.vertex); o.scrPos = ComputeScreenPos(o.pos); @@ -69,7 +67,6 @@ Properties { fixed4 frag (v2f i) : SV_Target { - UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); fixed4 glow = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_HPComposeGlowFinal, i.scrPos.xy/i.scrPos.w); fixed4 color = _Color; @@ -136,7 +133,6 @@ Properties { fixed4 frag(v2f i) : SV_Target { - UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); fixed4 glow = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv); fixed4 color = _Color; diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeGlow.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeGlow.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeGlow.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeGlow.shader.meta index 186a4c9..685907e 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeGlow.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeGlow.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 975a91ee935da4d9c8a3e807fecd8047 timeCreated: 1544699251 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeOutline.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeOutline.shader similarity index 93% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeOutline.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeOutline.shader index 35d8a65..b80cf1e 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeOutline.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeOutline.shader @@ -9,7 +9,7 @@ Properties { } SubShader { - Tags { "Queue" = "Transparent+120" "RenderType" = "Transparent" "DisableBatching" = "True" } + Tags { "Queue" = "Transparent+120" "RenderType" = "Transparent" } Blend SrcAlpha OneMinusSrcAlpha // Compose effect on camera target (optimal quad blit) @@ -48,7 +48,6 @@ SubShader { float4 pos: SV_POSITION; float4 scrPos: TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; @@ -57,7 +56,6 @@ SubShader v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_OUTPUT(v2f, o); - UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = UnityObjectToClipPos(v.vertex); o.scrPos = ComputeScreenPos(o.pos); @@ -67,7 +65,6 @@ SubShader fixed4 frag (v2f i) : SV_Target { - UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); fixed4 outline = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_HPComposeOutlineFinal, i.scrPos.xy/i.scrPos.w); fixed4 color = _Color; @@ -83,7 +80,7 @@ SubShader Pass { ZWrite Off - ZTest Always //[_ZTest] + ZTest Always // [_ZTest] Cull Off // [_Cull] Stencil { Ref 2 @@ -93,7 +90,6 @@ SubShader WriteMask 2 } - CGPROGRAM #pragma vertex vert #pragma fragment frag @@ -125,7 +121,6 @@ SubShader v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_OUTPUT(v2f, o); - UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = UnityObjectToClipPos(v.vertex); o.uv = UnityStereoScreenSpaceUVAdjust(v.uv, _MainTex_ST); @@ -135,7 +130,6 @@ SubShader fixed4 frag(v2f i) : SV_Target { - UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); fixed4 outline = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv); fixed4 color = _Color; diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeOutline.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeOutline.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeOutline.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeOutline.shader.meta index ced1aa1..8d27750 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightComposeOutline.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightComposeOutline.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 0a6de74b6cfa9440182f8f56e4a0e4f1 timeCreated: 1544699251 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.mat b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.mat similarity index 69% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.mat rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.mat index 8d5f4ce..202a9ca 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.mat +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.mat @@ -19,11 +19,19 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: + - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - _BumpMap: + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} @@ -43,53 +51,34 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - _SpecGlossMap: + - _ParallaxMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - - _AlphaClip: 0 - - _Blend: 0 - _BumpScale: 1 - _ConstantWidth: 1 - _Cull: 2 - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 - _DstBlend: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 - _GlowZTest: 4 - _Metallic: 0 + - _Mode: 0 - _OcclusionStrength: 1 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 + - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _Surface: 0 - - _WorkflowMode: 1 + - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - - _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _Glow: {r: 1, g: 0.025, b: 0.75, a: 0.5} - _Glow2: {r: 0.01, g: 1, b: 0.5, a: 0} - _GlowColor: {r: 1, g: 1, b: 1, a: 1} - _GlowDirection: {r: 1, g: 1, b: 0, a: 1} - - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} ---- !u!114 &8957597210722627563 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 1 diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.mat.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.mat.meta similarity index 64% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.mat.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.mat.meta index 43f7b20..4565bca 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.mat.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.mat.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 41672e7b4c6544aedbffb9e271c7ef7c +guid: 60e964940a24547a585c3ffff7e52e9b NativeFormatImporter: externalObjects: {} - mainObjectFileID: 0 + mainObjectFileID: 2100000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.shader similarity index 83% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.shader index 560e656..3fe23cc 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.shader @@ -1,13 +1,15 @@ -Shader "HighlightPlus/Geometry/Glow" { +Shader "HighlightPlus/Geometry/Glow" { Properties { _MainTex ("Texture", Any) = "white" {} + _Glow ("Glow", Vector) = (1, 0.025, 0.75, 0.5) _Glow2 ("Glow2", Vector) = (0.01, 1, 0.5, 0) + _GlowColor ("Glow Color", Color) = (1,1,1) _Color ("Color", Color) = (1,1,1) // not used; dummy property to avoid inspector warning "material has no _Color property" + _GlowDirection("GlowDir", Vector) = (1,1,0) _Cull ("Cull Mode", Int) = 2 _ConstantWidth ("Constant Width", Float) = 1 _GlowZTest ("ZTest", Int) = 4 _GlowStencilOp ("Stencil Operation", Int) = 0 - _CutOff("CutOff", Float ) = 0.5 _GlowStencilComp ("Stencil Comp", Int) = 6 } SubShader @@ -33,7 +35,6 @@ Properties { #pragma vertex vert #pragma fragment frag #pragma multi_compile_instancing - #pragma multi_compile_local _ HP_ALPHACLIP #include "UnityCG.cginc" #include "CustomVertexTransform.cginc" @@ -41,7 +42,6 @@ Properties { { float4 vertex : POSITION; float3 normal : NORMAL; - float2 uv : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; @@ -49,7 +49,6 @@ Properties { { float4 pos : SV_POSITION; fixed4 color : COLOR; - float2 uv : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; @@ -57,10 +56,6 @@ Properties { //float4 _Glow; // x = intensity, y = width, z = magic number 1, w = magic number 2 float3 _Glow2; // x = outline width, y = glow speed, z = dither on/off float _ConstantWidth; - fixed _CutOff; - sampler _MainTex; - float4 _MainTex_ST; - float4 _MainTex_TexelSize; UNITY_INSTANCING_BUFFER_START(Props) UNITY_DEFINE_INSTANCED_PROP(float4, _GlowColor) @@ -76,36 +71,36 @@ Properties { UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_OUTPUT(v2f, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - float4 pos = ComputeVertexPosition(v.vertex); - float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal); - float2 offset = any(norm.xy)!=0 ? TransformViewToProjection(normalize(norm.xy)) : 0.0.xx; - float2 glowDirection = UNITY_ACCESS_INSTANCED_PROP(Props, _GlowDirection); + + float4 glowDirection = UNITY_ACCESS_INSTANCED_PROP(Props, _GlowDirection); #if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) || defined(SINGLE_PASS_STEREO) glowDirection.x *= 2.0; #endif - offset += glowDirection; + + v.vertex.xyz += v.normal * glowDirection.z; + float4 pos = ComputeVertexPosition(v.vertex); + float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal); + float2 offset = TransformViewToProjection(normalize(norm.xy)); + + offset += glowDirection.xy; float z = lerp(UNITY_Z_0_FAR_FROM_CLIPSPACE(pos.z), 2.0, UNITY_MATRIX_P[3][3]); z = _ConstantWidth * (z - 2.0) + 2.0; float outlineWidth = _Glow2.x; + float4 glow = UNITY_ACCESS_INSTANCED_PROP(Props, _Glow); + float animatedWidth = glow.y * (1.0 + 0.25 * sin(_Time.w * _Glow2.y)); offset *= z * (outlineWidth + animatedWidth); pos.xy += offset; o.pos = pos; o.color = UNITY_ACCESS_INSTANCED_PROP(Props, _GlowColor); o.color.a = glow.x; - o.uv = TRANSFORM_TEX (v.uv, _MainTex); return o; } fixed4 frag (v2f i) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); - #if HP_ALPHACLIP - fixed4 col = tex2D(_MainTex, i.uv); - clip(col.a - _CutOff); - #endif - fixed4 color = i.color; float4 glow = UNITY_ACCESS_INSTANCED_PROP(Props, _Glow); float2 screenPos = floor( i.pos.xy * glow.z ) * glow.w; diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.shader.meta index ceb3a99..fe91538 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightGlow.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightGlow.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 049d9e75e07674a78a703cf1203c07dd timeCreated: 1544699250 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightInnerGlow.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightInnerGlow.shader similarity index 87% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightInnerGlow.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightInnerGlow.shader index 74cdc2e..b0bf6c4 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightInnerGlow.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightInnerGlow.shader @@ -1,4 +1,4 @@ -Shader "HighlightPlus/Geometry/InnerGlow" { +Shader "HighlightPlus/Geometry/InnerGlow" { Properties { _MainTex ("Texture", Any) = "white" {} _Color ("Color", Color) = (1,1,1) // not used; dummy property to avoid inspector warning "material has no _Color property" @@ -10,7 +10,7 @@ Properties { } SubShader { - Tags { "Queue"="Transparent+122" "RenderType"="Transparent" } + Tags { "Queue"="Transparent+122" "RenderType"="Transparent" "DisableBatching"="True" } // Inner Glow Pass @@ -23,7 +23,6 @@ Properties { } Blend SrcAlpha One ZWrite Off - Offset -1, -1 ZTest [_InnerGlowZTest] Cull [_Cull] @@ -52,7 +51,7 @@ Properties { UNITY_VERTEX_OUTPUT_STEREO }; - sampler _MainTex; + sampler2D _MainTex; float4 _MainTex_ST; fixed _CutOff; fixed4 _InnerGlowColor; @@ -66,6 +65,11 @@ Properties { UNITY_INITIALIZE_OUTPUT(v2f, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = ComputeVertexPosition(v.vertex); + #if UNITY_REVERSED_Z + o.pos.z += 0.0001; + #else + o.pos.z -= 0.0001; + #endif o.wpos = mul(unity_ObjectToWorld, v.vertex).xyz; o.normal = UnityObjectToWorldNormal(v.normal); o.uv = TRANSFORM_TEX (v.uv, _MainTex); @@ -75,8 +79,8 @@ Properties { fixed4 frag (v2f i) : SV_Target { #if HP_ALPHACLIP - fixed4 color = tex2D(_MainTex, i.uv); - clip(color.a - _CutOff); + fixed4 color = tex2D(_MainTex, i.uv); + clip(color.a - _CutOff); #endif float3 viewDir = normalize(i.wpos - _WorldSpaceCameraPos.xyz); diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightInnerGlow.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightInnerGlow.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightInnerGlow.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightInnerGlow.shader.meta index d52a3f3..5f67e27 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightInnerGlow.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightInnerGlow.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e5a069457bd344391acd5af227c0ce11 timeCreated: 1544699250 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightMask.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightMask.shader similarity index 65% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightMask.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightMask.shader index 75afea1..a9c9b06 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightMask.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightMask.shader @@ -4,19 +4,22 @@ Properties { _Color ("Color", Color) = (1,1,1) // not used; dummy property to avoid inspector warning "material has no _Color property" _CutOff("CutOff", Float ) = 0.5 _Cull ("Cull Mode", Int) = 2 - _ZTest("ZTest", Int) = 4 + _ZTest ("ZTest", Int) = 4 } SubShader { Tags { "Queue"="Transparent+100" "RenderType"="Transparent" "DisableBatching"="True" } + CGINCLUDE + #include "UnityCG.cginc" #include "CustomVertexTransform.cginc" - sampler _MainTex; + sampler2D _MainTex; float4 _MainTex_ST; float4 _MainTex_TexelSize; fixed _CutOff; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); struct appdata { @@ -29,40 +32,59 @@ Properties { { float4 pos: SV_POSITION; float2 uv : TEXCOORD0; + #if HP_DEPTHCLIP + float4 scrPos : TEXCOORD1; + float depth : TEXCOORD2; + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; - v2f vert (appdata v) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_TRANSFER_INSTANCE_ID(v, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = ComputeVertexPosition(v.vertex); o.uv = TRANSFORM_TEX (v.uv, _MainTex); - + #if HP_DEPTHCLIP + o.scrPos = ComputeScreenPos(o.pos); + COMPUTE_EYEDEPTH(o.depth); + #endif #if UNITY_REVERSED_Z o.pos.z += 0.0001; #else o.pos.z -= 0.0001; #endif - return o; } - + + float GetEyeDepth(float rawDepth) { + float persp = LinearEyeDepth(rawDepth); + float ortho = (_ProjectionParams.z-_ProjectionParams.y)*(1-rawDepth)+_ProjectionParams.y; + return lerp(persp,ortho,unity_OrthoParams.w); + } + fixed4 frag (v2f i) : SV_Target { + UNITY_SETUP_INSTANCE_ID(i); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); #if HP_ALPHACLIP - fixed4 col = tex2D(_MainTex, i.uv); - clip(col.a - _CutOff); + fixed4 col = tex2D(_MainTex, i.uv); + clip(col.a - _CutOff); #endif + #if HP_DEPTHCLIP + float sceneZ = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, UnityStereoTransformScreenSpaceTex(i.scrPos.xy / i.scrPos.w)); + float sceneDepth = GetEyeDepth(sceneZ); + clip(sceneDepth - i.depth * 0.999); + #endif return 0; } ENDCG - // Create mask Pass { @@ -80,13 +102,13 @@ Properties { ZTest [_ZTest] CGPROGRAM + #pragma multi_compile_local _ HP_ALPHACLIP + #pragma multi_compile_local _ HP_DEPTHCLIP #pragma vertex vert #pragma fragment frag - #pragma multi_compile_local _ HP_ALPHACLIP ENDCG } - // Create mask for see-through (the only difference is the ZTest) Pass { @@ -104,11 +126,13 @@ Properties { ZTest LEqual CGPROGRAM + #pragma multi_compile_local _ HP_ALPHACLIP + #pragma multi_compile_local _ HP_DEPTHCLIP #pragma vertex vert #pragma fragment frag - #pragma multi_compile_local _ HP_ALPHACLIP ENDCG } + } } \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightMask.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightMask.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightMask.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightMask.shader.meta index 54d5508..b550df4 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightMask.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightMask.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e694fa934b6db4a00b8d4b9887115332 timeCreated: 1544699251 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOccluder.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOccluder.shader similarity index 86% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOccluder.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOccluder.shader index a4e6b5a..3cff099 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOccluder.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOccluder.shader @@ -5,7 +5,7 @@ Properties { } SubShader { - Tags { "Queue"="Transparent+100" "RenderType"="Transparent" } + Tags { "Queue"="Transparent+100" "RenderType"="Transparent" "DisableBatching"="True" } // Create mask Pass @@ -14,10 +14,9 @@ Properties { Ref 2 Comp always Pass DecrWrap -} + } ColorMask 0 ZWrite Off - Offset -1, -1 CGPROGRAM #pragma vertex vert @@ -44,6 +43,11 @@ Properties { UNITY_INITIALIZE_OUTPUT(v2f, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = UnityObjectToClipPos(v.vertex); + #if UNITY_REVERSED_Z + o.pos.z += 0.0001; + #else + o.pos.z -= 0.0001; + #endif return o; } diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOccluder.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOccluder.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOccluder.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOccluder.shader.meta index b5eca91..47ef424 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOccluder.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOccluder.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 229baf997355a43cda580dd4cf86b71e timeCreated: 1544699251 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.mat b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.mat similarity index 68% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.mat rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.mat index 701eed8..0bdabcf 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.mat +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.mat @@ -1,18 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!114 &-6555637095062934885 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 1 --- !u!21 &2100000 Material: serializedVersion: 6 @@ -32,11 +19,19 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: + - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - _BumpMap: + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} @@ -56,39 +51,33 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - _SpecGlossMap: + - _ParallaxMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - - _AlphaClip: 0 - - _Blend: 0 - _BumpScale: 1 - _ConstantWidth: 1 - _Cull: 2 - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 - _DstBlend: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 - _Metallic: 0 + - _Mode: 0 - _OcclusionStrength: 1 - _OutlineWidth: 0.01 - _OutlineZTest: 4 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 + - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 - - _Surface: 0 - - _WorkflowMode: 1 + - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - - _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} - _OutlineDirection: {r: 0, g: 0, b: 0, a: 1} - - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.mat.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.mat.meta similarity index 64% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.mat.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.mat.meta index 2b0dc0b..499962b 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.mat.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.mat.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 580895c3d590f4760ba7d0ee2a5dc624 +guid: 57729312cdd6d4eb685a81a3b0bf8a5b NativeFormatImporter: externalObjects: {} - mainObjectFileID: 0 + mainObjectFileID: 2100000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.shader similarity index 75% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.shader index 638aa56..af1b2bd 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.shader @@ -1,12 +1,13 @@ -Shader "HighlightPlus/Geometry/Outline" { +Shader "HighlightPlus/Geometry/Outline" { Properties { _MainTex ("Texture", Any) = "white" {} + _OutlineColor ("Outline Color", Color) = (0,0,0,1) _OutlineWidth ("Outline Offset", Float) = 0.01 + _OutlineDirection("Outline Direction", Vector) = (0,0,0) _Color ("Color", Color) = (1,1,1) // not used; dummy property to avoid inspector warning "material has no _Color property" _Cull ("Cull Mode", Int) = 2 _ConstantWidth ("Constant Width", Float) = 1 _OutlineZTest("ZTest", Int) = 4 - _CutOff("CutOff", Float ) = 0.5 } SubShader { @@ -18,13 +19,13 @@ Properties { Stencil { Ref 2 Comp NotEqual - Pass replace + Pass replace ReadMask 2 WriteMask 2 } Blend SrcAlpha OneMinusSrcAlpha - ZWrite Off + ZWrite On Cull [_Cull] ZTest [_OutlineZTest] @@ -36,85 +37,6 @@ Properties { #include "UnityCG.cginc" #include "CustomVertexTransform.cginc" - struct appdata - { - float4 vertex : POSITION; - float3 normal : NORMAL; - float2 uv : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID - }; - - struct v2f - { - float4 pos : SV_POSITION; - float2 uv : TEXCOORD0; - UNITY_VERTEX_OUTPUT_STEREO - }; - - fixed4 _OutlineColor; - float _OutlineWidth; - float _ConstantWidth; - fixed _CutOff; - sampler _MainTex; - float4 _MainTex_ST; - float4 _MainTex_TexelSize; - - UNITY_INSTANCING_BUFFER_START(Props) - UNITY_DEFINE_INSTANCED_PROP(float4, _OutlineDirection) - UNITY_INSTANCING_BUFFER_END(Props) - - - v2f vert (appdata v) - { - v2f o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_OUTPUT(v2f, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - o.pos = ComputeVertexPosition(v.vertex); - float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal); - float2 offset = any(norm.xy)!=0 ? TransformViewToProjection(normalize(norm.xy)) : 0.0.xx; - float z = lerp(UNITY_Z_0_FAR_FROM_CLIPSPACE(o.pos.z), 2.0, UNITY_MATRIX_P[3][3]); - z = _ConstantWidth * (z - 2.0) + 2.0; - float4 outlineDirection = UNITY_ACCESS_INSTANCED_PROP(Props, _OutlineDirection); - #if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) || defined(SINGLE_PASS_STEREO) - outlineDirection.x *= 2.0; - #endif - o.pos.xy += offset * z * _OutlineWidth + outlineDirection.xy * z; - o.uv = TRANSFORM_TEX (v.uv, _MainTex); - return o; - } - - fixed4 frag (v2f i) : SV_Target - { - #if HP_ALPHACLIP - fixed4 col = tex2D(_MainTex, i.uv); - clip(col.a - _CutOff); - #endif - return _OutlineColor; - } - ENDCG - } - - Pass - { - Name "Outline Clear Stencil" - Stencil { - Ref 2 - Comp Always - Pass zero - } - - ColorMask 0 - ZWrite Off - Cull [_Cull] - ZTest [_OutlineZTest] - - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #include "UnityCG.cginc" - #include "CustomVertexTransform.cginc" - struct appdata { float4 vertex : POSITION; @@ -130,8 +52,12 @@ Properties { fixed4 _OutlineColor; float _OutlineWidth; - float2 _OutlineDirection; float _ConstantWidth; + float _OutlineVertexWidth; + + UNITY_INSTANCING_BUFFER_START(Props) + UNITY_DEFINE_INSTANCED_PROP(float4, _OutlineDirection) + UNITY_INSTANCING_BUFFER_END(Props) v2f vert (appdata v) { @@ -139,12 +65,79 @@ Properties { UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_OUTPUT(v2f, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.xyz += v.normal * _OutlineVertexWidth; o.pos = ComputeVertexPosition(v.vertex); float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal); - float2 offset = any(norm.xy)!=0 ? TransformViewToProjection(normalize(norm.xy)) : 0.0.xx; + float2 offset = TransformViewToProjection(normalize(norm.xy)); float z = lerp(UNITY_Z_0_FAR_FROM_CLIPSPACE(o.pos.z), 2.0, UNITY_MATRIX_P[3][3]); z = _ConstantWidth * (z - 2.0) + 2.0; - o.pos.xy += offset * z * _OutlineWidth + _OutlineDirection * z; + + float4 outlineDirection = UNITY_ACCESS_INSTANCED_PROP(Props, _OutlineDirection); + #if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED) || defined(SINGLE_PASS_STEREO) + outlineDirection.x *= 2.0; + #endif + o.pos.xy += offset * z * _OutlineWidth + outlineDirection.xy * z; + return o; + } + + fixed4 frag (v2f i) : SV_Target + { + return _OutlineColor; + } + ENDCG + } + + Pass + { + Name "Outline Clear Stencil" + Stencil { + Ref 2 + Comp Always + Pass zero + } + + ColorMask 0 + ZWrite Off + Cull [_Cull] + ZTest Always + + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "UnityCG.cginc" + #include "CustomVertexTransform.cginc" + + struct appdata + { + float4 vertex : POSITION; + float3 normal : NORMAL; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 pos : SV_POSITION; + UNITY_VERTEX_OUTPUT_STEREO + }; + + fixed4 _OutlineColor; + float _OutlineWidth; + float2 _OutlineDirection; + float _ConstantWidth; + float _OutlineVertexWidth; + v2f vert (appdata v) + { + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.xyz += v.normal * _OutlineVertexWidth; + o.pos = ComputeVertexPosition(v.vertex); + float3 norm = mul ((float3x3)UNITY_MATRIX_IT_MV, v.normal); + float2 offset = TransformViewToProjection(normalize(norm.xy)); + float z = lerp(UNITY_Z_0_FAR_FROM_CLIPSPACE(o.pos.z), 2.0, UNITY_MATRIX_P[3][3]); + z = _ConstantWidth * (z - 2.0) + 2.0; + o.pos.xy += offset * z * _OutlineWidth + _OutlineDirection * z; return o; } @@ -154,7 +147,5 @@ Properties { } ENDCG } - - } } \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.shader.meta index 14bfdeb..c1e26d2 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOutline.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOutline.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: cbbf740e9c8644e8492d08b1a3fd0203 timeCreated: 1544699250 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOverlay.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOverlay.shader similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOverlay.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOverlay.shader index 8064a7b..6b0ba38 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOverlay.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOverlay.shader @@ -1,4 +1,4 @@ -Shader "HighlightPlus/Geometry/Overlay" { +Shader "HighlightPlus/Geometry/Overlay" { Properties { _MainTex ("Texture", Any) = "white" {} _Color ("Color", Color) = (1,1,1) // not used; dummy property to avoid inspector warning "material has no _Color property" @@ -25,7 +25,6 @@ Properties { } Blend SrcAlpha OneMinusSrcAlpha ZWrite Off - Offset -1, -1 Cull [_Cull] CGPROGRAM @@ -71,6 +70,11 @@ Properties { UNITY_INITIALIZE_OUTPUT(v2f, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = ComputeVertexPosition(v.vertex); + #if UNITY_REVERSED_Z + o.pos.z += 0.0001; + #else + o.pos.z -= 0.0001; + #endif o.wpos = mul(unity_ObjectToWorld, v.vertex).xyz; o.wnorm = UnityObjectToWorldNormal(v.norm); o.uv = TRANSFORM_TEX (v.uv, _MainTex); @@ -81,10 +85,10 @@ Properties { { fixed4 color = tex2D(_MainTex, i.uv); #if HP_ALPHACLIP - clip(color.a - _CutOff); + clip(color.a - _CutOff); #endif float time = _Time.y % 1000; - fixed t = _OverlayData.y + (1.0 - _OverlayData.y) * 2.0 * abs(0.5 - frac(time * _OverlayData.x)); + fixed t = _OverlayData.y + (1.0 - _OverlayData.y) * 2.0 * abs(0.5 - frac(time * _OverlayData.x)); fixed4 col = lerp(_OverlayColor, color * _OverlayBackColor * _OverlayColor, _OverlayData.z); col.a *= t; diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOverlay.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOverlay.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOverlay.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightOverlay.shader.meta index 80f1636..5560e90 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightOverlay.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightOverlay.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d17a98d19ada34bb7b4f86130e590159 timeCreated: 1544699250 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthClipComp.mat b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthClipComp.mat new file mode 100644 index 0000000..2822c39 --- /dev/null +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthClipComp.mat @@ -0,0 +1,76 @@ +%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: HighlightPlusDepthClipComp + m_Shader: {fileID: 4800000, guid: 0917f634da79a4983ad78bac83d5a715, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthClipComp.mat.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthClipComp.mat.meta new file mode 100644 index 0000000..9399349 --- /dev/null +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthClipComp.mat.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 94aad838a87c54e1b89e9ef47ecad5bf +timeCreated: 1546857910 +licenseType: Pro +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightPlusDepthWrite.mat b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthWrite.mat similarity index 100% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightPlusDepthWrite.mat rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthWrite.mat diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightPlusDepthWrite.mat.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthWrite.mat.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightPlusDepthWrite.mat.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthWrite.mat.meta index 7ce4eb2..c02afaf 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightPlusDepthWrite.mat.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightPlusDepthWrite.mat.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 825cb444e111842cf97788cbb7583edd timeCreated: 1546857910 -licenseType: Store +licenseType: Pro NativeFormatImporter: mainObjectFileID: 2100000 userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughBorder.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughBorder.shader similarity index 87% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughBorder.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughBorder.shader index 2d5be5c..3bd1a2d 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughBorder.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughBorder.shader @@ -1,4 +1,4 @@ -Shader "HighlightPlus/Geometry/SeeThroughBorder" { +Shader "HighlightPlus/Geometry/SeeThroughBorder" { Properties { _MainTex ("Texture", Any) = "white" {} _SeeThroughBorderColor ("Outline Color", Color) = (0,0,0,1) @@ -11,12 +11,13 @@ Properties { _SeeThroughDepthOffset ("Depth Offset", Float) = 0 _SeeThroughMaxDepth("Max Depth", Float) = 0 _SeeThroughStencilPassOp ("Stencil Pass Operation", Int) = 0 + _SeeThroughOrdered("Ordered", Int) = 1 + _ZTest("ZTest", Int) = 4 } SubShader { Tags { "Queue"="Transparent+201" "RenderType"="Transparent" "DisableBatching"="True" } - // See through effect Pass { Name "See-through border" @@ -28,8 +29,9 @@ Properties { Pass [_SeeThroughStencilPassOp] Fail [_SeeThroughStencilPassOp] } - ZTest Greater - ZWrite Off + + ZTest [_ZTest] + ZWrite On Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM @@ -66,8 +68,10 @@ Properties { fixed _CutOff; float _SeeThroughDepthOffset; float _SeeThroughMaxDepth; + int _SeeThroughOrdered; float _SeeThroughBorderWidth; float _SeeThroughBorderConstantWidth; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); v2f vert (appdata v) @@ -87,7 +91,14 @@ Properties { float z = lerp(UNITY_Z_0_FAR_FROM_CLIPSPACE(o.pos.z), 2.0, UNITY_MATRIX_P[3][3]); z = _SeeThroughBorderConstantWidth * (z - 2.0) + 2.0; o.pos.xy += offset * z * _SeeThroughBorderWidth; - + + #if UNITY_REVERSED_Z + o.pos.z -= 0.0001; + o.pos.z = _SeeThroughOrdered ? o.pos.w - (o.pos.w - o.pos.z) * 0.001 : o.pos.z; + #else + o.pos.z += 0.0001; + o.pos.z = _SeeThroughOrdered ? -o.pos.w + ( o.pos.z + o.pos.w ) * 0.001 : o.pos.z; + #endif o.uv = TRANSFORM_TEX(v.uv, _MainTex); return o; } @@ -107,7 +118,7 @@ Properties { #endif #if HP_ALPHACLIP fixed4 col = tex2D(_MainTex, i.uv); - clip(col.a - _CutOff); + clip(col.a - _CutOff); #endif return _SeeThroughBorderColor; } diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThrough.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughBorder.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThrough.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughBorder.shader.meta index 8312b80..3009623 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThrough.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughBorder.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 47198bbf0b2a44882aceef6af17a467d timeCreated: 1544699250 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThrough.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughInner.shader similarity index 83% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThrough.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughInner.shader index 3626f76..fb496ae 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThrough.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughInner.shader @@ -1,9 +1,9 @@ -Shader "HighlightPlus/Geometry/SeeThrough" { +Shader "HighlightPlus/Geometry/SeeThroughInner" { Properties { _MainTex ("Texture", Any) = "white" {} _SeeThrough ("See Through", Range(0,1)) = 0.8 _SeeThroughTintColor ("See Through Tint Color", Color) = (1,0,0,0.8) - _SeeThroughNoise("Noise", Float) = 1 + _SeeThroughNoise("Noise", Float) = 1 _Color ("Color", Color) = (1,1,1) // not used; dummy property to avoid inspector warning "material has no _Color property" _CutOff("CutOff", Float ) = 0.5 _SeeThroughStencilRef ("Stencil Ref", Int) = 2 @@ -11,6 +11,8 @@ Properties { _SeeThroughStencilPassOp ("Stencil Pass Operation", Int) = 0 _SeeThroughDepthOffset ("Depth Offset", Float) = 0 _SeeThroughMaxDepth("Max Depth", Float) = 0 + _SeeThroughOrdered("Ordered", Int) = 1 + _ZTest("ZTest", Int) = 4 } SubShader { @@ -18,7 +20,7 @@ Properties { // See through effect Pass - { + { Name "See-through" Stencil { ReadMask 3 @@ -28,8 +30,10 @@ Properties { Pass [_SeeThroughStencilPassOp] Fail [_SeeThroughStencilPassOp] } - ZTest Greater - ZWrite Off + + ZTest [_ZTest] + ZWrite On // Needs to be on so see-through border do not overlap +// Cull Off Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM @@ -47,18 +51,18 @@ Properties { float4 vertex : POSITION; float3 normal : NORMAL; float2 uv : TEXCOORD0; - UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { - float4 pos: SV_POSITION; + float4 pos: SV_POSITION; float2 uv : TEXCOORD0; #if HP_DEPTH_OFFSET float4 scrPos : TEXCOORD1; float depth : TEXCOORD2; #endif - UNITY_VERTEX_OUTPUT_STEREO + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -66,17 +70,18 @@ Properties { fixed _SeeThrough; fixed4 _SeeThroughTintColor; fixed _CutOff; - fixed _SeeThroughNoise; + fixed _SeeThroughNoise; float _SeeThroughDepthOffset; float _SeeThroughMaxDepth; + int _SeeThroughOrdered; UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); v2f vert (appdata v) { v2f o; - UNITY_SETUP_INSTANCE_ID(v); - UNITY_INITIALIZE_OUTPUT(v2f, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = ComputeVertexPosition(v.vertex); #if HP_DEPTH_OFFSET o.scrPos = ComputeScreenPos(o.pos); @@ -108,11 +113,11 @@ Properties { clip(col.a - _CutOff); #endif col.rgb = lerp(col.rgb, _SeeThroughTintColor.rgb, _SeeThroughTintColor.a); - float scry = i.pos.y; + float scry = i.pos.y; float time = _Time.w % 1.0; col.rgb += _SeeThroughNoise *(frac( scry * time ) * 0.1); col.a = _SeeThrough; - col.a = lerp(col.a, col.a * ( (scry % 2) - 1.0 ), _SeeThroughNoise); + col.a = lerp(col.a, col.a * ( (scry % 2) - 1.0 ), _SeeThroughNoise); return col; #endif // HP_ONLY_BORDER diff --git a/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughInner.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughInner.shader.meta new file mode 100644 index 0000000..01f6f33 --- /dev/null +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughInner.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f5e95a6a4248649f7ac2ac6127ca0dd1 +timeCreated: 1544699250 +licenseType: Pro +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughMask.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughMask.shader similarity index 97% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughMask.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughMask.shader index a9c2483..ea0166b 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughMask.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughMask.shader @@ -10,7 +10,6 @@ Properties { // See through effect Pass { - Name "See-through mask" Stencil { WriteMask 3 Ref 1 diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughMask.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughMask.shader.meta similarity index 56% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughMask.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughMask.shader.meta index da76823..b9b1fec 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSeeThroughMask.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSeeThroughMask.shader.meta @@ -1,9 +1,9 @@ fileFormatVersion: 2 -guid: 457d76fdfc7c4472faeb0297c0edab29 +guid: 05afe1e2da9484c1f9317f48d5edb58c +timeCreated: 1544699251 +licenseType: Pro ShaderImporter: - externalObjects: {} defaultTextures: [] - nonModifiableTextures: [] userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSolidColor.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSolidColor.shader similarity index 70% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSolidColor.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightSolidColor.shader index 79b34fd..b50cb44 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSolidColor.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSolidColor.shader @@ -8,19 +8,15 @@ Properties { } SubShader { - Tags { "Queue"="Transparent+100" "RenderType"="Transparent" "DisableBatching" = "True" } + Tags { "Queue"="Transparent+100" "RenderType"="Transparent" } // Compose effect on camera target Pass { ZWrite Off Cull [_Cull] - ZTest Always - Stencil { - Ref 2 - Comp NotEqual - Pass replace - } + ZTest [_ZTest] + CGPROGRAM #pragma vertex vert #pragma fragment frag @@ -30,13 +26,11 @@ Properties { #include "UnityCG.cginc" #include "CustomVertexTransform.cginc" - sampler _MainTex; - #if HP_DEPTHCLIP - UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); - #endif + sampler2D _MainTex; float4 _MainTex_ST; fixed _CutOff; fixed4 _Color; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); struct appdata { @@ -47,11 +41,11 @@ Properties { struct v2f { - float4 pos : SV_POSITION; + float4 pos: SV_POSITION; float2 uv : TEXCOORD0; #if HP_DEPTHCLIP - float depth : TEXCOORD1; - float4 scrPos : TEXCOORD2; + float4 scrPos : TEXCOORD1; + float depth : TEXCOORD2; #endif UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO @@ -67,32 +61,37 @@ Properties { o.pos = ComputeVertexPosition(v.vertex); o.uv = TRANSFORM_TEX (v.uv, _MainTex); #if HP_DEPTHCLIP - COMPUTE_EYEDEPTH(o.depth); o.scrPos = ComputeScreenPos(o.pos); + COMPUTE_EYEDEPTH(o.depth); + #endif + #if UNITY_REVERSED_Z + o.pos.z += 0.0001; + #else + o.pos.z -= 0.0001; #endif return o; } + + float GetEyeDepth(float rawDepth) { + float persp = LinearEyeDepth(rawDepth); + float ortho = (_ProjectionParams.z-_ProjectionParams.y)*(1-rawDepth)+_ProjectionParams.y; + return lerp(persp,ortho,unity_OrthoParams.w); + } + fixed4 frag (v2f i) : SV_Target { UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); - #if HP_ALPHACLIP fixed4 col = tex2D(_MainTex, i.uv); clip(col.a - _CutOff); #endif #if HP_DEPTHCLIP - float depthRaw = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, UnityStereoTransformScreenSpaceTex(i.scrPos.xy / i.scrPos.w )); - float depthPersp = LinearEyeDepth(depthRaw); - #if defined(UNITY_REVERSED_Z) - depthRaw = 1.0 - depthRaw; - #endif - float depthOrtho = lerp(_ProjectionParams.y, _ProjectionParams.z, depthRaw); - float vz = unity_OrthoParams.w ? depthOrtho : depthPersp; - clip( vz - i.depth * 0.999); + float sceneZ = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, UnityStereoTransformScreenSpaceTex(i.scrPos.xy / i.scrPos.w)); + float sceneDepth = GetEyeDepth(sceneZ); + clip(sceneDepth - i.depth * 0.999); #endif - return fixed4(1.0, 1.0, 1.0, 1.0); } ENDCG diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSolidColor.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSolidColor.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSolidColor.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightSolidColor.shader.meta index 37f54c5..9afd1bb 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightSolidColor.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightSolidColor.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 77643996218224478a471439e0ea5fb4 timeCreated: 1544699251 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightTarget.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightTarget.shader similarity index 75% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightTarget.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightTarget.shader index e4aed23..e5b6b31 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightTarget.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightTarget.shader @@ -3,7 +3,7 @@ Properties { _MainTex ("Texture", 2D) = "white" {} _Color ("Color", Color) = (1,1,1,1) _ZTest ("ZTest", Int) = 0 - } +} SubShader { @@ -21,21 +21,17 @@ Properties { ZWrite Off ZTest [_ZTest] Cull Off - - HLSLPROGRAM + CGPROGRAM #pragma vertex vert #pragma fragment frag - #pragma target 3.0 - - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" - #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl" + #include "UnityCG.cginc" struct appdata { - float3 positionOS : POSITION; - UNITY_VERTEX_INPUT_INSTANCE_ID + float4 positionOS : POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f @@ -44,33 +40,32 @@ Properties { float4 screenPos : TEXCOORD0; float4 rayVS : TEXCOORD1; float3 camPosVS : TEXCOORD2; - UNITY_VERTEX_INPUT_INSTANCE_ID - UNITY_VERTEX_OUTPUT_STEREO + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; - CBUFFER_START(UnityPerMaterial) - float4 _MainTex_ST; - half4 _Color; - float4 _TargetFXRenderData; - CBUFFER_END - + float4 _MainTex_ST; + half4 _Color; + float4 _TargetFXRenderData; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + #define GROUND_NORMAL _TargetFXRenderData.xyz #define FADE_POWER _TargetFXRenderData.w + #define UNITY_MATRIX_I_M unity_WorldToObject v2f vert(appdata input) { v2f o; - UNITY_SETUP_INSTANCE_ID(input); - UNITY_TRANSFER_INSTANCE_ID(input, o); - UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - - VertexPositionInputs vertexPositionInput = GetVertexPositionInputs(input.positionOS); - o.positionCS = vertexPositionInput.positionCS; + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.positionCS = UnityObjectToClipPos(input.positionOS); o.screenPos = ComputeScreenPos(o.positionCS); - float3 viewRay = vertexPositionInput.positionVS; + float3 viewRay = UnityObjectToViewPos(input.positionOS); o.rayVS.w = viewRay.z; float4x4 viewToObject = mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V); o.rayVS.xyz = mul((float3x3)viewToObject, -viewRay); @@ -78,12 +73,13 @@ Properties { return o; } + + half4 frag(v2f i) : SV_Target { - UNITY_SETUP_INSTANCE_ID(i); + UNITY_SETUP_INSTANCE_ID(i); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); - - float depth = SampleSceneDepth(i.screenPos.xy / i.screenPos.w); + float depth = UNITY_SAMPLE_DEPTH(UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthTexture, i.screenPos.xy / i.screenPos.w)); float3 decalPos; if(unity_OrthoParams.w) { #if defined(UNITY_REVERSED_Z) @@ -93,9 +89,9 @@ Properties { float2 rayVSEnd = float2(unity_OrthoParams.xy * (i.screenPos.xy - 0.5) * 2.0); float4 posVS = float4(rayVSEnd, -sceneDepthVS, 1); float3 wpos = mul(UNITY_MATRIX_I_V, posVS).xyz; - decalPos = mul(GetWorldToObjectMatrix(), float4(wpos, 1)).xyz; + decalPos = mul(UNITY_MATRIX_I_M, float4(wpos, 1)).xyz; } else { - float depthEye = LinearEyeDepth(depth, _ZBufferParams); + float depthEye = LinearEyeDepth(depth); decalPos = i.camPosVS + (i.rayVS.xyz / i.rayVS.w) * depthEye; } clip(0.5 - abs(decalPos)); @@ -114,9 +110,11 @@ Properties { return col; } - ENDHLSL + ENDCG } - + + + // Regular target fx Pass { Blend SrcAlpha OneMinusSrcAlpha diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightTarget.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightTarget.shader.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightTarget.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightTarget.shader.meta index d768e87..2d63221 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightTarget.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightTarget.shader.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 54328cae8f89d442da972097ce4f23d9 timeCreated: 1544699250 -licenseType: Store +licenseType: Pro ShaderImporter: defaultTextures: [] userData: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.mat b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.mat similarity index 64% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.mat rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.mat index e9c33e3..22c9c22 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.mat +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.mat @@ -1,18 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!114 &-2752029129534311206 -MonoBehaviour: - m_ObjectHideFlags: 11 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} - m_Name: - m_EditorClassIdentifier: - version: 1 --- !u!21 &2100000 Material: serializedVersion: 6 @@ -21,7 +8,7 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: HighlightUIMask - m_Shader: {fileID: 4800000, guid: 3e461a1484e2948598abca48b53d8b58, type: 3} + m_Shader: {fileID: 4800000, guid: f65ebd3db9df34222b24b0b7b2b752b2, type: 3} m_ShaderKeywords: m_LightmapFlags: 4 m_EnableInstancingVariants: 0 @@ -32,11 +19,19 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: - - _BaseMap: + - _BumpMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - _BumpMap: + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} @@ -56,28 +51,24 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - - _SpecGlossMap: + - _ParallaxMap: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: - - _AlphaClip: 0 - - _Blend: 0 - _BumpScale: 1 - _ColorMask: 15 - - _Cull: 2 - _CutOff: 0.5 - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 - _DstBlend: 0 - - _EnvironmentReflections: 1 - - _GlossMapScale: 0 - - _Glossiness: 0 - - _GlossyReflections: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 - _Metallic: 0 + - _Mode: 0 - _OcclusionStrength: 1 - - _QueueOffset: 0 - - _ReceiveShadows: 1 - - _Smoothness: 0.5 + - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 @@ -86,11 +77,8 @@ Material: - _StencilOp: 0 - _StencilReadMask: 255 - _StencilWriteMask: 255 - - _Surface: 0 - - _WorkflowMode: 1 + - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} - - _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.mat.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.mat.meta similarity index 64% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.mat.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.mat.meta index e4c879a..443f0fa 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.mat.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.mat.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: 779128a8e84b44d4db81443c424af511 +guid: 7e86e0b9dab6441b2a8c2787c90d22aa NativeFormatImporter: externalObjects: {} - mainObjectFileID: 0 + mainObjectFileID: 2100000 userData: assetBundleName: assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.shader b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.shader similarity index 98% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.shader rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.shader index 64cc2c5..108714d 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.shader +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.shader @@ -34,7 +34,7 @@ Properties { #include "UnityCG.cginc" #include "CustomVertexTransform.cginc" - sampler _MainTex; + sampler2D _MainTex; float4 _MainTex_ST; float4 _MainTex_TexelSize; fixed _CutOff; diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.shader.meta b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.shader.meta similarity index 80% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.shader.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.shader.meta index 693ec2b..b546bf7 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/HighlightUIMask.shader.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/HighlightUIMask.shader.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3e461a1484e2948598abca48b53d8b58 +guid: f65ebd3db9df34222b24b0b7b2b752b2 ShaderImporter: externalObjects: {} defaultTextures: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/target.png b/Assets/HighlightPlus/Resources/HighlightPlus/target.png similarity index 100% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/target.png rename to Assets/HighlightPlus/Resources/HighlightPlus/target.png diff --git a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/target.png.meta b/Assets/HighlightPlus/Resources/HighlightPlus/target.png.meta similarity index 99% rename from Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/target.png.meta rename to Assets/HighlightPlus/Resources/HighlightPlus/target.png.meta index 77c6102..43c03a4 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Resources/HighlightPlus/target.png.meta +++ b/Assets/HighlightPlus/Resources/HighlightPlus/target.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 1de3c566a6c8c405b9f6f453137273ec timeCreated: 1555360741 -licenseType: Store +licenseType: Pro TextureImporter: fileIDToRecycleName: {} serializedVersion: 4 diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts.meta b/Assets/HighlightPlus/Scripts.meta similarity index 90% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts.meta rename to Assets/HighlightPlus/Scripts.meta index 1682aa4..3294e59 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts.meta +++ b/Assets/HighlightPlus/Scripts.meta @@ -2,7 +2,7 @@ fileFormatVersion: 2 guid: 89ce39cd6bb34454bbaf48f1d111f236 folderAsset: yes timeCreated: 1542876305 -licenseType: Store +licenseType: Pro DefaultImporter: userData: assetBundleName: diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffect.cs b/Assets/HighlightPlus/Scripts/HighlightEffect.cs similarity index 70% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffect.cs rename to Assets/HighlightPlus/Scripts/HighlightEffect.cs index b3a1f63..990c077 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffect.cs +++ b/Assets/HighlightPlus/Scripts/HighlightEffect.cs @@ -1,4 +1,4 @@ -/// +/// /// Highlight Plus - (c) 2018-2021 Kronnect Technologies SL /// @@ -17,12 +17,12 @@ namespace HighlightPlus { /// /// A value from 0 to 1 that represent the animation time from start to end, based on target duration and start time public delegate void OnTargetAnimatesEvent(ref Vector3 center, ref Quaternion rotation, ref Vector3 scale, float t); - public delegate void FullScreenBlitMethod(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, Material material, int passIndex); public enum NormalsOption { Smooth = 0, PreserveOriginal = 1, - Reorient = 2 + Reorient = 2, + Planar = 3 } public enum SeeThroughMode { @@ -72,7 +72,7 @@ namespace HighlightPlus { } [ExecuteInEditMode] - [HelpURL("https://www.dropbox.com/s/1p9h8xys68lm4a3/Documentation.pdf?dl=0")] + [HelpURL("https://www.dropbox.com/s/v9qgn68ydblqz8x/Documentation.pdf?dl=0")] public partial class HighlightEffect : MonoBehaviour { /// @@ -169,7 +169,7 @@ namespace HighlightPlus { [Tooltip("The farthest distance particles can get away from the camera before they fade from the camera’s view.")] public float cameraDistanceFadeFar = 1000; - [Tooltip("Normals handling option:\nPreserve original: use original mesh normals.\nSmooth: average normals to produce a smoother outline/glow mesh based effect.\nReorient: recomputes normals based on vertex direction to centroid.")] + [Tooltip("Normals handling option:\nPreserve original: use original mesh normals.\nSmooth: average normals to produce a smoother outline/glow mesh based effect.\nReorient: recomputes normals based on vertex direction to centroid.\nPlanar: same than reorient but renders outline and glow in an optimized way for 2D or planar meshes like quads or planes.")] public NormalsOption normalsOption; /// @@ -185,7 +185,6 @@ namespace HighlightPlus { public float fadeInDuration; public float fadeOutDuration; - public bool flipY; [Tooltip("Keeps the outline/glow size unaffected by object distance.")] @@ -214,12 +213,12 @@ namespace HighlightPlus { [ColorUsage(true, true)] public Color outlineColor = Color.black; public float outlineWidth = 0.45f; public QualityLevel outlineQuality = QualityLevel.Medium; - [Range(1, 8)] [Tooltip("Reduces the quality of the outline but improves performance a bit.")] public int outlineDownsampling = 2; public Visibility outlineVisibility = Visibility.Normal; public GlowBlendMode glowBlendMode = GlowBlendMode.Additive; + public bool outlineOptimalBlit = true; public bool outlineBlitDebug; [Tooltip("If enabled, this object won't combine the outline with other objects.")] public bool outlineIndependent; @@ -241,6 +240,8 @@ namespace HighlightPlus { public float glowMagicNumber2 = 0.5f; public float glowAnimationSpeed = 1f; public Visibility glowVisibility = Visibility.Normal; + [Tooltip("Performs a blit to screen only over the affected area, instead of a full-screen pass")] + public bool glowOptimalBlit = true; public bool glowBlitDebug; [Tooltip("Blends glow passes one after another. If this option is disabled, glow passes won't overlap (in this case, make sure the glow pass 1 has a smaller offset than pass 2, etc.)")] public bool glowBlendPasses = true; @@ -310,26 +311,29 @@ namespace HighlightPlus { [Tooltip("Only display the border instead of the full see-through effect.")] public bool seeThroughBorderOnly; public float seeThroughBorderWidth = 0.45f; - [Tooltip("This option clears the stencil buffer after rendering the see-through effect which results in correct rendering order and supports other stencil-based effects that render afterwards.")] + [Tooltip("Renders see-through effect on overlapping objects in a sequence that's relative to the distance to the camera")] public bool seeThroughOrdered; struct ModelMaterials { public bool render; // if this object can render this frame public Transform transform; + public bool bakedTransform; + public Vector3 currentPosition, currentRotation, currentScale; public bool renderWasVisibleDuringSetup; public Mesh mesh, originalMesh; public Renderer renderer; public bool isSkinnedMesh; - public Material[] fxMatMask, fxMatOutline, fxMatGlow, fxMatSolidColor, fxMatSeeThroughInner, fxMatSeeThroughBorder, fxMatOverlay, fxMatInnerGlow; public NormalsOption normalsOption; + public Material[] fxMatMask, fxMatSolidColor, fxMatSeeThroughInner, fxMatSeeThroughBorder, fxMatOverlay, fxMatInnerGlow; public Matrix4x4 renderingMatrix; - public bool isCombined; public bool preserveOriginalMesh { get { return !isCombined && normalsOption == NormalsOption.PreserveOriginal; } } public void Init() { render = false; transform = null; + bakedTransform = false; + currentPosition = currentRotation = currentScale = Vector3.zero; mesh = originalMesh = null; renderer = null; isSkinnedMesh = false; @@ -360,23 +364,31 @@ namespace HighlightPlus { /// [NonSerialized] public bool staticChildren; + #endif [NonSerialized] public Transform target; - // Time in which the highlight started + /// + /// Time in which the highlight started + /// [NonSerialized] public float highlightStartTime; - // Time in which the target fx started + /// + /// Time in which the target fx started + /// [NonSerialized] public float targetFxStartTime; - // True if this object is selected (if selectOnClick is used) + /// + /// True if this object is selected (if selectOnClick is used) + /// [NonSerialized] public bool isSelected; + [NonSerialized] public HighlightProfile previousSettings; @@ -387,18 +399,76 @@ namespace HighlightPlus { const float TAU = 0.70711f; // Reference materials. These are instanced per object (rms). - static Material fxMatMask, fxMatSolidColor, fxMatSeeThrough, fxMatSeeThroughBorder, fxMatOverlay, fxMatClearStencil; + static Material fxMatMask, fxMatSolidColor, fxMatSeeThroughInner, fxMatSeeThroughBorder, fxMatOverlay, fxMatClearStencil; + static Material fxMatGlowRef, fxMatInnerGlow, fxMatOutlineRef, fxMatTargetRef; + static Material fxMatComposeGlowRef, fxMatComposeOutlineRef, fxMatBlurGlowRef, fxMatBlurOutlineRef; static Material fxMatSeeThroughMask; // Per-object materials - Material fxMatGlowTemplate, fxMatInnerGlow, fxMatOutlineTemplate, fxMatTarget; - Material fxMatComposeGlow, fxMatComposeOutline, fxMatBlurGlow, fxMatBlurOutline; + Material _fxMatOutline, _fxMatGlow, _fxMatTarget; + Material _fxMatComposeGlow, _fxMatComposeOutline, _fxMatBlurGlow, _fxMatBlurOutline; + + Material fxMatOutline { + get { + if (_fxMatOutline == null && fxMatOutlineRef != null) { + _fxMatOutline = Instantiate(fxMatOutlineRef); + if (useGPUInstancing) _fxMatOutline.enableInstancing = true; else _fxMatOutline.enableInstancing = false; + } + return _fxMatOutline; + } + } + + Material fxMatGlow { + get { + if (_fxMatGlow == null && fxMatGlowRef != null) { + _fxMatGlow = Instantiate(fxMatGlowRef); + if (useGPUInstancing) _fxMatGlow.enableInstancing = true; else _fxMatGlow.enableInstancing = false; + } + return _fxMatGlow; + } + } + + Material fxMatTarget { + get { + if (_fxMatTarget == null && fxMatTargetRef != null) _fxMatTarget = Instantiate(fxMatTargetRef); + return _fxMatTarget; + } + } + + Material fxMatComposeGlow { + get { + if (_fxMatComposeGlow == null && fxMatComposeGlowRef != null) _fxMatComposeGlow = Instantiate(fxMatComposeGlowRef); + return _fxMatComposeGlow; + } + } + + Material fxMatComposeOutline { + get { + if (_fxMatComposeOutline == null && fxMatComposeOutlineRef != null) _fxMatComposeOutline = Instantiate(fxMatComposeOutlineRef); + return _fxMatComposeOutline; + } + } + + Material fxMatBlurGlow { + get { + if (_fxMatBlurGlow == null && fxMatBlurGlowRef != null) _fxMatBlurGlow = Instantiate(fxMatBlurGlowRef); + return _fxMatBlurGlow; + } + } + + Material fxMatBlurOutline { + get { + if (_fxMatBlurOutline == null && fxMatBlurOutlineRef != null) _fxMatBlurOutline = Instantiate(fxMatBlurOutlineRef); + return _fxMatBlurOutline; + } + } static Vector4[] offsets; float fadeStartTime; FadingState fading = FadingState.NoFading; - CommandBuffer cbHighlight; + CommandBuffer cbMask, cbSeeThrough, cbGlow, cbOutline, cbOverlay, cbInnerGlow; + CommandBuffer cbSmoothBlend; int[] mipGlowBuffers, mipOutlineBuffers; int glowRT, outlineRT; static Mesh quadMesh, cubeMesh; @@ -409,15 +479,9 @@ namespace HighlightPlus { Color debugColor, blackColor; Visibility lastOutlineVisibility; bool requireUpdateMaterial; - - [NonSerialized] - public static List effects = new List(); - - public static bool customSorting; - + bool usingPipeline = false; // set to false to avoid editor warning due to conditional code float occlusionCheckLastTime; int occlusionRenderFrame; - bool useSmoothGlow, useSmoothOutline, useSmoothBlend; bool lastOcclusionTestResult; bool useGPUInstancing; @@ -426,13 +490,17 @@ namespace HighlightPlus { static readonly List matDataGlow = new List(); static readonly List matDataColor = new List(); static Matrix4x4[] matrices; + public static readonly List effects = new List(); + public static bool customSorting; + static int customSortingFrame; + static Camera customSortingCamera; + int skipThisFrame = -1; int outlineOffsetsMin, outlineOffsetsMax; int glowOffsetsMin, glowOffsetsMax; static CombineInstance[] combineInstances; - Matrix4x4 matrix4x4Identity = Matrix4x4.identity; + Matrix4x4 matrix4X4Identity = Matrix4x4.identity; bool maskRequired; - FullScreenBlitMethod FullScreenBlit; void OnEnable() { lastOutlineVisibility = outlineVisibility; @@ -486,19 +554,19 @@ namespace HighlightPlus { CheckGeometrySupportDependencies(); SetupMaterial(); - effects.Add(this); - } - - void OnDisable() { - UpdateMaterialProperties(); - if (effects != null) { - int k = effects.IndexOf(this); - if (k >= 0) { - effects.RemoveAt(k); - } + if (!effects.Contains(this)) { + effects.Add(this); } } + void OnDisable() { + UpdateMaterialPropertiesNow(); + } + + + void Reset() { + SetupMaterial(); + } void DestroyMaterial(Material mat) { if (mat != null) DestroyImmediate(mat); @@ -515,8 +583,6 @@ namespace HighlightPlus { if (rms != null) { for (int k = 0; k < rms.Length; k++) { DestroyMaterialArray(rms[k].fxMatMask); - DestroyMaterialArray(rms[k].fxMatOutline); - DestroyMaterialArray(rms[k].fxMatGlow); DestroyMaterialArray(rms[k].fxMatSolidColor); DestroyMaterialArray(rms[k].fxMatSeeThroughInner); DestroyMaterialArray(rms[k].fxMatSeeThroughBorder); @@ -525,24 +591,44 @@ namespace HighlightPlus { } } - DestroyMaterial(fxMatGlowTemplate); - DestroyMaterial(fxMatInnerGlow); - DestroyMaterial(fxMatOutlineTemplate); + DestroyMaterial(fxMatGlow); + DestroyMaterial(fxMatOutline); DestroyMaterial(fxMatTarget); DestroyMaterial(fxMatComposeGlow); DestroyMaterial(fxMatComposeOutline); DestroyMaterial(fxMatBlurGlow); DestroyMaterial(fxMatBlurOutline); + if (effects.Contains(this)) { + effects.Remove(this); + } + if (combinedMeshes.ContainsKey(combinedMeshesHashId)) { combinedMeshes.Remove(combinedMeshesHashId); } } - void Reset() { - SetupMaterial(); + + public static void DrawEffectsNow(Camera cam = null) { + if (cam == null) { + cam = Camera.current; + if (cam == null) return; + } + int effectsCount = effects.Count; + int thisFrame = Time.frameCount; + for (int k = 0; k < effectsCount; k++) { + HighlightEffect effect = effects[k]; + if (effect != null) { + effect.DoOnRenderObject(cam); + effect.skipThisFrame = thisFrame; + } + } } + void OnRenderObject() { + if (usingPipeline) return; + DoOnRenderObject(Camera.current); + } /// /// Loads a profile into this effect @@ -589,59 +675,50 @@ namespace HighlightPlus { } } - RenderTargetIdentifier colorAttachmentBuffer, depthAttachmentBuffer; - public CommandBuffer GetCommandBuffer(Camera cam, RenderTargetIdentifier colorAttachmentBuffer, RenderTargetIdentifier depthAttachmentBuffer, FullScreenBlitMethod fullScreenBlit, bool clearStencil) { - this.colorAttachmentBuffer = colorAttachmentBuffer; - this.depthAttachmentBuffer = depthAttachmentBuffer; - this.FullScreenBlit = fullScreenBlit; - BuildCommandBuffer(cam, clearStencil); - return cbHighlight; + void DoOnRenderObject(Camera cam) { + + if (customSorting) { + int frameCount = Time.frameCount; + if (customSortingFrame != frameCount || customSortingCamera != cam) { + customSortingFrame = frameCount; + customSortingCamera = cam; + int effectsCount = effects.Count; + for (int k = 0; k < effectsCount; k++) { + HighlightEffect effect = effects[k]; + effect.skipThisFrame = -1; + effect.RenderEffect(cam); + effect.skipThisFrame = frameCount; + } + } + } else { + RenderEffect(cam); + } } - void BuildCommandBuffer(Camera cam, bool clearStencil) { + void RenderEffect(Camera cam) { - if (colorAttachmentBuffer == 0) { - colorAttachmentBuffer = BuiltinRenderTextureType.CameraTarget; - } - if (depthAttachmentBuffer == 0) { - depthAttachmentBuffer = BuiltinRenderTextureType.CameraTarget; - } - - if (cam == null || cbHighlight == null) return; - - cbHighlight.Clear(); - -#if UNITY_EDITOR - if (!previewInEditor && !Application.isPlaying) { - return; - } -#endif + if (cam == null || ((1 << cam.gameObject.layer) & camerasLayerMask) == 0) return; if (!reflectionProbes && cam.cameraType == CameraType.Reflection) return; -#if UNITY_2021_2_OR_NEWER - // depth priming might have changed depth render target so we ensure it's set to normal - cbHighlight.SetRenderTarget(colorAttachmentBuffer, depthAttachmentBuffer); +#if UNITY_EDITOR + if (!previewInEditor && !Application.isPlaying) + return; #endif + if (requireUpdateMaterial) { requireUpdateMaterial = false; - UpdateMaterialProperties(); - } - - bool independentFullScreenNotExecuted = true; - if (clearStencil) { - cbHighlight.DrawMesh(quadMesh, matrix4x4Identity, fxMatClearStencil, 0, 0); - independentFullScreenNotExecuted = false; + UpdateMaterialPropertiesNow(); } bool seeThroughReal = seeThroughIntensity > 0 && (seeThrough == SeeThroughMode.AlwaysWhenOccluded || (seeThrough == SeeThroughMode.WhenHighlighted && _highlighted)); if (seeThroughReal) { - seeThroughReal = RenderSeeThroughOccluders(cbHighlight, cam); + seeThroughReal = RenderSeeThroughOccluders(cam); if (seeThroughReal && seeThroughOccluderMask != -1) { if (seeThroughOccluderMaskAccurate) { - CheckOcclusionAccurate(cbHighlight, cam); + CheckOcclusionAccurate(cam); } else { seeThroughReal = CheckOcclusion(cam); } @@ -652,6 +729,12 @@ namespace HighlightPlus { return; } + if (skipThisFrame == Time.frameCount) { + return; + } + + if (rms == null) return; + // Check camera culling mask int cullingMask = cam.cullingMask; @@ -665,21 +748,47 @@ namespace HighlightPlus { } } - // Apply effect - float glowReal = _highlighted ? this.glow : 0; if (fxMatMask == null) return; + // Apply effect + float glowReal = _highlighted ? this.glow : 0; + // Check smooth blend ztesting capability + bool useSmoothGlow = glow > 0 && glowQuality == QualityLevel.Highest; + bool useSmoothOutline = outline > 0 && outlineQuality == QualityLevel.Highest; + bool useSmoothBlend = useSmoothGlow || useSmoothOutline; + if (useSmoothBlend) { + if (useSmoothGlow && useSmoothOutline) { + outlineVisibility = glowVisibility; + } + } Visibility smoothGlowVisibility = glowVisibility; Visibility smoothOutlineVisibility = outlineVisibility; - - float aspect = cam.aspect; - bool somePartVisible = false; +#if UNITY_EDITOR + if (useSmoothBlend && cam.cameraType == CameraType.SceneView) { + smoothGlowVisibility = smoothOutlineVisibility = Visibility.AlwaysOnTop; + } +#endif + if (useSmoothBlend) { + if (depthClip) { + cam.depthTextureMode |= DepthTextureMode.Depth; + } + if (Application.isMobilePlatform || (cam.allowMSAA && QualitySettings.antiAliasing > 1)) { + smoothGlowVisibility = smoothOutlineVisibility = Visibility.AlwaysOnTop; + } else if (UnityEngine.XR.XRSettings.enabled && Application.isPlaying) { + smoothGlowVisibility = smoothOutlineVisibility = Visibility.AlwaysOnTop; + } + } // First create masks + float camAspect = cam.aspect; + bool independentFullScreenNotExecuted = true; + bool somePartVisible = false; + for (int k = 0; k < rmsCount; k++) { rms[k].render = false; + Transform t = rms[k].transform; if (t == null) continue; @@ -688,8 +797,8 @@ namespace HighlightPlus { if (mesh == null) continue; + int layer = t.gameObject.layer; if (!ignoreObjectVisibility) { - int layer = t.gameObject.layer; if (((1 << layer) & cullingMask) == 0) continue; if (!rms[k].renderer.isVisible) @@ -701,38 +810,66 @@ namespace HighlightPlus { if (rms[k].isCombined) { rms[k].renderingMatrix = t.localToWorldMatrix; + } else if (!rms[k].preserveOriginalMesh) { + Vector3 lossyScale = t.lossyScale; + Vector3 position = t.position; + if (rms[k].bakedTransform) { + if (rms[k].currentPosition != t.position || rms[k].currentRotation != t.eulerAngles || rms[k].currentScale != t.lossyScale) { + BakeTransform(k, true); + } + rms[k].renderingMatrix = matrix4X4Identity; + } else { + rms[k].renderingMatrix = Matrix4x4.TRS(position, t.rotation, lossyScale); + } } + // Outline if (outlineIndependent) { if (useSmoothBlend) { if (independentFullScreenNotExecuted) { independentFullScreenNotExecuted = false; - cbHighlight.DrawMesh(quadMesh, matrix4x4Identity, fxMatClearStencil, 0, 0); + fxMatClearStencil.SetPass(0); + if (subMeshMask > 0) { + for (int l = 0; l < mesh.subMeshCount; l++) { + if (((1 << l) & subMeshMask) != 0) { + Graphics.DrawMeshNow(quadMesh, matrix4X4Identity, l); + } + } + } else { + Graphics.DrawMeshNow(quadMesh, matrix4X4Identity); + } } } else if (outline > 0 || glow > 0) { float width = outlineWidth; if (glow > 0) { width = Mathf.Max(width, glowWidth); } + Material mat = fxMatOutline; + bool usesMultipleOffsets = normalsOption != NormalsOption.Planar && outlineQuality.UsesMultipleOffsets(); for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; - if (outlineQuality.UsesMultipleOffsets()) { + if (usesMultipleOffsets) { for (int o = outlineOffsetsMin; o <= outlineOffsetsMax; o++) { - Vector4 direction = offsets[o] * (width / 100f); - direction.y *= aspect; - cbHighlight.SetGlobalVector(ShaderParams.OutlineDirection, direction); - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatOutline[l], l, 1); + Vector3 direction = offsets[o] * (width / 100f); + direction.y *= camAspect; + mat.SetVector(ShaderParams.OutlineDirection, direction); + if (rms[k].preserveOriginalMesh) { + cbOutline.Clear(); + cbOutline.DrawRenderer(rms[k].renderer, mat, l, 1); + Graphics.ExecuteCommandBuffer(cbOutline); } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatOutline[l], l, 1); + mat.SetPass(1); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } } else { - cbHighlight.SetGlobalVector(ShaderParams.OutlineDirection, Vector4.zero); - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatOutline[l], l, 1); + if (rms[k].preserveOriginalMesh) { + cbOutline.Clear(); + cbOutline.DrawRenderer(rms[k].renderer, mat, l, 1); + Graphics.ExecuteCommandBuffer(cbOutline); } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatOutline[l], l, 1); + mat.SetPass(1); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } } @@ -741,6 +878,8 @@ namespace HighlightPlus { } + if (!somePartVisible) return; + bool renderMaskOnTop = _highlighted && ((outline > 0 && smoothOutlineVisibility != Visibility.Normal) || (glow > 0 && smoothGlowVisibility != Visibility.Normal) || (innerGlow > 0 && innerGlowVisibility != Visibility.Normal)); if (maskRequired) { for (int k = 0; k < rmsCount; k++) { @@ -782,10 +921,65 @@ namespace HighlightPlus { glowReal *= 0.5f; } - bool targetEffectRendered = false; - bool usesSeeThroughBorder = (seeThroughBorder * seeThroughBorderWidth) > 0; + int smoothRTWidth = 0; + int smoothRTHeight = 0; + Bounds smoothBounds = new Bounds(); + + if (useSmoothBlend) { + // Prepare smooth outer glow / outline target + if (cbSmoothBlend == null) { + CheckBlurCommandBuffer(); + } + cbSmoothBlend.Clear(); + smoothRTWidth = cam.pixelWidth; + smoothRTHeight = cam.pixelHeight; + if (smoothRTHeight <= 0) { + smoothRTHeight = 1; + } + if (UnityEngine.XR.XRSettings.enabled && Application.isPlaying) { + sourceDesc = UnityEngine.XR.XRSettings.eyeTextureDesc; + } else { + sourceDesc = new RenderTextureDescriptor(smoothRTWidth, smoothRTHeight, Application.isMobilePlatform ? RenderTextureFormat.Default : RenderTextureFormat.DefaultHDR); + sourceDesc.volumeDepth = 1; + } + sourceDesc.msaaSamples = 1; + sourceDesc.useMipMap = false; + sourceDesc.depthBufferBits = 0; + + cbSmoothBlend.GetTemporaryRT(sourceRT, sourceDesc, FilterMode.Bilinear); + RenderTargetIdentifier sourceDestination = new RenderTargetIdentifier(sourceRT, 0, CubemapFace.Unknown, -1); + if ((glow > 0 && smoothGlowVisibility == Visibility.AlwaysOnTop) || (outline > 0 && smoothOutlineVisibility == Visibility.AlwaysOnTop)) { + cbSmoothBlend.SetRenderTarget(sourceDestination); + } else { + RenderTargetIdentifier targetDestination = new RenderTargetIdentifier(BuiltinRenderTextureType.CameraTarget, 0, CubemapFace.Unknown, -1); + if (Application.isMobilePlatform) { + cbSmoothBlend.SetRenderTarget(sourceDestination, RenderBufferLoadAction.DontCare, RenderBufferStoreAction.DontCare, targetDestination, RenderBufferLoadAction.Load, RenderBufferStoreAction.DontCare); + } else { + cbSmoothBlend.SetRenderTarget(sourceDestination, targetDestination); + } + } + cbSmoothBlend.ClearRenderTarget(false, true, new Color(0, 0, 0, 0)); + } + + bool targetEffectRendered = false; + cbSeeThrough.Clear(); + + // Add effects + if (seeThroughReal && renderMaskOnTop) { + for (int k = 0; k < rmsCount; k++) { + if (!rms[k].render) + continue; + Mesh mesh = rms[k].mesh; + RenderSeeThroughClearStencil(k, mesh); + } + for (int k = 0; k < rmsCount; k++) { + if (!rms[k].render) + continue; + Mesh mesh = rms[k].mesh; + RenderSeeThroughMask(k, mesh); + } + } - // Add mesh effects for (int k = 0; k < rmsCount; k++) { if (!rms[k].render) continue; @@ -797,6 +991,34 @@ namespace HighlightPlus { fade *= ComputeCameraDistanceFade(rms[k].transform.position, cam.transform); } + // See-Through + if (seeThroughReal) { + if (seeThroughDepthOffset > 0) { + cam.depthTextureMode |= DepthTextureMode.Depth; + } + bool usesSeeThroughBorder = (seeThroughBorder * seeThroughBorderWidth) > 0; + if (rms[k].preserveOriginalMesh) { + for (int l = 0; l < mesh.subMeshCount; l++) { + if (((1 << l) & subMeshMask) == 0) continue; + if (l < rms[k].fxMatSeeThroughInner.Length && rms[k].fxMatSeeThroughInner[l] != null) { + cbSeeThrough.DrawRenderer(rms[k].renderer, rms[k].fxMatSeeThroughInner[l], l); + if (usesSeeThroughBorder) { + cbSeeThrough.DrawRenderer(rms[k].renderer, rms[k].fxMatSeeThroughBorder[l], l); + } + } + } + } else { + for (int l = 0; l < mesh.subMeshCount; l++) { + if (((1 << l) & subMeshMask) == 0) continue; + if (l < rms[k].fxMatSeeThroughInner.Length && rms[k].fxMatSeeThroughInner[l] != null) { + cbSeeThrough.DrawMesh(mesh, rms[k].renderingMatrix, rms[k].fxMatSeeThroughInner[l], l); + if (usesSeeThroughBorder) { + cbSeeThrough.DrawMesh(mesh, rms[k].renderingMatrix, rms[k].fxMatSeeThroughBorder[l], l); + } + } + } + } + } if (_highlighted || hitActive) { // Hit FX @@ -832,6 +1054,7 @@ namespace HighlightPlus { overlayColor.a = overlay * fade; innerGlowColorA.a = innerGlow * fade; } + for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; @@ -846,21 +1069,27 @@ namespace HighlightPlus { } else { fxMat.SetVector(ShaderParams.OverlayHitPosData, Vector4.zero); } - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatOverlay[l], l); + if (rms[k].preserveOriginalMesh) { + cbOverlay.Clear(); + cbOverlay.DrawRenderer(rms[k].renderer, fxMat, l); + Graphics.ExecuteCommandBuffer(cbOverlay); } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatOverlay[l], l); + fxMat.SetPass(0); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } - // Inner Glow if (innerGlowColorA.a > 0) { rms[k].fxMatInnerGlow[l].SetColor(ShaderParams.InnerGlowColor, innerGlowColorA); - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatInnerGlow[l], l); + + if (rms[k].preserveOriginalMesh) { + cbInnerGlow.Clear(); + cbInnerGlow.DrawRenderer(rms[k].renderer, rms[k].fxMatInnerGlow[l], l); + Graphics.ExecuteCommandBuffer(cbInnerGlow); } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatInnerGlow[l], l); + rms[k].fxMatInnerGlow[l].SetPass(0); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } } @@ -869,59 +1098,79 @@ namespace HighlightPlus { if (!_highlighted) continue; - bool allowGPUInstancing = useGPUInstancing && !rms[k].isSkinnedMesh; + if (useSmoothBlend) { + if (k == 0) { + smoothBounds = rms[k].renderer.bounds; + } else { + smoothBounds.Encapsulate(rms[k].renderer.bounds); + } + } for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; + // Render object body for glow/outline highest quality + if (useSmoothBlend) { + if (l < rms[k].fxMatSolidColor.Length) { + if (rms[k].preserveOriginalMesh) { + cbSmoothBlend.DrawRenderer(rms[k].renderer, rms[k].fxMatSolidColor[l], l); + } else { + cbSmoothBlend.DrawMesh(mesh, rms[k].renderingMatrix, rms[k].fxMatSolidColor[l], l); + } + } + } + // Glow if (glow > 0 && glowQuality != QualityLevel.Highest) { matDataGlow.Clear(); matDataColor.Clear(); matDataDirection.Clear(); - for (int glowPass = 0; glowPass < glowPasses.Length; glowPass++) { - if (glowQuality.UsesMultipleOffsets()) { + Material mat = fxMatGlow; + Vector4 directionZero = normalsOption == NormalsOption.Planar ? new Vector4(0, 0, glowWidth / 100f, 0) : Vector4.zero; + mat.SetVector(ShaderParams.GlowDirection, directionZero); + for (int j = 0; j < glowPasses.Length; j++) { + Color dataColor = glowPasses[j].color; + mat.SetColor(ShaderParams.GlowColor, dataColor); + Vector4 dataGlow = new Vector4(fade * glowReal * glowPasses[j].alpha, normalsOption == NormalsOption.Planar ? 0 : glowPasses[j].offset * glowWidth / 100f, glowMagicNumber1, glowMagicNumber2); + mat.SetVector(ShaderParams.Glow, dataGlow); + if (normalsOption != NormalsOption.Planar && glowQuality.UsesMultipleOffsets()) { for (int o = glowOffsetsMin; o <= glowOffsetsMax; o++) { Vector4 direction = offsets[o]; - direction.y *= aspect; - Color dataColor = glowPasses[glowPass].color; - Vector4 dataGlow = new Vector4(fade * glowReal * glowPasses[glowPass].alpha, glowPasses[glowPass].offset * glowWidth / 100f, glowMagicNumber1, glowMagicNumber2); - if (allowGPUInstancing) { - matDataDirection.Add(direction); - matDataGlow.Add(dataGlow); - matDataColor.Add(new Vector4(dataColor.r, dataColor.g, dataColor.b, dataColor.a)); + direction.y *= camAspect; + mat.SetVector(ShaderParams.GlowDirection, direction); + if (rms[k].preserveOriginalMesh) { + cbGlow.Clear(); + cbGlow.DrawRenderer(rms[k].renderer, mat, l); + Graphics.ExecuteCommandBuffer(cbGlow); } else { - cbHighlight.SetGlobalVector(ShaderParams.GlowDirection, direction); - cbHighlight.SetGlobalColor(ShaderParams.GlowColor, dataColor); - cbHighlight.SetGlobalVector(ShaderParams.Glow, dataGlow); - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatGlow[l], l); + if (useGPUInstancing) { + matDataDirection.Add(direction); + matDataGlow.Add(dataGlow); + matDataColor.Add(new Vector4(dataColor.r, dataColor.g, dataColor.b, dataColor.a)); } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatGlow[l], l); + mat.SetPass(0); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } } } else { - Vector4 dataGlow = new Vector4(fade * glowReal * glowPasses[glowPass].alpha, glowPasses[glowPass].offset * glowWidth / 100f, glowMagicNumber1, glowMagicNumber2); - Color dataColor = glowPasses[glowPass].color; - if (allowGPUInstancing) { - matDataDirection.Add(Vector4.zero); - matDataGlow.Add(dataGlow); - matDataColor.Add(new Vector4(dataColor.r, dataColor.g, dataColor.b, dataColor.a)); + if (rms[k].preserveOriginalMesh) { + cbGlow.Clear(); + cbGlow.DrawRenderer(rms[k].renderer, mat, l); + Graphics.ExecuteCommandBuffer(cbGlow); } else { - int matIndex = glowPass * 8; - cbHighlight.SetGlobalColor(ShaderParams.GlowColor, dataColor); - cbHighlight.SetGlobalVector(ShaderParams.Glow, dataGlow); - cbHighlight.SetGlobalVector(ShaderParams.GlowDirection, Vector4.zero); - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatGlow[l], l); + if (useGPUInstancing) { + matDataDirection.Add(directionZero); + matDataGlow.Add(dataGlow); + matDataColor.Add(new Vector4(dataColor.r, dataColor.g, dataColor.b, dataColor.a)); } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatGlow[l], l); + mat.SetPass(0); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } } } - if (allowGPUInstancing) { + if (useGPUInstancing) { int instanceCount = matDataDirection.Count; if (instanceCount > 0) { glowPropertyBlock.Clear(); @@ -931,17 +1180,12 @@ namespace HighlightPlus { if (matrices == null || matrices.Length < instanceCount) { matrices = new Matrix4x4[instanceCount]; } - if (rms[k].isCombined) { - for (int m = 0; m < instanceCount; m++) { - matrices[m] = rms[k].renderingMatrix; - } - } else { - Matrix4x4 objectToWorld = rms[k].transform.localToWorldMatrix; - for (int m = 0; m < instanceCount; m++) { - matrices[m] = objectToWorld; - } + for (int m = 0; m < instanceCount; m++) { + matrices[m] = rms[k].renderingMatrix; } - cbHighlight.DrawMeshInstanced(mesh, l, rms[k].fxMatGlow[l], 0, matrices, instanceCount, glowPropertyBlock); + cbGlow.Clear(); + cbGlow.DrawMeshInstanced(mesh, l, mat, 0, matrices, instanceCount, glowPropertyBlock); + Graphics.ExecuteCommandBuffer(cbGlow); } } } @@ -950,24 +1194,28 @@ namespace HighlightPlus { if (outline > 0 && outlineQuality != QualityLevel.Highest) { Color outlineColor = this.outlineColor; outlineColor.a = outline * fade; - if (outlineQuality.UsesMultipleOffsets()) { + Material mat = fxMatOutline; + mat.SetColor(ShaderParams.OutlineColor, outlineColor); + if (normalsOption != NormalsOption.Planar && outlineQuality.UsesMultipleOffsets()) { matDataDirection.Clear(); for (int o = outlineOffsetsMin; o <= outlineOffsetsMax; o++) { - cbHighlight.SetGlobalColor(ShaderParams.OutlineColor, outlineColor); Vector4 direction = offsets[o] * (outlineWidth / 100f); - direction.y *= aspect; - if (allowGPUInstancing) { - matDataDirection.Add(direction); + direction.y *= camAspect; + mat.SetVector(ShaderParams.OutlineDirection, direction); + if (rms[k].preserveOriginalMesh) { + cbOutline.Clear(); + cbOutline.DrawRenderer(rms[k].renderer, mat, l, 0); + Graphics.ExecuteCommandBuffer(cbOutline); } else { - cbHighlight.SetGlobalVector(ShaderParams.OutlineDirection, direction); - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatOutline[l], l, 0); + if (useGPUInstancing) { + matDataDirection.Add(direction); } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatOutline[l], l, 0); + mat.SetPass(0); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } } - if (allowGPUInstancing) { + if (useGPUInstancing) { int instanceCount = matDataDirection.Count; if (instanceCount > 0) { outlinePropertyBlock.Clear(); @@ -975,31 +1223,25 @@ namespace HighlightPlus { if (matrices == null || matrices.Length < instanceCount) { matrices = new Matrix4x4[instanceCount]; } - if (rms[k].isCombined) { - for (int m = 0; m < instanceCount; m++) { - matrices[m] = rms[k].renderingMatrix; - } - } else { - Matrix4x4 objectToWorld = rms[k].transform.localToWorldMatrix; - for (int m = 0; m < instanceCount; m++) { - matrices[m] = objectToWorld; - } + for (int m = 0; m < instanceCount; m++) { + matrices[m] = rms[k].renderingMatrix; } - cbHighlight.DrawMeshInstanced(mesh, l, rms[k].fxMatOutline[l], 0, matrices, instanceCount, outlinePropertyBlock); + cbGlow.Clear(); // we reuse the same commandbuffer for glow + cbGlow.DrawMeshInstanced(mesh, l, mat, 0, matrices, instanceCount, outlinePropertyBlock); + Graphics.ExecuteCommandBuffer(cbGlow); } } } else { - cbHighlight.SetGlobalColor(ShaderParams.OutlineColor, outlineColor); - cbHighlight.SetGlobalVector(ShaderParams.OutlineDirection, Vector4.zero); - if (rms[k].isSkinnedMesh) { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatOutline[l], l, 0); + if (rms[k].preserveOriginalMesh) { + cbOutline.Clear(); + cbOutline.DrawRenderer(rms[k].renderer, mat, l, 0); + Graphics.ExecuteCommandBuffer(cbOutline); } else { - // keep this because normals may be reoriented / smoothed - cbHighlight.DrawMesh(mesh, rms[k].transform.localToWorldMatrix, rms[k].fxMatOutline[l], l, 0); + mat.SetPass(0); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } } - } // Target @@ -1031,6 +1273,7 @@ namespace HighlightPlus { } else { time = (float)DateTime.Now.Subtract(DateTime.Today).TotalSeconds; } + Bounds bounds = rms[k].renderer.bounds; if (!targetFXScaleToRenderBounds) { bounds.size = Vector3.one; @@ -1063,8 +1306,10 @@ namespace HighlightPlus { Matrix4x4 m = Matrix4x4.TRS(center, rotation, scale); Color color = targetFXColor; color.a *= fade * fadeOut; - fxMatTarget.color = color; - cbHighlight.DrawMesh(cubeMesh, m, fxMatTarget, 0, 0); + Material mat = fxMatTarget; + mat.color = color; + mat.SetPass(0); + Graphics.DrawMeshNow(cubeMesh, m); } } else { rotation = Quaternion.LookRotation(cam.transform.position - rms[k].transform.position); @@ -1076,63 +1321,16 @@ namespace HighlightPlus { Matrix4x4 m = Matrix4x4.TRS(center, rotation, scale); Color color = targetFXColor; color.a *= fade * fadeOut; - fxMatTarget.color = color; - cbHighlight.DrawMesh(quadMesh, m, fxMatTarget, 0, 1); + Material mat = fxMatTarget; + mat.color = color; + mat.SetPass(1); + Graphics.DrawMeshNow(quadMesh, m); } } } } - if (useSmoothBlend && _highlighted && somePartVisible) { - - int smoothRTWidth = 0; - int smoothRTHeight = 0; - Bounds smoothBounds = new Bounds(); - - // Prepare smooth outer glow / outline target - smoothRTWidth = cam.pixelWidth; - smoothRTHeight = cam.pixelHeight; - if (smoothRTHeight <= 0) { - smoothRTHeight = 1; - } - if (UnityEngine.XR.XRSettings.enabled && Application.isPlaying) { - sourceDesc = UnityEngine.XR.XRSettings.eyeTextureDesc; - } else { - sourceDesc = new RenderTextureDescriptor(smoothRTWidth, smoothRTHeight, Application.isMobilePlatform ? RenderTextureFormat.Default : RenderTextureFormat.DefaultHDR); - sourceDesc.volumeDepth = 1; - } - sourceDesc.msaaSamples = 1; - sourceDesc.useMipMap = false; - sourceDesc.depthBufferBits = 0; - - cbHighlight.GetTemporaryRT(sourceRT, sourceDesc, FilterMode.Bilinear); - RenderTargetIdentifier sourceTarget = new RenderTargetIdentifier(sourceRT, 0, CubemapFace.Unknown, -1); - cbHighlight.SetRenderTarget(sourceTarget); - cbHighlight.ClearRenderTarget(false, true, new Color(0, 0, 0, 0)); - - for (int k = 0; k < rmsCount; k++) { - if (!rms[k].render) - continue; - if (k == 0) { - smoothBounds = rms[k].renderer.bounds; - } else { - smoothBounds.Encapsulate(rms[k].renderer.bounds); - } - Mesh mesh = rms[k].mesh; - - // Render object body for glow/outline highest quality - for (int l = 0; l < mesh.subMeshCount; l++) { - if (((1 << l) & subMeshMask) == 0) continue; - if (l < rms[k].fxMatSolidColor.Length) { - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatSolidColor[l], l); - } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatSolidColor[l], l); - } - } - } - } - + if (useSmoothBlend) { if (ComputeSmoothQuadMatrix(cam, smoothBounds)) { // Smooth Glow if (useSmoothGlow) { @@ -1143,8 +1341,7 @@ namespace HighlightPlus { // Smooth Outline if (useSmoothOutline) { - float intensity = outline * fade; - fxMatComposeOutline.color = new Color(outlineColor.r, outlineColor.g, outlineColor.b, outlineColor.a * intensity * 10f); + fxMatComposeOutline.color = new Color(outlineColor.r, outlineColor.g, outlineColor.b, 5f * outlineColor.a * outline * fade); SmoothOutline(smoothRTWidth / outlineDownsampling, smoothRTHeight / outlineDownsampling); } @@ -1153,110 +1350,83 @@ namespace HighlightPlus { } } - // See-Through - if (seeThroughReal) { - if (renderMaskOnTop) { - for (int k = 0; k < rmsCount; k++) { - if (!rms[k].render) - continue; - Mesh mesh = rms[k].mesh; - RenderSeeThroughClearStencil(k, mesh); - } - for (int k = 0; k < rmsCount; k++) { - if (!rms[k].render) - continue; - Mesh mesh = rms[k].mesh; - RenderSeeThroughMask(k, mesh); - } - } + if (seeThroughReal && seeThroughOrdered) { // Ordered for see-through for (int k = 0; k < rmsCount; k++) { if (!rms[k].render) continue; Mesh mesh = rms[k].mesh; for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; - if (l < rms[k].fxMatSeeThroughInner.Length && rms[k].fxMatSeeThroughInner[l] != null) { - if (rms[k].isCombined) { - cbHighlight.DrawMesh(mesh, rms[k].renderingMatrix, rms[k].fxMatSeeThroughInner[l], l); - } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatSeeThroughInner[l], l); - } - } - if (usesSeeThroughBorder) { - if (rms[k].isCombined) { - cbHighlight.DrawMesh(mesh, rms[k].renderingMatrix, rms[k].fxMatSeeThroughBorder[l], l); - } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatSeeThroughBorder[l], l); - } - } - } - } - - if (seeThroughOrdered) { // Ordered for see-through - for (int k = 0; k < rmsCount; k++) { - if (!rms[k].render) - continue; - Mesh mesh = rms[k].mesh; - for (int l = 0; l < mesh.subMeshCount; l++) { - if (((1 << l) & subMeshMask) == 0) continue; - if (rms[k].isCombined) { - cbHighlight.DrawMesh(mesh, rms[k].renderingMatrix, fxMatClearStencil, l, 1); - } else { - cbHighlight.DrawRenderer(rms[k].renderer, fxMatClearStencil, l, 1); - } + if (rms[k].isCombined) { + cbSeeThrough.DrawMesh(mesh, rms[k].renderingMatrix, fxMatClearStencil, l, 1); + } else { + cbSeeThrough.DrawRenderer(rms[k].renderer, fxMatClearStencil, l, 1); } } } } - + Graphics.ExecuteCommandBuffer(cbSeeThrough); } - void RenderMask(int k, Mesh mesh, bool renderMaskOnTop) { - for (int l = 0; l < mesh.subMeshCount; l++) { - if (((1 << l) & subMeshMask) == 0) continue; - if (renderMaskOnTop) { - rms[k].fxMatMask[l].SetInt(ShaderParams.ZTest, (int)CompareFunction.Always); - } else { - rms[k].fxMatMask[l].SetInt(ShaderParams.ZTest, (int)CompareFunction.LessEqual); + + void RenderMask(int k, Mesh mesh, bool alwaysOnTop) { + if (rms[k].preserveOriginalMesh) { + cbMask.Clear(); + for (int l = 0; l < mesh.subMeshCount; l++) { + if (((1 << l) & subMeshMask) == 0) continue; + if (alwaysOnTop) { + rms[k].fxMatMask[l].SetInt(ShaderParams.ZTest, (int)CompareFunction.Always); + } else { + rms[k].fxMatMask[l].SetInt(ShaderParams.ZTest, (int)CompareFunction.LessEqual); + } + cbMask.DrawRenderer(rms[k].renderer, rms[k].fxMatMask[l], l, 0); } - if (rms[k].isCombined) { - cbHighlight.DrawMesh(rms[k].mesh, rms[k].renderingMatrix, rms[k].fxMatMask[l], l, 0); - } else { - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatMask[l], l, 0); + Graphics.ExecuteCommandBuffer(cbMask); + } else { + for (int l = 0; l < mesh.subMeshCount; l++) { + if (((1 << l) & subMeshMask) == 0) continue; + if (alwaysOnTop) { + rms[k].fxMatMask[l].SetInt(ShaderParams.ZTest, (int)CompareFunction.Always); + } else { + rms[k].fxMatMask[l].SetInt(ShaderParams.ZTest, (int)CompareFunction.LessEqual); + } + rms[k].fxMatMask[l].SetPass(0); + Graphics.DrawMeshNow(mesh, rms[k].renderingMatrix, l); } } + + } void RenderSeeThroughClearStencil(int k, Mesh mesh) { - if (rms[k].isCombined) { + if (rms[k].preserveOriginalMesh) { for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; - cbHighlight.DrawMesh(mesh, rms[k].renderingMatrix, fxMatClearStencil, l, 1); + cbSeeThrough.DrawRenderer(rms[k].renderer, fxMatClearStencil, l, 1); } } else { for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; - cbHighlight.DrawRenderer(rms[k].renderer, fxMatClearStencil, l, 1); + cbSeeThrough.DrawMesh(mesh, rms[k].renderingMatrix, fxMatClearStencil, l, 1); } } } void RenderSeeThroughMask(int k, Mesh mesh) { - if (rms[k].isCombined) { + if (rms[k].preserveOriginalMesh) { for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; - cbHighlight.DrawMesh(mesh, rms[k].renderingMatrix, rms[k].fxMatMask[l], l, 1); + cbSeeThrough.DrawRenderer(rms[k].renderer, rms[k].fxMatMask[l], l, 1); } } else { for (int l = 0; l < mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; - cbHighlight.DrawRenderer(rms[k].renderer, rms[k].fxMatMask[l], l, 1); + cbSeeThrough.DrawMesh(mesh, rms[k].renderingMatrix, rms[k].fxMatMask[l], l, 1); } } } - bool ComputeSmoothQuadMatrix(Camera cam, Bounds bounds) { // Compute bounds in screen space and enlarge for glow space Vector3 min = bounds.min; @@ -1360,19 +1530,21 @@ namespace HighlightPlus { } glowDesc.width = reducedWidth; glowDesc.height = reducedHeight; - cbHighlight.GetTemporaryRT(mipGlowBuffers[k], glowDesc, FilterMode.Bilinear); + cbSmoothBlend.GetTemporaryRT(mipGlowBuffers[k], glowDesc, FilterMode.Bilinear); } + Material matBlur = fxMatBlurGlow; + for (int k = 0; k < bufferCount - 1; k += 2) { if (k == 0) { - FullScreenBlit(cbHighlight, sourceRT, mipGlowBuffers[k + 1], fxMatBlurGlow, 0); + cbSmoothBlend.Blit(sourceRT, mipGlowBuffers[k + 1], matBlur, 0); } else { - FullScreenBlit(cbHighlight, mipGlowBuffers[k], mipGlowBuffers[k + 1], fxMatBlurGlow, 0); + cbSmoothBlend.Blit(mipGlowBuffers[k], mipGlowBuffers[k + 1], matBlur, 0); } - FullScreenBlit(cbHighlight, mipGlowBuffers[k + 1], mipGlowBuffers[k], fxMatBlurGlow, 1); + cbSmoothBlend.Blit(mipGlowBuffers[k + 1], mipGlowBuffers[k], matBlur, 1); if (k < bufferCount - 2) { - FullScreenBlit(cbHighlight, mipGlowBuffers[k], mipGlowBuffers[k + 2], fxMatBlurGlow, 2); + cbSmoothBlend.Blit(mipGlowBuffers[k], mipGlowBuffers[k + 2], matBlur, 2); } } } @@ -1405,90 +1577,87 @@ namespace HighlightPlus { } outlineDesc.width = reducedWidth; outlineDesc.height = reducedHeight; - cbHighlight.GetTemporaryRT(mipOutlineBuffers[k], outlineDesc, FilterMode.Bilinear); + cbSmoothBlend.GetTemporaryRT(mipOutlineBuffers[k], outlineDesc, FilterMode.Bilinear); } + Material matBlur = fxMatBlurOutline; for (int k = 0; k < bufferCount - 1; k += 2) { if (k == 0) { - FullScreenBlit(cbHighlight, sourceRT, mipOutlineBuffers[k + 1], fxMatBlurOutline, 0); + cbSmoothBlend.Blit(sourceRT, mipOutlineBuffers[k + 1], matBlur, 0); } else { - FullScreenBlit(cbHighlight, mipOutlineBuffers[k], mipOutlineBuffers[k + 1], fxMatBlurOutline, 0); + cbSmoothBlend.Blit(mipOutlineBuffers[k], mipOutlineBuffers[k + 1], matBlur, 0); } - FullScreenBlit(cbHighlight, mipOutlineBuffers[k + 1], mipOutlineBuffers[k], fxMatBlurOutline, 1); + cbSmoothBlend.Blit(mipOutlineBuffers[k + 1], mipOutlineBuffers[k], matBlur, 1); if (k < bufferCount - 2) { - FullScreenBlit(cbHighlight, mipOutlineBuffers[k], mipOutlineBuffers[k + 2], fxMatBlurOutline, 2); + cbSmoothBlend.Blit(mipOutlineBuffers[k], mipOutlineBuffers[k + 2], matBlur, 2); } } } - void ComposeSmoothBlend(Visibility smoothGlowVisibility, Visibility smoothOutlineVisibility) { - - // Render mask on target surface - //if (Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.IPhonePlayer) { // TODO: RML - cbHighlight.SetRenderTarget(colorAttachmentBuffer, depthAttachmentBuffer); - //} else { - // cbHighlight.SetRenderTarget(colorAttachmentBuffer); - //} - bool renderSmoothGlow = glow > 0 && glowQuality == QualityLevel.Highest; + RenderTargetIdentifier cameraTargetDestination = new RenderTargetIdentifier(BuiltinRenderTextureType.CameraTarget, 0, CubemapFace.Unknown, -1); if (renderSmoothGlow) { - fxMatComposeGlow.SetVector(ShaderParams.Flip, (UnityEngine.XR.XRSettings.enabled && flipY) ? new Vector4(1, -1) : new Vector4(0, 1)); - fxMatComposeGlow.SetInt(ShaderParams.ZTest, GetZTestValue(smoothGlowVisibility)); - fxMatComposeGlow.SetColor(ShaderParams.Debug, glowBlitDebug ? debugColor : blackColor); - fxMatComposeGlow.SetInt(ShaderParams.GlowStencilComp, glowIgnoreMask ? (int)CompareFunction.Always : (int)CompareFunction.NotEqual); - cbHighlight.DrawMesh(quadMesh, quadGlowMatrix, fxMatComposeGlow, 0, 0); + Material matComposeGlow = fxMatComposeGlow; + matComposeGlow.SetVector(ShaderParams.Flip, (UnityEngine.XR.XRSettings.enabled && flipY) ? new Vector3(1, -1, 0) : new Vector3(0, 1, 0)); + if (glowOptimalBlit) { + if (Application.isMobilePlatform && smoothGlowVisibility != Visibility.AlwaysOnTop) { + cbSmoothBlend.SetRenderTarget(cameraTargetDestination, RenderBufferLoadAction.Load, RenderBufferStoreAction.DontCare); + } else { + cbSmoothBlend.SetRenderTarget(cameraTargetDestination); + } + matComposeGlow.SetInt(ShaderParams.ZTest, GetZTestValue(smoothGlowVisibility)); + matComposeGlow.SetColor(ShaderParams.Debug, glowBlitDebug ? debugColor : blackColor); + cbSmoothBlend.DrawMesh(quadMesh, quadGlowMatrix, matComposeGlow, 0, 0); + } else { + cbSmoothBlend.Blit(glowRT, cameraTargetDestination, matComposeGlow, 1); + } } bool renderSmoothOutline = outline > 0 && outlineQuality == QualityLevel.Highest; if (renderSmoothOutline) { - fxMatComposeOutline.SetVector(ShaderParams.Flip, (UnityEngine.XR.XRSettings.enabled && flipY) ? new Vector4(1, -1) : new Vector4(0, 1)); - fxMatComposeOutline.SetInt(ShaderParams.ZTest, GetZTestValue(smoothOutlineVisibility)); - fxMatComposeOutline.SetColor(ShaderParams.Debug, outlineBlitDebug ? debugColor : blackColor); - cbHighlight.DrawMesh(quadMesh, quadOutlineMatrix, fxMatComposeOutline, 0, 0); + Material matComposeOutline = fxMatComposeOutline; + matComposeOutline.SetVector(ShaderParams.Flip, (UnityEngine.XR.XRSettings.enabled && flipY) ? new Vector3(1, -1, 0) : new Vector3(0, 1, 0)); + Debug.Log(Camera.current.name + " " + smoothOutlineVisibility); + if (outlineOptimalBlit) { + if (Application.isMobilePlatform && smoothOutlineVisibility != Visibility.AlwaysOnTop) { + cbSmoothBlend.SetRenderTarget(cameraTargetDestination, RenderBufferLoadAction.Load, RenderBufferStoreAction.DontCare); + } else { + cbSmoothBlend.SetRenderTarget(cameraTargetDestination); + } + matComposeOutline.SetInt(ShaderParams.ZTest, GetZTestValue(smoothOutlineVisibility)); + matComposeOutline.SetColor(ShaderParams.Debug, outlineBlitDebug ? debugColor : blackColor); + cbSmoothBlend.DrawMesh(quadMesh, quadOutlineMatrix, matComposeOutline, 0, 0); + } else { + cbSmoothBlend.Blit(outlineRT, cameraTargetDestination, matComposeOutline, 1); + } } // Release render textures if (renderSmoothGlow) { for (int k = 0; k < mipGlowBuffers.Length; k++) { - cbHighlight.ReleaseTemporaryRT(mipGlowBuffers[k]); + cbSmoothBlend.ReleaseTemporaryRT(mipGlowBuffers[k]); } } if (renderSmoothOutline) { for (int k = 0; k < mipOutlineBuffers.Length; k++) { - cbHighlight.ReleaseTemporaryRT(mipOutlineBuffers[k]); + cbSmoothBlend.ReleaseTemporaryRT(mipOutlineBuffers[k]); } } - cbHighlight.ReleaseTemporaryRT(sourceRT); + cbSmoothBlend.ReleaseTemporaryRT(sourceRT); + + Graphics.ExecuteCommandBuffer(cbSmoothBlend); } void InitMaterial(ref Material material, string shaderName) { - if (material != null) return; - Shader shaderFX = Shader.Find(shaderName); - if (shaderFX == null) { - Debug.LogError("Shader " + shaderName + " not found."); - enabled = false; - return; - } - material = new Material(shaderFX); - } - - void Fork(Material mat, ref Material[] mats, Mesh mesh) { - if (mesh == null) - return; - int count = mesh.subMeshCount; - Fork(mat, ref mats, count); - } - - void Fork(Material material, ref Material[] array, int count) { - if (array == null || array.Length < count) { - DestroyMaterialArray(array); - array = new Material[count]; - } - for (int k = 0; k < count; k++) { - if (array[k] == null) { - array[k] = Instantiate(material); + if (material == null) { + Shader shaderFX = Shader.Find(shaderName); + if (shaderFX == null) { + Debug.LogError("Shader " + shaderName + " not found."); + enabled = false; + return; } + material = new Material(shaderFX); } } @@ -1508,7 +1677,6 @@ namespace HighlightPlus { } - /// /// Sets target for highlight effects and also specify a list of renderers to be included as well /// @@ -1667,7 +1835,6 @@ namespace HighlightPlus { rms[rmsCount].renderer = renderer; rms[rmsCount].renderWasVisibleDuringSetup = renderer.isVisible; - if (renderer.transform != target) { HighlightEffect otherEffect = renderer.GetComponent(); if (otherEffect != null && otherEffect.enabled) { @@ -1686,10 +1853,11 @@ namespace HighlightPlus { bool isSkinnedMesh = renderer is SkinnedMeshRenderer; rms[rmsCount].isSkinnedMesh = isSkinnedMesh; rms[rmsCount].normalsOption = isSkinnedMesh ? NormalsOption.PreserveOriginal : normalsOption; - CheckCommandBuffers(); + if (rms[rmsCount].preserveOriginalMesh || combineMeshes) { + CheckCommandBuffers(); + } if (isSkinnedMesh) { // ignore cloth skinned renderers - rms[rmsCount].isSkinnedMesh = true; rms[rmsCount].mesh = ((SkinnedMeshRenderer)renderer).sharedMesh; } else if (Application.isPlaying && renderer.isPartOfStaticBatch) { // static batched objects need to have a mesh collider in order to use its original mesh @@ -1717,9 +1885,7 @@ namespace HighlightPlus { rms[rmsCount].transform = renderer.transform; Fork(fxMatMask, ref rms[rmsCount].fxMatMask, rms[rmsCount].mesh); - Fork(fxMatOutlineTemplate, ref rms[rmsCount].fxMatOutline, rms[rmsCount].mesh); - Fork(fxMatGlowTemplate, ref rms[rmsCount].fxMatGlow, rms[rmsCount].mesh); - Fork(fxMatSeeThrough, ref rms[rmsCount].fxMatSeeThroughInner, rms[rmsCount].mesh); + Fork(fxMatSeeThroughInner, ref rms[rmsCount].fxMatSeeThroughInner, rms[rmsCount].mesh); Fork(fxMatSeeThroughBorder, ref rms[rmsCount].fxMatSeeThroughBorder, rms[rmsCount].mesh); Fork(fxMatOverlay, ref rms[rmsCount].fxMatOverlay, rms[rmsCount].mesh); Fork(fxMatInnerGlow, ref rms[rmsCount].fxMatInnerGlow, rms[rmsCount].mesh); @@ -1727,12 +1893,14 @@ namespace HighlightPlus { rms[rmsCount].originalMesh = rms[rmsCount].mesh; if (!rms[rmsCount].preserveOriginalMesh) { if (innerGlow > 0 || (glow > 0 && glowQuality != QualityLevel.Highest) || (outline > 0 && outlineQuality != QualityLevel.Highest)) { - if (normalsOption == NormalsOption.Reorient) { + if (normalsOption == NormalsOption.Reorient || normalsOption == NormalsOption.Planar) { ReorientNormals(rmsCount); } else { AverageNormals(rmsCount); } } + // check if scale is negative + BakeTransform(rmsCount, true); } rmsCount++; } @@ -1749,14 +1917,18 @@ namespace HighlightPlus { CombineMeshes(); } - UpdateMaterialProperties(); + UpdateMaterialPropertiesNow(); } - readonly List tempRR = new List(); + List tempRR; Renderer[] FindRenderersWithLayerInScene(LayerMask layer) { Renderer[] rr = FindObjectsOfType(); - tempRR.Clear(); + if (tempRR == null) { + tempRR = new List(); + } else { + tempRR.Clear(); + } for (var i = 0; i < rr.Length; i++) { Renderer r = rr[i]; if (((1 << r.gameObject.layer) & layer) != 0) { @@ -1768,7 +1940,11 @@ namespace HighlightPlus { Renderer[] FindRenderersWithLayerInChildren(LayerMask layer) { Renderer[] rr = target.GetComponentsInChildren(); - tempRR.Clear(); + if (tempRR == null) { + tempRR = new List(); + } else { + tempRR.Clear(); + } for (var i = 0; i < rr.Length; i++) { Renderer r = rr[i]; if (((1 << r.gameObject.layer) & layer) != 0) { @@ -1780,33 +1956,117 @@ namespace HighlightPlus { void CheckGeometrySupportDependencies() { InitMaterial(ref fxMatMask, "HighlightPlus/Geometry/Mask"); - InitMaterial(ref fxMatGlowTemplate, "HighlightPlus/Geometry/Glow"); - if (fxMatGlowTemplate != null && useGPUInstancing) fxMatGlowTemplate.enableInstancing = true; - InitMaterial(ref fxMatInnerGlow, "HighlightPlus/Geometry/InnerGlow"); - InitMaterial(ref fxMatOutlineTemplate, "HighlightPlus/Geometry/Outline"); - if (fxMatOutlineTemplate != null && useGPUInstancing) fxMatOutlineTemplate.enableInstancing = true; InitMaterial(ref fxMatOverlay, "HighlightPlus/Geometry/Overlay"); - InitMaterial(ref fxMatSeeThrough, "HighlightPlus/Geometry/SeeThrough"); + InitMaterial(ref fxMatSeeThroughInner, "HighlightPlus/Geometry/SeeThroughInner"); InitMaterial(ref fxMatSeeThroughBorder, "HighlightPlus/Geometry/SeeThroughBorder"); InitMaterial(ref fxMatSeeThroughMask, "HighlightPlus/Geometry/SeeThroughMask"); - InitMaterial(ref fxMatTarget, "HighlightPlus/Geometry/Target"); - InitMaterial(ref fxMatComposeGlow, "HighlightPlus/Geometry/ComposeGlow"); - InitMaterial(ref fxMatComposeOutline, "HighlightPlus/Geometry/ComposeOutline"); InitMaterial(ref fxMatSolidColor, "HighlightPlus/Geometry/SolidColor"); - InitMaterial(ref fxMatBlurGlow, "HighlightPlus/Geometry/BlurGlow"); - InitMaterial(ref fxMatBlurOutline, "HighlightPlus/Geometry/BlurOutline"); InitMaterial(ref fxMatClearStencil, "HighlightPlus/ClearStencil"); + InitMaterial(ref fxMatOutlineRef, "HighlightPlus/Geometry/Outline"); + InitMaterial(ref fxMatGlowRef, "HighlightPlus/Geometry/Glow"); + InitMaterial(ref fxMatInnerGlow, "HighlightPlus/Geometry/InnerGlow"); + InitMaterial(ref fxMatTargetRef, "HighlightPlus/Geometry/Target"); + InitMaterial(ref fxMatComposeOutlineRef, "HighlightPlus/Geometry/ComposeOutline"); + InitMaterial(ref fxMatComposeGlowRef, "HighlightPlus/Geometry/ComposeGlow"); + InitMaterial(ref fxMatBlurOutlineRef, "HighlightPlus/Geometry/BlurOutline"); + InitMaterial(ref fxMatBlurGlowRef, "HighlightPlus/Geometry/BlurGlow"); + CheckRequiredCommandBuffers(); + } + + void CheckRequiredCommandBuffers() { + if (cbGlow == null) { + cbGlow = new CommandBuffer(); + cbGlow.name = "Outer Glow for " + name; + } + if (cbSeeThrough == null) { + cbSeeThrough = new CommandBuffer(); + cbSeeThrough.name = "See Through for " + name; + } } void CheckCommandBuffers() { - if (cbHighlight == null) { - cbHighlight = new CommandBuffer(); - cbHighlight.name = "Highlight Plus for " + name; + if (cbMask == null) { + cbMask = new CommandBuffer(); + cbMask.name = "Mask for " + name; + } + if (cbOutline == null) { + cbOutline = new CommandBuffer(); + cbOutline.name = "Outline for " + name; + } + if (cbOverlay == null) { + cbOverlay = new CommandBuffer(); + cbOverlay.name = "Overlay for " + name; + } + if (cbInnerGlow == null) { + cbInnerGlow = new CommandBuffer(); + cbInnerGlow.name = "Inner Glow for " + name; + } + } + + void CheckBlurCommandBuffer() { + if (cbSmoothBlend == null) { + cbSmoothBlend = new CommandBuffer(); + cbSmoothBlend.name = "Smooth Blend for " + name; + } + } + + void Fork(Material mat, ref Material[] mats, Mesh mesh) { + if (mesh == null) + return; + int count = mesh.subMeshCount; + if (mats == null || mats.Length < count) { + DestroyMaterialArray(mats); + mats = new Material[count]; + } + for (int k = 0; k < count; k++) { + if (mats[k] == null) { + mats[k] = Instantiate(mat); + } + } + } + + void BakeTransform(int objIndex, bool duplicateMesh) { + if (rms[objIndex].mesh == null) + return; + Transform t = rms[objIndex].transform; + Vector3 scale = t.localScale; + if (scale.x >= 0 && scale.y >= 0 && scale.z >= 0) { + rms[objIndex].bakedTransform = false; + return; + } + // Duplicates mesh and bake rotation + Mesh fixedMesh = duplicateMesh ? Instantiate(rms[objIndex].originalMesh) : rms[objIndex].mesh; + Vector3[] vertices = fixedMesh.vertices; + for (int k = 0; k < vertices.Length; k++) { + vertices[k] = t.TransformPoint(vertices[k]); + } + fixedMesh.vertices = vertices; + Vector3[] normals = fixedMesh.normals; + if (normals != null) { + for (int k = 0; k < normals.Length; k++) { + normals[k] = t.TransformVector(normals[k]).normalized; + } + fixedMesh.normals = normals; + } + fixedMesh.RecalculateBounds(); + rms[objIndex].mesh = fixedMesh; + rms[objIndex].bakedTransform = true; + rms[objIndex].currentPosition = t.position; + rms[objIndex].currentRotation = t.eulerAngles; + rms[objIndex].currentScale = t.lossyScale; + } + + public void UpdateMaterialProperties(bool forceNow = false) { + if (forceNow || !Application.isPlaying) { + requireUpdateMaterial = false; + UpdateMaterialPropertiesNow(); + } else { + requireUpdateMaterial = true; } } - public void UpdateMaterialProperties() { + void UpdateMaterialPropertiesNow() { if (rms == null) return; @@ -1853,9 +2113,6 @@ namespace HighlightPlus { if (targetFXStayDuration <= 0) { targetFXStayDuration = 0; } - if (targetFXFadePower <= 0) { - targetFXFadePower = 0; - } if (seeThroughDepthOffset < 0) { seeThroughDepthOffset = 0; } @@ -1865,17 +2122,43 @@ namespace HighlightPlus { if (seeThroughBorderWidth < 0) { seeThroughBorderWidth = 0; } - - useSmoothGlow = glow > 0 && glowQuality == QualityLevel.Highest; - useSmoothOutline = outline > 0 && outlineQuality == QualityLevel.Highest; - useSmoothBlend = useSmoothGlow || useSmoothOutline; - if (useSmoothBlend) { - if (useSmoothGlow && useSmoothOutline) { - outlineVisibility = glowVisibility; - } + if (targetFXFadePower < 0) { + targetFXFadePower = 0; } + + // Setup materials + + // Outline + float scaledOutlineWidth = (outlineQuality == QualityLevel.High || normalsOption == NormalsOption.Planar) ? 0f : outlineWidth / 100f; + Material matOutline = fxMatOutline; + matOutline.SetFloat(ShaderParams.OutlineWidth, scaledOutlineWidth); + matOutline.SetFloat(ShaderParams.OutlineVertexWidth, normalsOption == NormalsOption.Planar ? outlineWidth / 100f : 0); + matOutline.SetVector(ShaderParams.OutlineDirection, Vector3.zero); + matOutline.SetInt(ShaderParams.OutlineZTest, GetZTestValue(outlineVisibility)); + matOutline.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); + matOutline.SetFloat(ShaderParams.ConstantWidth, constantWidth ? 1.0f : 0); + + bool useSmoothOutline = outline > 0 && outlineQuality == QualityLevel.Highest; + if (useSmoothOutline) { + CheckBlurCommandBuffer(); + fxMatComposeOutline.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); + fxMatBlurOutline.SetFloat(ShaderParams.BlurScale, outlineWidth / outlineDownsampling); + } + + // Outer Glow + Material matGlow = fxMatGlow; + matGlow.SetVector(ShaderParams.Glow2, new Vector3(normalsOption == NormalsOption.Planar ? 0 : outlineWidth / 100f, glowAnimationSpeed, glowDithering ? 0 : 1)); + matGlow.SetInt(ShaderParams.GlowZTest, GetZTestValue(glowVisibility)); + matGlow.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); + matGlow.SetFloat(ShaderParams.ConstantWidth, constantWidth ? 1.0f : 0); + matGlow.SetInt(ShaderParams.GlowStencilOp, glowBlendPasses ? (int)StencilOp.Keep : (int)StencilOp.Replace); + matGlow.SetInt(ShaderParams.GlowStencilComp, glowIgnoreMask ? (int)CompareFunction.Always : (int)CompareFunction.NotEqual); + + bool useSmoothGlow = glow > 0 && glowQuality == QualityLevel.Highest; if (useSmoothGlow) { + CheckBlurCommandBuffer(); fxMatComposeGlow.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); + fxMatComposeGlow.SetInt(ShaderParams.GlowStencilComp, glowIgnoreMask ? (int)CompareFunction.Always : (int)CompareFunction.NotEqual); if (glowBlendMode == GlowBlendMode.Additive) { fxMatComposeGlow.SetInt(ShaderParams.BlendSrc, (int)BlendMode.One); fxMatComposeGlow.SetInt(ShaderParams.BlendDst, (int)BlendMode.One); @@ -1886,14 +2169,6 @@ namespace HighlightPlus { fxMatBlurGlow.SetFloat(ShaderParams.BlurScale, glowWidth / glowDownsampling); fxMatBlurGlow.SetFloat(ShaderParams.Speed, glowAnimationSpeed); } - - if (useSmoothOutline) { - fxMatComposeOutline.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); - fxMatBlurOutline.SetFloat(ShaderParams.BlurScale, outlineWidth / outlineDownsampling); - } - - // Setup materials - // Target if (targetFX) { if (targetFXTexture == null) { @@ -1903,111 +2178,57 @@ namespace HighlightPlus { fxMatTarget.SetInt(ShaderParams.ZTest, GetZTestValue(targetFXVisibility)); } - // Per object - float scaledOutlineWidth = outlineQuality.UsesMultipleOffsets() ? 0f : outlineWidth / 100f; - + // Per object materials + bool renderMaskOnTop = _highlighted && ((outline > 0 && outlineVisibility != Visibility.Normal) || (glow > 0 && glowVisibility != Visibility.Normal) || (innerGlow > 0 && innerGlowVisibility != Visibility.Normal)); for (int k = 0; k < rmsCount; k++) { + if (rms[k].mesh != null) { Renderer renderer = rms[k].renderer; if (renderer == null) continue; - renderer.GetSharedMaterials(rendererSharedMaterials); - - // Per submesh + // Mask, See-through & Overlay per submesh for (int l = 0; l < rms[k].mesh.subMeshCount; l++) { if (((1 << l) & subMeshMask) == 0) continue; Material mat = null; + renderer.GetSharedMaterials(rendererSharedMaterials); if (l < rendererSharedMaterials.Count) { mat = rendererSharedMaterials[l]; } if (mat == null) continue; - bool hasTexture = false; - Texture matTexture = null; - Vector2 matTextureOffset = Vector2.zero; - Vector2 matTextureScale = Vector2.one; - if (mat.HasProperty(ShaderParams.MainTex)) { - matTexture = mat.GetTexture(ShaderParams.MainTex); - matTextureOffset = mat.mainTextureOffset; - matTextureScale = mat.mainTextureScale; - hasTexture = true; - } else if (mat.HasProperty(ShaderParams.BaseMap)) { - matTexture = mat.GetTexture(ShaderParams.BaseMap); // we don't use mainTexture because ShaderGraph doesn't inform that generic property correctly - hasTexture = true; - if (mat.HasProperty(ShaderParams.BaseMapST)) { - // mat.mainTextureOffset will raise an error in builds - we need to manually get the scale/offset from the material by its property name - Vector4 baseMapST = mat.GetVector(ShaderParams.BaseMapST); - matTextureScale.x = baseMapST.x; - matTextureScale.y = baseMapST.y; - matTextureOffset.x = baseMapST.z; - matTextureOffset.y = baseMapST.w; - } - } + bool hasTexture = mat.HasProperty(ShaderParams.MainTex); bool useAlphaTest = alphaCutOff > 0 && hasTexture; // Mask if (rms[k].fxMatMask != null && rms[k].fxMatMask.Length > l) { Material fxMat = rms[k].fxMatMask[l]; if (fxMat != null) { - //if (hasTexture) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - //} + if (hasTexture) { + Texture texture = mat.mainTexture; + fxMat.mainTexture = texture; + fxMat.mainTextureOffset = mat.mainTextureOffset; + fxMat.mainTextureScale = mat.mainTextureScale; + } if (useAlphaTest) { fxMat.SetFloat(ShaderParams.CutOff, alphaCutOff); fxMat.EnableKeyword(ShaderParams.SKW_ALPHACLIP); } else { fxMat.DisableKeyword(ShaderParams.SKW_ALPHACLIP); } + if (depthClip && !renderMaskOnTop) { + fxMat.EnableKeyword(ShaderParams.SKW_DEPTHCLIP); + } else { + fxMat.DisableKeyword(ShaderParams.SKW_DEPTHCLIP); + } fxMat.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); } } - // Outline - if (rms[k].fxMatOutline != null && rms[k].fxMatOutline.Length > l) { - Material fxMat = rms[k].fxMatOutline[l]; - fxMat.SetFloat(ShaderParams.OutlineWidth, scaledOutlineWidth); - fxMat.SetInt(ShaderParams.OutlineZTest, GetZTestValue(outlineVisibility)); - fxMat.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); - fxMat.SetFloat(ShaderParams.ConstantWidth, constantWidth ? 1.0f : 0); - if (useAlphaTest) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - fxMat.SetFloat(ShaderParams.CutOff, alphaCutOff); - fxMat.EnableKeyword(ShaderParams.SKW_ALPHACLIP); - } else { - fxMat.DisableKeyword(ShaderParams.SKW_ALPHACLIP); - } - } - - // Glow - if (rms[k].fxMatGlow != null && rms[k].fxMatGlow.Length > l) { - Material fxMat = rms[k].fxMatGlow[l]; - fxMat.SetVector(ShaderParams.Glow2, new Vector4(outline > 0 ? outlineWidth / 100f : 0, glowAnimationSpeed, glowDithering ? 0 : 1)); - fxMat.SetInt(ShaderParams.GlowZTest, GetZTestValue(glowVisibility)); - fxMat.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); - fxMat.SetFloat(ShaderParams.ConstantWidth, constantWidth ? 1.0f : 0); - fxMat.SetInt(ShaderParams.GlowStencilOp, glowBlendPasses ? (int)StencilOp.Keep : (int)StencilOp.Replace); - fxMat.SetInt(ShaderParams.GlowStencilComp, glowIgnoreMask ? (int)CompareFunction.Always : (int)CompareFunction.NotEqual); - - if (useAlphaTest) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - fxMat.SetFloat(ShaderParams.CutOff, alphaCutOff); - fxMat.EnableKeyword(ShaderParams.SKW_ALPHACLIP); - } else { - fxMat.DisableKeyword(ShaderParams.SKW_ALPHACLIP); - } - } - - // See-through + // See-through inner bool usesSeeThroughBorder = rms[k].fxMatSeeThroughBorder != null && rms[k].fxMatSeeThroughBorder.Length > l && (seeThroughBorder * seeThroughBorderWidth > 0); if (rms[k].fxMatSeeThroughInner != null && rms[k].fxMatSeeThroughInner.Length > l) { Material fxMat = rms[k].fxMatSeeThroughInner[l]; @@ -2024,11 +2245,19 @@ namespace HighlightPlus { fxMat.SetInt(ShaderParams.SeeThroughStencilComp, (int)CompareFunction.Greater); fxMat.SetInt(ShaderParams.SeeThroughStencilPassOp, (int)StencilOp.Replace); } - //if (hasTexture) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - //} + if (seeThroughOrdered) { + fxMat.SetInt(ShaderParams.ZTest, (int)CompareFunction.LessEqual); + fxMat.SetInt(ShaderParams.SeeThroughOrdered, 1); + } else { + fxMat.SetInt(ShaderParams.ZTest, (int)CompareFunction.Greater); + fxMat.SetInt(ShaderParams.SeeThroughOrdered, 0); + } + if (hasTexture) { + Texture texture = mat.mainTexture; + fxMat.mainTexture = texture; + fxMat.mainTextureOffset = mat.mainTextureOffset; + fxMat.mainTextureScale = mat.mainTextureScale; + } if (useAlphaTest) { fxMat.SetFloat(ShaderParams.CutOff, alphaCutOff); fxMat.EnableKeyword(ShaderParams.SKW_ALPHACLIP); @@ -2064,13 +2293,21 @@ namespace HighlightPlus { } else { fxMat.SetInt(ShaderParams.SeeThroughStencilRef, 2); fxMat.SetInt(ShaderParams.SeeThroughStencilComp, (int)CompareFunction.Greater); - fxMat.SetInt(ShaderParams.SeeThroughStencilPassOp, (int)StencilOp.Keep); + fxMat.SetInt(ShaderParams.SeeThroughStencilPassOp, (int)StencilOp.Replace); + } + if (seeThroughOrdered) { + fxMat.SetInt(ShaderParams.ZTest, (int)CompareFunction.LessEqual); + fxMat.SetInt(ShaderParams.SeeThroughOrdered, 1); + } else { + fxMat.SetInt(ShaderParams.ZTest, (int)CompareFunction.Greater); + fxMat.SetInt(ShaderParams.SeeThroughOrdered, 0); + } + if (hasTexture) { + Texture texture = mat.mainTexture; + fxMat.mainTexture = texture; + fxMat.mainTextureOffset = mat.mainTextureOffset; + fxMat.mainTextureScale = mat.mainTextureScale; } - //if (hasTexture) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - //} if (useAlphaTest) { fxMat.SetFloat(ShaderParams.CutOff, alphaCutOff); fxMat.EnableKeyword(ShaderParams.SKW_ALPHACLIP); @@ -2091,11 +2328,12 @@ namespace HighlightPlus { if (rms[k].fxMatOverlay != null && rms[k].fxMatOverlay.Length > l) { Material fxMat = rms[k].fxMatOverlay[l]; if (fxMat != null) { - //if (hasTexture) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - //} + if (hasTexture) { + Texture texture = mat.mainTexture; + fxMat.mainTexture = texture; + fxMat.mainTextureOffset = mat.mainTextureOffset; + fxMat.mainTextureScale = mat.mainTextureScale; + } if (mat.HasProperty(ShaderParams.Color)) { fxMat.SetColor(ShaderParams.OverlayBackColor, mat.GetColor(ShaderParams.Color)); } @@ -2119,11 +2357,12 @@ namespace HighlightPlus { if (rms[k].fxMatInnerGlow != null && rms[k].fxMatInnerGlow.Length > l) { Material fxMat = rms[k].fxMatInnerGlow[l]; if (fxMat != null) { - //if (hasTexture) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - //} + if (hasTexture) { + Texture texture = mat.mainTexture; + fxMat.mainTexture = texture; + fxMat.mainTextureOffset = mat.mainTextureOffset; + fxMat.mainTextureScale = mat.mainTextureScale; + } fxMat.SetFloat(ShaderParams.InnerGlowWidth, innerGlowWidth); fxMat.SetInt(ShaderParams.InnerGlowZTest, GetZTestValue(innerGlowVisibility)); fxMat.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); @@ -2142,24 +2381,24 @@ namespace HighlightPlus { if (fxMat != null) { fxMat.color = glowHQColor; fxMat.SetInt(ShaderParams.Cull, cullBackFaces ? (int)CullMode.Back : (int)CullMode.Off); - //if (hasTexture) { - fxMat.mainTexture = matTexture; - fxMat.mainTextureOffset = matTextureOffset; - fxMat.mainTextureScale = matTextureScale; - //} - // if (!Application.isMobilePlatform) { // TODO: currently this does not work with URP on Android - if ((glow > 0 && glowQuality == QualityLevel.Highest && glowVisibility == Visibility.Normal) || (outline > 0 && outlineQuality == QualityLevel.Highest && outlineVisibility == Visibility.Normal)) { - fxMat.EnableKeyword(ShaderParams.SKW_DEPTHCLIP); - } else { - fxMat.DisableKeyword(ShaderParams.SKW_DEPTHCLIP); + fxMat.SetInt(ShaderParams.ZTest, GetZTestValue(useSmoothGlow ? glowVisibility : outlineVisibility)); + if (hasTexture) { + Texture texture = mat.mainTexture; + fxMat.mainTexture = texture; + fxMat.mainTextureOffset = mat.mainTextureOffset; + fxMat.mainTextureScale = mat.mainTextureScale; } - //} if (useAlphaTest) { fxMat.SetFloat(ShaderParams.CutOff, alphaCutOff); fxMat.EnableKeyword(ShaderParams.SKW_ALPHACLIP); } else { fxMat.DisableKeyword(ShaderParams.SKW_ALPHACLIP); } + if (depthClip && !renderMaskOnTop) { + fxMat.EnableKeyword(ShaderParams.SKW_DEPTHCLIP); + } else { + fxMat.DisableKeyword(ShaderParams.SKW_DEPTHCLIP); + } } } } @@ -2362,7 +2601,7 @@ namespace HighlightPlus { mid += vertices[k]; } mid /= vertexCount; - // Reorient normals + // Average normals for (int k = 0; k < vertexCount; k++) { normals.Add((vertices[k] - mid).normalized); } @@ -2376,6 +2615,7 @@ namespace HighlightPlus { const int MAX_VERTEX_COUNT = 65535; void CombineMeshes() { + // Combine meshes of group into the first mesh in rms if (combineInstances == null || combineInstances.Length != rmsCount) { combineInstances = new CombineInstance[rmsCount]; @@ -2384,7 +2624,7 @@ namespace HighlightPlus { int count = 0; combinedMeshesHashId = 0; int vertexCount = 0; - Matrix4x4 im = matrix4x4Identity; + Matrix4x4 im = matrix4X4Identity; for (int k = 0; k < rmsCount; k++) { combineInstances[k].mesh = null; if (!rms[k].isSkinnedMesh) { @@ -2423,5 +2663,3 @@ namespace HighlightPlus { } } - - diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffect.cs.meta b/Assets/HighlightPlus/Scripts/HighlightEffect.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffect.cs.meta rename to Assets/HighlightPlus/Scripts/HighlightEffect.cs.meta index 5bc1ff6..0ad03a7 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffect.cs.meta +++ b/Assets/HighlightPlus/Scripts/HighlightEffect.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 888380afc233049ce9e618f9f36c8ba8 timeCreated: 1545593776 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectActions.cs b/Assets/HighlightPlus/Scripts/HighlightEffectActions.cs similarity index 99% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectActions.cs rename to Assets/HighlightPlus/Scripts/HighlightEffectActions.cs index a49d877..ffacad6 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectActions.cs +++ b/Assets/HighlightPlus/Scripts/HighlightEffectActions.cs @@ -80,5 +80,7 @@ namespace HighlightPlus { UpdateMaterialProperties(); } } + + } } \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectActions.cs.meta b/Assets/HighlightPlus/Scripts/HighlightEffectActions.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectActions.cs.meta rename to Assets/HighlightPlus/Scripts/HighlightEffectActions.cs.meta index 12aa7a7..1461989 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectActions.cs.meta +++ b/Assets/HighlightPlus/Scripts/HighlightEffectActions.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: e749f80d0d29a49d49d6e0f4752065cd timeCreated: 1542876337 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectOccluderManager.cs b/Assets/HighlightPlus/Scripts/HighlightEffectOccluderManager.cs similarity index 87% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectOccluderManager.cs rename to Assets/HighlightPlus/Scripts/HighlightEffectOccluderManager.cs index 9f015a9..cea1b85 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectOccluderManager.cs +++ b/Assets/HighlightPlus/Scripts/HighlightEffectOccluderManager.cs @@ -10,9 +10,9 @@ namespace HighlightPlus { static readonly List occluders = new List(); static readonly Dictionary occludersFrameCount = new Dictionary(); + static CommandBuffer cbOccluder; static Material fxMatOccluder; static RaycastHit[] hits; - static Collider[] colliders; /// /// True if the see-through is cancelled by an occluder using raycast method @@ -65,7 +65,7 @@ namespace HighlightPlus { /// /// The camera to be tested /// Returns true if there's no raycast-based occluder cancelling the see-through effect - public bool RenderSeeThroughOccluders(CommandBuffer cb, Camera cam) { + public bool RenderSeeThroughOccluders(Camera cam) { int occludersCount = occluders.Count; if (occludersCount == 0 || rmsCount == 0) return true; @@ -91,11 +91,17 @@ namespace HighlightPlus { if (currentFrameCount == lastFrameCount) return true; occludersFrameCount[cam] = currentFrameCount; + if (cbOccluder == null) { + cbOccluder = new CommandBuffer(); + cbOccluder.name = "Occluder"; + } + if (fxMatOccluder == null) { InitMaterial(ref fxMatOccluder, "HighlightPlus/Geometry/SeeThroughOccluder"); if (fxMatOccluder == null) return true; } + cbOccluder.Clear(); for (int k = 0; k < occludersCount; k++) { HighlightSeeThroughOccluder occluder = occluders[k]; if (occluder == null || !occluder.isActiveAndEnabled) continue; @@ -107,12 +113,14 @@ namespace HighlightPlus { Renderer renderer = occluder.meshData[m].renderer; if (renderer.isVisible) { for (int s = 0; s < occluder.meshData[m].subMeshCount; s++) { - cb.DrawRenderer(renderer, fxMatOccluder, s); + cbOccluder.DrawRenderer(renderer, fxMatOccluder, s); } } } } } + Graphics.ExecuteCommandBuffer(cbOccluder); + return true; } @@ -128,10 +136,6 @@ namespace HighlightPlus { if (rms.Length == 0 || rms[0].renderer == null) return false; Vector3 camPos = cam.transform.position; - Quaternion quaternionIdentity = Quaternion.identity; - if (colliders == null || colliders.Length == 0) { - colliders = new Collider[1]; - } if (seeThroughOccluderCheckIndividualObjects) { for (int r = 0; r < rms.Length; r++) { @@ -139,12 +143,7 @@ namespace HighlightPlus { Bounds bounds = rms[r].renderer.bounds; Vector3 pos = bounds.center; float maxDistance = Vector3.Distance(pos, camPos); - Vector3 extents = bounds.extents * seeThroughOccluderThreshold; - if (Physics.OverlapBoxNonAlloc(pos, extents, colliders, quaternionIdentity, seeThroughOccluderMask) > 0) { - lastOcclusionTestResult = true; - return true; - } - if (Physics.BoxCast(pos, extents, (camPos - pos).normalized, quaternionIdentity, maxDistance, seeThroughOccluderMask)) { + if (Physics.BoxCast(pos, bounds.extents * seeThroughOccluderThreshold, (camPos - pos).normalized, Quaternion.identity, maxDistance, seeThroughOccluderMask)) { lastOcclusionTestResult = true; return true; } @@ -153,7 +152,7 @@ namespace HighlightPlus { lastOcclusionTestResult = false; return false; } else { - // Compute combined bounds + // Compute bounds Bounds bounds = rms[0].renderer.bounds; for (int r = 1; r < rms.Length; r++) { if (rms[r].renderer != null) { @@ -161,13 +160,8 @@ namespace HighlightPlus { } } Vector3 pos = bounds.center; - Vector3 extents = bounds.extents * seeThroughOccluderThreshold; - if (Physics.OverlapBoxNonAlloc(pos, extents, colliders, quaternionIdentity, seeThroughOccluderMask) > 0) { - lastOcclusionTestResult = true; - return true; - } float maxDistance = Vector3.Distance(pos, camPos); - lastOcclusionTestResult = Physics.BoxCast(pos, extents, (camPos - pos).normalized, quaternionIdentity, maxDistance, seeThroughOccluderMask); + lastOcclusionTestResult = Physics.BoxCast(pos, bounds.extents * seeThroughOccluderThreshold, (camPos - pos).normalized, Quaternion.identity, maxDistance, seeThroughOccluderMask); return lastOcclusionTestResult; } } @@ -187,7 +181,7 @@ namespace HighlightPlus { } } - void CheckOcclusionAccurate(CommandBuffer cbuf, Camera cam) { + void CheckOcclusionAccurate(Camera cam) { List occluderRenderers; if (!cachedOccludersPerCamera.TryGetValue(cam, out occluderRenderers)) { @@ -247,10 +241,14 @@ namespace HighlightPlus { // render occluders int occluderRenderersCount = occluderRenderers.Count; if (occluderRenderersCount > 0) { + cbSeeThrough.Clear(); for (int k = 0; k < occluderRenderersCount; k++) { Renderer r = occluderRenderers[k]; - cbuf.DrawRenderer(r, fxMatSeeThroughMask); + if (r != null) { + cbSeeThrough.DrawRenderer(r, fxMatSeeThroughMask); + } } + Graphics.ExecuteCommandBuffer(cbSeeThrough); } } diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectOccluderManager.cs.meta b/Assets/HighlightPlus/Scripts/HighlightEffectOccluderManager.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectOccluderManager.cs.meta rename to Assets/HighlightPlus/Scripts/HighlightEffectOccluderManager.cs.meta index bd8680d..c459f5e 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightEffectOccluderManager.cs.meta +++ b/Assets/HighlightPlus/Scripts/HighlightEffectOccluderManager.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: d0bc1f04199a64e66ae9630062b3a6ad timeCreated: 1542876337 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightManager.cs b/Assets/HighlightPlus/Scripts/HighlightManager.cs similarity index 91% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightManager.cs rename to Assets/HighlightPlus/Scripts/HighlightManager.cs index 4c59d9c..c219ac0 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightManager.cs +++ b/Assets/HighlightPlus/Scripts/HighlightManager.cs @@ -7,9 +7,10 @@ namespace HighlightPlus { public delegate bool OnObjectSelectionEvent(GameObject obj); + [RequireComponent(typeof(HighlightEffect))] [DefaultExecutionOrder(100)] - [HelpURL("https://www.dropbox.com/s/1p9h8xys68lm4a3/Documentation.pdf?dl=0")] + [HelpURL("https://www.dropbox.com/s/v9qgn68ydblqz8x/Documentation.pdf?dl=0")] public class HighlightManager : MonoBehaviour { [Tooltip("Enables highlight when pointer is over this object.")] @@ -66,30 +67,30 @@ namespace HighlightPlus { void OnEnable() { currentObject = null; currentEffect = null; - if (baseEffect == null) { - baseEffect = GetComponent (); - if (baseEffect == null) { - baseEffect = gameObject.AddComponent (); - } - } - raycastCamera = GetComponent (); - if (raycastCamera == null) { - raycastCamera = GetCamera (); - if (raycastCamera == null) { - Debug.LogError ("Highlight Manager: no camera found!"); - } - } + if (baseEffect == null) { + baseEffect = GetComponent(); + if (baseEffect == null) { + baseEffect = gameObject.AddComponent(); + } + } + raycastCamera = GetComponent(); + if (raycastCamera == null) { + raycastCamera = GetCamera(); + if (raycastCamera == null) { + Debug.LogError("Highlight Manager: no camera found!"); + } + } InputProxy.Init(); - } + } - void OnDisable () { - SwitchesCollider (null); + void OnDisable() { + SwitchesCollider(null); internal_DeselectAll(); - } + } - void Update () { - if (raycastCamera == null) + void Update() { + if (raycastCamera == null) return; #if ENABLE_INPUT_SYSTEM @@ -190,8 +191,8 @@ namespace HighlightPlus { if (InputProxy.GetMouseButtonDown(0) && lastTriggerTime < Time.frameCount) { internal_DeselectAll(); } - SwitchesCollider (null); - } + SwitchesCollider(null); + } #if ENABLE_INPUT_SYSTEM @@ -202,7 +203,7 @@ namespace HighlightPlus { #endif - void SwitchesCollider (Transform newObject) { + void SwitchesCollider(Transform newObject) { if (currentEffect != null) { if (highlightOnHover) { Highlight(false); @@ -213,19 +214,19 @@ namespace HighlightPlus { if (newObject == null) return; HighlightTrigger ht = newObject.GetComponent(); if (ht != null && ht.enabled) - return; - - HighlightEffect otherEffect = newObject.GetComponent (); - if (otherEffect == null) { - // Check if there's a parent highlight effect that includes this object - HighlightEffect parentEffect = newObject.GetComponentInParent(); - if (parentEffect != null && parentEffect.Includes(newObject)) { - currentEffect = parentEffect; + return; + + HighlightEffect otherEffect = newObject.GetComponent(); + if (otherEffect == null) { + // Check if there's a parent highlight effect that includes this object + HighlightEffect parentEffect = newObject.GetComponentInParent(); + if (parentEffect != null && parentEffect.Includes(newObject)) { + currentEffect = parentEffect; if (highlightOnHover) { Highlight(true); } - return; - } + return; + } } currentEffect = otherEffect != null ? otherEffect : baseEffect; baseEffect.enabled = currentEffect == baseEffect; @@ -258,7 +259,7 @@ namespace HighlightPlus { if (parentEffect != null && parentEffect.Includes(t)) { hb = parentEffect; if (hb.previousSettings == null) { - hb.previousSettings = ScriptableObject.CreateInstance(); + hb.previousSettings = ScriptableObject.CreateInstance(); } hb.previousSettings.Save(hb); } else { diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightManager.cs.meta b/Assets/HighlightPlus/Scripts/HighlightManager.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightManager.cs.meta rename to Assets/HighlightPlus/Scripts/HighlightManager.cs.meta index 02ba108..5f9c58e 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightManager.cs.meta +++ b/Assets/HighlightPlus/Scripts/HighlightManager.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: af4d46fd89b9543e5be2358ac0c9ced0 timeCreated: 1542876337 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightProfile.cs b/Assets/HighlightPlus/Scripts/HighlightProfile.cs similarity index 73% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightProfile.cs rename to Assets/HighlightPlus/Scripts/HighlightProfile.cs index eb7bd30..4b13c43 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightProfile.cs +++ b/Assets/HighlightPlus/Scripts/HighlightProfile.cs @@ -1,31 +1,26 @@ -using UnityEngine; +using UnityEngine; namespace HighlightPlus { [CreateAssetMenu(menuName = "Highlight Plus Profile", fileName = "Highlight Plus Profile", order = 100)] - [HelpURL("https://www.dropbox.com/s/1p9h8xys68lm4a3/Documentation.pdf?dl=0")] + [HelpURL("https://www.dropbox.com/s/v9qgn68ydblqz8x/Documentation.pdf?dl=0")] public class HighlightProfile : ScriptableObject { - [Tooltip("Different options to specify which objects are affected by this Highlight Effect component.")] + [Tooltip("Different options to specify which objects are affected by this Highlight Effect component.")] public TargetOptions effectGroup = TargetOptions.Children; - - [Tooltip("The layer that contains the affected objects by this effect when effectGroup is set to LayerMask.")] + [Tooltip("The layer that contains the affected objects by this effect when effectGroup is set to LayerMask.")] public LayerMask effectGroupLayer = -1; - - [Tooltip("Only include objects whose names contains this text.")] - public string effectNameFilter; - - [Tooltip("Combine meshes of all objects in this group affected by Highlight Effect reducing draw calls.")] + [Tooltip("Only include objects whose names contains this text.")] + public string effectNameFilter; + [Tooltip("Combine meshes of all objects in this group affected by Highlight Effect reducing draw calls.")] public bool combineMeshes; - - [Tooltip("The alpha threshold for transparent cutout objects. Pixels with alpha below this value will be discarded.")] + [Tooltip("The alpha threshold for transparent cutout objects. Pixels with alpha below this value will be discarded.")] [Range(0, 1)] - public float alphaCutOff; - - [Tooltip("If back facing triangles are ignored.Backfaces triangles are not visible but you may set this property to false to force highlight effects to act on those triangles as well.")] + public float alphaCutOff; + [Tooltip("If back facing triangles are ignored.Backfaces triangles are not visible but you may set this property to false to force highlight effects to act on those triangles as well.")] public bool cullBackFaces = true; - - [Tooltip("Normals handling option:\nPreserve original: use original mesh normals.\nSmooth: average normals to produce a smoother outline/glow mesh based effect.\nReorient: recomputes normals based on vertex direction to centroid.")] + public bool depthClip; + [Tooltip("Normals handling option:\nPreserve original: use original mesh normals.\nSmooth: average normals to produce a smoother outline/glow mesh based effect.\nReorient: recomputes normals based on vertex direction to centroid.")] public NormalsOption normalsOption; public float fadeInDuration; @@ -44,72 +39,70 @@ namespace HighlightPlus { public bool constantWidth = true; [Range(0, 1)] - [Tooltip("Intensity of the overlay effect. A value of 0 disables the overlay completely.")] + [Tooltip("Intensity of the overlay effect. A value of 0 disables the overlay completely.")] public float overlay; - - [ColorUsage(true, true)] public Color overlayColor = Color.yellow; + [ColorUsage(true, true)] public Color overlayColor = Color.yellow; public float overlayAnimationSpeed = 1f; - [Range(0, 1)] public float overlayMinIntensity = 0.5f; - [Range(0, 1)] - [Tooltip("Controls the blending or mix of the overlay color with the natural colors of the object.")] + [Tooltip("Controls the blending or mix of the overlay color with the natural colors of the object.")] public float overlayBlending = 1.0f; [Tooltip("Optional overlay texture.")] public Texture2D overlayTexture; public float overlayTextureScale = 1f; [Range(0, 1)] - [Tooltip("Intensity of the outline. A value of 0 disables the outline completely.")] + [Tooltip("Intensity of the outline. A value of 0 disables the outline completely.")] public float outline = 1f; - [ColorUsage(true, true)] public Color outlineColor = Color.black; + [ColorUsage(true, true)] public Color outlineColor = Color.black; public float outlineWidth = 0.45f; public QualityLevel outlineQuality = QualityLevel.High; [Range(1, 8)] - [Tooltip("Reduces the quality of the outline but improves performance a bit.")] + [Tooltip("Reduces the quality of the outline but improves performance a bit.")] public int outlineDownsampling = 2; - + public bool outlineOptimalBlit = true; public Visibility outlineVisibility = Visibility.Normal; - [Tooltip("If enabled, this object won't combine the outline with other objects.")] + [Tooltip("If enabled, this object won't combine the outline with other objects.")] public bool outlineIndependent; [Range(0, 5)] - [Tooltip("The intensity of the outer glow effect. A value of 0 disables the glow completely.")] + [Tooltip("The intensity of the outer glow effect. A value of 0 disables the glow completely.")] public float glow; public float glowWidth = 0.4f; public QualityLevel glowQuality = QualityLevel.High; [Range(1, 8)] - [Tooltip("Reduces the quality of the glow but improves performance a bit.")] + [Tooltip("Reduces the quality of the glow but improves performance a bit.")] public int glowDownsampling = 2; - [ColorUsage(true, true)] public Color glowHQColor = new Color(0.64f, 1f, 0f, 1f); - [Tooltip("When enabled, outer glow renders with dithering. When disabled, glow appears as a solid color.")] + [ColorUsage(true, true)] public Color glowHQColor = new Color (0.64f, 1f, 0f, 1f); + [Tooltip("When enabled, outer glow renders with dithering. When disabled, glow appears as a solid color.")] public bool glowDithering = true; - [Tooltip("Seed for the dithering effect")] + public bool glowOptimalBlit = true; + [Tooltip("Seed for the dithering effect")] public float glowMagicNumber1 = 0.75f; - [Tooltip("Another seed for the dithering effect that combines with first seed to create different patterns")] + [Tooltip("Another seed for the dithering effect that combines with first seed to create different patterns")] public float glowMagicNumber2 = 0.5f; public float glowAnimationSpeed = 1f; public Visibility glowVisibility = Visibility.Normal; public GlowBlendMode glowBlendMode = GlowBlendMode.Additive; - [Tooltip("Blends glow passes one after another. If this option is disabled, glow passes won't overlap (in this case, make sure the glow pass 1 has a smaller offset than pass 2, etc.)")] + [Tooltip("Blends glow passes one after another. If this option is disabled, glow passes won't overlap (in this case, make sure the glow pass 1 has a smaller offset than pass 2, etc.)")] public bool glowBlendPasses = true; public GlowPassData[] glowPasses; [Tooltip("If enabled, glow effect will not use a stencil mask. This can be used to render the glow effect alone.")] public bool glowIgnoreMask; [Range(0, 5f)] - [Tooltip("The intensity of the inner glow effect. A value of 0 disables the glow completely.")] + [Tooltip("The intensity of the inner glow effect. A value of 0 disables the glow completely.")] public float innerGlow; [Range(0, 2)] public float innerGlowWidth = 1f; - [ColorUsage(true, true)] public Color innerGlowColor = Color.white; + [ColorUsage(true, true)] public Color innerGlowColor = Color.white; public Visibility innerGlowVisibility = Visibility.Normal; - [Tooltip("Enables the targetFX effect. This effect draws an animated sprite over the object.")] + [Tooltip("Enables the targetFX effect. This effect draws an animated sprite over the object.")] public bool targetFX; public Texture2D targetFXTexture; - [ColorUsage(true, true)] public Color targetFXColor = Color.white; + [ColorUsage(true, true)] public Color targetFXColor = Color.white; public float targetFXRotationSpeed = 50f; public float targetFXInitialScale = 4f; public float targetFXEndScale = 1.5f; @@ -120,28 +113,28 @@ namespace HighlightPlus { [Tooltip("Max distance from the center of the highlighted object to the ground.")] public float targetFXGroundMaxDistance = 15f; public LayerMask targetFXGroundLayerMask = -1; - [Tooltip("Fade out effect with altitude")] - public float targetFXFadePower = 32; + [Tooltip("Fade out effect with altitude")] + public float targetFXFadePower = 32; public float targetFXTransitionDuration = 0.5f; public float targetFXStayDuration = 1.5f; public Visibility targetFXVisibility = Visibility.AlwaysOnTop; - [Tooltip("See-through mode for this Highlight Effect component.")] + [Tooltip("See-through mode for this Highlight Effect component.")] public SeeThroughMode seeThrough = SeeThroughMode.Never; - [Tooltip("This mask setting let you specify which objects will be considered as occluders and cause the see-through effect for this Highlight Effect component. For example, you assign your walls to a different layer and specify that layer here, so only walls and not other objects, like ground or ceiling, will trigger the see-through effect.")] + [Tooltip("This mask setting let you specify which objects will be considered as occluders and cause the see-through effect for this Highlight Effect component. For example, you assign your walls to a different layer and specify that layer here, so only walls and not other objects, like ground or ceiling, will trigger the see-through effect.")] public LayerMask seeThroughOccluderMask = -1; - [Tooltip("Uses stencil buffers to ensure pixel-accurate occlusion test. If this option is disabled, only physics raycasting is used to test for occlusion.")] + [Tooltip("Uses stencil buffers to ensure pixel-accurate occlusion test. If this option is disabled, only physics raycasting is used to test for occlusion.")] public bool seeThroughOccluderMaskAccurate; - [Tooltip("A multiplier for the occluder volume size which can be used to reduce the actual size of occluders when Highlight Effect checks if they're occluding this object.")] + [Tooltip("A multiplier for the occluder volume size which can be used to reduce the actual size of occluders when Highlight Effect checks if they're occluding this object.")] [Range(0.01f, 0.9f)] public float seeThroughOccluderThreshold = 0.4f; - [Tooltip("The interval of time between occlusion tests.")] + [Tooltip("The interval of time between occlusion tests.")] public float seeThroughOccluderCheckInterval = 1f; - [Tooltip("If enabled, occlusion test is performed for each children element. If disabled, the bounds of all children is combined and a single occlusion test is performed for the combined bounds.")] - public bool seeThroughOccluderCheckIndividualObjects; + [Tooltip("If enabled, occlusion test is performed for each children element. If disabled, the bounds of all children is combined and a single occlusion test is performed for the combined bounds.")] + public bool seeThroughOccluderCheckIndividualObjects; [Tooltip("Shows the see-through effect only if the occluder if at this 'offset' distance from the object.")] public float seeThroughDepthOffset; - [Tooltip("Hides the see-through effect if the occluder is further than this distance from the object (0 = infinite)")] - public float seeThroughMaxDepth; + [Tooltip("Hides the see-through effect if the occluder is further than this distance from the object (0 = infinite)")] + public float seeThroughMaxDepth; [Range(0, 5f)] public float seeThroughIntensity = 0.8f; [Range(0, 1)] public float seeThroughTintAlpha = 0.5f; public Color seeThroughTintColor = Color.red; @@ -151,8 +144,8 @@ namespace HighlightPlus { public float seeThroughBorderWidth = 0.45f; [Tooltip("Only display the border instead of the full see-through effect.")] public bool seeThroughBorderOnly; - [Tooltip("This option clears the stencil buffer after rendering the see-through effect which results in correct rendering order and supports other stencil-based effects that render afterwards.")] - public bool seeThroughOrdered; + [Tooltip("Renders see-through effect on overlapping objects in a sequence that's relative to the distance to the camera")] + public bool seeThroughOrdered = true; [Range(0, 1)] public float hitFxInitialIntensity; public HitFxMode hitFxMode = HitFxMode.Overlay; @@ -163,10 +156,11 @@ namespace HighlightPlus { public void Load(HighlightEffect effect) { effect.effectGroup = effectGroup; effect.effectGroupLayer = effectGroupLayer; - effect.effectNameFilter = effectNameFilter; + effect.effectNameFilter = effectNameFilter; effect.combineMeshes = combineMeshes; effect.alphaCutOff = alphaCutOff; effect.cullBackFaces = cullBackFaces; + effect.depthClip = depthClip; effect.normalsOption = normalsOption; effect.fadeInDuration = fadeInDuration; effect.fadeOutDuration = fadeOutDuration; @@ -185,12 +179,14 @@ namespace HighlightPlus { effect.outlineColor = outlineColor; effect.outlineWidth = outlineWidth; effect.outlineQuality = outlineQuality; + effect.outlineOptimalBlit = outlineOptimalBlit; effect.outlineDownsampling = outlineDownsampling; effect.outlineVisibility = outlineVisibility; effect.outlineIndependent = outlineIndependent; effect.glow = glow; effect.glowWidth = glowWidth; effect.glowQuality = glowQuality; + effect.glowOptimalBlit = glowOptimalBlit; effect.glowDownsampling = glowDownsampling; effect.glowHQColor = glowHQColor; effect.glowDithering = glowDithering; @@ -214,7 +210,7 @@ namespace HighlightPlus { effect.targetFXAlignToGround = targetFXAlignToGround; effect.targetFXGroundMaxDistance = targetFXGroundMaxDistance; effect.targetFXGroundLayerMask = targetFXGroundLayerMask; - effect.targetFXFadePower = targetFXFadePower; + effect.targetFXFadePower = targetFXFadePower; effect.targetFXRotationSpeed = targetFXRotationSpeed; effect.targetFXStayDuration = targetFXStayDuration; effect.targetFXTexture = targetFXTexture; @@ -225,7 +221,7 @@ namespace HighlightPlus { effect.seeThroughOccluderMaskAccurate = seeThroughOccluderMaskAccurate; effect.seeThroughOccluderThreshold = seeThroughOccluderThreshold; effect.seeThroughOccluderCheckInterval = seeThroughOccluderCheckInterval; - effect.seeThroughOccluderCheckIndividualObjects = seeThroughOccluderCheckIndividualObjects; + effect.seeThroughOccluderCheckIndividualObjects = seeThroughOccluderCheckIndividualObjects; effect.seeThroughIntensity = seeThroughIntensity; effect.seeThroughTintAlpha = seeThroughTintAlpha; effect.seeThroughTintColor = seeThroughTintColor; @@ -235,7 +231,7 @@ namespace HighlightPlus { effect.seeThroughBorderWidth = seeThroughBorderWidth; effect.seeThroughBorderOnly = seeThroughBorderOnly; effect.seeThroughDepthOffset = seeThroughDepthOffset; - effect.seeThroughMaxDepth = seeThroughMaxDepth; + effect.seeThroughMaxDepth = seeThroughMaxDepth; effect.seeThroughOrdered = seeThroughOrdered; effect.hitFxInitialIntensity = hitFxInitialIntensity; effect.hitFxMode = hitFxMode; @@ -248,10 +244,11 @@ namespace HighlightPlus { public void Save(HighlightEffect effect) { effectGroup = effect.effectGroup; effectGroupLayer = effect.effectGroupLayer; - effectNameFilter = effect.effectNameFilter; + effectNameFilter = effect.effectNameFilter; combineMeshes = effect.combineMeshes; alphaCutOff = effect.alphaCutOff; cullBackFaces = effect.cullBackFaces; + depthClip = effect.depthClip; normalsOption = effect.normalsOption; fadeInDuration = effect.fadeInDuration; fadeOutDuration = effect.fadeOutDuration; @@ -273,9 +270,11 @@ namespace HighlightPlus { outlineDownsampling = effect.outlineDownsampling; outlineVisibility = effect.outlineVisibility; outlineIndependent = effect.outlineIndependent; + outlineOptimalBlit = effect.outlineOptimalBlit; glow = effect.glow; glowWidth = effect.glowWidth; glowQuality = effect.glowQuality; + glowOptimalBlit = effect.glowOptimalBlit; glowDownsampling = effect.glowDownsampling; glowHQColor = effect.glowHQColor; glowDithering = effect.glowDithering; @@ -299,7 +298,7 @@ namespace HighlightPlus { targetFXAlignToGround = effect.targetFXAlignToGround; targetFXGroundMaxDistance = effect.targetFXGroundMaxDistance; targetFXGroundLayerMask = effect.targetFXGroundLayerMask; - targetFXFadePower = effect.targetFXFadePower; + targetFXFadePower = effect.targetFXFadePower; targetFXRotationSpeed = effect.targetFXRotationSpeed; targetFXStayDuration = effect.targetFXStayDuration; targetFXTexture = effect.targetFXTexture; @@ -310,7 +309,7 @@ namespace HighlightPlus { seeThroughOccluderMaskAccurate = effect.seeThroughOccluderMaskAccurate; seeThroughOccluderThreshold = effect.seeThroughOccluderThreshold; seeThroughOccluderCheckInterval = effect.seeThroughOccluderCheckInterval; - seeThroughOccluderCheckIndividualObjects = effect.seeThroughOccluderCheckIndividualObjects; + seeThroughOccluderCheckIndividualObjects = effect.seeThroughOccluderCheckIndividualObjects; seeThroughIntensity = effect.seeThroughIntensity; seeThroughTintAlpha = effect.seeThroughTintAlpha; seeThroughTintColor = effect.seeThroughTintColor; @@ -320,7 +319,7 @@ namespace HighlightPlus { seeThroughBorderWidth = effect.seeThroughBorderWidth; seeThroughDepthOffset = effect.seeThroughDepthOffset; seeThroughBorderOnly = effect.seeThroughBorderOnly; - seeThroughMaxDepth = effect.seeThroughMaxDepth; + seeThroughMaxDepth = effect.seeThroughMaxDepth; seeThroughOrdered = effect.seeThroughOrdered; hitFxInitialIntensity = effect.hitFxInitialIntensity; hitFxMode = effect.hitFxMode; @@ -342,11 +341,11 @@ namespace HighlightPlus { return pd; } - private void OnValidate() { - seeThroughDepthOffset = Mathf.Max(0, seeThroughDepthOffset); - seeThroughMaxDepth = Mathf.Max(0, seeThroughMaxDepth); - seeThroughBorderWidth = Mathf.Max(0, seeThroughBorderWidth); - targetFXFadePower = Mathf.Max(0, targetFXFadePower); + public void OnValidate() { + seeThroughDepthOffset = Mathf.Max(0, seeThroughDepthOffset); + seeThroughMaxDepth = Mathf.Max(0, seeThroughMaxDepth); + seeThroughBorderWidth = Mathf.Max(0, seeThroughBorderWidth); + targetFXFadePower = Mathf.Max(0, targetFXFadePower); cameraDistanceFadeNear = Mathf.Max(0, cameraDistanceFadeNear); cameraDistanceFadeFar = Mathf.Max(0, cameraDistanceFadeFar); if (glowPasses == null || glowPasses.Length == 0) { @@ -357,6 +356,7 @@ namespace HighlightPlus { glowPasses[3] = new GlowPassData() { offset = 1, alpha = 0.4f, color = new Color(0.64f, 1f, 0f, 1f) }; } } + } } diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightProfile.cs.meta b/Assets/HighlightPlus/Scripts/HighlightProfile.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightProfile.cs.meta rename to Assets/HighlightPlus/Scripts/HighlightProfile.cs.meta index f269c7c..9238d3e 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightProfile.cs.meta +++ b/Assets/HighlightPlus/Scripts/HighlightProfile.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8e9253636bf2648bd813257f451f8486 timeCreated: 1549831900 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightSeeThroughOccluder.cs b/Assets/HighlightPlus/Scripts/HighlightSeeThroughOccluder.cs similarity index 97% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightSeeThroughOccluder.cs rename to Assets/HighlightPlus/Scripts/HighlightSeeThroughOccluder.cs index f6f7219..00484f3 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightSeeThroughOccluder.cs +++ b/Assets/HighlightPlus/Scripts/HighlightSeeThroughOccluder.cs @@ -42,7 +42,7 @@ namespace HighlightPlus { } else { rr.Clear(); } - GetComponentsInChildren(rr); + GetComponentsInChildren(rr); int rrCount = rr.Count; meshData = new MeshData[rrCount]; for (int k = 0; k < rrCount; k++) { diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightSeeThroughOccluder.cs.meta b/Assets/HighlightPlus/Scripts/HighlightSeeThroughOccluder.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightSeeThroughOccluder.cs.meta rename to Assets/HighlightPlus/Scripts/HighlightSeeThroughOccluder.cs.meta index 6d02b16..677b0f5 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightSeeThroughOccluder.cs.meta +++ b/Assets/HighlightPlus/Scripts/HighlightSeeThroughOccluder.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 8dd965ceab19c4729a9dabd8aeb2972a timeCreated: 1542876337 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs b/Assets/HighlightPlus/Scripts/HighlightTrigger.cs similarity index 99% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs rename to Assets/HighlightPlus/Scripts/HighlightTrigger.cs index 531b4a7..3f93241 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs +++ b/Assets/HighlightPlus/Scripts/HighlightTrigger.cs @@ -20,7 +20,7 @@ namespace HighlightPlus { [RequireComponent(typeof(HighlightEffect))] [ExecuteInEditMode] - [HelpURL("https://www.dropbox.com/s/1p9h8xys68lm4a3/Documentation.pdf?dl=0")] + [HelpURL("https://www.dropbox.com/s/v9qgn68ydblqz8x/Documentation.pdf?dl=0")] public class HighlightTrigger : MonoBehaviour { [Tooltip("Enables highlight when pointer is over this object.")] @@ -389,6 +389,8 @@ namespace HighlightPlus { } } } + + } } \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs.meta b/Assets/HighlightPlus/Scripts/HighlightTrigger.cs.meta similarity index 92% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs.meta rename to Assets/HighlightPlus/Scripts/HighlightTrigger.cs.meta index 630204a..614f970 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/HighlightTrigger.cs.meta +++ b/Assets/HighlightPlus/Scripts/HighlightTrigger.cs.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 guid: 5009cbb7e54994bb586cde7a70f34e6b timeCreated: 1542876337 -licenseType: Store +licenseType: Pro MonoImporter: serializedVersion: 2 defaultReferences: [] diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/InputProxy.cs b/Assets/HighlightPlus/Scripts/InputProxy.cs similarity index 100% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/InputProxy.cs rename to Assets/HighlightPlus/Scripts/InputProxy.cs diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/InputProxy.cs.meta b/Assets/HighlightPlus/Scripts/InputProxy.cs.meta similarity index 83% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/InputProxy.cs.meta rename to Assets/HighlightPlus/Scripts/InputProxy.cs.meta index 954705e..d11561a 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/InputProxy.cs.meta +++ b/Assets/HighlightPlus/Scripts/InputProxy.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 22dd181849f53482686b5c26304410c2 +guid: dc62c86f3459d4fc29db51cfe5ecb977 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/ShaderParams.cs b/Assets/HighlightPlus/Scripts/ShaderParams.cs similarity index 94% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/ShaderParams.cs rename to Assets/HighlightPlus/Scripts/ShaderParams.cs index fa8da63..e5b0bb6 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/ShaderParams.cs +++ b/Assets/HighlightPlus/Scripts/ShaderParams.cs @@ -15,17 +15,15 @@ namespace HighlightPlus { public static int Debug = Shader.PropertyToID("_Debug"); public static int Color = Shader.PropertyToID("_Color"); public static int MainTex = Shader.PropertyToID("_MainTex"); - public static int BaseMap = Shader.PropertyToID("_BaseMap"); - public static int BaseMapST = Shader.PropertyToID("_BaseMap_ST"); - public static int AspectRatio = Shader.PropertyToID("_AspectRatio"); public static int BlendSrc = Shader.PropertyToID("_BlendSrc"); public static int BlendDst = Shader.PropertyToID("_BlendDst"); - + // outline uniforms public static int OutlineWidth = Shader.PropertyToID("_OutlineWidth"); public static int OutlineZTest = Shader.PropertyToID("_OutlineZTest"); public static int OutlineDirection = Shader.PropertyToID("_OutlineDirection"); public static int OutlineColor = Shader.PropertyToID("_OutlineColor"); + public static int OutlineVertexWidth = Shader.PropertyToID("_OutlineVertexWidth"); // glow uniforms public static int GlowZTest = Shader.PropertyToID("_GlowZTest"); @@ -48,6 +46,7 @@ namespace HighlightPlus { public static int SeeThroughStencilPassOp = Shader.PropertyToID("_SeeThroughStencilPassOp"); public static int SeeThroughDepthOffset = Shader.PropertyToID("_SeeThroughDepthOffset"); public static int SeeThroughMaxDepth = Shader.PropertyToID("_SeeThroughMaxDepth"); + public static int SeeThroughOrdered = Shader.PropertyToID("_SeeThroughOrdered"); // inner glow uniforms public static int InnerGlowWidth = Shader.PropertyToID("_InnerGlowWidth"); diff --git a/Assets/Plugins/HighlightPlus/Runtime/Scripts/ShaderParams.cs.meta b/Assets/HighlightPlus/Scripts/ShaderParams.cs.meta similarity index 83% rename from Assets/Plugins/HighlightPlus/Runtime/Scripts/ShaderParams.cs.meta rename to Assets/HighlightPlus/Scripts/ShaderParams.cs.meta index 39d981d..e076e9c 100644 --- a/Assets/Plugins/HighlightPlus/Runtime/Scripts/ShaderParams.cs.meta +++ b/Assets/HighlightPlus/Scripts/ShaderParams.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0c43adc34509547febe8181a2de00da5 +guid: 43d6485e67bc3460fabef0a5962f8e42 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Plugins/HighlightPlus.meta b/Assets/HighlightPlusBundle.meta similarity index 77% rename from Assets/Plugins/HighlightPlus.meta rename to Assets/HighlightPlusBundle.meta index fe175df..79b6e6d 100644 --- a/Assets/Plugins/HighlightPlus.meta +++ b/Assets/HighlightPlusBundle.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f8c038d44171a194f811310e73721b7e +guid: 68ae7b96c4d474fbb89db44167089a60 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Plugins/HighlightPlus/Pipelines.meta b/Assets/HighlightPlusBundle/Builtin.meta similarity index 77% rename from Assets/Plugins/HighlightPlus/Pipelines.meta rename to Assets/HighlightPlusBundle/Builtin.meta index 3a431a2..772d961 100644 --- a/Assets/Plugins/HighlightPlus/Pipelines.meta +++ b/Assets/HighlightPlusBundle/Builtin.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3302310c4cbf644e2b5dc5c588f0213f +guid: d04d6c36e2bc14d5c831b9afeb270cf9 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage b/Assets/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage new file mode 100644 index 0000000..00aeb72 Binary files /dev/null and b/Assets/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage differ diff --git a/Assets/Plugins/HighlightPlus/Documentation/Documentation.pdf.meta b/Assets/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage.meta similarity index 74% rename from Assets/Plugins/HighlightPlus/Documentation/Documentation.pdf.meta rename to Assets/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage.meta index cde3198..645dfac 100644 --- a/Assets/Plugins/HighlightPlus/Documentation/Documentation.pdf.meta +++ b/Assets/HighlightPlusBundle/Builtin/HighlightPlus_Builtin_Pipeline.unitypackage.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f20bfad4614a44fa9bee91947fa06753 +guid: 4c87a0e1993f7439285693c04d6dab68 DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/HighlightPlus/Pipelines/URP.meta b/Assets/HighlightPlusBundle/URP.meta similarity index 77% rename from Assets/Plugins/HighlightPlus/Pipelines/URP.meta rename to Assets/HighlightPlusBundle/URP.meta index 94662b2..080f8fe 100644 --- a/Assets/Plugins/HighlightPlus/Pipelines/URP.meta +++ b/Assets/HighlightPlusBundle/URP.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6ec7787befe3645f7a6f10c3762dc3df +guid: 33be22ed704cc4513850fb40f2298226 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage b/Assets/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage new file mode 100644 index 0000000..16fadc1 Binary files /dev/null and b/Assets/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage differ diff --git a/Assets/Plugins/HighlightPlus/Demo/Demo2_SelectionExample.unity.meta b/Assets/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage.meta similarity index 74% rename from Assets/Plugins/HighlightPlus/Demo/Demo2_SelectionExample.unity.meta rename to Assets/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage.meta index 5501c5d..20bc586 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Demo2_SelectionExample.unity.meta +++ b/Assets/HighlightPlusBundle/URP/HighlightPlus_URP_Pipeline.unitypackage.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: eb334622a9e1f41368317711b187e4c2 +guid: 52f45c84fa7e04a17922d3833762b05c DefaultImporter: externalObjects: {} userData: diff --git a/Assets/HighlightPlusBundle/_README.txt b/Assets/HighlightPlusBundle/_README.txt new file mode 100644 index 0000000..37d57d2 --- /dev/null +++ b/Assets/HighlightPlusBundle/_README.txt @@ -0,0 +1,22 @@ + +This asset contains 2 main packages. Please use the appropriate package according to the rendering pipeline of your project: + +** Built-in pipeline ** +- Import the package from the folder /Builtin. +- Requires Unity 2018.4 or later. + +** Universal Rendering Pipeline ** +- Import the package from the folder /URP +- Requires Unity 2019.3 or later. Setup video: https://youtu.be/OlCnEAcHJm0 + + +Once imported, read the PDF documentation for additional details. +Thanks for using Highlight Plus. + + +Questions / Suggestions / Support +--------------------------------- +* Website-Forum: https://kronnect.com +* Support: contact@kronnect.com +* Twitter: @KronnectGames + diff --git a/Assets/Plugins/HighlightPlus/Demo/Demo3_HitFXExample.unity.meta b/Assets/HighlightPlusBundle/_README.txt.meta similarity index 62% rename from Assets/Plugins/HighlightPlus/Demo/Demo3_HitFXExample.unity.meta rename to Assets/HighlightPlusBundle/_README.txt.meta index 37d1f5e..2c50cd1 100644 --- a/Assets/Plugins/HighlightPlus/Demo/Demo3_HitFXExample.unity.meta +++ b/Assets/HighlightPlusBundle/_README.txt.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: a9ed051e57e7249a89531758bd685c7f -DefaultImporter: +guid: 2b60423aba8cd4a19bf6f546a883a794 +TextScriptImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/Plugins/HighlightPlus/Documentation/Kronnect Assets.pdf b/Assets/Plugins/HighlightPlus/Documentation/Kronnect Assets.pdf deleted file mode 100644 index 3d1fda1..0000000 --- a/Assets/Plugins/HighlightPlus/Documentation/Kronnect Assets.pdf +++ /dev/null @@ -1,263 +0,0 @@ -Don’t miss these other cool assets brought to you by - - BEAUTIFY 2 is an acclaimed full-screen image processing effect that improves the image quality in real time - - producing incredibly crisp and vivid scenes. Compatible with built-in, LWRP and URP pipelines. - In addition to this unique image enhancement filter, you will find in Beautify additional effects like high quality Bloom, - dirty lens effect, vignetting, night & thermal vision and more! - Get it on the Asset Store: - - https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/beautify-2-advanced-post-processing-163949?aid=1101lGsd - - DYNAMIC FOG & MIST 2 is a full-screen image effect that adds live, moving Fog, Mist and Sky Haze to your scenes - - making them less dull and boring. Compatible with built-in and URP pipelines. - Get it on the Asset Store: - - https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/dynamic-fog-mist-48200?aid=1101lGsd - - VOLUMETRIC FOG & MIST 2 is the enhanced version of Dynamic Fog & Mist (which is also included in the package) - - and has been designed to provide a better-looking fog and cloud formations with support of lighting and glow effects. - Compatible with built-in and URP pipelines. - It’s feature-rich with options like fog of war, Sun tracking, better transparent and sprite support, sun shafts and more. - Get it on the Asset Store: - - https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/volumetric-fog-mist-2-162694?aid=1101lGsd - WORLD POLITICAL MAP SERIES is a collection of professional mapping assets for Unity (2D and Globe Editions). Used by - - many companies and agencies across the world to visualize data, resources, interact with the user, etc. - Compatible with built-in and URP pipelines. - - Get it on the Asset Store (Globe Edition): - - https://assetstore.unity.com/packages/tools/gui/world-map-globe-edition-2-150643?aid=1101lGsd - - Get it on the Asset Store (2D Edition): - - https://assetstore.unity.com/packages/tools/gui/world-map-2d-edition-2-151238?aid=1101lGsd - -WORLD MAP STRATEGY KIT 2 is a complete framework for building AAA strategy games, including all world countries - -and provinces, +7000 cities, cool 3D PBS dynamic viewport for map, hexagonal grid, pathfinding, real elevation, and much -more. -Compatible with built-in and URP pipelines. - -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/game-toolkits/world-map-strategy-kit-2-150938?aid=1101lGsd - - WORLD MAPS PRO BUNDLE 2 is our most complete and professional suite of maps for Unity platform for the best price. - - Compatible with built-in and URP pipelines. This bundle contains: - - World Political Map Globe Edition - - World Political Map 2D Edition - - World Map Strategy Kit - - World Flags and Weather Icons - - Purchase this bundle and save $$$! - - https://assetstore.unity.com/packages/tools/gui/world-maps-pro-bundle-2-151240?aid=1101lGsd - SHINY SSRR is our Screen Space Raytraced Reflections solution optimized for both forward and deferred rendering - -path. As with Beautify, this effect gives an instant boost to your scene by making light bounce on shiny surfaces, casting -gorgeous reflections on all kind of reflective surfaces. Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/slug/188638?aid=1101lGsd - -SKYBOX PLUS is an artist-driven replacement for Unity default skybox. Includes a lovely blend of procedural haze and - -hand-drawn clouds which mimic the style of Studio Ghibli. -Supports full day/night transition with moon, stars, several cloud layers with custom animation and lot of customization -options. . Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/2d/textures-materials/sky/skybox-plus-182966?aid=1101lGsd - -VOLUMETRIC LIGHTS is a powerful asset to add scattering effect to any number of Unity lights. Supports spot, point - -and area light types. Directional lights are also supported for localized areas. Includes advanced options like dust lit -particles and shadow occlusion. Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/vfx/shaders/volumetric-lights-164149?aid=1101lGsd - COMPASS NAVIGATOR PRO adds a “Skyrim”-like compass bar to your UI, including smooth fade in/out, various bar - -designs, +11 icons in two variations (+22 icons) and nice features like minimap and beam lights! -Compatible with all render pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/gui/compass-navigator-pro-59519?aid=1101lGsd - -X-FRAME FPS ACCELERATOR provides you extra frames per second in your mobile games (iOS and Android). It takes - -advantage of the huge screen resolution of these devices to sacrifice some pixels in Exchange of performance with flexible -and dynamic quality options. Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/camera/x-frame-fps-accelerator-63965?aid=1101lGsd - -SHADER CONTROL is a tiny but powerful tool that will allow you to identify and manage shader keywords usage in your - -project, taking more control over the build size and compilation time. Compatible with all render pipelines. -Quickly locates and helps you disable keywords not needed, learn about the shaders used in your project and their keywords! -Get it on the Asset Store: - -https://assetstore.unity.com/packages/vfx/shaders/shader-control-74817?aid=1101lGsd - TERRAIN GRID SYSTEM is an advanced grid generator and territory/cell highlighter/fader for both Terrain and 2D grids. - - Compatible with all render pipelines. It can generate Voronoi, hexagonal and boxed grids dynamically on your terrain, with - flexible position options . Compatible with built-in and URP pipelines. - Get it on the Asset Store: - - https://assetstore.unity.com/packages/tools/terrain/terrain-grid-system-47215?aid=1101lGsd - -GRIDS 2D is similar to Terrain Grid System but only for flat 2D grids. It’s fast, convenient and easy to use. - -Compatible with all render pipelines. It can also generate Voronoi, hexagonal and boxed grids dynamically on your terrain, with -flexible API to integrate with your game. Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/sprite-management/grids-2d-59981?aid=1101lGsd - -HEXASPHERE GRID SYSTEM leverages shader technologies like texture arrays and geometry shaders to render hundreds - -of thousands of interactive and customizable tiles in a spherical/hexagonal grid. -Fully interactive, with VR support and super-fast. Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/modeling/hexasphere-grid-system-89112?aid=1101lGsd - TUNNEL FX 2 is a full-screen post image effect that creates stunning, colorful 3D animated tunnels. It does not create any - -real tunnel but just draw the tunnel as a post-effect behind any geometry or UI. -Compatible with built-in and URP pipelines. - -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/particles-effects/tunnel-fx-2-86544?aid=1101lGsd - -GLOBAL SNOW renders your existing scene into a winter landscape with a couple of clicks. Just add a single script to your - -camera and customize the results. -Supports relief mapping for realistic snow effect + human footprints + terrain marks with automatic collision detection and -more! -Get it on the Asset Store: - -https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/global-snow-79795?aid=1101lGsd - -HIGHLIGHT PLUS adds outline, glow and see-through effects to any 3D object in the scene. - -It’s performant and designed for all platforms, including built-in and URP rendering pipelines. - -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/particles-effects/highlight-plus-134149?aid=1101lGsd - VOXEL PLAY 2 is a procedural, fast environment based on cubes. It leverages highly optimized code, including - -geometry shaders and texture arrays, to generate beautiful, rich, vast infinite worlds which can be customized and -modified in many ways. Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/tools/game-toolkits/voxel-play-2-201234?aid=1101lGsd - -PIRATES OF VOXEL PLAY is a multiplayer game template built with Mirror and Voxel Play. It’s the perfect - -sample project to learn how to implement multiplayer games using these two frameworks. -Includes animated characters, a fully populated tropical island with 3 biomes, wild beasts, weapons, loots, cute -music and sound effects and of course plenty of commented code, documentation and video tutorials! -Get it on the Asset Store: - -https://assetstore.unity.com/packages/slug/189096?aid=1101lGsd - LIQUID VOLUME is a powerful and highly customizable shader that simulates realistic and animated liquid - -containers. Can be used in 3D scenes and 2D UI (demos included). -Liquid Volume is super easy and fun to use: just add the main script to any primitive (sphere, box, cylinder and -similar shape models) to convert it into a liquid container! -Get it on the Asset Store: - -https://assetstore.unity.com/packages/vfx/shaders/liquid-volume-70992?aid=1101lGsd - -LIQUID VOLUME PRO 2 includes all features of Liquid Volume and adds additional advanced options plus - -improved compatibility with more platforms. -Among the new options are multiple liquid layers support, miscible liquids, bubbles, better mesh options and full -WebGL support! Compatible with built-in and URP pipelines. -Get it on the Asset Store: - -https://assetstore.unity.com/packages/vfx/shaders/liquid-volume-pro-129967?aid=1101lGsd - HIGHLIGHT PLUS 2D adds outline, glow, see-through and other effects to any sprite in the scene. - -It’s performant and designed for all platforms, including standard and URP rendering pipelines. -Get it on the Asset Store: -https://assetstore.unity.com/packages/tools/particles-effects/highlight-plus-2d-138383?aid=1101lGsd - -TRAILS FX renders smooth, mesmerizing trails behind moving objects and characters. - -It’s performant thanks to the use of GPU instancing and use correct transparency order producing a fascinating effect. -Compatible with built-in and URP pipelines. -Get it on the Asset Store: - - https://assetstore.unity.com/packages/tools/particles-effects/trails-fx-146898?aid=1101lGsd - -COLOR STUDIO is an Editor Extension that allows you to create awesome color palettes and recolor objects, sprites and scenes - -easily in editor and runtime. Compatible with all render pipelines. -It comes with an interactive color wheel editor and a complete set of tools that let you also export color palettes as LUTs, -transform existing textures or specific colors from object materials. -Get it on the Asset Store: -https://assetstore.unity.com/packages/tools/painting/color-studio-151892?aid=1101lGsd - LUT PACK is a collection of +200 cinematic and artistic LUTs plus tints for Beautify. They can dramatically change the mood - -and look of your game scenes. Beautify includes a LUT Browser that let you quickly text each one of the included LUT in this -package. -Get it on the Asset Store: -https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/lut-pack-for-beautify-202502?aid=1101lGsd - -FRAME PACK is a collection of +75 film mattes and artistic borders that can be used with Beautify or Unity UI. This p - -Get it on the Asset Store: -https://assetstore.unity.com/packages/2d/gui/frame-pack-204058?aid=1101lGsd - - MILITARY UNITS – THE STYLIZED ART COLLECTION includes +100 hand-painted, stylized portraits of military units - - from ancient warriors to modern ships and aircraft. Great for decorating your game screens, unit sheets, icons, or prototyping. - Get it on the Asset Store: - https://assetstore.unity.com/packages/2d/textures-materials/military-units-the-stylized-art-collection- - 187769?aid=1101lGsd - Luma Based Ambient Occlusion is a full-screen image effect that simulates occlusion based solely on color - -information. -Get it on the Asset Store: -https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/luma-based-ambient-occlusion-ssao-2d- -93013?aid=1101lGsd - -RPG Starter Bundle includes a collection of visual, environment effects, navigation tools and assets to quickly build the - -foundation of a RPG/Fantasy game or prototype. Save 50% purchasing this bundle (total value: $150)! This package -features the following assets: Compass Navigator Pro, Skybox Plus, Dynamic Fog % Mist, Tunnel FX 2, Liquid Volume -Get it on the Asset Store: -https://assetstore.unity.com/packages/templates/packs/rpg-starter-bundle-213822?aid=1101lGsd - -Beautify HDRP is a post processing effect created for High Definition Rendering Pipeline that improves the image - -quality in real time producing incredibly crisp and vivid scenes. -Get it on the Asset Store: -https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/beautify-hdrp-165411?aid=1101lGsd - Potions & Volumetric Liquid contains 8 unique (16 variations), high detailed, PBR set of magic potions with - -advanced volumetric effect for the liquids inside the flasks. -This asset uses Liquid Volume Pro to render the liquids and its effects (Liquid Volume Pro license is included with this -asset). - -Get it on the Asset Store: -https://assetstore.unity.com/packages/3d/props/potions-volumetric-liquid-221221?aid=1101lGsd - -Split Screen Pro is a camera composing system that enables automatic screen split between two targets or players. - -This asset can automatically detect when the two targets are far from each other and show a dynamic split line which -separates and adapts the view in two halves, one per each target or player. - -Get it on the Asset Store: -https://assetstore.unity.com/packages/tools/camera/split-screen-pro-207149?aid=1101lGsd - diff --git a/Assets/Plugins/HighlightPlus/Editor/TransparentWithDepth.cs b/Assets/Plugins/HighlightPlus/Editor/TransparentWithDepth.cs deleted file mode 100644 index 49a566a..0000000 --- a/Assets/Plugins/HighlightPlus/Editor/TransparentWithDepth.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEditor; - -namespace HighlightPlus { - - public class TransparentWithDepth { - - static Material bmDepthOnly; - - - [MenuItem ("GameObject/Effects/Highlight Plus/Add Depth To Transparent Object", false, 100)] - static void AddDepthOption () { - Renderer renderer = GetRenderer (); - if (renderer == null) - return; - - if (!EditorUtility.DisplayDialog ("Add Depth To Transparent Object", "This option will force the transparent object to write to the depth buffer by adding a new special material to the renderer (existing materials are preserved) so it can occlude and allow See-Through effect.\nOnly use on transparent objects.\n\nProceed?", "Yes", "No")) { - return; - } - - Material[] materials = renderer.sharedMaterials; - for (int k = 0; k < materials.Length; k++) { - if (materials [k] == bmDepthOnly) { - EditorUtility.DisplayDialog ("Depth Support", "Already set! Nothing to do.", "Ok"); - return; - } - } - if (materials == null) { - renderer.sharedMaterial = bmDepthOnly; - } else { - List newMaterials = new List (materials); - newMaterials.Insert (0, bmDepthOnly); - renderer.sharedMaterials = newMaterials.ToArray (); - } - } - - [MenuItem ("GameObject/Effects/Highlight Plus/Remove Depth Compatibility", false, 101)] - static void RemoveDepthOption () { - - Renderer renderer = GetRenderer (); - if (renderer == null) - return; - - Material[] materials = renderer.sharedMaterials; - for (int k = 0; k < materials.Length; k++) { - if (materials [k] == bmDepthOnly) { - List newMaterials = new List (renderer.sharedMaterials); - newMaterials.RemoveAt (k); - renderer.sharedMaterials = newMaterials.ToArray (); - return; - } - } - - for (int k = 0; k < materials.Length; k++) { - if (materials [k] == bmDepthOnly) { - EditorUtility.DisplayDialog ("Depth Support", "This object was not previously modified! Nothing to do.", "Ok"); - return; - } - } - - } - - - static Renderer GetRenderer () { - - if (Selection.activeGameObject == null) { - EditorUtility.DisplayDialog ("Depth Support", "This option can only be used on GameObjects.", "Ok"); - return null; - } - Renderer renderer = Selection.activeGameObject.GetComponent (); - if (renderer == null) { - EditorUtility.DisplayDialog ("Depth Support", "This option can only be used on GameObjects with a Renderer component attached.", "Ok"); - return null; - } - - if (bmDepthOnly == null) { - bmDepthOnly = Resources.Load ("HighlightPlus/HighlightPlusDepthWrite"); - if (bmDepthOnly == null) { - EditorUtility.DisplayDialog ("Depth Support", "HighlightPlusDepthWrite material not found!", "Ok"); - return null; - } - } - - return renderer; - } - - - } -} \ No newline at end of file diff --git a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusForwardRenderer.asset b/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusForwardRenderer.asset deleted file mode 100644 index 541c494..0000000 --- a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusForwardRenderer.asset +++ /dev/null @@ -1,95 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &-7137549924450841197 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 473a86c9e274347dfbdde619584cebe9, type: 3} - m_Name: NewHighlightPlusRenderPassFeature - m_EditorClassIdentifier: - m_Active: 1 - renderPassEvent: 500 - clearStencil: 0 ---- !u!114 &-1700769429572189234 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a1614fc811f8f184697d9bee70ab9fe5, type: 3} - m_Name: DecalRendererFeature - m_EditorClassIdentifier: - m_Active: 1 - m_Settings: - technique: 0 - maxDrawDistance: 1000 - dBufferSettings: - surfaceData: 2 - screenSpaceSettings: - normalBlend: 0 - useGBuffer: 1 - m_CopyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} - m_DBufferClear: {fileID: 4800000, guid: f056d8bd2a1c7e44e9729144b4c70395, type: 3} ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} - m_Name: HighlightPlusForwardRenderer - m_EditorClassIdentifier: - debugShaders: - debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3} - m_RendererFeatures: - - {fileID: -7137549924450841197} - - {fileID: -1700769429572189234} - m_RendererFeatureMap: ce83810137a765e8e48b81e159787579 - m_UseNativeRenderPass: 0 - postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} - xrSystemData: {fileID: 11400000, guid: 60e1133243b97e347b653163a8c01b64, type: 2} - shaders: - blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} - copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} - screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd, type: 3} - samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} - stencilDeferredPS: {fileID: 4800000, guid: e9155b26e1bc55942a41e518703fe304, type: 3} - fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} - materialErrorPS: {fileID: 4800000, guid: 5fd9a8feb75a4b5894c241777f519d4e, type: 3} - coreBlitPS: {fileID: 4800000, guid: 93446b5c5339d4f00b85c159e1159b7c, type: 3} - coreBlitColorAndDepthPS: {fileID: 4800000, guid: d104b2fc1ca6445babb8e90b0758136b, type: 3} - cameraMotionVector: {fileID: 4800000, guid: c56b7e0d4c7cb484e959caeeedae9bbf, type: 3} - objectMotionVector: {fileID: 4800000, guid: 7b3ede40266cd49a395def176e1bc486, type: 3} - m_AssetVersion: 2 - m_OpaqueLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_TransparentLayerMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_DefaultStencilState: - overrideStencilState: 0 - stencilReference: 0 - stencilCompareFunction: 8 - passOperation: 0 - failOperation: 0 - zFailOperation: 0 - m_ShadowTransparentReceive: 1 - m_RenderingMode: 0 - m_DepthPrimingMode: 0 - m_CopyDepthMode: 0 - m_AccurateGbufferNormals: 0 - m_ClusteredRendering: 0 - m_TileSize: 32 - m_IntermediateTextureMode: 1 diff --git a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusForwardRenderer.asset.meta b/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusForwardRenderer.asset.meta deleted file mode 100644 index 69856d5..0000000 --- a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusForwardRenderer.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 47db18f3169384f6b87445e6447e189e -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusRenderPassFeature.cs b/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusRenderPassFeature.cs deleted file mode 100644 index 24d17f6..0000000 --- a/Assets/Plugins/HighlightPlus/Pipelines/URP/HighlightPlusRenderPassFeature.cs +++ /dev/null @@ -1,135 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.Rendering; -using UnityEngine.Rendering.Universal; - -namespace HighlightPlus { - - public class HighlightPlusRenderPassFeature : ScriptableRendererFeature { - class HighlightPass : ScriptableRenderPass { - - // far objects render first - class DistanceComparer : IComparer { - - public Vector3 camPos; - - public int Compare(HighlightEffect e1, HighlightEffect e2) { - Vector3 e1Pos = e1 == null ? Vector3.zero : e1.transform.position; - float dx1 = e1Pos.x - camPos.x; - float dy1 = e1Pos.y - camPos.y; - float dz1 = e1Pos.z - camPos.z; - float distE1 = dx1 * dx1 + dy1 * dy1 + dz1 * dz1; - Vector3 e2Pos = e2 == null ? Vector3.zero : e2.transform.position; - float dx2 = e2Pos.x - camPos.x; - float dy2 = e2Pos.y - camPos.y; - float dz2 = e2Pos.z - camPos.z; - float distE2 = dx2 * dx2 + dy2 * dy2 + dz2 * dz2; - if (distE1 > distE2) return -1; - if (distE1 < distE2) return 1; - return 0; - } - } - - - public bool usesCameraOverlay = false; - - ScriptableRenderer renderer; - RenderTextureDescriptor cameraTextureDescriptor; - DistanceComparer effectDistanceComparer; - static bool isVREnabled; - bool clearStencil; - FullScreenBlitMethod fullScreenBlitMethod = FullScreenBlit; - - public void Setup(HighlightPlusRenderPassFeature passFeature, ScriptableRenderer renderer) { - this.renderPassEvent = passFeature.renderPassEvent; - this.clearStencil = passFeature.clearStencil; - this.renderer = renderer; - if (effectDistanceComparer == null) { - effectDistanceComparer = new DistanceComparer(); - } - isVREnabled = UnityEngine.XR.XRSettings.enabled && Application.isPlaying; - } - - public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) { - this.cameraTextureDescriptor = cameraTextureDescriptor; -#if UNITY_2021_2_OR_NEWER - ConfigureInput(ScriptableRenderPassInput.Depth); -#endif - } - - public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) { - - Camera cam = renderingData.cameraData.camera; - int camLayer = 1 << cam.gameObject.layer; - - RenderTargetIdentifier cameraColorTarget = renderer.cameraColorTarget; - RenderTargetIdentifier cameraDepthTarget = renderer.cameraDepthTarget; -#if !UNITY_2021_2_OR_NEWER - // In Unity 2021.2, when MSAA > 1, cameraDepthTarget is no longer cameraColorTarget - if (!usesCameraOverlay && (cameraTextureDescriptor.msaaSamples > 1 || cam.cameraType == CameraType.SceneView)) { - cameraDepthTarget = cameraColorTarget; - } -#endif - if (!HighlightEffect.customSorting && (Time.frameCount % 10 == 0 || !Application.isPlaying)) { - effectDistanceComparer.camPos = cam.transform.position; - HighlightEffect.effects.Sort(effectDistanceComparer); - } - - int count = HighlightEffect.effects.Count; - bool clearStencil = this.clearStencil; - for (int k = 0; k < count; k++) { - HighlightEffect effect = HighlightEffect.effects[k]; - if (effect.isActiveAndEnabled) { - if ((effect.camerasLayerMask & camLayer) == 0) continue; - CommandBuffer cb = effect.GetCommandBuffer(cam, cameraColorTarget, cameraDepthTarget, fullScreenBlitMethod, clearStencil); - if (cb != null) { - context.ExecuteCommandBuffer(cb); - clearStencil = false; - } - } - } - } - - static Matrix4x4 matrix4x4identity = Matrix4x4.identity; - static void FullScreenBlit(CommandBuffer cmd, RenderTargetIdentifier source, RenderTargetIdentifier destination, Material material, int passIndex) { - destination = new RenderTargetIdentifier(destination, 0, CubemapFace.Unknown, -1); - cmd.SetRenderTarget(destination); - cmd.SetGlobalTexture(ShaderParams.MainTex, source); - cmd.SetGlobalFloat(ShaderParams.AspectRatio, isVREnabled ? 0.5f : 1); - cmd.DrawMesh(RenderingUtils.fullscreenMesh, matrix4x4identity, material, 0, passIndex); - } - - public override void FrameCleanup(CommandBuffer cmd) { - } - } - - HighlightPass renderPass; - public RenderPassEvent renderPassEvent = RenderPassEvent.AfterRenderingTransparents; - [Tooltip("Clears stencil buffer before rendering highlight effects. This option can solve compatibility issues with shaders that also use stencil buffers.")] - public bool clearStencil; - public static bool installed; - - - void OnDisable() { - installed = false; - } - - public override void Create() { - renderPass = new HighlightPass(); - } - - // This method is called when setting up the renderer once per-camera. - public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) { -#if UNITY_2019_4_OR_NEWER - if (renderingData.cameraData.renderType == CameraRenderType.Base) { - Camera cam = renderingData.cameraData.camera; - renderPass.usesCameraOverlay = cam.GetUniversalAdditionalCameraData().cameraStack.Count > 0; - } -#endif - renderPass.Setup(this, renderer); - renderer.EnqueuePass(renderPass); - installed = true; - } - } - -} diff --git a/Assets/Plugins/HighlightPlus/Pipelines/URP/UniversalRenderPipelineAsset.asset b/Assets/Plugins/HighlightPlus/Pipelines/URP/UniversalRenderPipelineAsset.asset deleted file mode 100644 index f64cdb9..0000000 --- a/Assets/Plugins/HighlightPlus/Pipelines/URP/UniversalRenderPipelineAsset.asset +++ /dev/null @@ -1,75 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} - m_Name: UniversalRenderPipelineAsset - m_EditorClassIdentifier: - k_AssetVersion: 9 - k_AssetPreviousVersion: 9 - m_RendererType: 1 - m_RendererData: {fileID: 0} - m_RendererDataList: - - {fileID: 11400000, guid: 47db18f3169384f6b87445e6447e189e, type: 2} - m_DefaultRendererIndex: 0 - m_RequireDepthTexture: 1 - m_RequireOpaqueTexture: 0 - m_OpaqueDownsampling: 1 - m_SupportsTerrainHoles: 1 - m_StoreActionsOptimization: 0 - m_SupportsHDR: 1 - m_MSAA: 2 - m_RenderScale: 1 - m_UpscalingFilter: 0 - m_FsrOverrideSharpness: 0 - m_FsrSharpness: 0.92 - m_MainLightRenderingMode: 1 - m_MainLightShadowsSupported: 1 - m_MainLightShadowmapResolution: 2048 - m_AdditionalLightsRenderingMode: 1 - m_AdditionalLightsPerObjectLimit: 4 - m_AdditionalLightShadowsSupported: 0 - m_AdditionalLightsShadowmapResolution: 512 - m_AdditionalLightsShadowResolutionTierLow: 128 - m_AdditionalLightsShadowResolutionTierMedium: 256 - m_AdditionalLightsShadowResolutionTierHigh: 512 - m_ReflectionProbeBlending: 0 - m_ReflectionProbeBoxProjection: 0 - m_ShadowDistance: 50 - m_ShadowCascadeCount: 1 - m_Cascade2Split: 0.25 - m_Cascade3Split: {x: 0.1, y: 0.3} - m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} - m_CascadeBorder: 0.1 - m_ShadowDepthBias: 1 - m_ShadowNormalBias: 1 - m_AnyShadowsSupported: 1 - m_SoftShadowsSupported: 1 - m_ConservativeEnclosingSphere: 0 - m_NumIterationsEnclosingSphere: 64 - m_AdditionalLightsCookieResolution: 2048 - m_AdditionalLightsCookieFormat: 3 - m_UseSRPBatcher: 1 - m_SupportsDynamicBatching: 0 - m_MixedLightingSupported: 1 - m_SupportsLightLayers: 0 - m_DebugLevel: 0 - m_UseAdaptivePerformance: 1 - m_ColorGradingMode: 0 - m_ColorGradingLutSize: 32 - m_UseFastSRGBLinearConversion: 0 - m_ShadowType: 1 - m_LocalShadowsSupported: 0 - m_LocalShadowsAtlasResolution: 256 - m_MaxPixelLights: 0 - m_ShadowAtlasResolution: 256 - m_ShaderVariantLogLevel: 0 - m_VolumeFrameworkUpdateMode: 0 - m_ShadowCascades: 0 diff --git a/Assets/Plugins/HighlightPlus/Pipelines/URP/UniversalRenderPipelineAsset.asset.meta b/Assets/Plugins/HighlightPlus/Pipelines/URP/UniversalRenderPipelineAsset.asset.meta deleted file mode 100644 index a3eec97..0000000 --- a/Assets/Plugins/HighlightPlus/Pipelines/URP/UniversalRenderPipelineAsset.asset.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7cb1de89cd1dc44c5be43a3f6664fb90 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: