Alles
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
Shader "Custom/BoundingBoxShader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_Color ("Color", color) = (1, 1, 1, 1)
|
||||
_TexColorTint ("Texture Color", color) = (1, 1, 1, 1)
|
||||
}
|
||||
// URP SubShader
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "12.0"
|
||||
}
|
||||
|
||||
Tags { "Queue"="Transparent" "RenderType"="Transparent" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _Color;
|
||||
float4 _TexColorTint;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
float4 finalColor = _Color;
|
||||
|
||||
float4 texCol = tex2D(_MainTex, i.uv);
|
||||
if (texCol.a != 0)
|
||||
{
|
||||
finalColor = _TexColorTint;
|
||||
}
|
||||
return finalColor;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
// Built-in Render Pipeline SubShader
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="Transparent" "RenderType"="Transparent" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _Color;
|
||||
float4 _TexColorTint;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
float4 finalColor = _Color;
|
||||
|
||||
float4 texCol = tex2D(_MainTex, i.uv);
|
||||
if (texCol.a != 0)
|
||||
{
|
||||
finalColor = _TexColorTint;
|
||||
}
|
||||
return finalColor;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dc3a7bf6deeee45aa8640f348a8eaaa6
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,125 @@
|
||||
Shader "Unlit/CustomBottomEdgeGradient"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_ColorA ("ColorA", color) = (1, 1, 1, 1)
|
||||
_ColorB ("ColorB", color) = (1, 1, 1, 1)
|
||||
_InterpolateSpeed ("Interpolate Speed", Range(0, 2)) = 1
|
||||
}
|
||||
// URP SubShader
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "12.0"
|
||||
}
|
||||
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 localPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _ColorA;
|
||||
float4 _ColorB;
|
||||
float _EdgeHeight;
|
||||
float _Height;
|
||||
float _InterpolateSpeed;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
o.localPos = v.vertex.xyz; // 0 - 1
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
const float4 texCol = tex2D(_MainTex, i.uv);
|
||||
const float yVal = -1;
|
||||
float percent = ((yVal + (_Time.y * _InterpolateSpeed)) % 2) - 1;
|
||||
percent = abs(percent);
|
||||
float4 gradient = lerp(_ColorA, _ColorB, percent) * texCol;
|
||||
return gradient;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
// Built-in Render Pipeline SubShader
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 localPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _ColorA;
|
||||
float4 _ColorB;
|
||||
float _EdgeHeight;
|
||||
float _Height;
|
||||
float _InterpolateSpeed;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
o.localPos = v.vertex; // 0 - 1
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
const float4 texCol = tex2D(_MainTex, i.uv);
|
||||
const float yVal = -1;
|
||||
float percent = ((yVal + (_Time.y * _InterpolateSpeed)) % 2) - 1;
|
||||
percent = abs(percent);
|
||||
float4 gradient = lerp(_ColorA, _ColorB, percent) * texCol;
|
||||
return gradient;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aea96bab3020c48baa88550fa1b03d1f
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,127 @@
|
||||
Shader "Unlit/CustomGradient"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_ColorA ("ColorA", color) = (1, 1, 1, 1)
|
||||
_ColorB ("ColorB", color) = (1, 1, 1, 1)
|
||||
_InterpolateSpeed ("Interpolate Speed", Range(0, 2)) = 1
|
||||
}
|
||||
// URP SubShader
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "12.0"
|
||||
}
|
||||
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 localPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _ColorA;
|
||||
float4 _ColorB;
|
||||
float _EdgeHeight;
|
||||
float _Height;
|
||||
float _InterpolateSpeed;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
o.localPos = v.vertex.xyz;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
const float4 texCol = tex2D(_MainTex, i.uv);
|
||||
const float yVal = i.localPos.y * 2; // (-1, 1)
|
||||
float percent = ((yVal + (_Time.y * _InterpolateSpeed)) % 2) - 1;
|
||||
percent = abs(percent);
|
||||
|
||||
float4 gradient = lerp(_ColorA, _ColorB, percent) * texCol;
|
||||
return gradient;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
// Built-in Render Pipeline SubShader
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 localPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _ColorA;
|
||||
float4 _ColorB;
|
||||
float _EdgeHeight;
|
||||
float _Height;
|
||||
float _InterpolateSpeed;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
o.localPos = v.vertex;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
const float4 texCol = tex2D(_MainTex, i.uv);
|
||||
const float yVal = i.localPos.y * 2; // (-1, 1)
|
||||
float percent = ((yVal + (_Time.y * _InterpolateSpeed)) % 2) - 1;
|
||||
percent = abs(percent);
|
||||
|
||||
float4 gradient = lerp(_ColorA, _ColorB, percent) * texCol;
|
||||
return gradient;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 941b3fbd5c545490198e72022c55edfe
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,404 @@
|
||||
#ifndef CUSTOM_LIGHTING_INCLUDED
|
||||
#define CUSTOM_LIGHTING_INCLUDED
|
||||
|
||||
// @Cyanilux | https://github.com/Cyanilux/URP_ShaderGraphCustomLighting
|
||||
// Note this version of the package assumes v12+ due to usage of "Branch on Input Connection" node
|
||||
// For older versions, see branches on github repo!
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Main Light
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
- Obtains the Direction, Color and Distance Atten for the Main Light.
|
||||
- (DistanceAtten is either 0 or 1 for directional light, depending if the light is in the culling mask or not)
|
||||
- If you want shadow attenutation, see MainLightShadows_float, or use MainLightFull_float instead
|
||||
*/
|
||||
void MainLight_float (out float3 Direction, out float3 Color, out float DistanceAtten){
|
||||
#ifdef SHADERGRAPH_PREVIEW
|
||||
Direction = normalize(float3(1,1,-0.4));
|
||||
Color = float4(1,1,1,1);
|
||||
DistanceAtten = 1;
|
||||
#else
|
||||
Light mainLight = GetMainLight();
|
||||
Direction = mainLight.direction;
|
||||
Color = mainLight.color;
|
||||
DistanceAtten = mainLight.distanceAttenuation;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Main Light Layer Test
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
#if UNITY_VERSION < 202220
|
||||
/*
|
||||
GetMeshRenderingLayer() is only available in 2022.2+
|
||||
Previous versions need to use GetMeshRenderingLightLayer()
|
||||
*/
|
||||
uint GetMeshRenderingLayer(){
|
||||
return GetMeshRenderingLightLayer();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
- Tests whether the Main Light Layer Mask appears in the Rendering Layers from renderer
|
||||
- (Used to support Light Layers, pass your shading from Main Light into this)
|
||||
- To work in an Unlit Graph, requires keywords :
|
||||
- Boolean Keyword, Global Multi-Compile "_LIGHT_LAYERS"
|
||||
*/
|
||||
void MainLightLayer_float(float3 Shading, out float3 Out){
|
||||
#ifdef SHADERGRAPH_PREVIEW
|
||||
Out = Shading;
|
||||
#else
|
||||
Out = 0;
|
||||
uint meshRenderingLayers = GetMeshRenderingLayer();
|
||||
#ifdef _LIGHT_LAYERS
|
||||
if (IsMatchingLightLayer(GetMainLight().layerMask, meshRenderingLayers))
|
||||
#endif
|
||||
{
|
||||
Out = Shading;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
- Obtains the Light Cookie assigned to the Main Light
|
||||
- (For usage, You'd want to Multiply the result with your Light Colour)
|
||||
- To work in an Unlit Graph, requires keywords :
|
||||
- Boolean Keyword, Global Multi-Compile "_LIGHT_COOKIES"
|
||||
*/
|
||||
void MainLightCookie_float(float3 WorldPos, out float3 Cookie){
|
||||
Cookie = 1;
|
||||
#if defined(_LIGHT_COOKIES)
|
||||
Cookie = SampleMainLightCookie(WorldPos);
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Main Light Shadows
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
- This undef (un-define) is required to prevent the "invalid subscript 'shadowCoord'" error,
|
||||
which occurs when _MAIN_LIGHT_SHADOWS is used with 1/No Shadow Cascades with the Unlit Graph.
|
||||
- It's not required for the PBR/Lit graph, so I'm using the SHADERPASS_FORWARD to ignore it for that pass
|
||||
*/
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
||||
#if (SHADERPASS != SHADERPASS_FORWARD)
|
||||
#undef REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
- Samples the Shadowmap for the Main Light, based on the World Position passed in. (Position node)
|
||||
- For shadows to work in the Unlit Graph, the following keywords must be defined in the blackboard :
|
||||
- Enum Keyword, Global Multi-Compile "_MAIN_LIGHT", with entries :
|
||||
- "SHADOWS"
|
||||
- "SHADOWS_CASCADE"
|
||||
- "SHADOWS_SCREEN"
|
||||
- Boolean Keyword, Global Multi-Compile "_SHADOWS_SOFT"
|
||||
- For a PBR/Lit Graph, these keywords are already handled for you.
|
||||
*/
|
||||
void MainLightShadows_float (float3 WorldPos, half4 Shadowmask, out float ShadowAtten){
|
||||
#ifdef SHADERGRAPH_PREVIEW
|
||||
ShadowAtten = 1;
|
||||
#else
|
||||
#if defined(_MAIN_LIGHT_SHADOWS_SCREEN) && !defined(_SURFACE_TYPE_TRANSPARENT)
|
||||
float4 shadowCoord = ComputeScreenPos(TransformWorldToHClip(WorldPos));
|
||||
#else
|
||||
float4 shadowCoord = TransformWorldToShadowCoord(WorldPos);
|
||||
#endif
|
||||
ShadowAtten = MainLightShadow(shadowCoord, WorldPos, Shadowmask, _MainLightOcclusionProbes);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainLightShadows_float (float3 WorldPos, out float ShadowAtten){
|
||||
MainLightShadows_float(WorldPos, half4(1,1,1,1), ShadowAtten);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Shadowmask (v10+)
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
- Used to support "Shadowmask" mode in Lighting window.
|
||||
- Should be sampled once in graph, then input into the Main Light Shadows and/or Additional Light subgraphs/functions.
|
||||
- To work in an Unlit Graph, likely requires keywords :
|
||||
- Boolean Keyword, Global Multi-Compile "SHADOWS_SHADOWMASK"
|
||||
- Boolean Keyword, Global Multi-Compile "LIGHTMAP_SHADOW_MIXING"
|
||||
- (also LIGHTMAP_ON, but I believe Shader Graph is already defining this one)
|
||||
*/
|
||||
void Shadowmask_half (float2 lightmapUV, out half4 Shadowmask){
|
||||
#ifdef SHADERGRAPH_PREVIEW
|
||||
Shadowmask = half4(1,1,1,1);
|
||||
#else
|
||||
OUTPUT_LIGHTMAP_UV(lightmapUV, unity_LightmapST, lightmapUV);
|
||||
Shadowmask = SAMPLE_SHADOWMASK(lightmapUV);
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Ambient Lighting
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
- Uses "SampleSH", the spherical harmonic stuff that ambient lighting / light probes uses.
|
||||
- Will likely be used in the fragment, so will be per-pixel.
|
||||
- Alternatively could use the Baked GI node, as it'll also handle this for you.
|
||||
- Could also use the Ambient node, would be cheaper but the result won't automatically adapt based on the Environmental Lighting Source (Lighting tab).
|
||||
*/
|
||||
void AmbientSampleSH_float (float3 WorldNormal, out float3 Ambient){
|
||||
#ifdef SHADERGRAPH_PREVIEW
|
||||
Ambient = float3(0.1, 0.1, 0.1); // Default ambient colour for previews
|
||||
#else
|
||||
Ambient = SampleSH(WorldNormal);
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Subtractive Baked GI
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
- Used to support "Subtractive" mode in Lighting window.
|
||||
- To work in an Unlit Graph, likely requires keywords :
|
||||
- Boolean Keyword, Global Multi-Compile "LIGHTMAP_SHADOW_MIXING"
|
||||
- (also LIGHTMAP_ON, but I believe Shader Graph is already defining this one)
|
||||
*/
|
||||
void SubtractiveGI_float (float ShadowAtten, float3 normalWS, float3 bakedGI, out half3 result){
|
||||
#ifdef SHADERGRAPH_PREVIEW
|
||||
result = half3(1,1,1);
|
||||
#else
|
||||
Light mainLight = GetMainLight();
|
||||
mainLight.shadowAttenuation = ShadowAtten;
|
||||
MixRealtimeAndBakedGI(mainLight, normalWS, bakedGI);
|
||||
result = bakedGI;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Mix Fog
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
- Adds fog to the colour, based on the Fog settings in the Lighting tab.
|
||||
- Note : Not required for v12, can use Lerp instead. See "Mix Fog" SubGraph
|
||||
*/
|
||||
void MixFog_float (float3 Colour, float Fog, out float3 Out){
|
||||
#ifdef SHADERGRAPH_PREVIEW
|
||||
Out = Colour;
|
||||
#else
|
||||
Out = MixFog(Colour, Fog);
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Default Additional Lights
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
- Handles additional lights (e.g. additional directional, point, spotlights)
|
||||
- For custom lighting, you may want to duplicate this and swap the LightingLambert / LightingSpecular functions out. See Toon Example below!
|
||||
- To work in the Unlit Graph, the following keywords must be defined in the blackboard :
|
||||
- Boolean Keyword, Global Multi-Compile "_ADDITIONAL_LIGHT_SHADOWS"
|
||||
- Boolean Keyword, Global Multi-Compile "_ADDITIONAL_LIGHTS"
|
||||
- To support Forward+ path,
|
||||
- Boolean Keyword, Global Multi-Compile "_FORWARD_PLUS" (2022.2+)
|
||||
*/
|
||||
void AdditionalLights_float(float3 SpecColor, float Smoothness, float3 WorldPosition, float3 WorldNormal, float3 WorldView, half4 Shadowmask,
|
||||
out float3 Diffuse, out float3 Specular) {
|
||||
float3 diffuseColor = 0;
|
||||
float3 specularColor = 0;
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
Smoothness = exp2(10 * Smoothness + 1);
|
||||
uint pixelLightCount = GetAdditionalLightsCount();
|
||||
uint meshRenderingLayers = GetMeshRenderingLayer();
|
||||
|
||||
#if USE_FORWARD_PLUS
|
||||
for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) {
|
||||
FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
|
||||
Light light = GetAdditionalLight(lightIndex, WorldPosition, Shadowmask);
|
||||
#ifdef _LIGHT_LAYERS
|
||||
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
||||
#endif
|
||||
{
|
||||
// Blinn-Phong
|
||||
float3 attenuatedLightColor = light.color * (light.distanceAttenuation * light.shadowAttenuation);
|
||||
diffuseColor += LightingLambert(attenuatedLightColor, light.direction, WorldNormal);
|
||||
specularColor += LightingSpecular(attenuatedLightColor, light.direction, WorldNormal, WorldView, float4(SpecColor, 0), Smoothness);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// For Foward+ the LIGHT_LOOP_BEGIN macro will use inputData.normalizedScreenSpaceUV, inputData.positionWS, so create that:
|
||||
InputData inputData = (InputData)0;
|
||||
float4 screenPos = ComputeScreenPos(TransformWorldToHClip(WorldPosition));
|
||||
inputData.normalizedScreenSpaceUV = screenPos.xy / screenPos.w;
|
||||
inputData.positionWS = WorldPosition;
|
||||
|
||||
LIGHT_LOOP_BEGIN(pixelLightCount)
|
||||
Light light = GetAdditionalLight(lightIndex, WorldPosition, Shadowmask);
|
||||
#ifdef _LIGHT_LAYERS
|
||||
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
||||
#endif
|
||||
{
|
||||
// Blinn-Phong
|
||||
float3 attenuatedLightColor = light.color * (light.distanceAttenuation * light.shadowAttenuation);
|
||||
diffuseColor += LightingLambert(attenuatedLightColor, light.direction, WorldNormal);
|
||||
specularColor += LightingSpecular(attenuatedLightColor, light.direction, WorldNormal, WorldView, float4(SpecColor, 0), Smoothness);
|
||||
}
|
||||
LIGHT_LOOP_END
|
||||
#endif
|
||||
|
||||
Diffuse = diffuseColor;
|
||||
Specular = specularColor;
|
||||
}
|
||||
|
||||
// For backwards compatibility (before Shadowmask was introduced)
|
||||
void AdditionalLights_float(float3 SpecColor, float Smoothness, float3 WorldPosition, float3 WorldNormal, float3 WorldView,
|
||||
out float3 Diffuse, out float3 Specular) {
|
||||
AdditionalLights_float(SpecColor, Smoothness, WorldPosition, WorldNormal, WorldView, half4(1,1,1,1), Diffuse, Specular);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
// Additional Lights Toon Example
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
- Calculates light attenuation values to produce multiple bands for a toon effect. See AdditionalLightsToon function below
|
||||
*/
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
float ToonAttenuation(int lightIndex, float3 positionWS, float pointBands, float spotBands){
|
||||
#if !USE_FORWARD_PLUS
|
||||
lightIndex = GetPerObjectLightIndex(lightIndex);
|
||||
#endif
|
||||
#if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
|
||||
float4 lightPositionWS = _AdditionalLightsBuffer[lightIndex].position;
|
||||
half4 spotDirection = _AdditionalLightsBuffer[lightIndex].spotDirection;
|
||||
half4 distanceAndSpotAttenuation = _AdditionalLightsBuffer[lightIndex].attenuation;
|
||||
#else
|
||||
float4 lightPositionWS = _AdditionalLightsPosition[lightIndex];
|
||||
half4 spotDirection = _AdditionalLightsSpotDir[lightIndex];
|
||||
half4 distanceAndSpotAttenuation = _AdditionalLightsAttenuation[lightIndex];
|
||||
#endif
|
||||
|
||||
// Point
|
||||
float3 lightVector = lightPositionWS.xyz - positionWS * lightPositionWS.w;
|
||||
float distanceSqr = max(dot(lightVector, lightVector), HALF_MIN);
|
||||
float range = rsqrt(distanceAndSpotAttenuation.x);
|
||||
float dist = sqrt(distanceSqr) / range;
|
||||
|
||||
// Spot
|
||||
half3 lightDirection = half3(lightVector * rsqrt(distanceSqr));
|
||||
half SdotL = dot(spotDirection.xyz, lightDirection);
|
||||
half spotAtten = saturate(SdotL * distanceAndSpotAttenuation.z + distanceAndSpotAttenuation.w);
|
||||
spotAtten *= spotAtten;
|
||||
float maskSpotToRange = step(dist, 1);
|
||||
|
||||
// Atten
|
||||
bool isSpot = (distanceAndSpotAttenuation.z > 0);
|
||||
return isSpot ?
|
||||
//step(0.01, spotAtten) : // cheaper if you just want "1" band for spot lights
|
||||
(floor(spotAtten * spotBands) / spotBands) * maskSpotToRange :
|
||||
saturate(1.0 - floor(dist * pointBands) / pointBands);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
- Handles additional lights (e.g. point, spotlights) with banded toon effect
|
||||
- For shadows to work in the Unlit Graph, the following keywords must be defined in the blackboard :
|
||||
- Boolean Keyword, Global Multi-Compile "_ADDITIONAL_LIGHT_SHADOWS"
|
||||
- Boolean Keyword, Global Multi-Compile "_ADDITIONAL_LIGHTS" (required to prevent the one above from being stripped from builds)
|
||||
- For a PBR/Lit Graph, these keywords are already handled for you.
|
||||
*/
|
||||
void AdditionalLightsToon_float(float3 SpecColor, float Smoothness, float3 WorldPosition, float3 WorldNormal, float3 WorldView, half4 Shadowmask,
|
||||
float PointLightBands, float SpotLightBands,
|
||||
out float3 Diffuse, out float3 Specular) {
|
||||
float3 diffuseColor = 0;
|
||||
float3 specularColor = 0;
|
||||
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
Smoothness = exp2(10 * Smoothness + 1);
|
||||
uint pixelLightCount = GetAdditionalLightsCount();
|
||||
uint meshRenderingLayers = GetMeshRenderingLayer();
|
||||
|
||||
#if USE_FORWARD_PLUS
|
||||
for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) {
|
||||
FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
|
||||
Light light = GetAdditionalLight(lightIndex, WorldPosition, Shadowmask);
|
||||
#ifdef _LIGHT_LAYERS
|
||||
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
||||
#endif
|
||||
{
|
||||
if (PointLightBands <= 1 && SpotLightBands <= 1){
|
||||
// Solid colour lights
|
||||
diffuseColor += light.color * step(0.0001, light.distanceAttenuation * light.shadowAttenuation);
|
||||
}else{
|
||||
// Multiple bands
|
||||
diffuseColor += light.color * light.shadowAttenuation * ToonAttenuation(lightIndex, WorldPosition, PointLightBands, SpotLightBands);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// For Foward+ the LIGHT_LOOP_BEGIN macro will use inputData.normalizedScreenSpaceUV, inputData.positionWS, so create that:
|
||||
InputData inputData = (InputData)0;
|
||||
float4 screenPos = ComputeScreenPos(TransformWorldToHClip(WorldPosition));
|
||||
inputData.normalizedScreenSpaceUV = screenPos.xy / screenPos.w;
|
||||
inputData.positionWS = WorldPosition;
|
||||
|
||||
LIGHT_LOOP_BEGIN(pixelLightCount)
|
||||
Light light = GetAdditionalLight(lightIndex, WorldPosition, Shadowmask);
|
||||
#ifdef _LIGHT_LAYERS
|
||||
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
||||
#endif
|
||||
{
|
||||
if (PointLightBands <= 1 && SpotLightBands <= 1){
|
||||
// Solid colour lights
|
||||
diffuseColor += light.color * step(0.0001, light.distanceAttenuation * light.shadowAttenuation);
|
||||
}else{
|
||||
// Multiple bands
|
||||
diffuseColor += light.color * light.shadowAttenuation * ToonAttenuation(lightIndex, WorldPosition, PointLightBands, SpotLightBands);
|
||||
}
|
||||
}
|
||||
LIGHT_LOOP_END
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef SHADERGRAPH_PREVIEW
|
||||
Smoothness = exp2(10 * Smoothness + 1);
|
||||
WorldNormal = normalize(WorldNormal);
|
||||
WorldView = SafeNormalize(WorldView);
|
||||
int pixelLightCount = GetAdditionalLightsCount();
|
||||
for (int i = 0; i < pixelLightCount; ++i) {
|
||||
Light light = GetAdditionalLight(i, WorldPosition, Shadowmask);
|
||||
|
||||
// DIFFUSE
|
||||
if (PointLightBands <= 1 && SpotLightBands <= 1){
|
||||
// Solid colour lights
|
||||
diffuseColor += light.color * step(0.0001, light.distanceAttenuation * light.shadowAttenuation);
|
||||
}else{
|
||||
// Multiple bands :
|
||||
diffuseColor += light.color * light.shadowAttenuation * ToonAttenuation(i, WorldPosition, PointLightBands, SpotLightBands);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
Diffuse = diffuseColor;
|
||||
Specular = specularColor;
|
||||
// Didn't really like the look of specular lighting in the toon shader here, so just keeping it at 0
|
||||
}
|
||||
|
||||
// For backwards compatibility (before Shadowmask was introduced)
|
||||
void AdditionalLightsToon_float(float3 SpecColor, float Smoothness, float3 WorldPosition, float3 WorldNormal, float3 WorldView,
|
||||
float PointLightBands, float SpotLightBands,
|
||||
out float3 Diffuse, out float3 Specular) {
|
||||
AdditionalLightsToon_float(SpecColor, Smoothness, WorldPosition, WorldNormal, WorldView, half4(1,1,1,1),
|
||||
PointLightBands, SpotLightBands,Diffuse, Specular);
|
||||
}
|
||||
|
||||
#endif // CUSTOM_LIGHTING_INCLUDED
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3bbf75de25043a43acec26cc1d92a5c
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,127 @@
|
||||
Shader "Unlit/CustomTopEdgeGradient"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_ColorA ("ColorA", color) = (1, 1, 1, 1)
|
||||
_ColorB ("ColorB", color) = (1, 1, 1, 1)
|
||||
_InterpolateSpeed ("Interpolate Speed", Range(0, 2)) = 1
|
||||
}
|
||||
// URP SubShader
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "12.0"
|
||||
}
|
||||
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 localPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _ColorA;
|
||||
float4 _ColorB;
|
||||
float _EdgeHeight;
|
||||
float _Height;
|
||||
float _InterpolateSpeed;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
o.localPos = v.vertex.xyz;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
const float4 texCol = tex2D(_MainTex, i.uv);
|
||||
const float yVal = 1;
|
||||
float percent = ((yVal + (_Time.y * _InterpolateSpeed)) % 2) - 1;
|
||||
percent = abs(percent);
|
||||
|
||||
float4 gradient = lerp(_ColorA, _ColorB, percent) * texCol;
|
||||
return gradient;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
// Built-in Render Pipeline SubShader
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent"}
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 localPos : TEXCOORD1;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _ColorA;
|
||||
float4 _ColorB;
|
||||
float _EdgeHeight;
|
||||
float _Height;
|
||||
float _InterpolateSpeed;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
o.localPos = v.vertex;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
const float4 texCol = tex2D(_MainTex, i.uv);
|
||||
const float yVal = 1;
|
||||
float percent = ((yVal + (_Time.y * _InterpolateSpeed)) % 2) - 1;
|
||||
percent = abs(percent);
|
||||
|
||||
float4 gradient = lerp(_ColorA, _ColorB, percent) * texCol;
|
||||
return gradient;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c5c44fab989844e6b82dc803011e994c
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3455d1eea431c5428ec7b5aca24ee09
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d97921c9ddc246c44b683fccfcc004d8
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96b9cceda56768e40b91837153b05fc4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,144 @@
|
||||
#include "Utils.hlsl"
|
||||
|
||||
TEXTURE2D(_EnvironmentConfidenceTexture);
|
||||
SAMPLER(sampler_EnvironmentConfidenceTexture);
|
||||
|
||||
TEXTURE2D_ARRAY_FLOAT(_EnvironmentDepthTexture);
|
||||
SAMPLER(sampler_EnvironmentDepthTexture);
|
||||
float2 _EnvironmentDepthTexture_TexelSize;
|
||||
|
||||
TEXTURE2D_ARRAY_FLOAT(_EnvironmentDepthTexturePreprocessed);
|
||||
SAMPLER(sampler_EnvironmentDepthTexturePreprocessed);
|
||||
float4 _EnvironmentDepthTexturePreprocessed_TexelSize;
|
||||
|
||||
float4x4 _EnvironmentDepthProjectionMatrices[2];
|
||||
|
||||
void SetOcclusionVertOutputs(float4 positionOS, inout float4 positionCS, inout float4 objectPositionWS)
|
||||
{
|
||||
objectPositionWS = mul(unity_ObjectToWorld, float4(positionOS.xyz, 1.0));
|
||||
positionCS = mul(UNITY_MATRIX_VP, objectPositionWS);
|
||||
}
|
||||
|
||||
float SampleEnvironmentDepth(const float2 uv)
|
||||
{
|
||||
return SAMPLE_TEXTURE2D_ARRAY(_EnvironmentDepthTexture, sampler_EnvironmentDepthTexture, uv, unity_StereoEyeIndex).r;
|
||||
}
|
||||
|
||||
float SampleEnvironmentDepthLinear(const float2 uv)
|
||||
{
|
||||
const float environmentDepth = SampleEnvironmentDepth(uv);
|
||||
|
||||
#ifdef XR_LINEAR_DEPTH
|
||||
// depth is already linear
|
||||
return environmentDepth;
|
||||
#else
|
||||
return LinearizeDepth(ConvertDepthToSymmetricRange(environmentDepth));
|
||||
#endif
|
||||
}
|
||||
|
||||
float4 SamplePreprocessedEnvironmentDepth(const float2 uv, const float index)
|
||||
{
|
||||
return _EnvironmentDepthTexturePreprocessed.Sample(sampler_EnvironmentDepthTexturePreprocessed, float3(uv, index));
|
||||
}
|
||||
|
||||
float4 SampleEnvironmentDepthGeneral(const float2 uv)
|
||||
{
|
||||
#ifdef XR_SOFT_OCCLUSION
|
||||
return SamplePreprocessedEnvironmentDepth(uv, unity_StereoEyeIndex);
|
||||
#else
|
||||
return float4(SampleEnvironmentDepthLinear(uv), 0, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
float GetHardPixelVisibility(const float linearEnvironmentDepth, const float linearSceneDepth)
|
||||
{
|
||||
return float (linearEnvironmentDepth > linearSceneDepth);
|
||||
}
|
||||
|
||||
float GetSoftPixelVisibility(const float4 depthSample, const float linearSceneDepth)
|
||||
{
|
||||
const float symmetricSceneDepthNDC = LinearDepthToSymmetricRangeNDC(linearSceneDepth);
|
||||
const float nonSymmetricSceneDepthNDC = ConvertDepthToNonSymmetricRange(symmetricSceneDepthNDC);
|
||||
|
||||
// inversed scale factor is inversely proportional to (nonSymmetricSceneDepthNDC - 1.0f)
|
||||
// at ndc value == 0 formula must return scaleAtZero scale factor
|
||||
const float scaleAtZero = 15.0f; // determined experimentally
|
||||
float invScaleFactor = -scaleAtZero / (nonSymmetricSceneDepthNDC - 1.0f);
|
||||
|
||||
float3 minMaxMidEnvDepths = float3(1.0f - depthSample.x, 1.0f - depthSample.y, depthSample.z + 1.0f - depthSample.x);
|
||||
|
||||
float3 depthDeltas = saturate((minMaxMidEnvDepths - nonSymmetricSceneDepthNDC) * invScaleFactor);
|
||||
|
||||
// blend min and max deltas
|
||||
// min delta -> object fully invisible
|
||||
// max delta -> object fully visible
|
||||
const float kForegroundLevel = 0.1f;
|
||||
const float kBackgroundLevel = 0.9f;
|
||||
const float interp = depthSample.z / depthSample.w;
|
||||
const float blendFactor = smoothstep(kForegroundLevel, kBackgroundLevel, interp);
|
||||
const float differenceThreshold = 0.05f ;
|
||||
const float isBlending = step(differenceThreshold, depthDeltas.y - depthDeltas.x);
|
||||
const float alpha = depthDeltas.z * (1 - isBlending) + lerp(depthDeltas.x, depthDeltas.y, blendFactor) * isBlending;
|
||||
|
||||
return alpha;
|
||||
}
|
||||
|
||||
float GetToleranceBasedPixelVisibility(const float linearEnvironmentDepth, const float linearSceneDepth)
|
||||
{
|
||||
const float depthNearMin = 0.0;
|
||||
const float depthNearMax = 0.05;
|
||||
const float depthFarMin = 4.5;
|
||||
const float depthFarMax = 6.5;
|
||||
const float depthCloseToleranceThreshold = 3.5;
|
||||
const float depthFarToleranceThreshold = 5.5;
|
||||
const float toleranceClose = 0.02;
|
||||
const float toleranceFurthest = 0.5;
|
||||
const float toleranceGamma = 1;
|
||||
|
||||
const float delta = linearSceneDepth - linearEnvironmentDepth;
|
||||
|
||||
// |____|_______|____________|_____|
|
||||
// 0 nMin nMax fmin fmax
|
||||
//d ^
|
||||
|
||||
const float trustDepthNear = NormalizeWithinBounds(linearEnvironmentDepth, depthNearMin, depthNearMax);
|
||||
const float trustDepthFar = 1 - NormalizeWithinBounds(linearEnvironmentDepth, depthFarMin, depthFarMax);
|
||||
const float sceneAssetVisibility = 1 - NormalizeWithinBounds(linearSceneDepth, depthFarMin, depthFarMax);
|
||||
const float tolerance_t = NormalizeWithinBounds(linearEnvironmentDepth, depthCloseToleranceThreshold, depthFarToleranceThreshold);
|
||||
const float tolerance = toleranceClose + pow(tolerance_t, toleranceGamma) * (toleranceFurthest - toleranceClose);
|
||||
|
||||
//gradually change visibility 0 to 1 on depth delta values <= tolerance.
|
||||
const float closeProximityVisibility = saturate(1 - (delta + tolerance) / (2 * tolerance) * trustDepthFar);
|
||||
return sceneAssetVisibility * max(max(closeProximityVisibility, 0), 1 - trustDepthNear);
|
||||
}
|
||||
|
||||
float ComputePixelVisibility(const float4 environmentDepth, const float linearSceneDepth)
|
||||
{
|
||||
#ifdef XR_SOFT_OCCLUSION
|
||||
return GetSoftPixelVisibility(environmentDepth, linearSceneDepth);
|
||||
#elif XR_HARD_OCCLUSION
|
||||
return GetHardPixelVisibility(environmentDepth.x, linearSceneDepth);
|
||||
#else
|
||||
return GetToleranceBasedPixelVisibility(environmentDepth.x, linearSceneDepth);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void SetOcclusion(float4 objectPositionWS, inout float4 color)
|
||||
{
|
||||
const float4 clipSpaceDepthRelativePos = mul(_EnvironmentDepthProjectionMatrices[unity_StereoEyeIndex], objectPositionWS);
|
||||
const float2 uv = (clipSpaceDepthRelativePos.xy / clipSpaceDepthRelativePos.w + 1.0f) * 0.5f;
|
||||
|
||||
if (all(uv < 0.0) || all(uv > 1.0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const float4 environmentDepth = SampleEnvironmentDepthGeneral(uv);
|
||||
const float sceneDepthNDC = clipSpaceDepthRelativePos.z / clipSpaceDepthRelativePos.w;
|
||||
const float linearSceneDepth = LinearizeDepth(sceneDepthNDC);
|
||||
|
||||
color.a *= ComputePixelVisibility(environmentDepth, linearSceneDepth);
|
||||
color.rgb *= color.a;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1fb59a4bbefcdc4ca8e0cfd9eca8d24
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
struct OcclusionAttributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
};
|
||||
|
||||
struct OcclusionVaryings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float4 objectPositionWS : TEXCOORD0;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a5bbeb8efe23a14c84c435f4db0f366
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39cb2e721fae497499ddea5dea274f96
|
||||
timeCreated: 1729717388
|
||||
+471
@@ -0,0 +1,471 @@
|
||||
// Shader targeted for low end devices. Single Pass Forward Rendering.
|
||||
Shader "Occlusion/OcclusionSimpleLit"
|
||||
{
|
||||
// Keep properties of StandardSpecular shader for upgrade reasons.
|
||||
Properties
|
||||
{
|
||||
[MainTexture] _BaseMap("Base Map (RGB) Smoothness / Alpha (A)", 2D) = "white" {}
|
||||
[MainColor] _BaseColor("Base Color", Color) = (1, 1, 1, 1)
|
||||
|
||||
_Cutoff("Alpha Clipping", Range(0.0, 1.0)) = 0.5
|
||||
|
||||
_Smoothness("Smoothness", Range(0.0, 1.0)) = 0.5
|
||||
_SpecColor("Specular Color", Color) = (0.5, 0.5, 0.5, 0.5)
|
||||
_SpecGlossMap("Specular Map", 2D) = "white" {}
|
||||
_SmoothnessSource("Smoothness Source", Float) = 0.0
|
||||
_SpecularHighlights("Specular Highlights", Float) = 1.0
|
||||
|
||||
[HideInInspector] _BumpScale("Scale", Float) = 1.0
|
||||
[NoScaleOffset] _BumpMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[HDR] _EmissionColor("Emission Color", Color) = (0,0,0)
|
||||
[NoScaleOffset]_EmissionMap("Emission Map", 2D) = "white" {}
|
||||
|
||||
// Blending state
|
||||
_Surface("__surface", Float) = 0.0
|
||||
_Blend("__blend", Float) = 0.0
|
||||
_Cull("__cull", Float) = 2.0
|
||||
[ToggleUI] _AlphaClip("__clip", Float) = 0.0
|
||||
[HideInInspector] _SrcBlend("__src", Float) = 1.0
|
||||
[HideInInspector] _DstBlend("__dst", Float) = 0.0
|
||||
[HideInInspector] _SrcBlendAlpha("__srcA", Float) = 1.0
|
||||
[HideInInspector] _DstBlendAlpha("__dstA", Float) = 0.0
|
||||
[HideInInspector] _ZWrite("__zw", Float) = 1.0
|
||||
[HideInInspector] _BlendModePreserveSpecular("_BlendModePreserveSpecular", Float) = 1.0
|
||||
[HideInInspector] _AlphaToMask("__alphaToMask", Float) = 0.0
|
||||
[HideInInspector] _AddPrecomputedVelocity("_AddPrecomputedVelocity", Float) = 0.0
|
||||
|
||||
[ToggleUI] _ReceiveShadows("Receive Shadows", Float) = 1.0
|
||||
// Editmode props
|
||||
_QueueOffset("Queue offset", Float) = 0.0
|
||||
|
||||
// ObsoleteProperties
|
||||
[HideInInspector] _MainTex("BaseMap", 2D) = "white" {}
|
||||
[HideInInspector] _Color("Base Color", Color) = (1, 1, 1, 1)
|
||||
[HideInInspector] _Shininess("Smoothness", Float) = 0.0
|
||||
[HideInInspector] _GlossinessSource("GlossinessSource", Float) = 0.0
|
||||
[HideInInspector] _SpecSource("SpecularHighlights", Float) = 0.0
|
||||
|
||||
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
|
||||
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
|
||||
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderType" = "Opaque"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
"UniversalMaterialType" = "SimpleLit"
|
||||
"IgnoreProjector" = "True"
|
||||
}
|
||||
LOD 300
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ForwardLit"
|
||||
Tags
|
||||
{
|
||||
"LightMode" = "UniversalForward"
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Render State Commands
|
||||
// Use same blending / depth states as Standard shader
|
||||
Blend[_SrcBlend][_DstBlend], [_SrcBlendAlpha][_DstBlendAlpha]
|
||||
ZWrite[_ZWrite]
|
||||
Cull[_Cull]
|
||||
AlphaToMask[_AlphaToMask]
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
// -------------------------------------
|
||||
// Shader Stages
|
||||
#pragma vertex LitPassVertexSimple
|
||||
#pragma fragment LitPassFragmentSimple
|
||||
|
||||
// -------------------------------------
|
||||
// Material Keywords
|
||||
#pragma shader_feature_local _NORMALMAP
|
||||
#pragma shader_feature_local_fragment _EMISSION
|
||||
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
|
||||
#pragma shader_feature_local_fragment _SURFACE_TYPE_TRANSPARENT
|
||||
#pragma shader_feature_local_fragment _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
|
||||
#pragma shader_feature_local_fragment _ _SPECGLOSSMAP _SPECULAR_COLOR
|
||||
#pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
|
||||
|
||||
// -------------------------------------
|
||||
// Universal Pipeline keywords
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
||||
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
||||
#pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
|
||||
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
||||
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
||||
#pragma multi_compile _ _LIGHT_LAYERS
|
||||
#pragma multi_compile _ _FORWARD_PLUS
|
||||
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||||
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
|
||||
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
||||
#pragma multi_compile_fragment _ _LIGHT_COOKIES
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
|
||||
|
||||
// -------------------------------------
|
||||
// Unity defined keywords
|
||||
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
||||
#pragma multi_compile _ LIGHTMAP_ON
|
||||
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
||||
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
|
||||
#pragma multi_compile_fragment _ DEBUG_DISPLAY
|
||||
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||
|
||||
//--------------------------------------
|
||||
// GPU Instancing
|
||||
#pragma multi_compile_instancing
|
||||
#pragma instancing_options renderinglayer
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
||||
|
||||
// Occlusion features
|
||||
#pragma multi_compile _ XR_LINEAR_DEPTH
|
||||
#pragma multi_compile _ XR_HARD_OCCLUSION XR_SOFT_OCCLUSION
|
||||
|
||||
//--------------------------------------
|
||||
// Defines
|
||||
#define BUMP_SCALE_NOT_SUPPORTED 1
|
||||
|
||||
// -------------------------------------
|
||||
// Includes
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include "OcclusionSimpleLitForwardPass.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags
|
||||
{
|
||||
"LightMode" = "ShadowCaster"
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Render State Commands
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
ColorMask 0
|
||||
Cull[_Cull]
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
// -------------------------------------
|
||||
// Shader Stages
|
||||
#pragma vertex ShadowPassVertex
|
||||
#pragma fragment ShadowPassFragment
|
||||
|
||||
// -------------------------------------
|
||||
// Material Keywords
|
||||
#pragma shader_feature_local _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
|
||||
|
||||
// -------------------------------------
|
||||
// Unity defined keywords
|
||||
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||
|
||||
//--------------------------------------
|
||||
// GPU Instancing
|
||||
#pragma multi_compile_instancing
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
||||
|
||||
// This is used during shadow map generation to differentiate between directional and punctual light shadows, as they use different formulas to apply Normal Bias
|
||||
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
|
||||
|
||||
// -------------------------------------
|
||||
// Includes
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/ShadowCasterPass.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "GBuffer"
|
||||
Tags
|
||||
{
|
||||
"LightMode" = "UniversalGBuffer"
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Render State Commands
|
||||
ZWrite[_ZWrite]
|
||||
ZTest LEqual
|
||||
Cull[_Cull]
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 4.5
|
||||
|
||||
// Deferred Rendering Path does not support the OpenGL-based graphics API:
|
||||
// Desktop OpenGL, OpenGL ES 3.0, WebGL 2.0.
|
||||
#pragma exclude_renderers gles3 glcore
|
||||
|
||||
// -------------------------------------
|
||||
// Shader Stages
|
||||
#pragma vertex LitPassVertexSimple
|
||||
#pragma fragment LitPassFragmentSimple
|
||||
|
||||
// -------------------------------------
|
||||
// Material Keywords
|
||||
#pragma shader_feature_local_fragment _ALPHATEST_ON
|
||||
//#pragma shader_feature _ALPHAPREMULTIPLY_ON
|
||||
#pragma shader_feature_local_fragment _ _SPECGLOSSMAP _SPECULAR_COLOR
|
||||
#pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
|
||||
#pragma shader_feature_local _NORMALMAP
|
||||
#pragma shader_feature_local_fragment _EMISSION
|
||||
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
|
||||
|
||||
// -------------------------------------
|
||||
// Universal Pipeline keywords
|
||||
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
||||
//#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
||||
//#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
||||
#pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
||||
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
|
||||
|
||||
// -------------------------------------
|
||||
// Unity defined keywords
|
||||
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
||||
#pragma multi_compile _ LIGHTMAP_ON
|
||||
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
||||
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
|
||||
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
||||
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
||||
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
|
||||
#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
|
||||
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||
|
||||
//--------------------------------------
|
||||
// GPU Instancing
|
||||
#pragma multi_compile_instancing
|
||||
#pragma instancing_options renderinglayer
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
||||
|
||||
//--------------------------------------
|
||||
// Defines
|
||||
#define BUMP_SCALE_NOT_SUPPORTED 1
|
||||
|
||||
// -------------------------------------
|
||||
// Includes
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitGBufferPass.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "DepthOnly"
|
||||
Tags
|
||||
{
|
||||
"LightMode" = "DepthOnly"
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Render State Commands
|
||||
ZWrite On
|
||||
ColorMask R
|
||||
Cull[_Cull]
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
// -------------------------------------
|
||||
// Shader Stages
|
||||
#pragma vertex DepthOnlyVertex
|
||||
#pragma fragment DepthOnlyFragment
|
||||
|
||||
// -------------------------------------
|
||||
// Material Keywords
|
||||
#pragma shader_feature_local _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
|
||||
|
||||
// -------------------------------------
|
||||
// Unity defined keywords
|
||||
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||
|
||||
//--------------------------------------
|
||||
// GPU Instancing
|
||||
#pragma multi_compile_instancing
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
||||
|
||||
// -------------------------------------
|
||||
// Includes
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
// This pass is used when drawing to a _CameraNormalsTexture texture
|
||||
Pass
|
||||
{
|
||||
Name "DepthNormals"
|
||||
Tags
|
||||
{
|
||||
"LightMode" = "DepthNormals"
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Render State Commands
|
||||
ZWrite On
|
||||
Cull[_Cull]
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
// -------------------------------------
|
||||
// Shader Stages
|
||||
#pragma vertex DepthNormalsVertex
|
||||
#pragma fragment DepthNormalsFragment
|
||||
|
||||
// -------------------------------------
|
||||
// Material Keywords
|
||||
#pragma shader_feature_local _NORMALMAP
|
||||
#pragma shader_feature_local _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _GLOSSINESS_FROM_BASE_ALPHA
|
||||
|
||||
// -------------------------------------
|
||||
// Unity defined keywords
|
||||
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||
|
||||
// Universal Pipeline keywords
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
|
||||
|
||||
//--------------------------------------
|
||||
// GPU Instancing
|
||||
#pragma multi_compile_instancing
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
||||
|
||||
// -------------------------------------
|
||||
// Includes
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitDepthNormalsPass.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
// This pass it not used during regular rendering, only for lightmap baking.
|
||||
Pass
|
||||
{
|
||||
Name "Meta"
|
||||
Tags
|
||||
{
|
||||
"LightMode" = "Meta"
|
||||
}
|
||||
|
||||
// -------------------------------------
|
||||
// Render State Commands
|
||||
Cull Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
// -------------------------------------
|
||||
// Shader Stages
|
||||
#pragma vertex UniversalVertexMeta
|
||||
#pragma fragment UniversalFragmentMetaSimple
|
||||
|
||||
// -------------------------------------
|
||||
// Material Keywords
|
||||
#pragma shader_feature_local_fragment _EMISSION
|
||||
#pragma shader_feature_local_fragment _SPECGLOSSMAP
|
||||
#pragma shader_feature EDITOR_VISUALIZATION
|
||||
|
||||
// -------------------------------------
|
||||
// Includes
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitMetaPass.hlsl"
|
||||
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Universal2D"
|
||||
Tags
|
||||
{
|
||||
"LightMode" = "Universal2D"
|
||||
"RenderType" = "Transparent"
|
||||
"Queue" = "Transparent"
|
||||
}
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma target 2.0
|
||||
|
||||
// -------------------------------------
|
||||
// Shader Stages
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
// -------------------------------------
|
||||
// Material Keywords
|
||||
#pragma shader_feature_local_fragment _ALPHATEST_ON
|
||||
#pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
|
||||
|
||||
// -------------------------------------
|
||||
// Includes
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/Universal2D.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "MotionVectors"
|
||||
Tags { "LightMode" = "MotionVectors" }
|
||||
ColorMask RG
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma shader_feature_local _ALPHATEST_ON
|
||||
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||
#pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "XRMotionVectors"
|
||||
Tags { "LightMode" = "XRMotionVectors" }
|
||||
ColorMask RGBA
|
||||
|
||||
// Stencil write for obj motion pixels
|
||||
Stencil
|
||||
{
|
||||
WriteMask 1
|
||||
Ref 1
|
||||
Comp Always
|
||||
Pass Replace
|
||||
}
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma shader_feature_local _ALPHATEST_ON
|
||||
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
||||
#pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY
|
||||
#define APLICATION_SPACE_WARP_MOTION 1
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/SimpleLitInput.hlsl"
|
||||
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Universal Render Pipeline/Simple Lit"
|
||||
CustomEditor "UnityEditor.Rendering.Universal.ShaderGUI.SimpleLitShader"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 394bcf679cb659a46aa1d3dec30186e3
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+234
@@ -0,0 +1,234 @@
|
||||
#ifndef UNIVERSAL_SIMPLE_LIT_PASS_INCLUDED
|
||||
#define UNIVERSAL_SIMPLE_LIT_PASS_INCLUDED
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
||||
#include "../OcclusionComputation.hlsl"
|
||||
#include "../OcclusionInputOutput.hlsl"
|
||||
#if defined(LOD_FADE_CROSSFADE)
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
|
||||
#endif
|
||||
|
||||
struct Attributes : OcclusionAttributes
|
||||
{
|
||||
float3 normalOS : NORMAL;
|
||||
float4 tangentOS : TANGENT;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 staticLightmapUV : TEXCOORD1;
|
||||
float2 dynamicLightmapUV : TEXCOORD2;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct Varyings : OcclusionVaryings
|
||||
{
|
||||
float2 uv : TEXCOORD1;
|
||||
|
||||
float3 positionWS : TEXCOORD2; // xyz: posWS
|
||||
|
||||
#ifdef _NORMALMAP
|
||||
half4 normalWS : TEXCOORD3; // xyz: normal, w: viewDir.x
|
||||
half4 tangentWS : TEXCOORD4; // xyz: tangent, w: viewDir.y
|
||||
half4 bitangentWS : TEXCOORD5; // xyz: bitangent, w: viewDir.z
|
||||
#else
|
||||
half3 normalWS : TEXCOORD6;
|
||||
#endif
|
||||
|
||||
#ifdef _ADDITIONAL_LIGHTS_VERTEX
|
||||
half4 fogFactorAndVertexLight : TEXCOORD7; // x: fogFactor, yzw: vertex light
|
||||
#else
|
||||
half fogFactor : TEXCOORD8;
|
||||
#endif
|
||||
|
||||
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
||||
float4 shadowCoord : TEXCOORD9;
|
||||
#endif
|
||||
|
||||
DECLARE_LIGHTMAP_OR_SH(staticLightmapUV, vertexSH, 10);
|
||||
|
||||
#ifdef DYNAMICLIGHTMAP_ON
|
||||
float2 dynamicLightmapUV : TEXCOORD11; // Dynamic lightmap UVs
|
||||
#endif
|
||||
|
||||
#ifdef USE_APV_PROBE_OCCLUSION
|
||||
float4 probeOcclusion : TEXCOORD12;
|
||||
#endif
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData)
|
||||
{
|
||||
inputData = (InputData)0;
|
||||
|
||||
inputData.positionWS = input.positionWS;
|
||||
#if defined(DEBUG_DISPLAY)
|
||||
inputData.positionCS = input.positionCS;
|
||||
#endif
|
||||
|
||||
#ifdef _NORMALMAP
|
||||
half3 viewDirWS = half3(input.normalWS.w, input.tangentWS.w, input.bitangentWS.w);
|
||||
inputData.tangentToWorld = half3x3(input.tangentWS.xyz, input.bitangentWS.xyz, input.normalWS.xyz);
|
||||
inputData.normalWS = TransformTangentToWorld(normalTS, inputData.tangentToWorld);
|
||||
#else
|
||||
half3 viewDirWS = GetWorldSpaceNormalizeViewDir(inputData.positionWS);
|
||||
inputData.normalWS = input.normalWS;
|
||||
#endif
|
||||
|
||||
inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
|
||||
viewDirWS = SafeNormalize(viewDirWS);
|
||||
|
||||
inputData.viewDirectionWS = viewDirWS;
|
||||
|
||||
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
||||
inputData.shadowCoord = input.shadowCoord;
|
||||
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
||||
inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
|
||||
#else
|
||||
inputData.shadowCoord = float4(0, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
#ifdef _ADDITIONAL_LIGHTS_VERTEX
|
||||
inputData.fogCoord = InitializeInputDataFog(float4(inputData.positionWS, 1.0), input.fogFactorAndVertexLight.x);
|
||||
inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
|
||||
#else
|
||||
inputData.fogCoord = InitializeInputDataFog(float4(inputData.positionWS, 1.0), input.fogFactor);
|
||||
inputData.vertexLighting = half3(0, 0, 0);
|
||||
#endif
|
||||
|
||||
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
|
||||
|
||||
#if defined(DEBUG_DISPLAY)
|
||||
#if defined(DYNAMICLIGHTMAP_ON)
|
||||
inputData.dynamicLightmapUV = input.dynamicLightmapUV.xy;
|
||||
#endif
|
||||
#if defined(LIGHTMAP_ON)
|
||||
inputData.staticLightmapUV = input.staticLightmapUV;
|
||||
#else
|
||||
inputData.vertexSH = input.vertexSH;
|
||||
#endif
|
||||
#if defined(USE_APV_PROBE_OCCLUSION)
|
||||
inputData.probeOcclusion = input.probeOcclusion;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void InitializeBakedGIData(Varyings input, inout InputData inputData)
|
||||
{
|
||||
#if defined(DYNAMICLIGHTMAP_ON)
|
||||
inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.dynamicLightmapUV, input.vertexSH, inputData.normalWS);
|
||||
inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV);
|
||||
#elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
|
||||
inputData.bakedGI = SAMPLE_GI(input.vertexSH,
|
||||
GetAbsolutePositionWS(inputData.positionWS),
|
||||
inputData.normalWS,
|
||||
inputData.viewDirectionWS,
|
||||
input.positionCS.xy,
|
||||
input.probeOcclusion,
|
||||
inputData.shadowMask);
|
||||
#else
|
||||
inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.vertexSH, inputData.normalWS);
|
||||
inputData.shadowMask = SAMPLE_SHADOWMASK(input.staticLightmapUV);
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Vertex and Fragment functions //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Used in Standard (Simple Lighting) shader
|
||||
Varyings LitPassVertexSimple(Attributes input)
|
||||
{
|
||||
Varyings output = (Varyings)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
|
||||
|
||||
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
|
||||
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
|
||||
|
||||
#if defined(_FOG_FRAGMENT)
|
||||
half fogFactor = 0;
|
||||
#else
|
||||
half fogFactor = ComputeFogFactor(vertexInput.positionCS.z);
|
||||
#endif
|
||||
|
||||
output.uv = TRANSFORM_TEX(input.texcoord, _BaseMap);
|
||||
output.positionWS.xyz = vertexInput.positionWS;
|
||||
output.positionCS = vertexInput.positionCS;
|
||||
|
||||
#ifdef _NORMALMAP
|
||||
half3 viewDirWS = GetWorldSpaceViewDir(vertexInput.positionWS);
|
||||
output.normalWS = half4(normalInput.normalWS, viewDirWS.x);
|
||||
output.tangentWS = half4(normalInput.tangentWS, viewDirWS.y);
|
||||
output.bitangentWS = half4(normalInput.bitangentWS, viewDirWS.z);
|
||||
#else
|
||||
output.normalWS = NormalizeNormalPerVertex(normalInput.normalWS);
|
||||
#endif
|
||||
|
||||
OUTPUT_LIGHTMAP_UV(input.staticLightmapUV, unity_LightmapST, output.staticLightmapUV);
|
||||
#ifdef DYNAMICLIGHTMAP_ON
|
||||
output.dynamicLightmapUV = input.dynamicLightmapUV.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
|
||||
#endif
|
||||
OUTPUT_SH4(vertexInput.positionWS, output.normalWS.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), output.vertexSH, output.probeOcclusion);
|
||||
|
||||
#ifdef _ADDITIONAL_LIGHTS_VERTEX
|
||||
half3 vertexLight = VertexLighting(vertexInput.positionWS, normalInput.normalWS);
|
||||
output.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
|
||||
#else
|
||||
output.fogFactor = fogFactor;
|
||||
#endif
|
||||
|
||||
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
||||
output.shadowCoord = GetShadowCoord(vertexInput);
|
||||
#endif
|
||||
|
||||
SetOcclusionVertOutputs(input.positionOS, output.positionCS, output.objectPositionWS);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
// Used for StandardSimpleLighting shader
|
||||
void LitPassFragmentSimple(
|
||||
Varyings input
|
||||
, out half4 outColor : SV_Target0
|
||||
#ifdef _WRITE_RENDERING_LAYERS
|
||||
, out float4 outRenderingLayers : SV_Target1
|
||||
#endif
|
||||
)
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(input);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
|
||||
SurfaceData surfaceData;
|
||||
InitializeSimpleLitSurfaceData(input.uv, surfaceData);
|
||||
|
||||
#ifdef LOD_FADE_CROSSFADE
|
||||
LODFadeCrossFade(input.positionCS);
|
||||
#endif
|
||||
|
||||
InputData inputData;
|
||||
InitializeInputData(input, surfaceData.normalTS, inputData);
|
||||
SETUP_DEBUG_TEXTURE_DATA(inputData, UNDO_TRANSFORM_TEX(input.uv, _BaseMap));
|
||||
|
||||
#if defined(_DBUFFER)
|
||||
ApplyDecalToSurfaceData(input.positionCS, surfaceData, inputData);
|
||||
#endif
|
||||
|
||||
InitializeBakedGIData(input, inputData);
|
||||
|
||||
half4 color = UniversalFragmentBlinnPhong(inputData, surfaceData);
|
||||
color.rgb = MixFog(color.rgb, inputData.fogCoord);
|
||||
color.a = OutputAlpha(color.a, IsSurfaceTypeTransparent(_Surface));
|
||||
|
||||
SetOcclusion(input.objectPositionWS, color);
|
||||
|
||||
outColor = color;
|
||||
|
||||
#ifdef _WRITE_RENDERING_LAYERS
|
||||
uint renderingLayers = GetMeshRenderingLayer();
|
||||
outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 268c0a01b77e00e4980fcdfa657c2e95
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,56 @@
|
||||
float2 _NdcLinearConversionParameters;
|
||||
|
||||
float NormalizeWithinBounds(const float v, const float min, const float max)
|
||||
{
|
||||
return saturate((v - min) / (max - min));
|
||||
}
|
||||
|
||||
//symmetric range is [-1:1] (OpenGL)
|
||||
float ConvertDepthToSymmetricRange(const float depthNDC)
|
||||
{
|
||||
return depthNDC * 2.0 - 1.0;
|
||||
}
|
||||
|
||||
//non-symmetric range is [0:1] (Vulcan, DirectX, Metal)
|
||||
float ConvertDepthToNonSymmetricRange(const float depthNDC)
|
||||
{
|
||||
return (depthNDC + 1.0) * 0.5;
|
||||
}
|
||||
|
||||
float LinearizeDepth(const float symmetricRangeDepthNdc)
|
||||
{
|
||||
return _NdcLinearConversionParameters.x / (symmetricRangeDepthNdc + _NdcLinearConversionParameters.y);
|
||||
}
|
||||
|
||||
float LinearDepthToSymmetricRangeNDC(const float linearDepth)
|
||||
{
|
||||
return _NdcLinearConversionParameters.x / linearDepth - _NdcLinearConversionParameters.y;
|
||||
}
|
||||
|
||||
float4 DebugDepthDistance(const float linearDepth)
|
||||
{
|
||||
const float4 colors[9] =
|
||||
{
|
||||
float4(1, 1, 1, 1), // White, 0 meter
|
||||
float4(1, 0, 0, 1), // Red, 1 meter
|
||||
float4(1, 0.125, 0, 1), // Orange, 2 meters
|
||||
float4(1, 1, 0, 1), // Yellow, 3 meters
|
||||
float4(0, 1, 0, 1), // Green, 4 meters
|
||||
float4(0.5, 0.5, 0, 1), // Cyan, 5 meters
|
||||
float4(0, 0, 1, 1), // Blue, 6 meters
|
||||
float4(0.375, 0.375, 1, 1), // Magenta, 7 meters
|
||||
float4(0.7, 0.25, 1, 1) // Pink, 8 meters
|
||||
};
|
||||
|
||||
float step = 1;
|
||||
float tempD = step;
|
||||
|
||||
while (tempD < linearDepth && tempD < 10)
|
||||
{
|
||||
tempD += step;
|
||||
}
|
||||
|
||||
int colIndex = (int) (tempD / step) - 1;
|
||||
colIndex = clamp(colIndex, 0, 7);
|
||||
return lerp(colors[colIndex], colors[colIndex + 1], (1 - (tempD - linearDepth)) / step);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9df531dab4d0654c8c6415921314b82
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,116 @@
|
||||
Shader "AR/Occlusion"
|
||||
{
|
||||
// URP SubShader
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "12.0"
|
||||
}
|
||||
|
||||
Tags
|
||||
{
|
||||
"RenderType"="Opaque"
|
||||
"Queue" = "Geometry-1"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
ColorMask 0
|
||||
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
ZERO_INITIALIZE(v2f, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
o.vertex = TransformObjectToHClip(v.vertex.xyz);
|
||||
return o;
|
||||
}
|
||||
|
||||
real4 frag (v2f i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
return real4(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
// Built-in Render Pipeline Subshader
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Opaque" }
|
||||
Tags { "Queue" = "Geometry-1" }
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
ColorMask 0
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_OUTPUT(v2f, o);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
return fixed4(0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf76bda1af4d3a045ad7dcd8c4dd09f1
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,122 @@
|
||||
Shader "Unlit/PlaneShader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_Color ("Main Color", color) = (1, 1, 1, 1)
|
||||
_TexColorTint ("Texture Color", color) = (1, 1, 1, 1)
|
||||
}
|
||||
// URP SubShader
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "12.0"
|
||||
}
|
||||
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent" }
|
||||
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite Off
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _Color;
|
||||
float4 _TexColorTint;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
float4 finalColor = _Color;
|
||||
|
||||
float4 texCol = tex2D(_MainTex, i.uv);
|
||||
if (texCol.a != 0)
|
||||
{
|
||||
finalColor = _TexColorTint;
|
||||
}
|
||||
return finalColor;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
// Built-in Render Pipeline SubShader
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType"="Transparent" "RenderQueue"="Transparent" }
|
||||
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite Off
|
||||
Pass
|
||||
{
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
float4 _Color;
|
||||
float4 _TexColorTint;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = mul(UNITY_MATRIX_MVP, float4(v.vertex.xyz, 1.0));
|
||||
o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (const v2f i) : SV_Target
|
||||
{
|
||||
float4 finalColor = _Color;
|
||||
|
||||
float4 texCol = tex2D(_MainTex, i.uv);
|
||||
if (texCol.a != 0)
|
||||
{
|
||||
finalColor = _TexColorTint;
|
||||
}
|
||||
return finalColor;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1673c64b6fb331c4996dd1c3bdb61bdb
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,837 @@
|
||||
{
|
||||
"m_SGVersion": 3,
|
||||
"m_Type": "UnityEditor.ShaderGraph.GraphData",
|
||||
"m_ObjectId": "29e4d87130e145d6a2102d4ef414aa76",
|
||||
"m_Properties": [
|
||||
{
|
||||
"m_Id": "ddb4deba1665c2848837f2dee0f96367"
|
||||
}
|
||||
],
|
||||
"m_Keywords": [],
|
||||
"m_Dropdowns": [],
|
||||
"m_CategoryData": [
|
||||
{
|
||||
"m_Id": "5ccb374199114b3080c7a3c06cc9f073"
|
||||
}
|
||||
],
|
||||
"m_Nodes": [
|
||||
{
|
||||
"m_Id": "b7156b6c180eec83909a21d448e5f0ff"
|
||||
},
|
||||
{
|
||||
"m_Id": "9fd032fbfa178187a186331edf8e300d"
|
||||
},
|
||||
{
|
||||
"m_Id": "dd7d1a333a8f424d82209a261f8a8bf4"
|
||||
},
|
||||
{
|
||||
"m_Id": "ca028bd008094db495d08f183d9f8dbd"
|
||||
},
|
||||
{
|
||||
"m_Id": "ae92dd27c1fb4e34a0a76a7a96086bca"
|
||||
},
|
||||
{
|
||||
"m_Id": "acd5c3b1d74b419aba4a2744b7b939e3"
|
||||
},
|
||||
{
|
||||
"m_Id": "03a0b14afdea425a87be983abcc656e3"
|
||||
},
|
||||
{
|
||||
"m_Id": "1345c3962ad54b1d926409ea4a8f59e5"
|
||||
},
|
||||
{
|
||||
"m_Id": "6686c26a8b344edd972d8d1ad9c4a29a"
|
||||
}
|
||||
],
|
||||
"m_GroupDatas": [],
|
||||
"m_StickyNoteDatas": [
|
||||
{
|
||||
"m_Id": "8db3a3ccf5ac4d2b9e9f3015c7f6ca57"
|
||||
}
|
||||
],
|
||||
"m_Edges": [
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "6686c26a8b344edd972d8d1ad9c4a29a"
|
||||
},
|
||||
"m_SlotId": 4
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "9fd032fbfa178187a186331edf8e300d"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "9fd032fbfa178187a186331edf8e300d"
|
||||
},
|
||||
"m_SlotId": 1
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "03a0b14afdea425a87be983abcc656e3"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "b7156b6c180eec83909a21d448e5f0ff"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "acd5c3b1d74b419aba4a2744b7b939e3"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"m_VertexContext": {
|
||||
"m_Position": {
|
||||
"x": -123.99999237060547,
|
||||
"y": -144.00001525878907
|
||||
},
|
||||
"m_Blocks": [
|
||||
{
|
||||
"m_Id": "dd7d1a333a8f424d82209a261f8a8bf4"
|
||||
},
|
||||
{
|
||||
"m_Id": "ca028bd008094db495d08f183d9f8dbd"
|
||||
},
|
||||
{
|
||||
"m_Id": "ae92dd27c1fb4e34a0a76a7a96086bca"
|
||||
}
|
||||
]
|
||||
},
|
||||
"m_FragmentContext": {
|
||||
"m_Position": {
|
||||
"x": -123.99999237060547,
|
||||
"y": 55.99998474121094
|
||||
},
|
||||
"m_Blocks": [
|
||||
{
|
||||
"m_Id": "acd5c3b1d74b419aba4a2744b7b939e3"
|
||||
},
|
||||
{
|
||||
"m_Id": "03a0b14afdea425a87be983abcc656e3"
|
||||
},
|
||||
{
|
||||
"m_Id": "1345c3962ad54b1d926409ea4a8f59e5"
|
||||
}
|
||||
]
|
||||
},
|
||||
"m_PreviewData": {
|
||||
"serializedMesh": {
|
||||
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
|
||||
"m_Guid": ""
|
||||
},
|
||||
"preventRotation": false
|
||||
},
|
||||
"m_Path": "Shader Graphs",
|
||||
"m_GraphPrecision": 0,
|
||||
"m_PreviewMode": 2,
|
||||
"m_OutputNode": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_ActiveTargets": [
|
||||
{
|
||||
"m_Id": "8e75d3fd6f5047e992cecfedf66b18aa"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "03a0b14afdea425a87be983abcc656e3",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.Alpha",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "bdbbb096db1742928b68859200775950"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.Alpha"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "1345c3962ad54b1d926409ea4a8f59e5",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.AlphaClipThreshold",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "aeb0f0d12075460fbd247ee4a7745b86"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
|
||||
"m_ObjectId": "1b7dbff5829e4f19905eac674edb025e",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Base Color",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "BaseColor",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": {
|
||||
"x": 0.7353569269180298,
|
||||
"y": 0.7353569269180298,
|
||||
"z": 0.7353569269180298
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_ColorMode": 0,
|
||||
"m_DefaultColor": {
|
||||
"r": 0.5,
|
||||
"g": 0.5,
|
||||
"b": 0.5,
|
||||
"a": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
|
||||
"m_ObjectId": "22c0276bae1d4c9faa73da85e2f7d86d",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Normal",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Normal",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 2,
|
||||
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget",
|
||||
"m_ObjectId": "2a6625aaa3ed4cc5bae4c6c3cef6cbe3"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "5ccb374199114b3080c7a3c06cc9f073",
|
||||
"m_Name": "",
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "ddb4deba1665c2848837f2dee0f96367"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.SubGraphNode",
|
||||
"m_ObjectId": "6686c26a8b344edd972d8d1ad9c4a29a",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Main Light Shadows",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -655.0,
|
||||
"y": 294.0000305175781,
|
||||
"width": 242.00003051757813,
|
||||
"height": 302.0000305175781
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "6e653e432ed64968b836f71a679c760e"
|
||||
},
|
||||
{
|
||||
"m_Id": "7a382769fb3945b38d4bcea0d38db406"
|
||||
},
|
||||
{
|
||||
"m_Id": "cdfa98b33bff46bd9bf50959fca10376"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedSubGraph": "{\n \"subGraph\": {\n \"fileID\": -5475051401550479605,\n \"guid\": \"ad7eea367bef08f4684356c8a5513abf\",\n \"type\": 3\n }\n}",
|
||||
"m_PropertyGuids": [
|
||||
"c7b957cd-dd93-4549-bd10-7676ba0773f3",
|
||||
"759c9413-cc1d-418d-861f-42108b837a20"
|
||||
],
|
||||
"m_PropertyIds": [
|
||||
133537113,
|
||||
69846019
|
||||
],
|
||||
"m_Dropdowns": [],
|
||||
"m_DropdownSelectedEntries": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
|
||||
"m_ObjectId": "6e653e432ed64968b836f71a679c760e",
|
||||
"m_Id": 133537113,
|
||||
"m_DisplayName": "Position",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Vector3_B87D7B6B",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "70ac43b88afc7489848cafb130a0e869",
|
||||
"m_Id": 1,
|
||||
"m_DisplayName": "Out",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
|
||||
"m_ObjectId": "7a382769fb3945b38d4bcea0d38db406",
|
||||
"m_Id": 69846019,
|
||||
"m_DisplayName": "Shadowmask",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "_Shadowmask",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 1.0,
|
||||
"w": 1.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
|
||||
"m_ObjectId": "81fa076018a4408083a6d50cc1e3f1ac",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Position",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Position",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.StickyNoteData",
|
||||
"m_ObjectId": "8db3a3ccf5ac4d2b9e9f3015c7f6ca57",
|
||||
"m_Title": "",
|
||||
"m_Content": "Used to create transparent objects that can recieve shadows and colour them\n\nRecommended to turn off Cast Shadows on Mesh Renderer",
|
||||
"m_TextSize": 0,
|
||||
"m_Theme": 0,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -137.0,
|
||||
"y": 257.0,
|
||||
"width": 245.0,
|
||||
"height": 116.0
|
||||
},
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
|
||||
"m_ObjectId": "8e75d3fd6f5047e992cecfedf66b18aa",
|
||||
"m_Datas": [],
|
||||
"m_ActiveSubTarget": {
|
||||
"m_Id": "2a6625aaa3ed4cc5bae4c6c3cef6cbe3"
|
||||
},
|
||||
"m_AllowMaterialOverride": false,
|
||||
"m_SurfaceType": 1,
|
||||
"m_ZTestMode": 4,
|
||||
"m_ZWriteControl": 0,
|
||||
"m_AlphaMode": 3,
|
||||
"m_RenderFace": 2,
|
||||
"m_AlphaClip": false,
|
||||
"m_CastShadows": true,
|
||||
"m_ReceiveShadows": true,
|
||||
"m_SupportsLODCrossFade": false,
|
||||
"m_CustomEditorGUI": "",
|
||||
"m_SupportVFX": false
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
|
||||
"m_ObjectId": "8eefb7b5f9143687836e492a24fee881",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Color",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.OneMinusNode",
|
||||
"m_ObjectId": "9fd032fbfa178187a186331edf8e300d",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "One Minus",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -380.00006103515627,
|
||||
"y": 155.99998474121095,
|
||||
"width": 128.00003051757813,
|
||||
"height": 94.00001525878906
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "d0fd6e8f9b479d80beb8cfdea726fe29"
|
||||
},
|
||||
{
|
||||
"m_Id": "70ac43b88afc7489848cafb130a0e869"
|
||||
}
|
||||
],
|
||||
"synonyms": [
|
||||
"complement",
|
||||
"invert",
|
||||
"opposite"
|
||||
],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": false,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
|
||||
"m_ObjectId": "a2058cb25a0847ff867f3ac2c2f271a3",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Tangent",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Tangent",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "acd5c3b1d74b419aba4a2744b7b939e3",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.BaseColor",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "1b7dbff5829e4f19905eac674edb025e"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "ae92dd27c1fb4e34a0a76a7a96086bca",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Tangent",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "a2058cb25a0847ff867f3ac2c2f271a3"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Tangent"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "aeb0f0d12075460fbd247ee4a7745b86",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Alpha Clip Threshold",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "AlphaClipThreshold",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": 0.0,
|
||||
"m_DefaultValue": 0.5,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
|
||||
"m_ObjectId": "b7156b6c180eec83909a21d448e5f0ff",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Property",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -399.0000915527344,
|
||||
"y": 82.0,
|
||||
"width": 105.0,
|
||||
"height": 34.00000762939453
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "8eefb7b5f9143687836e492a24fee881"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_Property": {
|
||||
"m_Id": "ddb4deba1665c2848837f2dee0f96367"
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "bdbbb096db1742928b68859200775950",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Alpha",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Alpha",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": 1.0,
|
||||
"m_DefaultValue": 1.0,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "ca028bd008094db495d08f183d9f8dbd",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Normal",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "22c0276bae1d4c9faa73da85e2f7d86d"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Normal"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "cdfa98b33bff46bd9bf50959fca10376",
|
||||
"m_Id": 4,
|
||||
"m_DisplayName": "ShadowAtten",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "ShadowAtten",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": 0.0,
|
||||
"m_DefaultValue": 0.0,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "d0fd6e8f9b479d80beb8cfdea726fe29",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "In",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "In",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 1.0,
|
||||
"w": 1.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "dd7d1a333a8f424d82209a261f8a8bf4",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Position",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "81fa076018a4408083a6d50cc1e3f1ac"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Position"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 3,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty",
|
||||
"m_ObjectId": "ddb4deba1665c2848837f2dee0f96367",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "81878459-0b64-4744-a302-ae3c2a257259"
|
||||
},
|
||||
"m_Name": "Color",
|
||||
"m_DefaultRefNameVersion": 0,
|
||||
"m_RefNameGeneratedByDisplayName": "",
|
||||
"m_DefaultReferenceName": "Color_A34449EB",
|
||||
"m_OverrideReferenceName": "_ShadowColor",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": {
|
||||
"r": 0.0,
|
||||
"g": 0.0,
|
||||
"b": 0.0,
|
||||
"a": 0.10196078568696976
|
||||
},
|
||||
"isMainColor": false,
|
||||
"m_ColorMode": 0
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3eee307ff8451c40a6e35e74df26fd1
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e2a84dc6fa41024bb55dd6ad0179b02
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,781 @@
|
||||
{
|
||||
"m_SGVersion": 3,
|
||||
"m_Type": "UnityEditor.ShaderGraph.GraphData",
|
||||
"m_ObjectId": "6ccc676f731a493fafa9835286dfc528",
|
||||
"m_Properties": [
|
||||
{
|
||||
"m_Id": "7ea1bbbacf460c879f6d8c85fd91750d"
|
||||
},
|
||||
{
|
||||
"m_Id": "f0e0b7c9dc84459b9872e8ec2c4fb3ca"
|
||||
}
|
||||
],
|
||||
"m_Keywords": [
|
||||
{
|
||||
"m_Id": "fd52011850ba44c28114430ca2d357f2"
|
||||
},
|
||||
{
|
||||
"m_Id": "70080533ec814c13a94c4028ed1d264b"
|
||||
}
|
||||
],
|
||||
"m_Dropdowns": [],
|
||||
"m_CategoryData": [
|
||||
{
|
||||
"m_Id": "1a0133ec0b7148738854ac5fbfdb06c6"
|
||||
}
|
||||
],
|
||||
"m_Nodes": [
|
||||
{
|
||||
"m_Id": "0f043bb7e9b9d1849a740f31c19b79a8"
|
||||
},
|
||||
{
|
||||
"m_Id": "3be2118d2270ff818ec5f0f1353e249f"
|
||||
},
|
||||
{
|
||||
"m_Id": "65e443cb15a9fb859a50ebae06e81569"
|
||||
},
|
||||
{
|
||||
"m_Id": "4f79f9fd24d2450fbfd056685c845f8a"
|
||||
},
|
||||
{
|
||||
"m_Id": "a73253d1c5e2424c89b6af884a7eb179"
|
||||
},
|
||||
{
|
||||
"m_Id": "3a2eacd6e269401591082a237182fdb5"
|
||||
}
|
||||
],
|
||||
"m_GroupDatas": [],
|
||||
"m_StickyNoteDatas": [],
|
||||
"m_Edges": [
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "3a2eacd6e269401591082a237182fdb5"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "3be2118d2270ff818ec5f0f1353e249f"
|
||||
},
|
||||
"m_SlotId": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "3be2118d2270ff818ec5f0f1353e249f"
|
||||
},
|
||||
"m_SlotId": 4
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "0f043bb7e9b9d1849a740f31c19b79a8"
|
||||
},
|
||||
"m_SlotId": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "4f79f9fd24d2450fbfd056685c845f8a"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "a73253d1c5e2424c89b6af884a7eb179"
|
||||
},
|
||||
"m_SlotId": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "65e443cb15a9fb859a50ebae06e81569"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "a73253d1c5e2424c89b6af884a7eb179"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "65e443cb15a9fb859a50ebae06e81569"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "a73253d1c5e2424c89b6af884a7eb179"
|
||||
},
|
||||
"m_SlotId": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "a73253d1c5e2424c89b6af884a7eb179"
|
||||
},
|
||||
"m_SlotId": 3
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "3be2118d2270ff818ec5f0f1353e249f"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"m_VertexContext": {
|
||||
"m_Position": {
|
||||
"x": 259.0,
|
||||
"y": -74.0
|
||||
},
|
||||
"m_Blocks": []
|
||||
},
|
||||
"m_FragmentContext": {
|
||||
"m_Position": {
|
||||
"x": 259.0,
|
||||
"y": 126.0
|
||||
},
|
||||
"m_Blocks": []
|
||||
},
|
||||
"m_PreviewData": {
|
||||
"serializedMesh": {
|
||||
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
|
||||
"m_Guid": ""
|
||||
},
|
||||
"preventRotation": false
|
||||
},
|
||||
"m_Path": "Custom Lighting",
|
||||
"m_GraphPrecision": 0,
|
||||
"m_PreviewMode": 2,
|
||||
"m_OutputNode": {
|
||||
"m_Id": "0f043bb7e9b9d1849a740f31c19b79a8"
|
||||
},
|
||||
"m_ActiveTargets": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.SubGraphOutputNode",
|
||||
"m_ObjectId": "0f043bb7e9b9d1849a740f31c19b79a8",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Out_Vector1",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 276.0,
|
||||
"y": -74.0,
|
||||
"width": 124.0,
|
||||
"height": 77.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "dc6b8c814bcd455ea664442a17ea0a5d"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"IsFirstSlotValid": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "1a0133ec0b7148738854ac5fbfdb06c6",
|
||||
"m_Name": "",
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "7ea1bbbacf460c879f6d8c85fd91750d"
|
||||
},
|
||||
{
|
||||
"m_Id": "f0e0b7c9dc84459b9872e8ec2c4fb3ca"
|
||||
},
|
||||
{
|
||||
"m_Id": "70080533ec814c13a94c4028ed1d264b"
|
||||
},
|
||||
{
|
||||
"m_Id": "fd52011850ba44c28114430ca2d357f2"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "2199b9343e174d67a2318f82273ee63c",
|
||||
"m_Id": 1,
|
||||
"m_DisplayName": "Connected",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Connected",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 1.0,
|
||||
"w": 1.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
|
||||
"m_ObjectId": "257887c1d11f388091ca856e82012ef9",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "World Pos",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "WorldPos",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [
|
||||
"X",
|
||||
"Y",
|
||||
"Z"
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
|
||||
"m_ObjectId": "282df091de7a41d8a8463afa0fa70234",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Out",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
|
||||
"m_ObjectId": "3a2eacd6e269401591082a237182fdb5",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Property",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -213.00001525878907,
|
||||
"y": 136.0,
|
||||
"width": 147.00003051757813,
|
||||
"height": 33.999969482421878
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "c7fb942196dd45ce8f0e9fc62e8817ba"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 2,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_Property": {
|
||||
"m_Id": "f0e0b7c9dc84459b9872e8ec2c4fb3ca"
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CustomFunctionNode",
|
||||
"m_ObjectId": "3be2118d2270ff818ec5f0f1353e249f",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "MainLightShadows (Custom Function)",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 12.99996566772461,
|
||||
"y": -74.0,
|
||||
"width": 229.00001525878907,
|
||||
"height": 350.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "257887c1d11f388091ca856e82012ef9"
|
||||
},
|
||||
{
|
||||
"m_Id": "b1d45983685a4101a2c1fffb3a369391"
|
||||
},
|
||||
{
|
||||
"m_Id": "5db4eed2e36d7488a62403610a345235"
|
||||
}
|
||||
],
|
||||
"synonyms": [
|
||||
"code",
|
||||
"HLSL"
|
||||
],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SourceType": 0,
|
||||
"m_FunctionName": "MainLightShadows",
|
||||
"m_FunctionSource": "d3bbf75de25043a43acec26cc1d92a5c",
|
||||
"m_FunctionBody": "Enter function body here..."
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PositionNode",
|
||||
"m_ObjectId": "4f79f9fd24d2450fbfd056685c845f8a",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Position",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -510.0,
|
||||
"y": -103.0,
|
||||
"width": 206.0,
|
||||
"height": 131.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "282df091de7a41d8a8463afa0fa70234"
|
||||
}
|
||||
],
|
||||
"synonyms": [
|
||||
"location"
|
||||
],
|
||||
"m_Precision": 1,
|
||||
"m_PreviewExpanded": false,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 2,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_Space": 2,
|
||||
"m_PositionSource": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PropertyConnectionStateMaterialSlot",
|
||||
"m_ObjectId": "5084da4ba599400c990d8f8757a85a44",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Input",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Input",
|
||||
"m_StageCapability": 3
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "5db4eed2e36d7488a62403610a345235",
|
||||
"m_Id": 4,
|
||||
"m_DisplayName": "Shadow Atten",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "ShadowAtten",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": 0.0,
|
||||
"m_DefaultValue": 0.0,
|
||||
"m_Labels": [
|
||||
"X"
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
|
||||
"m_ObjectId": "65e443cb15a9fb859a50ebae06e81569",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Property",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -451.0,
|
||||
"y": -157.99998474121095,
|
||||
"width": 119.0,
|
||||
"height": 34.000022888183597
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "7d190f51c889ce8198ca0ecfe494d421"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_Property": {
|
||||
"m_Id": "7ea1bbbacf460c879f6d8c85fd91750d"
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ShaderKeyword",
|
||||
"m_ObjectId": "70080533ec814c13a94c4028ed1d264b",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "3678795c-ea8d-481d-ba86-f0b64554d241"
|
||||
},
|
||||
"m_Name": "Shadows Enum",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Shadows Enum",
|
||||
"m_DefaultReferenceName": "_SHADOWS_ENUM",
|
||||
"m_OverrideReferenceName": "_MAIN_LIGHT",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_KeywordType": 1,
|
||||
"m_KeywordDefinition": 1,
|
||||
"m_KeywordScope": 1,
|
||||
"m_KeywordStages": 63,
|
||||
"m_Entries": [
|
||||
{
|
||||
"id": 1,
|
||||
"displayName": "SHADOWS",
|
||||
"referenceName": "SHADOWS"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"displayName": "SHADOWS_CASCADE",
|
||||
"referenceName": "SHADOWS_CASCADE"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"displayName": "SHADOWS_SCREEN",
|
||||
"referenceName": "SHADOWS_SCREEN"
|
||||
}
|
||||
],
|
||||
"m_Value": 0,
|
||||
"m_IsEditable": true
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot",
|
||||
"m_ObjectId": "7d190f51c889ce8198ca0ecfe494d421",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Position",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [
|
||||
"X",
|
||||
"Y",
|
||||
"Z"
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector3ShaderProperty",
|
||||
"m_ObjectId": "7ea1bbbacf460c879f6d8c85fd91750d",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "c7b957cd-dd93-4549-bd10-7676ba0773f3"
|
||||
},
|
||||
"m_Name": "Position",
|
||||
"m_DefaultRefNameVersion": 0,
|
||||
"m_RefNameGeneratedByDisplayName": "",
|
||||
"m_DefaultReferenceName": "Vector3_B87D7B6B",
|
||||
"m_OverrideReferenceName": "",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": true,
|
||||
"m_CustomSlotLabel": "World Space",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "a1ca80e42f7045488e6db2a2a054ffff",
|
||||
"m_Id": 3,
|
||||
"m_DisplayName": "Out",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BranchOnInputConnectionNode",
|
||||
"m_ObjectId": "a73253d1c5e2424c89b6af884a7eb179",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Branch On Input Connection",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -274.0,
|
||||
"y": -98.0,
|
||||
"width": 207.99998474121095,
|
||||
"height": 326.0000305175781
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "5084da4ba599400c990d8f8757a85a44"
|
||||
},
|
||||
{
|
||||
"m_Id": "2199b9343e174d67a2318f82273ee63c"
|
||||
},
|
||||
{
|
||||
"m_Id": "d320e64b77e647b78f623c4569bcd9cc"
|
||||
},
|
||||
{
|
||||
"m_Id": "a1ca80e42f7045488e6db2a2a054ffff"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
|
||||
"m_ObjectId": "b1d45983685a4101a2c1fffb3a369391",
|
||||
"m_Id": 5,
|
||||
"m_DisplayName": "Shadowmask",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Shadowmask",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
|
||||
"m_ObjectId": "c7fb942196dd45ce8f0e9fc62e8817ba",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Shadowmask",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "d320e64b77e647b78f623c4569bcd9cc",
|
||||
"m_Id": 2,
|
||||
"m_DisplayName": "NotConnected",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "NotConnected",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "dc6b8c814bcd455ea664442a17ea0a5d",
|
||||
"m_Id": 4,
|
||||
"m_DisplayName": "ShadowAtten",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "ShadowAtten",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": 0.0,
|
||||
"m_DefaultValue": 0.0,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector4ShaderProperty",
|
||||
"m_ObjectId": "f0e0b7c9dc84459b9872e8ec2c4fb3ca",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "759c9413-cc1d-418d-861f-42108b837a20"
|
||||
},
|
||||
"m_Name": "Shadowmask",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Shadowmask",
|
||||
"m_DefaultReferenceName": "_Shadowmask",
|
||||
"m_OverrideReferenceName": "",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 2,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 1.0,
|
||||
"w": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ShaderKeyword",
|
||||
"m_ObjectId": "fd52011850ba44c28114430ca2d357f2",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "4cdeb2ff-a6fa-4fcb-8108-78394fdebc34"
|
||||
},
|
||||
"m_Name": "Shadows Soft",
|
||||
"m_DefaultRefNameVersion": 0,
|
||||
"m_RefNameGeneratedByDisplayName": "",
|
||||
"m_DefaultReferenceName": "BOOLEAN_71BC2F5C_ON",
|
||||
"m_OverrideReferenceName": "_SHADOWS_SOFT",
|
||||
"m_GeneratePropertyBlock": false,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_KeywordType": 0,
|
||||
"m_KeywordDefinition": 1,
|
||||
"m_KeywordScope": 1,
|
||||
"m_KeywordStages": 2,
|
||||
"m_Entries": [],
|
||||
"m_Value": 0,
|
||||
"m_IsEditable": true
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad7eea367bef08f4684356c8a5513abf
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 60072b568d64c40a485e0fc55012dc9f, type: 3}
|
||||
@@ -0,0 +1,102 @@
|
||||
Shader "SpatialFramework/Textured Fresnel/Standard"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_EdgeColor("Edge Color", COLOR) = (1,1,1,1)
|
||||
_Color("Color", COLOR) = (.25,.25,.25,.25)
|
||||
_EdgeData("Edge min, max, S-strength, S-Blend", VECTOR) = (0, 0.85, 0.5, 1)
|
||||
_MainTex("Texture", 2D) = "white" {}
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
// First, we do a stencil like technique of writing depth of the model,
|
||||
// so we don't have any transparent overdraw in subsequent steps
|
||||
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
|
||||
Pass
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderType" = "Transparent"
|
||||
"Queue" = "Transparent"
|
||||
"LightMode" = "UniversalForward"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
LOD 100
|
||||
|
||||
Name "Depth Fill"
|
||||
Blend One One
|
||||
Lighting Off
|
||||
ZTest Less
|
||||
Offset -1, 0
|
||||
|
||||
ColorMask 0
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment fragEmpty
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "TexturedStableFresnelCommon.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderType" = "Transparent"
|
||||
"Queue" = "Transparent"
|
||||
"LightMode" = "Always"
|
||||
}
|
||||
LOD 100
|
||||
|
||||
Name "Depth Fill"
|
||||
Blend One One
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
Offset -1, 0
|
||||
|
||||
ColorMask 0
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment fragEmpty
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "TexturedStableFresnelCommon.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Next, fill in with the base and rim color
|
||||
Pass
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderType" = "Transparent"
|
||||
"Queue" = "Transparent"
|
||||
}
|
||||
|
||||
Name "Fresnel Color"
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite Off
|
||||
Offset -1, 0
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment fragRimShader
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "TexturedStableFresnelCommon.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e723135b0fd1e34ba403dc074c61877
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,54 @@
|
||||
#ifndef STABLE_FRESNEL_COMMON
|
||||
#define STABLE_FRESNEL_COMMON
|
||||
|
||||
half4 _EdgeColor; // Color and alpha of the fresnel effect
|
||||
half4 _Color; // Color and alpha of the base of the object
|
||||
half4 _EdgeData; // Min, Max, Power, Blend values
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
struct appdata_fresnel
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
|
||||
float2 uv : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct fresnel_vertex
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float3 worldPos : TEXCOORD0;
|
||||
float3 worldNormal : TEXCOORD1;
|
||||
float2 uv : TEXCOORD2;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
fresnel_vertex vert(appdata_fresnel v)
|
||||
{
|
||||
fresnel_vertex o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
o.uv = o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
|
||||
o.worldNormal = UnityObjectToWorldNormal(v.normal);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 fragEmpty(fresnel_vertex i) : COLOR
|
||||
{
|
||||
return half4(0,0,0,1);
|
||||
}
|
||||
|
||||
half4 fragRimShader(fresnel_vertex i) : COLOR
|
||||
{
|
||||
half3 worldViewDir = normalize(UnityWorldSpaceViewDir(i.worldPos));
|
||||
half rim = saturate(((1.0 - saturate(dot(normalize(worldViewDir), i.worldNormal))) - _EdgeData.x) / (_EdgeData.y - _EdgeData.x));
|
||||
half processedRim = (3 + _EdgeData.z) * pow(rim, _EdgeData.z + 1) - (2 + _EdgeData.z) * pow(rim, _EdgeData.z + 2);
|
||||
return lerp(_Color, _EdgeColor, lerp(rim, processedRim, _EdgeData.w)) * tex2D(_MainTex, i.uv).rgba;
|
||||
}
|
||||
|
||||
#endif // STABLE_FRESNEL_COMMON
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e993ba3aff41e5449030adfcd2d5525
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72b70a85e28db11498d5206a5d9bbab6
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
@@ -0,0 +1,817 @@
|
||||
{
|
||||
"m_SGVersion": 3,
|
||||
"m_Type": "UnityEditor.ShaderGraph.GraphData",
|
||||
"m_ObjectId": "8161ad8aa258493baa5f166ef3ca8501",
|
||||
"m_Properties": [
|
||||
{
|
||||
"m_Id": "c45b522280874a35a24d4181ebc364a4"
|
||||
}
|
||||
],
|
||||
"m_Keywords": [],
|
||||
"m_Dropdowns": [],
|
||||
"m_CategoryData": [
|
||||
{
|
||||
"m_Id": "d53bdf617595482b9f47d2f4d8b69eb4"
|
||||
}
|
||||
],
|
||||
"m_Nodes": [
|
||||
{
|
||||
"m_Id": "d1e2323ac363467eb284de887e51fa1a"
|
||||
},
|
||||
{
|
||||
"m_Id": "6a2b3eb6f083493f8c641bbd405344b0"
|
||||
},
|
||||
{
|
||||
"m_Id": "789166c4d868437e91f71e24d5e9ab7e"
|
||||
},
|
||||
{
|
||||
"m_Id": "54da0ef9e4bd404898db594f4599e0c3"
|
||||
},
|
||||
{
|
||||
"m_Id": "8f4342f261bd4206b5d33d99eb111bbf"
|
||||
},
|
||||
{
|
||||
"m_Id": "15ccb1b4a1ae462182ee6089d773e14e"
|
||||
},
|
||||
{
|
||||
"m_Id": "052e5a62ddbd4673b69ea59e5b25d39d"
|
||||
},
|
||||
{
|
||||
"m_Id": "cc1024fa9e994fffab3cec1211cebe4e"
|
||||
},
|
||||
{
|
||||
"m_Id": "ae545c5bddc542808590ed752526c04d"
|
||||
}
|
||||
],
|
||||
"m_GroupDatas": [],
|
||||
"m_StickyNoteDatas": [],
|
||||
"m_Edges": [
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "052e5a62ddbd4673b69ea59e5b25d39d"
|
||||
},
|
||||
"m_SlotId": 2
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "54da0ef9e4bd404898db594f4599e0c3"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "8f4342f261bd4206b5d33d99eb111bbf"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "ae545c5bddc542808590ed752526c04d"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "ae545c5bddc542808590ed752526c04d"
|
||||
},
|
||||
"m_SlotId": 1
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "052e5a62ddbd4673b69ea59e5b25d39d"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"m_OutputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "cc1024fa9e994fffab3cec1211cebe4e"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
},
|
||||
"m_InputSlot": {
|
||||
"m_Node": {
|
||||
"m_Id": "15ccb1b4a1ae462182ee6089d773e14e"
|
||||
},
|
||||
"m_SlotId": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"m_VertexContext": {
|
||||
"m_Position": {
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
},
|
||||
"m_Blocks": [
|
||||
{
|
||||
"m_Id": "d1e2323ac363467eb284de887e51fa1a"
|
||||
},
|
||||
{
|
||||
"m_Id": "6a2b3eb6f083493f8c641bbd405344b0"
|
||||
},
|
||||
{
|
||||
"m_Id": "789166c4d868437e91f71e24d5e9ab7e"
|
||||
}
|
||||
]
|
||||
},
|
||||
"m_FragmentContext": {
|
||||
"m_Position": {
|
||||
"x": -92.99998474121094,
|
||||
"y": 317.0
|
||||
},
|
||||
"m_Blocks": [
|
||||
{
|
||||
"m_Id": "54da0ef9e4bd404898db594f4599e0c3"
|
||||
},
|
||||
{
|
||||
"m_Id": "15ccb1b4a1ae462182ee6089d773e14e"
|
||||
}
|
||||
]
|
||||
},
|
||||
"m_PreviewData": {
|
||||
"serializedMesh": {
|
||||
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
|
||||
"m_Guid": ""
|
||||
},
|
||||
"preventRotation": false
|
||||
},
|
||||
"m_Path": "Shader Graphs",
|
||||
"m_GraphPrecision": 1,
|
||||
"m_PreviewMode": 2,
|
||||
"m_OutputNode": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_ActiveTargets": [
|
||||
{
|
||||
"m_Id": "3c24fb95c9524616aca09c695d57c00c"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "007d686f520c4313b5013407fff5eb1b",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Alpha",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Alpha",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": 1.0,
|
||||
"m_DefaultValue": 1.0,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PowerNode",
|
||||
"m_ObjectId": "052e5a62ddbd4673b69ea59e5b25d39d",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Power",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -407.3299865722656,
|
||||
"y": 239.37249755859376,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "8be4c0072d694ac7ba56199cfc65786d"
|
||||
},
|
||||
{
|
||||
"m_Id": "9c441516487345aeb0650806dd8462c3"
|
||||
},
|
||||
{
|
||||
"m_Id": "57e7022448fa48a885f3c93ba07d2edc"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "15ccb1b4a1ae462182ee6089d773e14e",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.Alpha",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "007d686f520c4313b5013407fff5eb1b"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.Alpha"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 2,
|
||||
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget",
|
||||
"m_ObjectId": "1c2a5143c76a4a66992a99c973aa37c1"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "21090b1dc6664d9c95dc4b20ca2fa5ed",
|
||||
"m_Id": 1,
|
||||
"m_DisplayName": "Out",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
|
||||
"m_ObjectId": "3c24fb95c9524616aca09c695d57c00c",
|
||||
"m_Datas": [],
|
||||
"m_ActiveSubTarget": {
|
||||
"m_Id": "1c2a5143c76a4a66992a99c973aa37c1"
|
||||
},
|
||||
"m_AllowMaterialOverride": false,
|
||||
"m_SurfaceType": 1,
|
||||
"m_ZTestMode": 4,
|
||||
"m_ZWriteControl": 0,
|
||||
"m_AlphaMode": 0,
|
||||
"m_RenderFace": 2,
|
||||
"m_AlphaClip": false,
|
||||
"m_CastShadows": true,
|
||||
"m_ReceiveShadows": true,
|
||||
"m_SupportsLODCrossFade": false,
|
||||
"m_CustomEditorGUI": "",
|
||||
"m_SupportVFX": false
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "54da0ef9e4bd404898db594f4599e0c3",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "SurfaceDescription.BaseColor",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "800af8fb2a384fd1a60795f3ecba0278"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "57e7022448fa48a885f3c93ba07d2edc",
|
||||
"m_Id": 2,
|
||||
"m_DisplayName": "Out",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "6a2b3eb6f083493f8c641bbd405344b0",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Normal",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "abbeeefa7ecd4df7bd8ca3ef36f3efb5"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Normal"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "789166c4d868437e91f71e24d5e9ab7e",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Tangent",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "9ed41208c9c041b392eebb4e16dc6af0"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Tangent"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
|
||||
"m_ObjectId": "800af8fb2a384fd1a60795f3ecba0278",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Base Color",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "BaseColor",
|
||||
"m_StageCapability": 2,
|
||||
"m_Value": {
|
||||
"x": 0.5,
|
||||
"y": 0.5,
|
||||
"z": 0.5
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_ColorMode": 0,
|
||||
"m_DefaultColor": {
|
||||
"r": 0.5,
|
||||
"g": 0.5,
|
||||
"b": 0.5,
|
||||
"a": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "8be4c0072d694ac7ba56199cfc65786d",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "A",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "A",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.VertexColorNode",
|
||||
"m_ObjectId": "8f4342f261bd4206b5d33d99eb111bbf",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Vertex Color",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -1139.0,
|
||||
"y": 238.99998474121095,
|
||||
"width": 208.0,
|
||||
"height": 278.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "e8e2488838da4a839f59ec769fa47706"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 2,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
|
||||
"m_ObjectId": "94639ec76287419cbf62300d609c783c",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Alpha",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": 0.0,
|
||||
"m_DefaultValue": 0.0,
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "9c441516487345aeb0650806dd8462c3",
|
||||
"m_Id": 1,
|
||||
"m_DisplayName": "B",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "B",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 2.200000047683716,
|
||||
"y": 2.200000047683716,
|
||||
"z": 2.200000047683716,
|
||||
"w": 2.200000047683716
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
|
||||
"m_ObjectId": "9ed41208c9c041b392eebb4e16dc6af0",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Tangent",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Tangent",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
|
||||
"m_ObjectId": "abbeeefa7ecd4df7bd8ca3ef36f3efb5",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Normal",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Normal",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.AbsoluteNode",
|
||||
"m_ObjectId": "ae545c5bddc542808590ed752526c04d",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Absolute",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -903.0,
|
||||
"y": 238.99998474121095,
|
||||
"width": 208.0,
|
||||
"height": 278.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "fcadf8d9695149dd9edc71eca0652ab2"
|
||||
},
|
||||
{
|
||||
"m_Id": "21090b1dc6664d9c95dc4b20ca2fa5ed"
|
||||
}
|
||||
],
|
||||
"synonyms": [
|
||||
"positive"
|
||||
],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 1,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
|
||||
"m_ObjectId": "c45b522280874a35a24d4181ebc364a4",
|
||||
"m_Guid": {
|
||||
"m_GuidSerialized": "755109f7-9d61-48c6-8367-3be1f8dd0861"
|
||||
},
|
||||
"m_Name": "Alpha",
|
||||
"m_DefaultRefNameVersion": 1,
|
||||
"m_RefNameGeneratedByDisplayName": "Alpha",
|
||||
"m_DefaultReferenceName": "_Alpha",
|
||||
"m_OverrideReferenceName": "",
|
||||
"m_GeneratePropertyBlock": true,
|
||||
"m_UseCustomSlotLabel": false,
|
||||
"m_CustomSlotLabel": "",
|
||||
"m_DismissedVersion": 0,
|
||||
"m_Precision": 0,
|
||||
"overrideHLSLDeclaration": false,
|
||||
"hlslDeclarationOverride": 0,
|
||||
"m_Hidden": false,
|
||||
"m_Value": 1.0,
|
||||
"m_FloatType": 0,
|
||||
"m_RangeValues": {
|
||||
"x": 0.0,
|
||||
"y": 1.0
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
|
||||
"m_ObjectId": "cc1024fa9e994fffab3cec1211cebe4e",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "Property",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": -1139.0,
|
||||
"y": 137.0,
|
||||
"width": 105.0,
|
||||
"height": 34.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "94639ec76287419cbf62300d609c783c"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_Property": {
|
||||
"m_Id": "c45b522280874a35a24d4181ebc364a4"
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
|
||||
"m_ObjectId": "d1e2323ac363467eb284de887e51fa1a",
|
||||
"m_Group": {
|
||||
"m_Id": ""
|
||||
},
|
||||
"m_Name": "VertexDescription.Position",
|
||||
"m_DrawState": {
|
||||
"m_Expanded": true,
|
||||
"m_Position": {
|
||||
"serializedVersion": "2",
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"width": 0.0,
|
||||
"height": 0.0
|
||||
}
|
||||
},
|
||||
"m_Slots": [
|
||||
{
|
||||
"m_Id": "e4defad07bc843d595b179bea932d028"
|
||||
}
|
||||
],
|
||||
"synonyms": [],
|
||||
"m_Precision": 0,
|
||||
"m_PreviewExpanded": true,
|
||||
"m_DismissedVersion": 0,
|
||||
"m_PreviewMode": 0,
|
||||
"m_CustomColors": {
|
||||
"m_SerializableColors": []
|
||||
},
|
||||
"m_SerializedDescriptor": "VertexDescription.Position"
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
|
||||
"m_ObjectId": "d53bdf617595482b9f47d2f4d8b69eb4",
|
||||
"m_Name": "",
|
||||
"m_ChildObjectList": [
|
||||
{
|
||||
"m_Id": "c45b522280874a35a24d4181ebc364a4"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
|
||||
"m_ObjectId": "e4defad07bc843d595b179bea932d028",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Position",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Position",
|
||||
"m_StageCapability": 1,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"m_Labels": [],
|
||||
"m_Space": 0
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
|
||||
"m_ObjectId": "e8e2488838da4a839f59ec769fa47706",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "Out",
|
||||
"m_SlotType": 1,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "Out",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 1.0,
|
||||
"y": 1.0,
|
||||
"z": 1.0,
|
||||
"w": 1.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_Labels": []
|
||||
}
|
||||
|
||||
{
|
||||
"m_SGVersion": 0,
|
||||
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
|
||||
"m_ObjectId": "fcadf8d9695149dd9edc71eca0652ab2",
|
||||
"m_Id": 0,
|
||||
"m_DisplayName": "In",
|
||||
"m_SlotType": 0,
|
||||
"m_Hidden": false,
|
||||
"m_ShaderOutputName": "In",
|
||||
"m_StageCapability": 3,
|
||||
"m_Value": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
},
|
||||
"m_DefaultValue": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0,
|
||||
"w": 0.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cbe79175562bf8b45a79c77148f076ae
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
Reference in New Issue
Block a user