enemy spawner
This commit is contained in:
@@ -0,0 +1,181 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Screen Distortion"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Toggle(_ALPHATEST_ON)] _UseAlphaClip ("Alpha Clipping (Cutout)", Float) = 0
|
||||
//# IF_KEYWORD _ALPHATEST_ON
|
||||
_Cutoff ("Cutoff Threshold", Range(0.001,1)) = 0.1
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_EDGE_FADING)] _UseEF ("Edge Fade", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_EDGE_FADING
|
||||
_EdgeFadePow ("Edge Fade Power", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Texture
|
||||
//#
|
||||
[NoScaleOffset] _ScreenDistortionTex ("Distortion Texture", 2D) = "bump" {}
|
||||
_ScreenDistortionScale ("Distortion Scale", Range(-0.5, 0.5)) = 0.1
|
||||
|
||||
//# ========================================================
|
||||
//# Debug
|
||||
//#
|
||||
|
||||
[Toggle(_DEBUG_VISUALIZE_DISTORTION)] _DebugVisualize ("Visualize Distortion Particles", Float) = 0
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
|
||||
Blend SrcAlpha OneMinusSrcAlpha, One One
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
Subshader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local _ _DEBUG_VISUALIZE_DISTORTION
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_SCREEN_DISTORTION_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local _ _DEBUG_VISUALIZE_DISTORTION
|
||||
|
||||
#define _CameraOpaqueTexture _CameraSortingLayerTexture
|
||||
#define CFXR_URP
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_SCREEN_DISTORTION_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
GrabPass
|
||||
{
|
||||
Tags { "LightMode" = "Always" }
|
||||
"_GrabTexture"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local _ _DEBUG_VISUALIZE_DISTORTION
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define CFXR_SCREEN_DISTORTION_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 304630dc6079b47419e5333f284382fd
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 70
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Screen Distortion NEW\"\r\n{\r\n\tProperties\r\n\t{
|
||||
\r\n\t\t[Toggle(_ALPHATEST_ON)] _UseAlphaClip (\"Alpha Clipping (Cutout)\", Float)
|
||||
= 0\r\n\t//# IF_KEYWORD _ALPHATEST_ON\r\n\t\t_Cutoff (\"Cutoff Threshold\", Range(0.001,1))
|
||||
= 0.1\r\n\t//# END_IF\r\n\t\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# \r\n\r\n\t\t[Toggle(_CFXR_EDGE_FADING)]
|
||||
_UseEF (\"Edge Fade\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_EDGE_FADING\r\n\t\t_EdgeFadePow
|
||||
(\"Edge Fade Power\", Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\t//#
|
||||
Texture\r\n\t//#\r\n\t\t[NoScaleOffset] _ScreenDistortionTex (\"Distortion Texture\",
|
||||
2D) = \"bump\" {}\r\n\t\t_ScreenDistortionScale (\"Distortion Scale\", Range(-0.5,
|
||||
0.5)) = 0.1\r\n\t\t\r\n\t//# ========================================================\r\n\t//#
|
||||
Debug\r\n\t//# \r\n\t\t\r\n\t\t[Toggle(_DEBUG_VISUALIZE_DISTORTION)] _DebugVisualize
|
||||
(\"Visualize Distortion Particles\", Float) = 0 \r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t\t\"PreviewType\"=\"Plane\"\r\n\t\t}\r\n\r\n\t\tBlend
|
||||
SrcAlpha OneMinusSrcAlpha, One One\r\n\t\tZWrite Off\r\n\t\tCull Off\r\n\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tGrabPass\r\n\t\t\t{\r\n\t\t\t\tTags
|
||||
{ \"LightMode\" = \"Always\" }\r\n\t\t\t\t\"_GrabTexture\"\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_particles\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t//#pragma
|
||||
multi_compile_fwdbase\r\n\t\t\t\t//#pragma multi_compile SHADOWS_SCREEN\r\n\t\t\t\t\r\n\t\t\t\t//
|
||||
Using the same keywords as Unity's Standard Particle shader to minimize project-wide
|
||||
keyword usage\r\n\t\t\t\t#pragma shader_feature_local _ _FADING_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _DEBUG_VISUALIZE_DISTORTION\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define
|
||||
CFXR_SCREEN_DISTORTION_SHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Screen Distortion NEW
|
||||
shaderErrors: []
|
||||
variantCount: 64
|
||||
variantCountUsed: 2
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR Particle
|
||||
Distortion.cfxrshader
|
||||
uploadId: 756876
|
||||
@@ -0,0 +1,275 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Procedural Glow"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
//# Blending
|
||||
//#
|
||||
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Blend Source", Float) = 5
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Blend Destination", Float) = 10
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_DISSOLVE)] _UseDissolve ("Enable Dissolve", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DISSOLVE
|
||||
[NoScaleOffset] _DissolveTex ("Dissolve Texture", 2D) = "gray" {}
|
||||
_DissolveSmooth ("Dissolve Smoothing", Range(0.0001,0.5)) = 0.1
|
||||
[ToggleNoKeyword] _InvertDissolveTex ("Invert Dissolve Texture", Float) = 0
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Procedural Circle
|
||||
//#
|
||||
|
||||
[KeywordEnum(P0, P2, P4, P8)] _CFXR_GLOW_POW ("Apply Power of", Float) = 0
|
||||
_GlowMin ("Circle Min", Float) = 0
|
||||
_GlowMax ("Circle Max", Float) = 1
|
||||
//#
|
||||
_MaxValue ("Max Value", Float) = 10
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
_HdrMultiply ("HDR Multiplier", Float) = 2
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Shadows
|
||||
//#
|
||||
|
||||
[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS ("Dithered Shadows", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_ShadowStrength ("Shadows Strength Max", Range(0,1)) = 1.0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_DitherCustom ("Dithering 3D Texture", 3D) = "black" {}
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
Blend [_SrcBlend] [_DstBlend], One One
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define CFXR_URP
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_GLOW_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67dfcda17071f4a41be79c4049965e67
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 108
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Procedural Glow NEW\"\r\n{\r\n\tProperties\r\n\t{\r\n\t//#
|
||||
Blending\r\n\t//#\r\n\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend
|
||||
(\"Blend Source\", Float) = 5\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)]
|
||||
_DstBlend (\"Blend Destination\", Float) = 10\r\n\t\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_DISSOLVE)]
|
||||
_UseDissolve (\"Enable Dissolve\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE\r\n\t\t[NoScaleOffset]
|
||||
_DissolveTex (\"Dissolve Texture\", 2D) = \"gray\" {}\r\n\t\t_DissolveSmooth
|
||||
(\"Dissolve Smoothing\", Range(0.0001,0.5)) = 0.1\r\n\t\t[ToggleNoKeyword] _InvertDissolveTex
|
||||
(\"Invert Dissolve Texture\", Float) = 0\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t//#
|
||||
Procedural Circle\r\n\t//#\r\n\r\n\t\t[KeywordEnum(P0, P2, P4, P8)] _CFXR_GLOW_POW
|
||||
(\"Apply Power of\", Float) = 0\r\n\t\t_GlowMin (\"Circle Min\", Float) = 0\r\n\t\t_GlowMax
|
||||
(\"Circle Max\", Float) = 1\r\n\t//#\r\n\t\t_MaxValue (\"Max Value\", Float)
|
||||
= 10\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_HDR_BOOST)]
|
||||
_HdrBoost (\"Enable HDR Multiplier\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_HDR_BOOST\r\n\t\t_HdrMultiply
|
||||
(\"HDR Multiplier\", Float) = 2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\t//#
|
||||
Shadows\r\n\t//#\r\n\r\n\t\t[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS
|
||||
(\"Dithered Shadows\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON
|
||||
|| _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_ShadowStrength\t\t(\"Shadows
|
||||
Strength Max\", Range(0,1)) = 1.0\r\n\t\t//#\tIF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_DitherCustom\t\t(\"Dithering
|
||||
3D Texture\", 3D) = \"black\" {}\r\n\t\t//#\tEND_IF\r\n\t//# END_IF\r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t\t\"PreviewType\"=\"Plane\"\r\n\t\t}\r\n\t\tBlend
|
||||
[_SrcBlend] [_DstBlend], One One\r\n\t\tCull Off\r\n\t\tZWrite Off\r\n\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_particles\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\r\n\t\t\t\t#pragma shader_feature_local _FADING_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#include
|
||||
\"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define CFXR_GLOW_SHADER\r\n\t\t\t\t#include
|
||||
\"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\t\t\t\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_GLOW_POW_P2 _CFXR_GLOW_POW_P4 _CFXR_GLOW_POW_P8\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON
|
||||
_ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define
|
||||
PASS_SHADOW_CASTER\r\n\t\t\t\t#define CFXR_GLOW_SHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Procedural Glow NEW
|
||||
shaderErrors: []
|
||||
variantCount: 3040
|
||||
variantCountUsed: 4
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR Particle
|
||||
Glow.cfxrshader
|
||||
uploadId: 756876
|
||||
@@ -0,0 +1,269 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Procedural Ring"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
//# Blending
|
||||
//#
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Blend Source", Float) = 5
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Blend Destination", Float) = 10
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_DISSOLVE)] _UseDissolve ("Enable Dissolve", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DISSOLVE
|
||||
[NoScaleOffset] _DissolveTex ("Dissolve Texture", 2D) = "gray" {}
|
||||
_DissolveSmooth ("Dissolve Smoothing", Range(0.0001,0.5)) = 0.1
|
||||
[ToggleNoKeyword] _InvertDissolveTex ("Invert Dissolve Texture", Float) = 0
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Textures
|
||||
//#
|
||||
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
[Toggle] _SingleChannel ("Single Channel Texture", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Ring
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_RADIAL_UV)] _UseRadialUV ("Enable Radial UVs", Float) = 0
|
||||
_RingTopOffset ("Ring Offset", float) = 0.05
|
||||
[Toggle(_CFXR_WORLD_SPACE_RING)] _WorldSpaceRing ("World Space", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
_HdrMultiply ("HDR Multiplier", Float) = 2
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Shadows
|
||||
//#
|
||||
|
||||
[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS ("Dithered Shadows", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_ShadowStrength ("Shadows Strength Max", Range(0,1)) = 1.0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_DitherCustom ("Dithering 3D Texture", 3D) = "black" {}
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
}
|
||||
Blend [_SrcBlend] [_DstBlend]
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define CFXR_URP
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
#pragma multi_compile_particles
|
||||
// #pragma multi_compile_instancing
|
||||
#pragma multi_compile_fog
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_RADIAL_UV
|
||||
#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
|
||||
#pragma shader_feature_local _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_PROCEDURAL_RING_SHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1581eccce46ba384596a1dce7936ab19
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 113
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Procedural Ring NEW\"\r\n{\r\n\tProperties\r\n\t{\r\n\t//#
|
||||
Blending\r\n\t//#\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend (\"Blend
|
||||
Source\", Float) = 5\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend
|
||||
(\"Blend Destination\", Float) = 10\r\n\t\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_DISSOLVE)]
|
||||
_UseDissolve (\"Enable Dissolve\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE\r\n\t\t[NoScaleOffset]
|
||||
_DissolveTex (\"Dissolve Texture\", 2D) = \"gray\" {}\r\n\t\t_DissolveSmooth
|
||||
(\"Dissolve Smoothing\", Range(0.0001,0.5)) = 0.1\r\n\t\t[ToggleNoKeyword] _InvertDissolveTex
|
||||
(\"Invert Dissolve Texture\", Float) = 0\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t//#
|
||||
Textures\r\n\t//#\r\n\r\n\t\t_MainTex (\"Texture\", 2D) = \"white\" {}\r\n\t\t[Toggle(_CFXR_SINGLE_CHANNEL)]
|
||||
_SingleChannel (\"Single Channel Texture\", Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t//#
|
||||
Ring\r\n\t//#\r\n\r\n\t\t[Toggle(_CFXR_RADIAL_UV)] _UseRadialUV (\"Enable Radial
|
||||
UVs\", Float) = 0\r\n\t\t_RingTopOffset (\"Ring Offset\", float) = 0.05\r\n\t\t[Toggle(_CFXR_WORLD_SPACE_RING)]
|
||||
_WorldSpaceRing (\"World Space\", Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_HDR_BOOST)]
|
||||
_HdrBoost (\"Enable HDR Multiplier\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_HDR_BOOST\r\n\t\t_HdrMultiply
|
||||
(\"HDR Multiplier\", Float) = 2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\t//#
|
||||
Shadows\r\n\t//#\r\n\r\n\t\t[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS
|
||||
(\"Dithered Shadows\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON
|
||||
|| _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_ShadowStrength\t\t(\"Shadows
|
||||
Strength Max\", Range(0,1)) = 1.0\r\n\t\t//#\tIF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_DitherCustom\t\t(\"Dithering
|
||||
3D Texture\", 3D) = \"black\" {}\r\n\t\t//#\tEND_IF\r\n\t//# END_IF\r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t}\r\n\t\tBlend
|
||||
[_SrcBlend] [_DstBlend]\r\n\t\tCull Off\r\n\t\tZWrite Off\r\n\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
target 2.0\r\n\t\t\t\t\r\n\t\t\t\t#pragma multi_compile_particles\r\n\t\t\t\t//
|
||||
#pragma multi_compile_instancing\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_RADIAL_UV\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_HDR_BOOST\r\n\r\n\t\t\t\t// Using the same keywords as Unity's Standard
|
||||
Particle shader to minimize project-wide keyword usage\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#define CFXR_PROCEDURAL_RING_SHADER\r\n\t\t\t\t#include
|
||||
\"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\t\t\t\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_RADIAL_UV\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_WORLD_SPACE_RING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
_ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#define PASS_SHADOW_CASTER\r\n\t\t\t\t#define
|
||||
CFXR_PROCEDURAL_RING_SHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Procedural Ring NEW
|
||||
shaderErrors: []
|
||||
variantCount: 6080
|
||||
variantCountUsed: 4
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR Particle
|
||||
Procedural Ring.cfxrshader
|
||||
uploadId: 756876
|
||||
@@ -0,0 +1,422 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2020 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Shader "Cartoon FX/Remaster/Particle Ubershader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
//# Blending
|
||||
//#
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend ("Blend Source", Float) = 5
|
||||
[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend ("Blend Destination", Float) = 10
|
||||
[KeywordEnumNoPrefix(Alpha Blending, _ALPHABLEND_ON, Alpha Blending Premultiplied, _ALPHAPREMULTIPLY_ON, Multiplicative, _ALPHAMODULATE_ON, Additive, _CFXR_ADDITIVE)] _BlendingType ("Blending Type", Float) = 0
|
||||
|
||||
//#
|
||||
[ToggleNoKeyword] _ZWrite ("Depth Write", Float) = 0
|
||||
[Toggle(_ALPHATEST_ON)] _UseAlphaClip ("Alpha Clipping (Cutout)", Float) = 0
|
||||
//# IF_KEYWORD _ALPHATEST_ON
|
||||
_Cutoff ("Cutoff Threshold", Range(0.001,1)) = 0.1
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FADING_ON)] _UseSP ("Soft Particles", Float) = 0
|
||||
//# IF_KEYWORD _FADING_ON
|
||||
_SoftParticlesFadeDistanceNear ("Near Fade", Float) = 0
|
||||
_SoftParticlesFadeDistanceFar ("Far Fade", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_EDGE_FADING)] _UseEF ("Edge Fade", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_EDGE_FADING
|
||||
_EdgeFadePow ("Edge Fade Power", Float) = 1
|
||||
//# END_IF
|
||||
|
||||
//#
|
||||
|
||||
//# ========================================================
|
||||
|
||||
//# Effects
|
||||
//#
|
||||
|
||||
[Toggle(_CFXR_DISSOLVE)] _UseDissolve ("Enable Dissolve", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DISSOLVE
|
||||
_DissolveTex ("Dissolve Texture", 2D) = "gray" {}
|
||||
_DissolveSmooth ("Dissolve Smoothing", Range(0.0001,0.5)) = 0.1
|
||||
[ToggleNoKeyword] _InvertDissolveTex ("Invert Dissolve Texture", Float) = 0
|
||||
[ToggleNoKeyword] _DoubleDissolve ("Double Dissolve", Float) = 0
|
||||
[Toggle] _UseDissolveOffsetUV ("Dissolve offset along X", Float) = 0
|
||||
//# IF_PROPERTY _UseDissolveOffsetUV > 0
|
||||
_DissolveScroll ("UV Scrolling", Vector) = (0,0,0,0)
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_UV_DISTORTION)] _UseUVDistortion ("Enable UV Distortion", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_UV_DISTORTION
|
||||
|
||||
[NoScaleOffset] _DistortTex ("Distortion Texture", 2D) = "gray" {}
|
||||
_DistortScrolling ("Scroll (XY) Tile (ZW)", Vector) = (0,0,1,1)
|
||||
[Toggle] _UseUV2Distortion ("Use UV2", Float) = 0
|
||||
_Distort ("Distortion Strength", Range(0,2.0)) = 0.1
|
||||
[ToggleNoKeyword] _FadeAlongU ("Fade along Y", Float) = 0
|
||||
[Toggle] _UVDistortionAdd ("Add to base UV", Float) = 0
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
|
||||
//# Colors
|
||||
//#
|
||||
|
||||
[NoScaleOffset] _MainTex ("Texture", 2D) = "white" {}
|
||||
[Toggle] _SingleChannel ("Single Channel Texture", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[KeywordEnum(Off,1x,2x)] _CFXR_OVERLAYTEX ("Enable Overlay Texture", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_OVERLAYTEX_1X || _CFXR_OVERLAYTEX_2X
|
||||
[Enum(RGBA,0,RGB,1,A,2)] _CFXR_OVERLAYBLEND ("Overlay Blend Channels", Float) = 0
|
||||
[NoScaleOffset] _OverlayTex ("Overlay Texture", 2D) = "white" {}
|
||||
_OverlayTex_Scroll ("Overlay Scrolling / Scale", Vector) = (0.1,0.1,1,1)
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_FLIPBOOK_BLENDING)] _UseFB ("Flipbook Blending", Float) = 0
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_SECONDCOLOR_LERP)] _UseSecondColor ("Secondary Vertex Color (TEXCOORD2)", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_SECONDCOLOR_LERP
|
||||
[NoScaleOffset] _SecondColorTex ("Second Color Map", 2D) = "black" {}
|
||||
_SecondColorSmooth ("Second Color Smoothing", Range(0.0001,0.5)) = 0.2
|
||||
//# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
[Toggle(_CFXR_FONT_COLORS)] _UseFontColor ("Use Font Colors", Float) = 0
|
||||
|
||||
// //# --------------------------------------------------------
|
||||
//
|
||||
// [Toggle(_CFXR_GRADIENTMAP)] _UseGradientMap ("Gradient Map", Float) = 0
|
||||
// //# IF_KEYWORD _CFXR_GRADIENTMAP
|
||||
// [NoScaleOffset] _GradientMap ("Gradient Map", 2D) = "black" {}
|
||||
// //# END_IF
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
_HdrMultiply ("HDR Multiplier", Float) = 1
|
||||
|
||||
//# --------------------------------------------------------
|
||||
|
||||
//# Lighting
|
||||
//#
|
||||
|
||||
[KeywordEnumNoPrefix(Off, _, Direct, _CFXR_LIGHTING_DIRECT, Indirect, _CFXR_LIGHTING_INDIRECT, Both, _CFXR_LIGHTING_ALL)] _UseLighting ("Mode", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_ALL
|
||||
_DirectLightingRamp ("Direct Lighting Ramp", Range(0,1)) = 1.0
|
||||
//# END_IF
|
||||
//#
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL
|
||||
[Toggle(_NORMALMAP)] _UseNormalMap ("Enable Normal Map", Float) = 0
|
||||
//# IF_KEYWORD _NORMALMAP
|
||||
[NoScaleOffset] _BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
_BumpScale ("Normal Scale", Range(-1, 1)) = 1.0
|
||||
//# END_IF
|
||||
//#
|
||||
[Toggle(_EMISSION)] _UseEmission ("Enable Emission (TEXCOORD2)", Float) = 0
|
||||
//#
|
||||
[Toggle(_CFXR_LIGHTING_WPOS_OFFSET)] _UseLightingWorldPosOffset ("Enable World Pos. Offset", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_WPOS_OFFSET
|
||||
_LightingWorldPosStrength ("Offset Strength", Range(0,1)) = 0.2
|
||||
//# END_IF
|
||||
//#
|
||||
[Toggle(_CFXR_LIGHTING_BACK)] _UseBackLighting ("Enable Backlighting", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_BACK
|
||||
_DirLightScreenAtten ("Dir. Light Screen Attenuation", Range(0, 5)) = 1.0
|
||||
_BacklightTransmittance ("Backlight Transmittance", Range(0, 2)) = 1.0
|
||||
//# END_IF
|
||||
//#
|
||||
//# IF_KEYWORD _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL
|
||||
_IndirectLightingMix ("Indirect Lighting Mix", Range(0,1)) = 0.5
|
||||
//# END_IF
|
||||
_ShadowColor ("Shadow Color", Color) = (0,0,0,1)
|
||||
//#
|
||||
//# END_IF
|
||||
|
||||
//# ========================================================
|
||||
//# Shadows
|
||||
//#
|
||||
|
||||
[KeywordEnum(Off,On,CustomTexture)] _CFXR_DITHERED_SHADOWS ("Dithered Shadows", Float) = 0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_ShadowStrength ("Shadows Strength Max", Range(0,1)) = 1.0
|
||||
//# IF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
_DitherCustom ("Dithering 3D Texture", 3D) = "black" {}
|
||||
//# END_IF
|
||||
//# END_IF
|
||||
|
||||
// _ReceivedShadowsStrength ("Received Shadows Strength", Range(0,1)) = 0.5
|
||||
}
|
||||
|
||||
Category
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"PreviewType"="Plane"
|
||||
}
|
||||
|
||||
Blend [_SrcBlend] [_DstBlend], One One
|
||||
ZWrite [_ZWrite]
|
||||
Cull Off
|
||||
|
||||
/*** URP ***/
|
||||
//====================================================================================================================================
|
||||
// Universal Rendering Pipeline
|
||||
|
||||
Subshader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="UniversalForward" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
// #pragma shader_feature_local _ _CFXR_GRADIENTMAP
|
||||
#pragma shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local _ _CFXR_EDGE_FADING
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_BACK
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _NORMALMAP
|
||||
#pragma shader_feature_local _ _EMISSION
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_URP
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Same as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword
|
||||
Pass
|
||||
{
|
||||
Name "BASE_URP"
|
||||
Tags { "LightMode"="Universal2D" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma target 2.0
|
||||
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:ParticleInstancingSetup
|
||||
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
// #pragma shader_feature_local _ _CFXR_GRADIENTMAP
|
||||
#pragma shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local _ _CFXR_EDGE_FADING
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_BACK
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _NORMALMAP
|
||||
#pragma shader_feature_local _ _EMISSION
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#define CFXR_UPR
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#define CFXR_UPR
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END URP ***/
|
||||
|
||||
/*** BIRP ***/
|
||||
//====================================================================================================================================
|
||||
// Built-in Rendering Pipeline
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Name "BASE"
|
||||
Tags { "LightMode"="ForwardBase" }
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma multi_compile_particles
|
||||
#pragma multi_compile_fog
|
||||
//#pragma multi_compile_fwdbase
|
||||
//#pragma multi_compile SHADOWS_SCREEN
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
// #pragma shader_feature_local _ _CFXR_GRADIENTMAP
|
||||
#pragma shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local _ _CFXR_EDGE_FADING
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET
|
||||
#pragma shader_feature_local _ _CFXR_LIGHTING_BACK
|
||||
|
||||
// Using the same keywords as Unity's Standard Particle shader to minimize project-wide keyword usage
|
||||
#pragma shader_feature_local _ _NORMALMAP
|
||||
#pragma shader_feature_local _ _EMISSION
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
#pragma shader_feature_local _ _FADING_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
BlendOp Add
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vertex_program
|
||||
#pragma fragment fragment_program
|
||||
|
||||
//vertInstancingSetup writes to global, not allowed with DXC
|
||||
// #pragma never_use_dxc
|
||||
// #pragma target 2.5
|
||||
// #pragma multi_compile_instancing
|
||||
// #pragma instancing_options procedural:vertInstancingSetup
|
||||
|
||||
#pragma shader_feature_local _ _CFXR_DISSOLVE
|
||||
#pragma shader_feature_local_fragment _ _CFXR_UV_DISTORTION
|
||||
#pragma shader_feature_local_fragment _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X
|
||||
#pragma shader_feature_local_fragment _ _FLIPBOOK_BLENDING
|
||||
|
||||
#pragma shader_feature_local_fragment _ _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON _CFXR_ADDITIVE
|
||||
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
#pragma target 3.0 //needed for VPOS
|
||||
#endif
|
||||
|
||||
#include "UnityStandardParticleInstancing.cginc"
|
||||
|
||||
#define PASS_SHADOW_CASTER
|
||||
#define CFXR_UBERSHADER
|
||||
#include "CFXR_PASSES.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
/*** END BIRP ***/
|
||||
}
|
||||
|
||||
CustomEditor "CartoonFX.MaterialInspector"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a29b4d27eb8b04479ef89c00dea533d
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: fe56ec25963759b49955809beeb4324b, type: 3}
|
||||
detectedRenderPipeline: Built-In Render Pipeline
|
||||
strippedLinesCount: 0
|
||||
shaderSourceCode: "//--------------------------------------------------------------------------------------------------------------------------------\r\n//
|
||||
Cartoon FX\r\n// (c) 2012-2020 Jean Moreno\r\n//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\nShader
|
||||
\"Cartoon FX/Remaster/Particle Ubershader\"\r\n{\r\n\tProperties\r\n\t{\r\n\t//#
|
||||
Blending\r\n\t//#\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend (\"Blend
|
||||
Source\", Float) = 5\r\n\t\t[Enum(UnityEngine.Rendering.BlendMode)] _DstBlend
|
||||
(\"Blend Destination\", Float) = 10\r\n\t\t[KeywordEnumNoPrefix(Alpha Blending,
|
||||
_ALPHABLEND_ON, Alpha Blending Premultiplied, _ALPHAPREMULTIPLY_ON, Multiplicative,
|
||||
_ALPHAMODULATE_ON, Additive, _CFXR_ADDITIVE)] _BlendingType (\"Blending Type\",
|
||||
Float) = 0\r\n\r\n\t//# \r\n\t\t[ToggleNoKeyword] _ZWrite (\"Depth Write\", Float)
|
||||
= 0\r\n\t\t[Toggle(_ALPHATEST_ON)] _UseAlphaClip (\"Alpha Clipping (Cutout)\",
|
||||
Float) = 0\r\n\t//# IF_KEYWORD _ALPHATEST_ON\r\n\t\t_Cutoff (\"Cutoff Threshold\",
|
||||
Range(0.001,1)) = 0.1\r\n\t//# END_IF\r\n\t\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t\t[Toggle(_FADING_ON)]
|
||||
_UseSP (\"Soft Particles\", Float) = 0\r\n\t//# IF_KEYWORD _FADING_ON\r\n\t\t_SoftParticlesFadeDistanceNear
|
||||
(\"Near Fade\", Float) = 0\r\n\t\t_SoftParticlesFadeDistanceFar (\"Far Fade\",
|
||||
Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# \r\n\r\n\t\t[Toggle(_CFXR_EDGE_FADING)]
|
||||
_UseEF (\"Edge Fade\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_EDGE_FADING\r\n\t\t_EdgeFadePow
|
||||
(\"Edge Fade Power\", Float) = 1\r\n\t//# END_IF\r\n\r\n\t//# \r\n\r\n\t//# ========================================================\r\n\r\n\t//#
|
||||
Effects\r\n\t//#\r\n\r\n\t\t[Toggle(_CFXR_DISSOLVE)] _UseDissolve (\"Enable Dissolve\",
|
||||
Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE\r\n\t\t_DissolveTex (\"Dissolve
|
||||
Texture\", 2D) = \"gray\" {}\r\n\t\t_DissolveSmooth (\"Dissolve Smoothing\",
|
||||
Range(0.0001,0.5)) = 0.1\r\n\t\t[ToggleNoKeyword] _InvertDissolveTex (\"Invert
|
||||
Dissolve Texture\", Float) = 0\r\n\t\t[ToggleNoKeyword] _DoubleDissolve (\"Double
|
||||
Dissolve\", Float) = 0\r\n\t\t[Toggle(_CFXR_DISSOLVE_ALONG_UV_X)] _UseDissolveOffsetUV
|
||||
(\"Dissolve offset along X\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t_DissolveScroll
|
||||
(\"UV Scrolling\", Vector) = (0,0,0,0)\r\n\t//# END_IF\r\n\t//# END_IF\r\n\r\n\t//#
|
||||
--------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_UV_DISTORTION)]
|
||||
_UseUVDistortion (\"Enable UV Distortion\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_UV_DISTORTION\r\n\t\t\r\n\t\t[NoScaleOffset]
|
||||
_DistortTex (\"Distortion Texture\", 2D) = \"gray\" {}\r\n\t\t_DistortScrolling
|
||||
(\"Scroll (XY) Tile (ZW)\", Vector) = (0,0,1,1)\r\n\t\t[Toggle(_CFXR_UV2_DISTORTION)]
|
||||
_UseUV2Distortion (\"Use UV2\", Float) = 0\r\n\t\t_Distort (\"Distortion Strength\",
|
||||
Range(0,2.0)) = 0.1\r\n\t\t[ToggleNoKeyword] _FadeAlongU (\"Fade along Y\", Float)
|
||||
= 0\r\n\t\t[Toggle(_CFXR_UV_DISTORTION_ADD)] _UVDistortionAdd (\"Add to base
|
||||
UV\", Float) = 0\r\n\t//# END_IF\r\n\r\n\t//# ========================================================\r\n\r\n\t//#
|
||||
Colors\r\n\t//#\r\n\r\n\t\t[NoScaleOffset] _MainTex (\"Texture\", 2D) = \"white\"
|
||||
{}\r\n\t\t[Toggle(_CFXR_SINGLE_CHANNEL)] _SingleChannel (\"Single Channel Texture\",
|
||||
Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[KeywordEnum(Off,1x,2x)]
|
||||
_CFXR_OVERLAYTEX (\"Enable Overlay Texture\", Float) = 0\r\n\t//# IF_KEYWORD
|
||||
_CFXR_OVERLAYTEX_1X || _CFXR_OVERLAYTEX_2X\r\n\t\t[KeywordEnum(RGBA,RGB,A)] _CFXR_OVERLAYBLEND
|
||||
(\"Overlay Blend Channels\", Float) = 0\r\n\t\t[NoScaleOffset] _OverlayTex (\"Overlay
|
||||
Texture\", 2D) = \"white\" {}\r\n\t\t_OverlayTex_Scroll (\"Overlay Scrolling
|
||||
/ Scale\", Vector) = (0.1,0.1,1,1)\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_FLIPBOOK_BLENDING)]
|
||||
_UseFB (\"Flipbook Blending\", Float) = 0\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_SECONDCOLOR_LERP)]
|
||||
_UseSecondColor (\"Secondary Vertex Color (TEXCOORD2)\", Float) = 0\r\n\t//#
|
||||
IF_KEYWORD _CFXR_SECONDCOLOR_LERP\r\n\t\t[NoScaleOffset] _SecondColorTex (\"Second
|
||||
Color Map\", 2D) = \"black\" {}\r\n\t\t_SecondColorSmooth (\"Second Color Smoothing\",
|
||||
Range(0.0001,0.5)) = 0.2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_FONT_COLORS)]
|
||||
_UseFontColor (\"Use Font Colors\", Float) = 0\r\n\r\n//\t//# --------------------------------------------------------\r\n//\r\n//\t[Toggle(_CFXR_GRADIENTMAP)]
|
||||
_UseGradientMap (\"Gradient Map\", Float) = 0\r\n//\t//# IF_KEYWORD _CFXR_GRADIENTMAP\r\n//\t\t[NoScaleOffset]
|
||||
_GradientMap (\"Gradient Map\", 2D) = \"black\" {}\r\n//\t//# END_IF\r\n\r\n\t//#
|
||||
--------------------------------------------------------\r\n\r\n\t\t[Toggle(_CFXR_HDR_BOOST)]
|
||||
_HdrBoost (\"Enable HDR Multiplier\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_HDR_BOOST\r\n\t\t
|
||||
_HdrMultiply (\"HDR Multiplier\", Float) = 2\r\n\t//# END_IF\r\n\r\n\t//# --------------------------------------------------------\r\n\t\r\n\t//#
|
||||
Lighting\r\n\t//#\r\n\r\n\t\t[KeywordEnumNoPrefix(Off, _, Direct, _CFXR_LIGHTING_DIRECT,
|
||||
Indirect, _CFXR_LIGHTING_INDIRECT, Both, _CFXR_LIGHTING_ALL)] _UseLighting (\"Mode\",
|
||||
Float) = 0\r\n\t//# IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_ALL\r\n\t\t_DirectLightingRamp
|
||||
(\"Direct Lighting Ramp\", Range(0,1)) = 1.0\r\n\t//# END_IF\r\n\t//# \r\n\t//#
|
||||
IF_KEYWORD _CFXR_LIGHTING_DIRECT || _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL\r\n\t\t[Toggle(_NORMALMAP)]
|
||||
_UseNormalMap (\"Enable Normal Map\", Float) = 0\r\n\t//# IF_KEYWORD _NORMALMAP\r\n\t\t[NoScaleOffset]
|
||||
_BumpMap (\"Normal Map\", 2D) = \"bump\" {}\r\n\t\t_BumpScale (\"Normal Scale\",
|
||||
Range(-1, 1)) = 1.0\r\n\t//# END_IF\r\n\t//# \r\n\t\t[Toggle(_EMISSION)] _UseEmission
|
||||
(\"Enable Emission (TEXCOORD2)\", Float) = 0\r\n\t//# \r\n\t\t[Toggle(_CFXR_LIGHTING_WPOS_OFFSET)]
|
||||
_UseLightingWorldPosOffset (\"Enable World Pos. Offset\", Float) = 0\r\n\t//#
|
||||
IF_KEYWORD _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t_LightingWorldPosStrength (\"Offset
|
||||
Strength\", Range(0,1)) = 0.2\r\n\t//# END_IF\r\n\t//# \r\n\t\t[Toggle(_CFXR_LIGHTING_BACK)]
|
||||
_UseBackLighting (\"Enable Backlighting\", Float) = 0\r\n\t//# IF_KEYWORD _CFXR_LIGHTING_BACK\r\n\t\t_DirLightScreenAtten
|
||||
(\"Dir. Light Screen Attenuation\", Range(0, 5)) = 1.0\r\n\t\t_BacklightTransmittance
|
||||
(\"Backlight Transmittance\", Range(0, 2)) = 1.0\r\n\t//# END_IF\r\n\t//# \r\n\t//#
|
||||
IF_KEYWORD _CFXR_LIGHTING_INDIRECT || _CFXR_LIGHTING_ALL\r\n\t\t_IndirectLightingMix
|
||||
(\"Indirect Lighting Mix\", Range(0,1)) = 0.5\r\n\t//# END_IF\r\n\t\t_ShadowColor
|
||||
(\"Shadow Color\", Color) = (0,0,0,1)\r\n\t//# \r\n\t//# END_IF\r\n\r\n\t//#
|
||||
========================================================\r\n\t//# Shadows\r\n\t//#\r\n\r\n\t\t[KeywordEnum(Off,On,CustomTexture)]
|
||||
_CFXR_DITHERED_SHADOWS (\"Dithered Shadows\", Float) = 0\r\n\t//# IF_KEYWORD
|
||||
_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_ShadowStrength\t\t(\"Shadows
|
||||
Strength Max\", Range(0,1)) = 1.0\r\n\t\t//#\tIF_KEYWORD _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\t\t_DitherCustom\t\t(\"Dithering
|
||||
3D Texture\", 3D) = \"black\" {}\r\n\t\t//#\tEND_IF\r\n\t//# END_IF\r\n\r\n//\t\t_ReceivedShadowsStrength
|
||||
(\"Received Shadows Strength\", Range(0,1)) = 0.5\r\n\t}\r\n\t\r\n\tCategory\r\n\t{\r\n\t\tTags\r\n\t\t{\r\n\t\t\t\"Queue\"=\"Transparent\"\r\n\t\t\t\"IgnoreProjector\"=\"True\"\r\n\t\t\t\"RenderType\"=\"Transparent\"\r\n\t\t\t\"PreviewType\"=\"Plane\"\r\n\t\t}\r\n\r\n\t\tBlend
|
||||
[_SrcBlend] [_DstBlend], One One\r\n\t\tZWrite [_ZWrite]\r\n\t\tCull Off\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Universal Rendering Pipeline\r\n\r\n\t\tSubshader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE_URP\"\r\n\t\t\t\tTags { \"LightMode\"=\"UniversalForward\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
target 2.0\r\n\t\t\t\t\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:ParticleInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_fog\r\n\t\t\t\t//#pragma multi_compile_fwdbase\r\n\t\t\t\t//#pragma
|
||||
multi_compile SHADOWS_SCREEN\r\n\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t// #pragma shader_feature_local _ _CFXR_GRADIENTMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_EDGE_FADING\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT
|
||||
_CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_BACK\r\n\r\n\t\t\t\t//
|
||||
Using the same keywords as Unity's Standard Particle shader to minimize project-wide
|
||||
keyword usage\r\n\t\t\t\t#pragma shader_feature_local _ _NORMALMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _EMISSION\r\n\t\t\t\t#pragma shader_feature_local _ _FLIPBOOK_BLENDING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#define CFXR_URP\r\n\t\t\t\t#define CFXR_UBERSHADER\r\n\t\t\t\t#include
|
||||
\"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Same
|
||||
as above with 'Universal2D' instead and DISABLE_SOFT_PARTICLES keyword\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE_URP\"\r\n\t\t\t\tTags { \"LightMode\"=\"Universal2D\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\t\t\t\t\r\n\t\t\t\t#pragma
|
||||
target 2.0\r\n\t\t\t\t\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:ParticleInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_fog\r\n\t\t\t\t//#pragma multi_compile_fwdbase\r\n\t\t\t\t//#pragma
|
||||
multi_compile SHADOWS_SCREEN\r\n\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t// #pragma shader_feature_local _ _CFXR_GRADIENTMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_EDGE_FADING\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_DIRECT
|
||||
_CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_LIGHTING_BACK\r\n\r\n\t\t\t\t//
|
||||
Using the same keywords as Unity's Standard Particle shader to minimize project-wide
|
||||
keyword usage\r\n\t\t\t\t#pragma shader_feature_local _ _NORMALMAP\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _EMISSION\r\n\t\t\t\t#pragma shader_feature_local _ _FLIPBOOK_BLENDING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#define CFXR_UPR\r\n\t\t\t\t#define DISABLE_SOFT_PARTICLES\r\n\t\t\t\t#define
|
||||
CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FLIPBOOK_BLENDING\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
_ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#define CFXR_UPR\r\n\t\t\t\t#define
|
||||
PASS_SHADOW_CASTER\r\n\t\t\t\t#define CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//====================================================================================================================================\r\n\t\t//
|
||||
Built-in Rendering Pipeline\r\n\r\n\t\tSubShader\r\n\t\t{\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"BASE\"\r\n\t\t\t\tTags { \"LightMode\"=\"ForwardBase\" }\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
multi_compile_particles\r\n\t\t\t\t#pragma multi_compile_fog\r\n\t\t\t\t//#pragma
|
||||
multi_compile_fwdbase\r\n\t\t\t\t//#pragma multi_compile SHADOWS_SCREEN\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t//
|
||||
#pragma shader_feature_local _ _CFXR_GRADIENTMAP\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_SECONDCOLOR_LERP _CFXR_FONT_COLORS\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_HDR_BOOST\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_EDGE_FADING\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_LIGHTING_DIRECT _CFXR_LIGHTING_INDIRECT _CFXR_LIGHTING_ALL\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_LIGHTING_WPOS_OFFSET\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_LIGHTING_BACK\r\n\r\n\t\t\t\t// Using the same keywords as Unity's Standard
|
||||
Particle shader to minimize project-wide keyword usage\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _NORMALMAP\r\n\t\t\t\t#pragma shader_feature_local _ _EMISSION\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FLIPBOOK_BLENDING\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _FADING_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHATEST_ON\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
_CFXR_ADDITIVE\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\t\t\t\t#define
|
||||
CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\r\n\t\t\t//--------------------------------------------------------------------------------------------------------------------------------\r\n\r\n\t\t\tPass\r\n\t\t\t{\r\n\t\t\t\tName
|
||||
\"ShadowCaster\"\r\n\t\t\t\tTags { \"LightMode\" = \"ShadowCaster\" }\r\n\r\n\t\t\t\tBlendOp
|
||||
Add\r\n\t\t\t\tBlend One Zero\r\n\t\t\t\tZWrite On\r\n\t\t\t\tCull Off\r\n\r\n\t\t\t\tCGPROGRAM\r\n\r\n\t\t\t\t#pragma
|
||||
vertex vertex_program\r\n\t\t\t\t#pragma fragment fragment_program\r\n\r\n\t\t\t\t//vertInstancingSetup
|
||||
writes to global, not allowed with DXC\r\n\t\t\t\t// #pragma never_use_dxc\r\n\t\t\t\t//
|
||||
#pragma target 2.5\r\n\t\t\t\t// #pragma multi_compile_instancing\r\n\t\t\t\t//
|
||||
#pragma instancing_options procedural:vertInstancingSetup\r\n\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_SINGLE_CHANNEL\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_DISSOLVE\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_DISSOLVE_ALONG_UV_X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_UV_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _CFXR_UV2_DISTORTION\r\n\t\t\t\t#pragma shader_feature_local _ _CFXR_UV_DISTORTION_ADD\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYTEX_1X _CFXR_OVERLAYTEX_2X\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_OVERLAYBLEND_A _CFXR_OVERLAYBLEND_RGB\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _FLIPBOOK_BLENDING\r\n\r\n\t\t\t\t#pragma shader_feature_local
|
||||
_ _ALPHATEST_ON\r\n\t\t\t\t#pragma shader_feature_local _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
_ALPHAMODULATE_ON _CFXR_ADDITIVE\r\n\r\n\t\t\t\t#pragma multi_compile_shadowcaster\r\n\t\t\t\t#pragma
|
||||
shader_feature_local _ _CFXR_DITHERED_SHADOWS_ON _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE\r\n\r\n\t\t\t#if
|
||||
(_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)\r\n\t\t\t\t#pragma
|
||||
target 3.0\t\t//needed for VPOS\r\n\t\t\t#endif\r\n\r\n\t\t\t\t#include \"UnityStandardParticleInstancing.cginc\"\r\n\r\n\t\t\t\t#define
|
||||
PASS_SHADOW_CASTER\r\n\t\t\t\t#define CFXR_UBERSHADER\r\n\t\t\t\t#include \"CFXR_PASSES.cginc\"\r\n\r\n\t\t\t\tENDCG\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tCustomEditor
|
||||
\"CartoonFX.MaterialInspector\"\r\n}\r\n\r\n"
|
||||
shaderName: Cartoon FX/Remaster/Particle Ubershader
|
||||
shaderErrors: []
|
||||
variantCount: 283253760
|
||||
variantCountUsed: 8
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR Particle
|
||||
Ubershader.cfxrshader
|
||||
uploadId: 756876
|
||||
@@ -0,0 +1,366 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
#pragma exclude_renderers gles
|
||||
#endif
|
||||
|
||||
#if defined(GLOBAL_DISABLE_SOFT_PARTICLES) && !defined(DISABLE_SOFT_PARTICLES)
|
||||
#define DISABLE_SOFT_PARTICLES
|
||||
#endif
|
||||
|
||||
#if defined(CFXR_URP)
|
||||
float LinearEyeDepthURP(float depth, float4 zBufferParam)
|
||||
{
|
||||
return 1.0 / (zBufferParam.z * depth + zBufferParam.w);
|
||||
}
|
||||
|
||||
float SoftParticles(float near, float far, float4 projection)
|
||||
{
|
||||
float sceneZ = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(projection)).r;
|
||||
|
||||
if (unity_OrthoParams.w == 1)
|
||||
{
|
||||
// orthographic camera
|
||||
#if defined(UNITY_REVERSED_Z)
|
||||
sceneZ = 1.0f - sceneZ;
|
||||
#endif
|
||||
sceneZ = (sceneZ * _ProjectionParams.z) + _ProjectionParams.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
// perspective camera
|
||||
sceneZ = LinearEyeDepthURP(sceneZ, _ZBufferParams);
|
||||
}
|
||||
|
||||
float fade = saturate (far * ((sceneZ - near) - projection.z));
|
||||
return fade;
|
||||
}
|
||||
#else
|
||||
float SoftParticles(float near, float far, float4 projection)
|
||||
{
|
||||
float sceneZ = (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(projection)));
|
||||
if (unity_OrthoParams.w == 1)
|
||||
{
|
||||
// orthographic camera
|
||||
#if defined(UNITY_REVERSED_Z)
|
||||
sceneZ = 1.0f - sceneZ;
|
||||
#endif
|
||||
sceneZ = (sceneZ * _ProjectionParams.z) + _ProjectionParams.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
// perspective camera
|
||||
sceneZ = LinearEyeDepth(sceneZ);
|
||||
}
|
||||
|
||||
float fade = saturate (far * ((sceneZ - near) - projection.z));
|
||||
return fade;
|
||||
}
|
||||
#endif
|
||||
|
||||
float LinearToGammaSpaceApprox(float value)
|
||||
{
|
||||
return max(1.055h * pow(value, 0.416666667h) - 0.055h, 0.h);
|
||||
}
|
||||
|
||||
// Same as UnityStandardUtils.cginc, but without the SHADER_TARGET limitation
|
||||
half3 UnpackScaleNormal_CFXR(half4 packednormal, half bumpScale)
|
||||
{
|
||||
#if defined(UNITY_NO_DXT5nm)
|
||||
half3 normal = packednormal.xyz * 2 - 1;
|
||||
// #if (SHADER_TARGET >= 30)
|
||||
// SM2.0: instruction count limitation
|
||||
// SM2.0: normal scaler is not supported
|
||||
normal.xy *= bumpScale;
|
||||
// #endif
|
||||
return normal;
|
||||
#else
|
||||
// This do the trick
|
||||
packednormal.x *= packednormal.w;
|
||||
|
||||
half3 normal;
|
||||
normal.xy = (packednormal.xy * 2 - 1);
|
||||
// #if (SHADER_TARGET >= 30)
|
||||
// SM2.0: instruction count limitation
|
||||
// SM2.0: normal scaler is not supported
|
||||
normal.xy *= bumpScale;
|
||||
// #endif
|
||||
normal.z = sqrt(1.0 - saturate(dot(normal.xy, normal.xy)));
|
||||
return normal;
|
||||
#endif
|
||||
}
|
||||
|
||||
//Macros
|
||||
|
||||
// Project Position
|
||||
#if !defined(PASS_SHADOW_CASTER) && !defined(GLOBAL_DISABLE_SOFT_PARTICLES) && !defined(DISABLE_SOFT_PARTICLES) && ( (defined(SOFTPARTICLES_ON) || defined(CFXR_URP) || defined(SOFT_PARTICLES_ORTHOGRAPHIC)) && defined(_FADING_ON) )
|
||||
#define vertProjPos(o, clipPos) \
|
||||
o.projPos = ComputeScreenPos(clipPos); \
|
||||
COMPUTE_EYEDEPTH(o.projPos.z);
|
||||
#else
|
||||
#define vertProjPos(o, clipPos)
|
||||
#endif
|
||||
|
||||
// Soft Particles
|
||||
#if !defined(PASS_SHADOW_CASTER) && !defined(GLOBAL_DISABLE_SOFT_PARTICLES) && !defined(DISABLE_SOFT_PARTICLES) && ((defined(SOFTPARTICLES_ON) || defined(CFXR_URP) || defined(SOFT_PARTICLES_ORTHOGRAPHIC)) && defined(_FADING_ON))
|
||||
#define fragSoftParticlesFade(i, color) \
|
||||
color *= SoftParticles(_SoftParticlesFadeDistanceNear, _SoftParticlesFadeDistanceFar, i.projPos);
|
||||
#else
|
||||
#define fragSoftParticlesFade(i, color)
|
||||
#endif
|
||||
|
||||
// Edge fade (note: particle meshes are already in world space)
|
||||
#if !defined(PASS_SHADOW_CASTER) && defined(_CFXR_EDGE_FADING)
|
||||
#define vertEdgeFade(v, color) \
|
||||
float3 viewDir = UnityWorldSpaceViewDir(v.vertex); \
|
||||
float ndv = abs(dot(normalize(viewDir), v.normal.xyz)); \
|
||||
color *= saturate(pow(ndv, _EdgeFadePow));
|
||||
#else
|
||||
#define vertEdgeFade(v, color)
|
||||
#endif
|
||||
|
||||
// Fog
|
||||
#if _ALPHABLEND_ON
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, unity_FogColor);
|
||||
#elif _ALPHAPREMULTIPLY_ON
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, alpha * unity_FogColor);
|
||||
#elif _CFXR_ADDITIVE
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, half4(0, 0, 0, 0));
|
||||
#elif _ALPHAMODULATE_ON
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, half4(1, 1, 1, 1));
|
||||
#else
|
||||
#define applyFog(i, color, alpha) UNITY_APPLY_FOG_COLOR(i.fogCoord, color, unity_FogColor);
|
||||
#endif
|
||||
|
||||
// Vertex program
|
||||
#if defined(PASS_SHADOW_CASTER)
|
||||
void vert(appdata v, v2f_shadowCaster o, out float4 opos)
|
||||
#else
|
||||
v2f vert(appdata v, v2f o)
|
||||
#endif
|
||||
{
|
||||
UNITY_TRANSFER_FOG(o, o.pos);
|
||||
vertProjPos(o, o.pos);
|
||||
vertEdgeFade(v, o.color.a);
|
||||
|
||||
#if defined(PASS_SHADOW_CASTER)
|
||||
TRANSFER_SHADOW_CASTER_NOPOS(o, opos);
|
||||
#else
|
||||
return o;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Fragment program
|
||||
#if defined(PASS_SHADOW_CASTER)
|
||||
float4 frag(v2f_shadowCaster i, UNITY_VPOS_TYPE vpos, half3 particleColor, half particleAlpha, half dissolve, half dissolveTime, half doubleDissolveWidth) : SV_Target
|
||||
#else
|
||||
half4 frag(v2f i, half3 particleColor, half particleAlpha, half dissolve, half dissolveTime, half doubleDissolveWidth) : SV_Target
|
||||
#endif
|
||||
{
|
||||
#if _CFXR_DISSOLVE
|
||||
// Dissolve
|
||||
half time = lerp(-_DissolveSmooth, 1+_DissolveSmooth, dissolveTime);
|
||||
particleAlpha *= smoothstep(dissolve - _DissolveSmooth, dissolve + _DissolveSmooth, time);
|
||||
if (doubleDissolveWidth > 0)
|
||||
{
|
||||
half dissolveSubtract = smoothstep(dissolve - _DissolveSmooth, dissolve + _DissolveSmooth, time - doubleDissolveWidth);
|
||||
particleAlpha = saturate(particleAlpha - dissolveSubtract);
|
||||
}
|
||||
#endif
|
||||
|
||||
//Blending
|
||||
#if _ALPHAPREMULTIPLY_ON
|
||||
particleColor *= particleAlpha;
|
||||
#endif
|
||||
#if _ALPHAMODULATE_ON
|
||||
particleColor.rgb = lerp(float3(1,1,1), particleColor.rgb, particleAlpha);
|
||||
#endif
|
||||
|
||||
#if _ALPHATEST_ON
|
||||
clip(particleAlpha - _Cutoff);
|
||||
#endif
|
||||
|
||||
#if !defined(PASS_SHADOW_CASTER)
|
||||
// Fog & Soft Particles
|
||||
applyFog(i, particleColor, particleAlpha);
|
||||
fragSoftParticlesFade(i, particleAlpha);
|
||||
#endif
|
||||
|
||||
// Prevent alpha from exceeding 1
|
||||
particleAlpha = min(particleAlpha, 1.0);
|
||||
|
||||
#if !defined(PASS_SHADOW_CASTER)
|
||||
return float4(particleColor, particleAlpha);
|
||||
#else
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Shadow Caster Pass
|
||||
|
||||
#if _CFXR_ADDITIVE
|
||||
half alpha = max(particleColor.r, max(particleColor.g, particleColor.b)) * particleAlpha;
|
||||
#else
|
||||
half alpha = particleAlpha;
|
||||
#endif
|
||||
|
||||
#if (_CFXR_DITHERED_SHADOWS_ON || _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE) && !defined(SHADER_API_GLES)
|
||||
alpha = min(alpha, _ShadowStrength);
|
||||
// Use dither mask for alpha blended shadows, based on pixel position xy
|
||||
// and alpha level. Our dither texture is 4x4x16.
|
||||
#if _CFXR_DITHERED_SHADOWS_CUSTOMTEXTURE
|
||||
half texSize = _DitherCustom_TexelSize.z;
|
||||
alpha = tex3D(_DitherCustom, float3(vpos.xy*(1 / texSize), alpha*(1 - (1 / (texSize*texSize))))).a;
|
||||
#else
|
||||
alpha = tex3D(_DitherMaskLOD, float3(vpos.xy*0.25, alpha*0.9375)).a;
|
||||
#endif
|
||||
#endif
|
||||
clip(alpha - 0.01);
|
||||
SHADOW_CASTER_FRAGMENT(i)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ================================================================================================================================
|
||||
// ParticlesInstancing.hlsl
|
||||
// ================================================================================================================================
|
||||
|
||||
#if defined(CFXR_URP)
|
||||
#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED) && !defined(SHADER_TARGET_SURFACE_ANALYSIS)
|
||||
#define UNITY_PARTICLE_INSTANCING_ENABLED
|
||||
#endif
|
||||
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
|
||||
#ifndef UNITY_PARTICLE_INSTANCE_DATA
|
||||
#define UNITY_PARTICLE_INSTANCE_DATA DefaultParticleInstanceData
|
||||
#endif
|
||||
|
||||
struct DefaultParticleInstanceData
|
||||
{
|
||||
float3x4 transform;
|
||||
uint color;
|
||||
float animFrame;
|
||||
};
|
||||
|
||||
StructuredBuffer<UNITY_PARTICLE_INSTANCE_DATA> unity_ParticleInstanceData;
|
||||
float4 unity_ParticleUVShiftData;
|
||||
float unity_ParticleUseMeshColors;
|
||||
|
||||
void ParticleInstancingMatrices(out float4x4 objectToWorld, out float4x4 worldToObject)
|
||||
{
|
||||
UNITY_PARTICLE_INSTANCE_DATA data = unity_ParticleInstanceData[unity_InstanceID];
|
||||
|
||||
// transform matrix
|
||||
objectToWorld._11_21_31_41 = float4(data.transform._11_21_31, 0.0f);
|
||||
objectToWorld._12_22_32_42 = float4(data.transform._12_22_32, 0.0f);
|
||||
objectToWorld._13_23_33_43 = float4(data.transform._13_23_33, 0.0f);
|
||||
objectToWorld._14_24_34_44 = float4(data.transform._14_24_34, 1.0f);
|
||||
|
||||
// inverse transform matrix (TODO: replace with a library implementation if/when available)
|
||||
float3x3 worldToObject3x3;
|
||||
worldToObject3x3[0] = objectToWorld[1].yzx * objectToWorld[2].zxy - objectToWorld[1].zxy * objectToWorld[2].yzx;
|
||||
worldToObject3x3[1] = objectToWorld[0].zxy * objectToWorld[2].yzx - objectToWorld[0].yzx * objectToWorld[2].zxy;
|
||||
worldToObject3x3[2] = objectToWorld[0].yzx * objectToWorld[1].zxy - objectToWorld[0].zxy * objectToWorld[1].yzx;
|
||||
|
||||
float det = dot(objectToWorld[0].xyz, worldToObject3x3[0]);
|
||||
|
||||
worldToObject3x3 = transpose(worldToObject3x3);
|
||||
|
||||
worldToObject3x3 *= rcp(det);
|
||||
|
||||
float3 worldToObjectPosition = mul(worldToObject3x3, -objectToWorld._14_24_34);
|
||||
|
||||
worldToObject._11_21_31_41 = float4(worldToObject3x3._11_21_31, 0.0f);
|
||||
worldToObject._12_22_32_42 = float4(worldToObject3x3._12_22_32, 0.0f);
|
||||
worldToObject._13_23_33_43 = float4(worldToObject3x3._13_23_33, 0.0f);
|
||||
worldToObject._14_24_34_44 = float4(worldToObjectPosition, 1.0f);
|
||||
}
|
||||
|
||||
void ParticleInstancingSetup()
|
||||
{
|
||||
ParticleInstancingMatrices(unity_ObjectToWorld, unity_WorldToObject);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void ParticleInstancingSetup() {}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ================================================================================================================================
|
||||
// Instancing functions
|
||||
// ================================================================================================================================
|
||||
|
||||
float4 UnpackFromR8G8B8A8(uint rgba)
|
||||
{
|
||||
return float4(rgba & 255, (rgba >> 8) & 255, (rgba >> 16) & 255, (rgba >> 24) & 255) * (1.0 / 255);
|
||||
}
|
||||
|
||||
half4 GetParticleColor(half4 color)
|
||||
{
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
#if !defined(UNITY_PARTICLE_INSTANCE_DATA_NO_COLOR)
|
||||
UNITY_PARTICLE_INSTANCE_DATA data = unity_ParticleInstanceData[unity_InstanceID];
|
||||
color = lerp(half4(1.0, 1.0, 1.0, 1.0), color, unity_ParticleUseMeshColors);
|
||||
color *= UnpackFromR8G8B8A8(data.color);
|
||||
#endif
|
||||
#endif
|
||||
return color;
|
||||
}
|
||||
|
||||
void GetParticleTexcoords(out float2 outputTexcoord, out float2 outputTexcoord2, inout float outputBlend, in float4 inputTexcoords, in float inputBlend)
|
||||
{
|
||||
#if defined(UNITY_PARTICLE_INSTANCING_ENABLED)
|
||||
if (unity_ParticleUVShiftData.x != 0.0)
|
||||
{
|
||||
UNITY_PARTICLE_INSTANCE_DATA data = unity_ParticleInstanceData[unity_InstanceID];
|
||||
|
||||
float numTilesX = unity_ParticleUVShiftData.y;
|
||||
float2 animScale = unity_ParticleUVShiftData.zw;
|
||||
#ifdef UNITY_PARTICLE_INSTANCE_DATA_NO_ANIM_FRAME
|
||||
float sheetIndex = 0.0;
|
||||
#else
|
||||
float sheetIndex = data.animFrame;
|
||||
#endif
|
||||
|
||||
float index0 = floor(sheetIndex);
|
||||
float vIdx0 = floor(index0 / numTilesX);
|
||||
float uIdx0 = floor(index0 - vIdx0 * numTilesX);
|
||||
float2 offset0 = float2(uIdx0 * animScale.x, (1.0 - animScale.y) - vIdx0 * animScale.y); // Copied from built-in as is and it looks like upside-down flip
|
||||
|
||||
outputTexcoord = inputTexcoords.xy * animScale.xy + offset0.xy;
|
||||
|
||||
#ifdef _FLIPBOOKBLENDING_ON
|
||||
float index1 = floor(sheetIndex + 1.0);
|
||||
float vIdx1 = floor(index1 / numTilesX);
|
||||
float uIdx1 = floor(index1 - vIdx1 * numTilesX);
|
||||
float2 offset1 = float2(uIdx1 * animScale.x, (1.0 - animScale.y) - vIdx1 * animScale.y);
|
||||
|
||||
outputTexcoord2.xy = inputTexcoords.xy * animScale.xy + offset1.xy;
|
||||
outputBlend = frac(sheetIndex);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
outputTexcoord = inputTexcoords.xy;
|
||||
#ifdef _FLIPBOOKBLENDING_ON
|
||||
outputTexcoord2.xy = inputTexcoords.zw;
|
||||
outputBlend = inputBlend;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef _FLIPBOOKBLENDING_ON
|
||||
outputTexcoord2.xy = inputTexcoords.xy;
|
||||
//outputBlend = 0.5;
|
||||
#endif
|
||||
}
|
||||
|
||||
void GetParticleTexcoords(out float2 outputTexcoord, in float2 inputTexcoord)
|
||||
{
|
||||
float2 dummyTexcoord2 = 0.0;
|
||||
float dummyBlend = 0.0;
|
||||
GetParticleTexcoords(outputTexcoord, dummyTexcoord2, dummyBlend, inputTexcoord.xyxy, 0.0);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3dab2eb6bcf5df42a6c45d4638e0f46
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR.cginc
|
||||
uploadId: 756876
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0abf89ecb90eb024cbbc2a2dee76edf1
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR_PASSES.cginc
|
||||
uploadId: 756876
|
||||
@@ -0,0 +1,22 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Global settings for the Cartoon FX Remaster shaders
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/* Uncomment this line if you want to globally disable soft particles */
|
||||
// #define GLOBAL_DISABLE_SOFT_PARTICLES
|
||||
|
||||
/* Change this value if you want to globally scale the HDR effects */
|
||||
/* (e.g. if your bloom effect is too strong or too weak on the effects) */
|
||||
#define GLOBAL_HDR_MULTIPLIER 1
|
||||
|
||||
/* Comment this line if you want to disable point lights for lit particles */
|
||||
#define ENABLE_POINT_LIGHTS
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 12c0fc6ff46c9b64a99fb4b921970883
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR_SETTINGS.cginc
|
||||
uploadId: 756876
|
||||
@@ -0,0 +1,232 @@
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
// Cartoon FX
|
||||
// (c) 2012-2025 Jean Moreno
|
||||
//--------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Copy of URP specific variables needed for lighting
|
||||
|
||||
// ================================================================================================================================
|
||||
// Input.hlsl:
|
||||
// ================================================================================================================================
|
||||
|
||||
#if defined(SHADER_API_MOBILE) || (defined(SHADER_API_GLCORE) && !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3) // Workaround for bug on Nintendo Switch where SHADER_API_GLCORE is mistakenly defined
|
||||
#define MAX_VISIBLE_LIGHTS 32
|
||||
#else
|
||||
#define MAX_VISIBLE_LIGHTS 256
|
||||
#endif
|
||||
|
||||
// --------------------------------
|
||||
|
||||
float4 _MainLightPosition;
|
||||
half4 _MainLightColor;
|
||||
|
||||
// --------------------------------
|
||||
|
||||
half4 _AdditionalLightsCount;
|
||||
#if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
|
||||
StructuredBuffer<LightData> _AdditionalLightsBuffer;
|
||||
StructuredBuffer<int> _AdditionalLightsIndices;
|
||||
#else
|
||||
// GLES3 causes a performance regression in some devices when using CBUFFER.
|
||||
#ifndef SHADER_API_GLES3
|
||||
CBUFFER_START(AdditionalLights)
|
||||
#endif
|
||||
float4 _AdditionalLightsPosition[MAX_VISIBLE_LIGHTS];
|
||||
half4 _AdditionalLightsColor[MAX_VISIBLE_LIGHTS];
|
||||
half4 _AdditionalLightsAttenuation[MAX_VISIBLE_LIGHTS];
|
||||
half4 _AdditionalLightsSpotDir[MAX_VISIBLE_LIGHTS];
|
||||
half4 _AdditionalLightsOcclusionProbes[MAX_VISIBLE_LIGHTS];
|
||||
#ifndef SHADER_API_GLES3
|
||||
CBUFFER_END
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ================================================================================================================================
|
||||
// UnityInput.hlsl:
|
||||
// ================================================================================================================================
|
||||
|
||||
half4 unity_LightData;
|
||||
half4 unity_LightIndices[2];
|
||||
|
||||
// --------------------------------
|
||||
|
||||
// ================================================================================================================================
|
||||
// Macros.hlsl
|
||||
// ================================================================================================================================
|
||||
|
||||
#define HALF_MIN 6.103515625e-5 // 2^-14, the same value for 10, 11 and 16-bit: https://www.khronos.org/opengl/wiki/Small_Float_Formats
|
||||
|
||||
// ================================================================================================================================
|
||||
// Lighting.hlsl
|
||||
// ================================================================================================================================
|
||||
|
||||
// Abstraction over Light shading data.
|
||||
struct Light
|
||||
{
|
||||
half3 direction;
|
||||
half3 color;
|
||||
half distanceAttenuation;
|
||||
half shadowAttenuation;
|
||||
};
|
||||
|
||||
// Matches Unity Vanila attenuation
|
||||
// Attenuation smoothly decreases to light range.
|
||||
float DistanceAttenuation(float distanceSqr, half2 distanceAttenuation)
|
||||
{
|
||||
// We use a shared distance attenuation for additional directional and puctual lights
|
||||
// for directional lights attenuation will be 1
|
||||
float lightAtten = rcp(distanceSqr);
|
||||
|
||||
#if SHADER_HINT_NICE_QUALITY
|
||||
// Use the smoothing factor also used in the Unity lightmapper.
|
||||
half factor = distanceSqr * distanceAttenuation.x;
|
||||
half smoothFactor = saturate(1.0h - factor * factor);
|
||||
smoothFactor = smoothFactor * smoothFactor;
|
||||
#else
|
||||
// We need to smoothly fade attenuation to light range. We start fading linearly at 80% of light range
|
||||
// Therefore:
|
||||
// fadeDistance = (0.8 * 0.8 * lightRangeSq)
|
||||
// smoothFactor = (lightRangeSqr - distanceSqr) / (lightRangeSqr - fadeDistance)
|
||||
// We can rewrite that to fit a MAD by doing
|
||||
// distanceSqr * (1.0 / (fadeDistanceSqr - lightRangeSqr)) + (-lightRangeSqr / (fadeDistanceSqr - lightRangeSqr)
|
||||
// distanceSqr * distanceAttenuation.y + distanceAttenuation.z
|
||||
half smoothFactor = saturate(distanceSqr * distanceAttenuation.x + distanceAttenuation.y);
|
||||
#endif
|
||||
|
||||
return lightAtten * smoothFactor;
|
||||
}
|
||||
|
||||
half AngleAttenuation(half3 spotDirection, half3 lightDirection, half2 spotAttenuation)
|
||||
{
|
||||
// Spot Attenuation with a linear falloff can be defined as
|
||||
// (SdotL - cosOuterAngle) / (cosInnerAngle - cosOuterAngle)
|
||||
// This can be rewritten as
|
||||
// invAngleRange = 1.0 / (cosInnerAngle - cosOuterAngle)
|
||||
// SdotL * invAngleRange + (-cosOuterAngle * invAngleRange)
|
||||
// SdotL * spotAttenuation.x + spotAttenuation.y
|
||||
|
||||
// If we precompute the terms in a MAD instruction
|
||||
half SdotL = dot(spotDirection, lightDirection);
|
||||
half atten = saturate(SdotL * spotAttenuation.x + spotAttenuation.y);
|
||||
return atten * atten;
|
||||
}
|
||||
|
||||
// Fills a light struct given a perObjectLightIndex
|
||||
Light GetAdditionalPerObjectLight(int perObjectLightIndex, float3 positionWS)
|
||||
{
|
||||
// Abstraction over Light input constants
|
||||
#if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
|
||||
float4 lightPositionWS = _AdditionalLightsBuffer[perObjectLightIndex].position;
|
||||
half3 color = _AdditionalLightsBuffer[perObjectLightIndex].color.rgb;
|
||||
half4 distanceAndSpotAttenuation = _AdditionalLightsBuffer[perObjectLightIndex].attenuation;
|
||||
half4 spotDirection = _AdditionalLightsBuffer[perObjectLightIndex].spotDirection;
|
||||
half4 lightOcclusionProbeInfo = _AdditionalLightsBuffer[perObjectLightIndex].occlusionProbeChannels;
|
||||
#else
|
||||
float4 lightPositionWS = _AdditionalLightsPosition[perObjectLightIndex];
|
||||
half3 color = _AdditionalLightsColor[perObjectLightIndex].rgb;
|
||||
half4 distanceAndSpotAttenuation = _AdditionalLightsAttenuation[perObjectLightIndex];
|
||||
half4 spotDirection = _AdditionalLightsSpotDir[perObjectLightIndex];
|
||||
half4 lightOcclusionProbeInfo = _AdditionalLightsOcclusionProbes[perObjectLightIndex];
|
||||
#endif
|
||||
|
||||
// Directional lights store direction in lightPosition.xyz and have .w set to 0.0.
|
||||
// This way the following code will work for both directional and punctual lights.
|
||||
float3 lightVector = lightPositionWS.xyz - positionWS * lightPositionWS.w;
|
||||
float distanceSqr = max(dot(lightVector, lightVector), HALF_MIN);
|
||||
|
||||
half3 lightDirection = half3(lightVector * rsqrt(distanceSqr));
|
||||
half attenuation = DistanceAttenuation(distanceSqr, distanceAndSpotAttenuation.xy) * AngleAttenuation(spotDirection.xyz, lightDirection, distanceAndSpotAttenuation.zw);
|
||||
|
||||
Light light;
|
||||
light.direction = lightDirection;
|
||||
light.distanceAttenuation = attenuation;
|
||||
/// light.shadowAttenuation = AdditionalLightRealtimeShadow(perObjectLightIndex, positionWS);
|
||||
light.shadowAttenuation = 1;
|
||||
light.color = color;
|
||||
|
||||
// In case we're using light probes, we can sample the attenuation from the `unity_ProbesOcclusion`
|
||||
#if defined(LIGHTMAP_ON) || defined(_MIXED_LIGHTING_SUBTRACTIVE)
|
||||
// First find the probe channel from the light.
|
||||
// Then sample `unity_ProbesOcclusion` for the baked occlusion.
|
||||
// If the light is not baked, the channel is -1, and we need to apply no occlusion.
|
||||
|
||||
// probeChannel is the index in 'unity_ProbesOcclusion' that holds the proper occlusion value.
|
||||
int probeChannel = lightOcclusionProbeInfo.x;
|
||||
|
||||
// lightProbeContribution is set to 0 if we are indeed using a probe, otherwise set to 1.
|
||||
half lightProbeContribution = lightOcclusionProbeInfo.y;
|
||||
|
||||
half probeOcclusionValue = unity_ProbesOcclusion[probeChannel];
|
||||
light.distanceAttenuation *= max(probeOcclusionValue, lightProbeContribution);
|
||||
#endif
|
||||
|
||||
return light;
|
||||
}
|
||||
|
||||
uint GetPerObjectLightIndexOffset()
|
||||
{
|
||||
#if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
|
||||
return unity_LightData.x;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Returns a per-object index given a loop index.
|
||||
// This abstract the underlying data implementation for storing lights/light indices
|
||||
int GetPerObjectLightIndex(uint index)
|
||||
{
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Structured Buffer Path /
|
||||
// /
|
||||
// Lights and light indices are stored in StructuredBuffer. We can just index them. /
|
||||
// Currently all non-mobile platforms take this path :( /
|
||||
// There are limitation in mobile GPUs to use SSBO (performance / no vertex shader support) /
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
|
||||
uint offset = unity_LightData.x;
|
||||
return _AdditionalLightsIndices[offset + index];
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// UBO path /
|
||||
// /
|
||||
// We store 8 light indices in float4 unity_LightIndices[2]; /
|
||||
// Due to memory alignment unity doesn't support int[] or float[] /
|
||||
// Even trying to reinterpret cast the unity_LightIndices to float[] won't work /
|
||||
// it will cast to float4[] and create extra register pressure. :( /
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#elif !defined(SHADER_API_GLES)
|
||||
// since index is uint shader compiler will implement
|
||||
// div & mod as bitfield ops (shift and mask).
|
||||
|
||||
// TODO: Can we index a float4? Currently compiler is
|
||||
// replacing unity_LightIndicesX[i] with a dp4 with identity matrix.
|
||||
// u_xlat16_40 = dot(unity_LightIndices[int(u_xlatu13)], ImmCB_0_0_0[u_xlati1]);
|
||||
// This increases both arithmetic and register pressure.
|
||||
return unity_LightIndices[index / 4][index % 4];
|
||||
#else
|
||||
// Fallback to GLES2. No bitfield magic here :(.
|
||||
// We limit to 4 indices per object and only sample unity_4LightIndices0.
|
||||
// Conditional moves are branch free even on mali-400
|
||||
// small arithmetic cost but no extra register pressure from ImmCB_0_0_0 matrix.
|
||||
half2 lightIndex2 = (index < 2.0h) ? unity_LightIndices[0].xy : unity_LightIndices[0].zw;
|
||||
half i_rem = (index < 2.0h) ? index : index - 2.0h;
|
||||
return (i_rem < 1.0h) ? lightIndex2.x : lightIndex2.y;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Fills a light struct given a loop i index. This will convert the i
|
||||
// index to a perObjectLightIndex
|
||||
Light GetAdditionalLight(uint i, float3 positionWS)
|
||||
{
|
||||
int perObjectLightIndex = GetPerObjectLightIndex(i);
|
||||
return GetAdditionalPerObjectLight(perObjectLightIndex, positionWS);
|
||||
}
|
||||
|
||||
int GetAdditionalLightsCount()
|
||||
{
|
||||
// TODO: we need to expose in SRP api an ability for the pipeline cap the amount of lights
|
||||
// in the culling. This way we could do the loop branch with an uniform
|
||||
// This would be helpful to support baking exceeding lights in SH as well
|
||||
return min(_AdditionalLightsCount.x, unity_LightData.y);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3eab241579cd5514388d88f452714385
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 109565
|
||||
packageName: Cartoon FX Remaster Free
|
||||
packageVersion: R 1.5.0
|
||||
assetPath: Assets/JMO Assets/Cartoon FX Remaster/CFXR Assets/Shaders/CFXR_URP.cginc
|
||||
uploadId: 756876
|
||||
Reference in New Issue
Block a user