Added player character and step in/out of dialogue in scene 101
This commit is contained in:
+54
@@ -0,0 +1,54 @@
|
||||
Shader "ProBuilder/Diffuse Texture Blend"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_FirstTex ("Texture", 2D) = "white" {}
|
||||
_SecondTex ("Texture", 2D) = "white" {}
|
||||
_ThirdTex ("Texture", 2D) = "white" {}
|
||||
_FourthTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "RenderType" = "Opaque" }
|
||||
|
||||
ColorMask RGB
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf Lambert
|
||||
|
||||
sampler2D _FirstTex;
|
||||
sampler2D _SecondTex;
|
||||
sampler2D _ThirdTex;
|
||||
sampler2D _FourthTex;
|
||||
|
||||
struct Input
|
||||
{
|
||||
float4 color : COLOR;
|
||||
float2 uv_FirstTex;
|
||||
float2 uv_SecondTex;
|
||||
float2 uv_ThirdTex;
|
||||
float2 uv_FourthTex;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o)
|
||||
{
|
||||
fixed4 c0 = tex2D(_FirstTex, IN.uv_FirstTex);
|
||||
fixed4 c1 = tex2D(_SecondTex, IN.uv_SecondTex);
|
||||
fixed4 c2 = tex2D(_ThirdTex, IN.uv_ThirdTex);
|
||||
fixed4 c3 = tex2D(_FourthTex, IN.uv_FourthTex);
|
||||
|
||||
fixed4 blend = normalize(IN.color);
|
||||
|
||||
fixed4 rgba = c0 * blend.r;
|
||||
rgba = lerp(rgba, c1, blend.g);
|
||||
rgba = lerp(rgba, c2, blend.b);
|
||||
rgba = lerp(rgba, c3, blend.a);
|
||||
|
||||
o.Albedo = rgba.rgb;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Fallback "Diffuse"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33cb4e8ff0c1d43ac8ec40692656c7ed
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
Shader "ProBuilder/Diffuse Vertex Color" {
|
||||
Properties {
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType" = "Opaque" }
|
||||
|
||||
ColorMask RGB
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf Lambert
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct Input {
|
||||
float4 color : COLOR;
|
||||
float2 uv_MainTex;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutput o) {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color;
|
||||
o.Albedo = c.rgb;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Fallback "Diffuse"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 911130a939bf84843bcc4211c327f579
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,59 @@
|
||||
Shader "Hidden/ProBuilder/EdgePicker"
|
||||
{
|
||||
Properties {}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="EdgePass"
|
||||
"IgnoreProjector"="True"
|
||||
"DisableBatching"="True"
|
||||
"LightMode"="Always"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Edges"
|
||||
AlphaTest Greater .25
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
#include "ProBuilderCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPosWithOffset(v.vertex.xyz);
|
||||
o.color = v.color;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
return i.color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86212504c7e9f468db2300dc5932dc17
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
Shader "Hidden/ProBuilder/EdgePickerURP"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "17.0"
|
||||
}
|
||||
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="EdgePass"
|
||||
"RenderType"="Opaque"
|
||||
"RenderPipeline"="UniversalPipeline"
|
||||
"Queue"="Geometry"
|
||||
"IgnoreProjector"="True"
|
||||
"DisableBatching"="True"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Edges"
|
||||
Tags { "LightMode"="ProBuilderPickerA" }
|
||||
ZTest Less
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "ProBuilderCG_URP.hlsl"
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
Varyings vert(Attributes input)
|
||||
{
|
||||
Varyings output;
|
||||
output.positionCS = UnityObjectToClipPosWithOffset(input.positionOS.xyz);
|
||||
output.color = input.color;
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 frag(Varyings input) : SV_Target
|
||||
{
|
||||
clip(input.color.a - 0.75);
|
||||
return input.color;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to built-in renderer version
|
||||
Fallback "Hidden/ProBuilder/EdgePicker"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5a6aaaf03bf583c4e9adee705d3255d7
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,60 @@
|
||||
Shader "Hidden/ProBuilder/FaceHighlight"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color ("Color Tint", Color) = (1,1,1,1)
|
||||
_Dither ("Dithering", float) = 0
|
||||
_HandleZTest ("_HandleZTest", Int) = 8
|
||||
_HandleZWrite("_HandleZWrite", Int) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector"="True" "Queue"="Transparent" }
|
||||
Lighting Off
|
||||
ZTest [_HandleZTest]
|
||||
ZWrite [_HandleZWrite]
|
||||
Cull Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
#include "ProBuilderCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
float _Dither;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPosWithOffset(v.vertex.xyz);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
i.pos.xy = floor(i.pos.xy * 1) * .5;
|
||||
float checker = -frac(i.pos.x + i.pos.y);
|
||||
clip(lerp(1, checker, _Dither));
|
||||
|
||||
return _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f37d9e45fbae41b386f76d3bfefec4a
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,52 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "Hidden/ProBuilder/FacePicker"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="Base" "LightMode"="Always" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend Off
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Base"
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.color = v.color;
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
return i.color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c84d57d423a2042eb92da86f9fa670a3
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
Shader "Hidden/ProBuilder/FacePickerURP"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "17.0"
|
||||
}
|
||||
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="Base"
|
||||
"RenderType"="Opaque"
|
||||
"RenderPipeline"="UniversalPipeline"
|
||||
"Queue"="Geometry"
|
||||
"DisableBatching"="True"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Base"
|
||||
Tags { "LightMode"="ProBuilderPickerA" }
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "ProBuilderCG_URP.hlsl"
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
Varyings vert(Attributes input)
|
||||
{
|
||||
Varyings output;
|
||||
|
||||
VertexPositionInputs positions = GetVertexPositionInputs(input.positionOS.xyz);
|
||||
output.positionCS = positions.positionCS;
|
||||
output.color = input.color;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 frag(Varyings input) : SV_Target
|
||||
{
|
||||
return input.color;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to built-in renderer version
|
||||
Fallback "Hidden/ProBuilder/FacePicker"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9cb691ed12f573842860b94cad8331e1
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
Shader "Hidden/ProBuilder/HideVertices"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector"="True" "RenderType"="Geometry" }
|
||||
Lighting Off
|
||||
ZTest On
|
||||
ZWrite On
|
||||
Cull Back
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = fixed4(0,0,0,0);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return fixed4(0,0,0,0);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfa7edf01005f4e338d973cea2f6eab3
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,107 @@
|
||||
Shader "Hidden/ProBuilder/LineBillboard"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_Scale ("Scale", Range(0, 20)) = 7
|
||||
_HandleZTest ("_HandleZTest", Int) = 8
|
||||
_HandleZWrite("_HandleZWrite", Int) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="EdgePass"
|
||||
"RenderType"="Geometry"
|
||||
"Queue"="Geometry"
|
||||
"DisableBatching"="True"
|
||||
"ForceNoShadowCasting"="True"
|
||||
"IgnoreProjector"="True"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest [_HandleZTest]
|
||||
ZWrite [_HandleZWrite]
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset -1, -1
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "EdgePass"
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 4.0
|
||||
#pragma vertex vert
|
||||
#pragma geometry geo
|
||||
#pragma fragment frag
|
||||
#pragma exclude_renderers metal
|
||||
#include "UnityCG.cginc"
|
||||
#include "ProBuilderCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
};
|
||||
|
||||
float _Scale;
|
||||
float4 _Color;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = float4(UnityObjectToViewPos(v.vertex.xyz), 1);
|
||||
|
||||
// pull closer to camera and into clip space
|
||||
o.pos *= .99;
|
||||
o.pos = mul(UNITY_MATRIX_P, o.pos);
|
||||
// convert clip -> ndc -> screen, build billboards in geo shader, then screen -> ndc -> clip
|
||||
o.pos = ClipToScreen(o.pos);
|
||||
o.color = v.color;
|
||||
return o;
|
||||
}
|
||||
|
||||
[maxvertexcount(4)]
|
||||
void geo(line v2f p[2], inout TriangleStream<v2f> triStream)
|
||||
{
|
||||
float2 perp = normalize(float2(-(p[1].pos.y - p[0].pos.y), p[1].pos.x - p[0].pos.x)) * _Scale;
|
||||
|
||||
v2f geo_out;
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[1].pos.x + perp.x, p[1].pos.y + perp.y, p[1].pos.z, p[1].pos.w) );
|
||||
geo_out.color = p[1].color;
|
||||
triStream.Append(geo_out);
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[1].pos.x - perp.x, p[1].pos.y - perp.y, p[1].pos.z, p[1].pos.w) );
|
||||
geo_out.color = p[1].color;
|
||||
triStream.Append(geo_out);
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[0].pos.x + perp.x, p[0].pos.y + perp.y, p[0].pos.z, p[0].pos.w) );
|
||||
geo_out.color = p[0].color;
|
||||
triStream.Append(geo_out);
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[0].pos.x - perp.x, p[0].pos.y - perp.y, p[0].pos.z, p[0].pos.w) );
|
||||
geo_out.color = p[0].color;
|
||||
triStream.Append(geo_out);
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : COLOR
|
||||
{
|
||||
return i.color * _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback Off
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4293210a3280c4283b9872316017f1f9
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
Shader "Hidden/ProBuilder/LineBillboardMetal"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Scale("Scale", Range(1,7)) = 3.3
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_HandleZTest ("_HandleZTest", Int) = 8
|
||||
_HandleZWrite("_HandleZWrite", Int) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Geometry"
|
||||
"Queue"="Geometry"
|
||||
"DisableBatching"="True"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest [_HandleZTest]
|
||||
ZWrite [_HandleZWrite]
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset -1,-1
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
#include "ProBuilderCG.cginc"
|
||||
|
||||
float _Scale;
|
||||
float4 _Color;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
// next vertex is stored in xyz, and direction to move current vertex is w
|
||||
float4 tangent : TANGENT;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = UnityObjectToClipPosWithOffsetMetal(v.vertex.xyz);
|
||||
|
||||
// convert vertex to screen space, add pixel-unit xy to vertex, then transform back to clip space.
|
||||
float4 clip = o.pos;
|
||||
|
||||
float4 a = ClipToScreen(o.pos);
|
||||
float4 b = ClipToScreen(UnityObjectToClipPosWithOffset(v.tangent.xyz));
|
||||
float2 d = normalize(b-a).xy;
|
||||
float2 p = float2(-d.y, d.x);
|
||||
a.xy += p * v.tangent.w * _Scale;
|
||||
|
||||
o.pos = ScreenToClip(a);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4300ae919783d4fa38001d745fbdecc1
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
Shader "Hidden/ProBuilder/NormalPreview"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="Geometry" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float _Scale;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
// secretely this is the normal, w is used to pass extrusion
|
||||
float4 tangent : TANGENT;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
float4 world = mul(unity_ObjectToWorld, v.vertex);
|
||||
float3 nrm = UnityObjectToWorldNormal(v.tangent.xyz);
|
||||
float4 extruded = world + float4((nrm * v.tangent.w * _Scale), 0);
|
||||
o.pos = mul(UNITY_MATRIX_VP, extruded);
|
||||
o.color = float4(abs(v.tangent.xyz), 1);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return i.color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a07688e921e974338945464731e069ce
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,131 @@
|
||||
Shader "Hidden/ProBuilder/PointBillboard"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_Scale ("Scale", Range(0, 20)) = 7
|
||||
_HandleZTest ("_HandleZTest", Int) = 8
|
||||
_HandleZWrite("_HandleZWrite", Int) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="VertexPass"
|
||||
"RenderType"="Geometry"
|
||||
"Queue"="Geometry"
|
||||
"IgnoreProjector"="True"
|
||||
"ForceNoShadowCasting"="True"
|
||||
"DisableBatching"="True"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "VertexPass"
|
||||
Lighting Off
|
||||
ZTest [_HandleZTest]
|
||||
ZWrite [_HandleZWrite]
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset 0, -2
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 4.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma geometry geo
|
||||
#pragma exclude_renderers metal
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct GS_INPUT
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct FS_INPUT
|
||||
{
|
||||
float4 pos : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
float _Scale;
|
||||
float4 _Color;
|
||||
|
||||
// Is the camera in orthographic mode? (1 yes, 0 no)
|
||||
#define ORTHO (1 - UNITY_MATRIX_P[3][3])
|
||||
|
||||
#define ScreenDepthModifier (lerp(.00001, 0, ORTHO))
|
||||
|
||||
float4 ClipToScreen(float4 v)
|
||||
{
|
||||
v.xy /= v.w;
|
||||
v.xy = v.xy * .5 + .5;
|
||||
v.xy *= _ScreenParams.xy;
|
||||
return v;
|
||||
}
|
||||
|
||||
float4 ScreenToClip(float4 v)
|
||||
{
|
||||
v.xy /= _ScreenParams.xy;
|
||||
v.xy = (v.xy - .5) / .5;
|
||||
v.xy *= v.w;
|
||||
return v;
|
||||
}
|
||||
|
||||
GS_INPUT vert(appdata v)
|
||||
{
|
||||
GS_INPUT output = (GS_INPUT)0;
|
||||
|
||||
output.pos = float4(UnityObjectToViewPos(v.vertex.xyz), 1);
|
||||
// perspective rendering applies offset in view coordinates, and orthographic applies offset in the geometry
|
||||
// shader screen space
|
||||
output.pos.xyz *= lerp(1, .95, ORTHO);
|
||||
output.pos = mul(UNITY_MATRIX_P, output.pos);
|
||||
// convert clip -> ndc -> screen, build billboards in geo shader, then screen -> ndc -> clip
|
||||
output.pos = ClipToScreen(output.pos);
|
||||
output.color = v.color;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
[maxvertexcount(4)]
|
||||
void geo(point GS_INPUT p[1], inout TriangleStream<FS_INPUT> triStream)
|
||||
{
|
||||
// 3 1
|
||||
// 2 0
|
||||
|
||||
FS_INPUT geo_out;
|
||||
geo_out.color = p[0].color;
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[0].pos.x + _Scale, p[0].pos.y - _Scale, p[0].pos.z, p[0].pos.w - ScreenDepthModifier) );
|
||||
triStream.Append(geo_out);
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[0].pos.x + _Scale, p[0].pos.y + _Scale, p[0].pos.z, p[0].pos.w - ScreenDepthModifier) );
|
||||
triStream.Append(geo_out);
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[0].pos.x - _Scale, p[0].pos.y - _Scale, p[0].pos.z, p[0].pos.w - ScreenDepthModifier) );
|
||||
triStream.Append(geo_out);
|
||||
|
||||
geo_out.pos = ScreenToClip( float4(p[0].pos.x - _Scale, p[0].pos.y + _Scale, p[0].pos.z, p[0].pos.w - ScreenDepthModifier) );
|
||||
triStream.Append(geo_out);
|
||||
}
|
||||
|
||||
float4 frag(FS_INPUT input) : COLOR
|
||||
{
|
||||
return _Color * input.color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback Off
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ca8b34aa013842f3b399b6961e7dc3b
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,61 @@
|
||||
// Is the camera in orthographic mode? (1 yes, 0 no)
|
||||
#define ORTHO (1 - UNITY_MATRIX_P[3][3])
|
||||
|
||||
// How far to pull vertices towards camera in orthographic mode
|
||||
const float ORTHO_CAM_OFFSET = .0001;
|
||||
|
||||
inline float4 ClipToScreen(float4 v)
|
||||
{
|
||||
v.xy /= v.w;
|
||||
v.xy = v.xy * .5 + .5;
|
||||
v.xy *= _ScreenParams.xy;
|
||||
return v;
|
||||
}
|
||||
|
||||
inline float4 ScreenToClip(float4 v)
|
||||
{
|
||||
v.z -= ORTHO_CAM_OFFSET * ORTHO;
|
||||
v.xy /= _ScreenParams.xy;
|
||||
v.xy = (v.xy - .5) / .5;
|
||||
v.xy *= v.w;
|
||||
return v;
|
||||
}
|
||||
|
||||
inline float4 UnityObjectToClipPosWithOffset(float3 pos)
|
||||
{
|
||||
float4 ret = float4(UnityObjectToViewPos(pos), 1);
|
||||
//Offsetting the edges to avoid z-fighting problems
|
||||
//Do not offset when using orthographic camera as XY are
|
||||
//screen coords, this would shift the rendering
|
||||
ret.xyz *= lerp(.99, 1, unity_OrthoParams.w);
|
||||
//Moving edges closer
|
||||
//.99 is not sufficient for Orthographic Camera
|
||||
ret.z *= lerp(1, 0.95, unity_OrthoParams.w);
|
||||
return mul(UNITY_MATRIX_P, ret);
|
||||
}
|
||||
|
||||
inline float4 UnityObjectToClipPosWithOffsetMetal(float3 pos)
|
||||
{
|
||||
float4 ret = float4(UnityObjectToViewPos(pos), 1);
|
||||
ret *= lerp(.99, .95, ORTHO);
|
||||
return mul(UNITY_MATRIX_P, ret);
|
||||
}
|
||||
|
||||
inline float4 GetPickerColor(float4 pos, float2 texcoord1)
|
||||
{
|
||||
// convert vertex to screen space, add pixel-unit xy to vertex, then transform back to clip space.
|
||||
float4 clip = pos;
|
||||
|
||||
clip.xy /= clip.w;
|
||||
clip.xy = clip.xy * .5 + .5;
|
||||
clip.xy *= _ScreenParams.xy;
|
||||
|
||||
clip.xy += texcoord1.xy * 3.5;
|
||||
clip.z -= .0001 * (1 - UNITY_MATRIX_P[3][3]);
|
||||
|
||||
clip.xy /= _ScreenParams.xy;
|
||||
clip.xy = (clip.xy - .5) / .5;
|
||||
clip.xy *= clip.w;
|
||||
|
||||
return clip;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6aba455f32e574b6e86ede4acd901efa
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
// ProBuilderCG_URP.cginc - URP-compatible version of ProBuilderCG.cginc
|
||||
// Must be included AFTER: #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
// so that TransformObjectToWorld, TransformWorldToView, UNITY_MATRIX_P, unity_OrthoParams are available.
|
||||
|
||||
// Is the camera in orthographic mode? (1 yes, 0 no)
|
||||
#define ORTHO (1 - UNITY_MATRIX_P[3][3])
|
||||
|
||||
// How far to pull vertices towards camera in orthographic mode
|
||||
const float ORTHO_CAM_OFFSET = .0001;
|
||||
|
||||
inline float4 ClipToScreen(float4 v)
|
||||
{
|
||||
v.xy /= v.w;
|
||||
v.xy = v.xy * .5 + .5;
|
||||
v.xy *= _ScreenParams.xy;
|
||||
return v;
|
||||
}
|
||||
|
||||
inline float4 ScreenToClip(float4 v)
|
||||
{
|
||||
v.z -= ORTHO_CAM_OFFSET * ORTHO;
|
||||
v.xy /= _ScreenParams.xy;
|
||||
v.xy = (v.xy - .5) / .5;
|
||||
v.xy *= v.w;
|
||||
return v;
|
||||
}
|
||||
|
||||
inline float4 UnityObjectToClipPosWithOffset(float3 positionOS)
|
||||
{
|
||||
VertexPositionInputs positions = GetVertexPositionInputs(positionOS);
|
||||
|
||||
float4 ret = float4(positions.positionVS, 1);
|
||||
//Offsetting the edges to avoid z-fighting problems
|
||||
//Do not offset when using orthographic camera as XY are
|
||||
//screen coords, this would shift the rendering
|
||||
ret.xyz *= lerp(0.99, 0.95, unity_OrthoParams.w);
|
||||
//Moving edges closer
|
||||
//.99 is not sufficient for Orthographic Camera
|
||||
ret.w *= lerp(1, 0.95, unity_OrthoParams.w);
|
||||
return mul(UNITY_MATRIX_P, ret);
|
||||
}
|
||||
|
||||
inline float4 UnityObjectToClipPosWithOffsetMetal(float3 positionOS)
|
||||
{
|
||||
VertexPositionInputs positions = GetVertexPositionInputs(positionOS);
|
||||
|
||||
float4 ret = float4(positions.positionVS, 1);
|
||||
ret *= lerp(.99, .95, ORTHO);
|
||||
return mul(UNITY_MATRIX_P, ret);
|
||||
}
|
||||
|
||||
inline float4 GetPickerColor(float4 pos, float2 texcoord1)
|
||||
{
|
||||
// convert vertex to screen space, add pixel-unit xy to vertex, then transform back to clip space.
|
||||
float4 clip = pos;
|
||||
|
||||
clip.xy /= clip.w;
|
||||
clip.xy = clip.xy * .5 + .5;
|
||||
clip.xy *= _ScreenParams.xy;
|
||||
|
||||
clip.xy += texcoord1.xy * 3.5;
|
||||
clip.z -= .0001 * (1 - UNITY_MATRIX_P[3][3]);
|
||||
|
||||
clip.xy /= _ScreenParams.xy;
|
||||
clip.xy = (clip.xy - .5) / .5;
|
||||
clip.xy *= clip.w;
|
||||
|
||||
return clip;
|
||||
}
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee82fff19db555c45baac786068d84fe
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "ProBuilder/Reference Unlit"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Offset 1,1
|
||||
|
||||
Pass
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 texcoord0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = v.texcoord0.xy;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return tex2D(_MainTex, i.uv);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 209f4c3496c1b46a3a2f9f0f27be788f
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
// Shader created with Shader Forge v1.32
|
||||
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
|
||||
// Note: Manually altering this data may prevent you from opening it in Shader Forge
|
||||
/*SF_DATA;ver:1.32;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:2,bsrc:0,bdst:1,dpts:6,wrdp:True,dith:0,rfrpo:False,rfrpn:Refraction,coma:15,ufog:False,aust:False,igpj:False,qofs:0,qpre:1,rntp:5,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:3138,x:33161,y:32544,varname:node_3138,prsc:2|emission-7953-OUT;n:type:ShaderForge.SFN_Color,id:7241,x:32343,y:32483,ptovrint:False,ptlb:Highlight,ptin:_Highlight,varname:node_7241,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.07843138,c2:0.3921569,c3:0.7843137,c4:1;n:type:ShaderForge.SFN_TexCoord,id:1076,x:32355,y:32830,varname:node_1076,prsc:2,uv:0;n:type:ShaderForge.SFN_Lerp,id:7953,x:32889,y:32503,varname:node_7953,prsc:2|A-7241-RGB,B-1009-RGB,T-3159-OUT;n:type:ShaderForge.SFN_Color,id:1009,x:32343,y:32656,ptovrint:False,ptlb:Base,ptin:_Base,varname:node_1009,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.5,c2:0.5,c3:0.5,c4:1;n:type:ShaderForge.SFN_Multiply,id:6573,x:32673,y:33080,varname:node_6573,prsc:2|A-9717-OUT,B-9741-OUT;n:type:ShaderForge.SFN_Slider,id:9741,x:32275,y:33210,ptovrint:False,ptlb:Speed,ptin:_Speed,varname:node_9741,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:0.1,max:1;n:type:ShaderForge.SFN_Frac,id:6472,x:32865,y:33050,varname:node_6472,prsc:2|IN-6573-OUT;n:type:ShaderForge.SFN_Distance,id:7233,x:32904,y:32864,varname:node_7233,prsc:2|A-6472-OUT,B-7546-OUT;n:type:ShaderForge.SFN_Smoothstep,id:3159,x:32856,y:32677,varname:node_3159,prsc:2|A-3575-OUT,B-4893-OUT,V-7233-OUT;n:type:ShaderForge.SFN_Vector1,id:3575,x:32608,y:32677,varname:node_3575,prsc:2,v1:0;n:type:ShaderForge.SFN_Vector1,id:4893,x:32608,y:32738,varname:node_4893,prsc:2,v1:0.2;n:type:ShaderForge.SFN_ValueProperty,id:9717,x:32387,y:33067,ptovrint:False,ptlb:EditorTime,ptin:_EditorTime,varname:node_9717,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:0;n:type:ShaderForge.SFN_ValueProperty,id:6146,x:32486,y:32982,ptovrint:False,ptlb:LineDistance,ptin:_LineDistance,varname:node_6146,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,v1:18;n:type:ShaderForge.SFN_Divide,id:7546,x:32700,y:32889,varname:node_7546,prsc:2|A-1076-U,B-6146-OUT;proporder:7241-1009-9741-9717-6146;pass:END;sub:END;*/
|
||||
|
||||
Shader "Hidden/ProBuilder/ScrollHighlight" {
|
||||
Properties {
|
||||
_Highlight ("Highlight", Color) = (0.07843138,0.3921569,0.7843137,1)
|
||||
_Base ("Base", Color) = (0.5,0.5,0.5,1)
|
||||
_Speed ("Speed", Range(0, 1)) = 0.5
|
||||
_EditorTime ("EditorTime", Float ) = 0
|
||||
_LineDistance ("LineDistance", Float ) = 18
|
||||
}
|
||||
SubShader {
|
||||
Tags {
|
||||
"RenderType"="Overlay"
|
||||
}
|
||||
Pass {
|
||||
Name "FORWARD"
|
||||
Tags {
|
||||
"LightMode"="ForwardBase"
|
||||
}
|
||||
Cull Off
|
||||
ZTest Always
|
||||
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#ifndef UNITY_PASS_FORWARDBASE
|
||||
#define UNITY_PASS_FORWARDBASE
|
||||
#endif
|
||||
#include "UnityCG.cginc"
|
||||
#pragma multi_compile_fwdbase_fullshadows
|
||||
#pragma target 3.0
|
||||
uniform float4 _Highlight;
|
||||
uniform float4 _Base;
|
||||
uniform float _Speed;
|
||||
uniform float _EditorTime;
|
||||
uniform float _LineDistance;
|
||||
struct VertexInput {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
};
|
||||
struct VertexOutput {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
};
|
||||
VertexOutput vert (VertexInput v) {
|
||||
VertexOutput o = (VertexOutput)0;
|
||||
o.uv0 = v.texcoord0;
|
||||
o.pos = UnityObjectToClipPos(v.vertex );
|
||||
return o;
|
||||
}
|
||||
float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
|
||||
float isFrontFace = ( facing >= 0 ? 1 : 0 );
|
||||
float faceSign = ( facing >= 0 ? 1 : -1 );
|
||||
////// Lighting:
|
||||
////// Emissive:
|
||||
float3 emissive = lerp(_Highlight.rgb,_Base.rgb,smoothstep( 0.0, 0.2, distance(frac((_EditorTime*_Speed)),(i.uv0.r/_LineDistance)) ));
|
||||
float3 finalColor = emissive;
|
||||
return fixed4(finalColor,1);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 04b5dda5f278e4f56a9dbda64d90bb95
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,40 @@
|
||||
Shader "Hidden/ProBuilder/SelectionPicker"
|
||||
{
|
||||
Properties {}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="EdgePass" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
|
||||
UsePass "Hidden/ProBuilder/EdgePicker/EDGES"
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="VertexPass" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
|
||||
UsePass "Hidden/ProBuilder/VertexPicker/VERTICES"
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="Base" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend Off
|
||||
|
||||
UsePass "Hidden/ProBuilder/FacePicker/BASE"
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fd883d610b2f42a98fc7abaf6809430
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
Shader "Hidden/ProBuilder/SelectionPickerURP"
|
||||
{
|
||||
Properties {}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="EdgePass" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
|
||||
UsePass "Hidden/ProBuilder/EdgePickerURP/EDGES"
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="VertexPass" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
|
||||
UsePass "Hidden/ProBuilder/VertexPickerURP/VERTICES"
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="Base" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend Off
|
||||
|
||||
UsePass "Hidden/ProBuilder/FacePickerURP/BASE"
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c2a9f4e3d1b4086b5e0c2d8a9f4e1b3
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,63 @@
|
||||
Shader "Hidden/ProBuilder/SmoothingPreview"
|
||||
{
|
||||
Properties {
|
||||
_Opacity ("Opacity", Float) = .5
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector"="True" "RenderType"="Geometry" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float _Opacity;
|
||||
float _Dither;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = float4(UnityObjectToViewPos(v.vertex.xyz), 1);
|
||||
o.pos.xyz *= .98;
|
||||
o.pos = mul(UNITY_MATRIX_P, o.pos);
|
||||
o.color = v.color;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
i.pos.xy = floor(i.pos.xy * 1) * .5;
|
||||
float checker = -frac(i.pos.x + i.pos.y);
|
||||
clip(lerp(1, checker, _Dither));
|
||||
|
||||
half4 c = half4(i.color.rgb, i.color.a * _Opacity);
|
||||
return c;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8c3a1662a88140ae84d69a3a4cfdbaa
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+1795
File diff suppressed because it is too large
Load Diff
+20
@@ -0,0 +1,20 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8547ec39534635c4289065e5c5033f43
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
useAsTemplate: 0
|
||||
exposeTemplateAsShader: 0
|
||||
indexedData: {instanceID: 0}
|
||||
template:
|
||||
name:
|
||||
category:
|
||||
description:
|
||||
icon: {instanceID: 0}
|
||||
thumbnail: {instanceID: 0}
|
||||
order: 0
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
Shader "Hidden/ProBuilder/TransparentOverlay"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector"="True" "RenderType"="Transparent" "Queue"="Transparent" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
float4 texcoord0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
|
||||
o.uv = v.texcoord0.xy;
|
||||
|
||||
o.color = v.color;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return tex2D(_MainTex, i.uv) * i.color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25b8a80cb03994c769145599929a5e97
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "ProBuilder/Unlit Solid Color"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color ("Color Tint", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector"="True" "Queue"="Transparent" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float4 _Color;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24f9f312f97bd48dba1a728d58c89842
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,51 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "ProBuilder/UnlitVertexColor"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.color = v.color;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return i.color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35e778fba8b2b49a198d8d7cfced67eb
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,76 @@
|
||||
Shader "Hidden/ProBuilder/VertexPicker"
|
||||
{
|
||||
Properties {}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="VertexPass"
|
||||
"RenderType"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"DisableBatching"="True"
|
||||
// needed by HDRP
|
||||
"LightMode"="Always"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset -1, -1
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Vertices"
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
#include "ProBuilderCG.cginc"
|
||||
|
||||
// Is the camera in orthographic mode? (1 yes, 0 no)
|
||||
#define ORTHO (1 - UNITY_MATRIX_P[3][3])
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
o.pos = float4(UnityObjectToViewPos(v.vertex.xyz), 1);
|
||||
o.pos.xyz *= lerp(.99, .95, ORTHO);
|
||||
o.pos = mul(UNITY_MATRIX_P, o.pos);
|
||||
|
||||
o.pos = GetPickerColor(o.pos, v.texcoord1);
|
||||
o.uv = v.texcoord.xy;
|
||||
o.color = v.color;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
float4 frag (v2f i) : COLOR
|
||||
{
|
||||
return i.color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c26db15b9a2ed4b2ebefefd26ce85ae1
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
Shader "Hidden/ProBuilder/VertexPickerURP"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
PackageRequirements
|
||||
{
|
||||
"com.unity.render-pipelines.universal": "17.0"
|
||||
}
|
||||
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="VertexPass"
|
||||
"RenderType"="Opaque"
|
||||
"RenderPipeline"="UniversalPipeline"
|
||||
"Queue"="Geometry"
|
||||
"IgnoreProjector"="True"
|
||||
"DisableBatching"="True"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Vertices"
|
||||
Tags { "LightMode"="ProBuilderPickerA" }
|
||||
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset -1, -1
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "ProBuilderCG_URP.hlsl"
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
float3 normalOS : NORMAL;
|
||||
float4 color : COLOR;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
float2 uv1 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
Varyings vert(Attributes input)
|
||||
{
|
||||
Varyings output;
|
||||
output.positionCS = UnityObjectToClipPosWithOffset(input.positionOS.xyz);
|
||||
output.positionCS = GetPickerColor(output.positionCS, input.uv1);
|
||||
output.uv = input.uv0.xy;
|
||||
output.color = input.color;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 frag(Varyings input) : SV_Target
|
||||
{
|
||||
return input.color;
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Hidden/ProBuilder/VertexPicker"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 488491a14dff2924db58a2ddc0b9e26f
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,82 @@
|
||||
Shader "Hidden/ProBuilder/VertexShader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Scale("Scale", Range(1,7)) = 3.3
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_HandleZTest ("_HandleZTest", Int) = 8
|
||||
_HandleZWrite("_HandleZWrite", Int) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Geometry"
|
||||
"Queue"="Geometry"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest [_HandleZTest]
|
||||
ZWrite [_HandleZWrite]
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset -1,-1
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float _Scale;
|
||||
float4 _Color;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
};
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
float ortho = (1 - UNITY_MATRIX_P[3][3]);
|
||||
v2f o;
|
||||
|
||||
o.pos = float4(UnityObjectToViewPos(v.vertex.xyz), 1);
|
||||
o.pos.xyz *= lerp(.99, .95, ortho);
|
||||
o.pos = mul(UNITY_MATRIX_P, o.pos);
|
||||
|
||||
// convert vertex to screen space, add pixel-unit xy to vertex, then transform back to clip space.
|
||||
float4 clip = o.pos;
|
||||
|
||||
clip.xy /= clip.w;
|
||||
clip.xy = clip.xy * .5 + .5;
|
||||
clip.xy *= _ScreenParams.xy;
|
||||
|
||||
clip.xy += v.texcoord.xy * _Scale;
|
||||
clip.xy /= _ScreenParams.xy;
|
||||
clip.xy = (clip.xy - .5) / .5;
|
||||
clip.xy *= clip.w;
|
||||
|
||||
o.pos = clip;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6e5744ac426949ff8c0f02936689d4c
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user