add games
This commit is contained in:
@@ -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"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 78587c467ea0d3d47a2f6abb67ddc588
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -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"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f2e318166a2346a4a1c50f27f484127
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,58 @@
|
||||
Shader "Hidden/ProBuilder/FaceHighlight"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color ("Color Tint", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector"="True" "RenderType"="Geometry" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
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;
|
||||
|
||||
/// https://www.opengl.org/discussion_boards/showthread.php/166719-Clean-Wireframe-Over-Solid-Mesh
|
||||
o.pos = float4(UnityObjectToViewPos(v.vertex.xyz), 1);
|
||||
o.pos.xyz *= .99;
|
||||
o.pos = mul(UNITY_MATRIX_P, o.pos);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8d498332605de34b8534d9cf22aea95
|
||||
timeCreated: 1508535912
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,54 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "Hidden/ProBuilder/FacePicker"
|
||||
{
|
||||
Properties {}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "ProBuilderPicker"="Base" }
|
||||
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: 0adce3c87598d6444bd095f123e5cfbf
|
||||
timeCreated: 1508535910
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
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: 99ab5b57a637bdb4192babafc1298bee
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,57 @@
|
||||
Shader "Hidden/ProBuilder/NormalPreview"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="Geometry" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
Pass
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float _Scale;
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
// secretely this is the normal
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ab5688c9cc8cf7479fba8f23d8eab9d
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,61 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "ProBuilder/Reference Unlit"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="AlphaTest" "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
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35731d35d00f82046b37dbeabba5cda3
|
||||
timeCreated: 1508535910
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,68 @@
|
||||
// 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
|
||||
#define UNITY_PASS_FORWARDBASE
|
||||
#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"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d12d55fd8a06e4f49b461f2f4c1ccec2
|
||||
timeCreated: 1508535912
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,28 @@
|
||||
Shader "Hidden/ProBuilder/SelectionPicker"
|
||||
{
|
||||
Properties {}
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e58e16192dbb47469ae041ba1331088
|
||||
timeCreated: 1508535910
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,66 @@
|
||||
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
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
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;
|
||||
|
||||
/// https://www.opengl.org/discussion_boards/showthread.php/166719-Clean-Wireframe-Over-Solid-Mesh
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3990a77f519f9844e9e0dbd0b1d2e13c
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,410 @@
|
||||
/**
|
||||
* This shader was created with Shaderforge but contains multiple manual edits.
|
||||
* If you modify this shader make sure to go through and pack uv1 and uv2 channels
|
||||
* into a single float4 to save on registers (on penalty of compile error)
|
||||
*/
|
||||
// Shader created with Shader Forge v1.38
|
||||
// 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
|
||||
// Uncomment (just the //) this line to edit with ShaderForge
|
||||
// /*SF_DATA;ver:1.38;sub:START;pass:START;ps:flbk:Standard,iptp:0,cusa:False,bamd:0,cgin:,lico:1,lgpr:1,limd:3,spmd:1,trmd:0,grmd:1,uamb:True,mssp:True,bkdf:True,hqlp:False,rprd:True,enco:False,rmgx:True,imps:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,atcv:False,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,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,atwp: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,fsmp:False;n:type:ShaderForge.SFN_Final,id:2865,x:32719,y:32712,varname:node_2865,prsc:2|diff-6343-OUT,spec-358-OUT,gloss-1813-OUT,normal-5964-RGB;n:type:ShaderForge.SFN_Multiply,id:6343,x:32114,y:32712,varname:node_6343,prsc:2|A-7736-RGB,B-6665-RGB,C-3150-RGB;n:type:ShaderForge.SFN_Color,id:6665,x:31921,y:32805,ptovrint:False,ptlb:Color,ptin:_Color,varname:_Color,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:1,c2:1,c3:1,c4:1;n:type:ShaderForge.SFN_Tex2d,id:7736,x:31921,y:32620,ptovrint:True,ptlb:Base Color,ptin:_MainTex,varname:_MainTex,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,ntxv:0,isnm:False;n:type:ShaderForge.SFN_Tex2d,id:5964,x:32407,y:32978,ptovrint:True,ptlb:Normal Map,ptin:_BumpMap,varname:_BumpMap,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,ntxv:3,isnm:True;n:type:ShaderForge.SFN_Slider,id:358,x:32250,y:32780,ptovrint:False,ptlb:Metallic,ptin:_Metallic,varname:node_358,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:0,max:1;n:type:ShaderForge.SFN_Slider,id:1813,x:32250,y:32882,ptovrint:False,ptlb:Gloss,ptin:_Gloss,varname:_Metallic_copy,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:0,cur:0.8,max:1;n:type:ShaderForge.SFN_VertexColor,id:3150,x:31921,y:32967,varname:node_3150,prsc:2;proporder:5964-6665-7736-358-1813;pass:END;sub:END;*/
|
||||
|
||||
Shader "ProBuilder/Standard Vertex Color" {
|
||||
Properties {
|
||||
_MainTex ("Base Color", 2D) = "white" {}
|
||||
_BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_Metallic ("Metallic", Range(0, 1)) = 0
|
||||
_Gloss ("Gloss", Range(0, 1)) = 0.8
|
||||
}
|
||||
SubShader {
|
||||
Tags {
|
||||
"RenderType"="Opaque"
|
||||
}
|
||||
Pass {
|
||||
Name "FORWARD"
|
||||
Tags {
|
||||
"LightMode"="ForwardBase"
|
||||
}
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#define UNITY_PASS_FORWARDBASE
|
||||
#define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
|
||||
#define _GLOSSYENV 1
|
||||
#include "UnityCG.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "UnityStandardBRDF.cginc"
|
||||
#pragma multi_compile_fwdbase_fullshadows
|
||||
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
|
||||
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
|
||||
#pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
|
||||
#pragma multi_compile_fog
|
||||
#pragma target 3.0
|
||||
uniform float4 _Color;
|
||||
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
|
||||
uniform sampler2D _BumpMap; uniform float4 _BumpMap_ST;
|
||||
uniform float _Metallic;
|
||||
uniform float _Gloss;
|
||||
struct VertexInput {
|
||||
float4 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float4 tangent : TANGENT;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
float2 texcoord2 : TEXCOORD2;
|
||||
float4 vertexColor : COLOR;
|
||||
};
|
||||
struct VertexOutput {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
float4 uv1 : TEXCOORD1;
|
||||
float4 posWorld : TEXCOORD3;
|
||||
float3 normalDir : TEXCOORD4;
|
||||
float3 tangentDir : TEXCOORD5;
|
||||
float3 bitangentDir : TEXCOORD6;
|
||||
float4 vertexColor : COLOR;
|
||||
LIGHTING_COORDS(7,8)
|
||||
UNITY_FOG_COORDS(9)
|
||||
#if defined(LIGHTMAP_ON) || defined(UNITY_SHOULD_SAMPLE_SH)
|
||||
float4 ambientOrLightmapUV : TEXCOORD10;
|
||||
#endif
|
||||
};
|
||||
VertexOutput vert (VertexInput v) {
|
||||
VertexOutput o = (VertexOutput)0;
|
||||
o.uv0 = v.texcoord0;
|
||||
o.uv1 = float4(v.texcoord1, v.texcoord2);
|
||||
o.vertexColor = v.vertexColor;
|
||||
#ifdef LIGHTMAP_ON
|
||||
o.ambientOrLightmapUV.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw;
|
||||
o.ambientOrLightmapUV.zw = 0;
|
||||
#elif UNITY_SHOULD_SAMPLE_SH
|
||||
#endif
|
||||
#ifdef DYNAMICLIGHTMAP_ON
|
||||
o.ambientOrLightmapUV.zw = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
|
||||
#endif
|
||||
o.normalDir = UnityObjectToWorldNormal(v.normal);
|
||||
o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
|
||||
o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
float3 lightColor = _LightColor0.rgb;
|
||||
o.pos = UnityObjectToClipPos( v.vertex );
|
||||
UNITY_TRANSFER_FOG(o,o.pos);
|
||||
TRANSFER_VERTEX_TO_FRAGMENT(o)
|
||||
return o;
|
||||
}
|
||||
float4 frag(VertexOutput i) : COLOR {
|
||||
i.normalDir = normalize(i.normalDir);
|
||||
float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
|
||||
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
|
||||
float3 _BumpMap_var = UnpackNormal(tex2D(_BumpMap,TRANSFORM_TEX(i.uv0, _BumpMap)));
|
||||
float3 normalLocal = _BumpMap_var.rgb;
|
||||
float3 normalDirection = normalize(mul( normalLocal, tangentTransform )); // Perturbed normals
|
||||
float3 viewReflectDirection = reflect( -viewDirection, normalDirection );
|
||||
float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
|
||||
float3 lightColor = _LightColor0.rgb;
|
||||
float3 halfDirection = normalize(viewDirection+lightDirection);
|
||||
////// Lighting:
|
||||
float attenuation = LIGHT_ATTENUATION(i);
|
||||
float3 attenColor = attenuation * _LightColor0.xyz;
|
||||
float Pi = 3.141592654;
|
||||
float InvPi = 0.31830988618;
|
||||
///////// Gloss:
|
||||
float gloss = 1.0 - _Gloss; // Convert roughness to gloss
|
||||
float perceptualRoughness = _Gloss;
|
||||
float roughness = perceptualRoughness * perceptualRoughness;
|
||||
float specPow = exp2( gloss * 10.0 + 1.0 );
|
||||
/////// GI Data:
|
||||
UnityLight light;
|
||||
#ifdef LIGHTMAP_OFF
|
||||
light.color = lightColor;
|
||||
light.dir = lightDirection;
|
||||
light.ndotl = LambertTerm (normalDirection, light.dir);
|
||||
#else
|
||||
light.color = half3(0.f, 0.f, 0.f);
|
||||
light.ndotl = 0.0f;
|
||||
light.dir = half3(0.f, 0.f, 0.f);
|
||||
#endif
|
||||
UnityGIInput d;
|
||||
d.light = light;
|
||||
d.worldPos = i.posWorld.xyz;
|
||||
d.worldViewDir = viewDirection;
|
||||
d.atten = attenuation;
|
||||
#if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON)
|
||||
d.ambient = 0;
|
||||
d.lightmapUV = i.ambientOrLightmapUV;
|
||||
#else
|
||||
d.ambient = i.ambientOrLightmapUV;
|
||||
#endif
|
||||
#if UNITY_SPECCUBE_BLENDING || UNITY_SPECCUBE_BOX_PROJECTION
|
||||
d.boxMin[0] = unity_SpecCube0_BoxMin;
|
||||
d.boxMin[1] = unity_SpecCube1_BoxMin;
|
||||
#endif
|
||||
#if UNITY_SPECCUBE_BOX_PROJECTION
|
||||
d.boxMax[0] = unity_SpecCube0_BoxMax;
|
||||
d.boxMax[1] = unity_SpecCube1_BoxMax;
|
||||
d.probePosition[0] = unity_SpecCube0_ProbePosition;
|
||||
d.probePosition[1] = unity_SpecCube1_ProbePosition;
|
||||
#endif
|
||||
d.probeHDR[0] = unity_SpecCube0_HDR;
|
||||
d.probeHDR[1] = unity_SpecCube1_HDR;
|
||||
Unity_GlossyEnvironmentData ugls_en_data;
|
||||
ugls_en_data.roughness = 1.0 - gloss;
|
||||
ugls_en_data.reflUVW = viewReflectDirection;
|
||||
UnityGI gi = UnityGlobalIllumination(d, 1, normalDirection, ugls_en_data );
|
||||
lightDirection = gi.light.dir;
|
||||
lightColor = gi.light.color;
|
||||
////// Specular:
|
||||
float NdotL = saturate(dot( normalDirection, lightDirection ));
|
||||
float LdotH = saturate(dot(lightDirection, halfDirection));
|
||||
float3 specularColor = _Metallic;
|
||||
float specularMonochrome;
|
||||
float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex));
|
||||
float3 diffuseColor = (_MainTex_var.rgb*_Color.rgb*i.vertexColor.rgb); // Need this for specular when using metallic
|
||||
diffuseColor = DiffuseAndSpecularFromMetallic( diffuseColor, specularColor, specularColor, specularMonochrome );
|
||||
specularMonochrome = 1.0-specularMonochrome;
|
||||
float NdotV = abs(dot( normalDirection, viewDirection ));
|
||||
float NdotH = saturate(dot( normalDirection, halfDirection ));
|
||||
float VdotH = saturate(dot( viewDirection, halfDirection ));
|
||||
float visTerm = SmithJointGGXVisibilityTerm( NdotL, NdotV, roughness );
|
||||
float normTerm = GGXTerm(NdotH, roughness);
|
||||
float specularPBL = (visTerm*normTerm) * UNITY_PI;
|
||||
#ifdef UNITY_COLORSPACE_GAMMA
|
||||
specularPBL = sqrt(max(1e-4h, specularPBL));
|
||||
#endif
|
||||
specularPBL = max(0, specularPBL * NdotL);
|
||||
#if defined(_SPECULARHIGHLIGHTS_OFF)
|
||||
specularPBL = 0.0;
|
||||
#endif
|
||||
half surfaceReduction;
|
||||
#ifdef UNITY_COLORSPACE_GAMMA
|
||||
surfaceReduction = 1.0-0.28*roughness*perceptualRoughness;
|
||||
#else
|
||||
surfaceReduction = 1.0/(roughness*roughness + 1.0);
|
||||
#endif
|
||||
specularPBL *= any(specularColor) ? 1.0 : 0.0;
|
||||
float3 directSpecular = attenColor*specularPBL*FresnelTerm(specularColor, LdotH);
|
||||
half grazingTerm = saturate( gloss + specularMonochrome );
|
||||
float3 indirectSpecular = (gi.indirect.specular);
|
||||
indirectSpecular *= FresnelLerp (specularColor, grazingTerm, NdotV);
|
||||
indirectSpecular *= surfaceReduction;
|
||||
float3 specular = (directSpecular + indirectSpecular);
|
||||
/////// Diffuse:
|
||||
NdotL = max(0.0,dot( normalDirection, lightDirection ));
|
||||
half fd90 = 0.5 + 2 * LdotH * LdotH * (1-gloss);
|
||||
float nlPow5 = Pow5(1-NdotL);
|
||||
float nvPow5 = Pow5(1-NdotV);
|
||||
float3 directDiffuse = ((1 +(fd90 - 1)*nlPow5) * (1 + (fd90 - 1)*nvPow5) * NdotL) * attenColor;
|
||||
float3 indirectDiffuse = float3(0,0,0);
|
||||
indirectDiffuse += gi.indirect.diffuse;
|
||||
float3 diffuse = (directDiffuse + indirectDiffuse) * diffuseColor;
|
||||
/// Final Color:
|
||||
float3 finalColor = diffuse + specular;
|
||||
fixed4 finalRGBA = fixed4(finalColor,1);
|
||||
UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
|
||||
return finalRGBA;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass {
|
||||
Name "FORWARD_DELTA"
|
||||
Tags {
|
||||
"LightMode"="ForwardAdd"
|
||||
}
|
||||
Blend One One
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#define UNITY_PASS_FORWARDADD
|
||||
#define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
|
||||
#define _GLOSSYENV 1
|
||||
#include "UnityCG.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "UnityStandardBRDF.cginc"
|
||||
#pragma multi_compile_fwdadd_fullshadows
|
||||
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
|
||||
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
|
||||
#pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
|
||||
#pragma multi_compile_fog
|
||||
#pragma target 3.0
|
||||
uniform float4 _Color;
|
||||
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
|
||||
uniform sampler2D _BumpMap; uniform float4 _BumpMap_ST;
|
||||
uniform float _Metallic;
|
||||
uniform float _Gloss;
|
||||
struct VertexInput {
|
||||
float4 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float4 tangent : TANGENT;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
float2 texcoord2 : TEXCOORD2;
|
||||
float4 vertexColor : COLOR;
|
||||
};
|
||||
struct VertexOutput {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
float4 uv1 : TEXCOORD1;
|
||||
float4 posWorld : TEXCOORD3;
|
||||
float3 normalDir : TEXCOORD4;
|
||||
float3 tangentDir : TEXCOORD5;
|
||||
float3 bitangentDir : TEXCOORD6;
|
||||
float4 vertexColor : COLOR;
|
||||
LIGHTING_COORDS(7,8)
|
||||
UNITY_FOG_COORDS(9)
|
||||
};
|
||||
VertexOutput vert (VertexInput v) {
|
||||
VertexOutput o = (VertexOutput)0;
|
||||
o.uv0 = v.texcoord0;
|
||||
o.uv1 = float4(v.texcoord1, v.texcoord2);
|
||||
o.vertexColor = v.vertexColor;
|
||||
o.normalDir = UnityObjectToWorldNormal(v.normal);
|
||||
o.tangentDir = normalize( mul( unity_ObjectToWorld, float4( v.tangent.xyz, 0.0 ) ).xyz );
|
||||
o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
float3 lightColor = _LightColor0.rgb;
|
||||
o.pos = UnityObjectToClipPos( v.vertex );
|
||||
UNITY_TRANSFER_FOG(o,o.pos);
|
||||
TRANSFER_VERTEX_TO_FRAGMENT(o)
|
||||
return o;
|
||||
}
|
||||
float4 frag(VertexOutput i) : COLOR {
|
||||
i.normalDir = normalize(i.normalDir);
|
||||
float3x3 tangentTransform = float3x3( i.tangentDir, i.bitangentDir, i.normalDir);
|
||||
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
|
||||
float3 _BumpMap_var = UnpackNormal(tex2D(_BumpMap,TRANSFORM_TEX(i.uv0, _BumpMap)));
|
||||
float3 normalLocal = _BumpMap_var.rgb;
|
||||
float3 normalDirection = normalize(mul( normalLocal, tangentTransform )); // Perturbed normals
|
||||
float3 lightDirection = normalize(lerp(_WorldSpaceLightPos0.xyz, _WorldSpaceLightPos0.xyz - i.posWorld.xyz,_WorldSpaceLightPos0.w));
|
||||
float3 lightColor = _LightColor0.rgb;
|
||||
float3 halfDirection = normalize(viewDirection+lightDirection);
|
||||
////// Lighting:
|
||||
float attenuation = LIGHT_ATTENUATION(i);
|
||||
float3 attenColor = attenuation * _LightColor0.xyz;
|
||||
float Pi = 3.141592654;
|
||||
float InvPi = 0.31830988618;
|
||||
///////// Gloss:
|
||||
float gloss = 1.0 - _Gloss; // Convert roughness to gloss
|
||||
float perceptualRoughness = _Gloss;
|
||||
float roughness = perceptualRoughness * perceptualRoughness;
|
||||
float specPow = exp2( gloss * 10.0 + 1.0 );
|
||||
////// Specular:
|
||||
float NdotL = saturate(dot( normalDirection, lightDirection ));
|
||||
float LdotH = saturate(dot(lightDirection, halfDirection));
|
||||
float3 specularColor = _Metallic;
|
||||
float specularMonochrome;
|
||||
float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex));
|
||||
float3 diffuseColor = (_MainTex_var.rgb*_Color.rgb*i.vertexColor.rgb); // Need this for specular when using metallic
|
||||
diffuseColor = DiffuseAndSpecularFromMetallic( diffuseColor, specularColor, specularColor, specularMonochrome );
|
||||
specularMonochrome = 1.0-specularMonochrome;
|
||||
float NdotV = abs(dot( normalDirection, viewDirection ));
|
||||
float NdotH = saturate(dot( normalDirection, halfDirection ));
|
||||
float VdotH = saturate(dot( viewDirection, halfDirection ));
|
||||
float visTerm = SmithJointGGXVisibilityTerm( NdotL, NdotV, roughness );
|
||||
float normTerm = GGXTerm(NdotH, roughness);
|
||||
float specularPBL = (visTerm*normTerm) * UNITY_PI;
|
||||
#ifdef UNITY_COLORSPACE_GAMMA
|
||||
specularPBL = sqrt(max(1e-4h, specularPBL));
|
||||
#endif
|
||||
specularPBL = max(0, specularPBL * NdotL);
|
||||
#if defined(_SPECULARHIGHLIGHTS_OFF)
|
||||
specularPBL = 0.0;
|
||||
#endif
|
||||
specularPBL *= any(specularColor) ? 1.0 : 0.0;
|
||||
float3 directSpecular = attenColor*specularPBL*FresnelTerm(specularColor, LdotH);
|
||||
float3 specular = directSpecular;
|
||||
/////// Diffuse:
|
||||
NdotL = max(0.0,dot( normalDirection, lightDirection ));
|
||||
half fd90 = 0.5 + 2 * LdotH * LdotH * (1-gloss);
|
||||
float nlPow5 = Pow5(1-NdotL);
|
||||
float nvPow5 = Pow5(1-NdotV);
|
||||
float3 directDiffuse = ((1 +(fd90 - 1)*nlPow5) * (1 + (fd90 - 1)*nvPow5) * NdotL) * attenColor;
|
||||
float3 diffuse = directDiffuse * diffuseColor;
|
||||
/// Final Color:
|
||||
float3 finalColor = diffuse + specular;
|
||||
fixed4 finalRGBA = fixed4(finalColor * 1,0);
|
||||
UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
|
||||
return finalRGBA;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass {
|
||||
Name "Meta"
|
||||
Tags {
|
||||
"LightMode"="Meta"
|
||||
}
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#define UNITY_PASS_META 1
|
||||
#define SHOULD_SAMPLE_SH ( defined (LIGHTMAP_OFF) && defined(DYNAMICLIGHTMAP_OFF) )
|
||||
#define _GLOSSYENV 1
|
||||
#include "UnityCG.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "UnityStandardBRDF.cginc"
|
||||
#include "UnityMetaPass.cginc"
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#pragma multi_compile_shadowcaster
|
||||
#pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
|
||||
#pragma multi_compile DIRLIGHTMAP_OFF DIRLIGHTMAP_COMBINED DIRLIGHTMAP_SEPARATE
|
||||
#pragma multi_compile DYNAMICLIGHTMAP_OFF DYNAMICLIGHTMAP_ON
|
||||
#pragma multi_compile_fog
|
||||
#pragma target 3.0
|
||||
uniform float4 _Color;
|
||||
uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
|
||||
uniform float _Metallic;
|
||||
uniform float _Gloss;
|
||||
struct VertexInput {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
float2 texcoord2 : TEXCOORD2;
|
||||
float4 vertexColor : COLOR;
|
||||
};
|
||||
struct VertexOutput {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv0 : TEXCOORD0;
|
||||
float4 uv1 : TEXCOORD1;
|
||||
float4 posWorld : TEXCOORD3;
|
||||
float4 vertexColor : COLOR;
|
||||
};
|
||||
VertexOutput vert (VertexInput v) {
|
||||
VertexOutput o = (VertexOutput)0;
|
||||
o.uv0 = v.texcoord0;
|
||||
o.uv1 = float4(v.texcoord1, v.texcoord2);
|
||||
o.vertexColor = v.vertexColor;
|
||||
o.posWorld = mul(unity_ObjectToWorld, v.vertex);
|
||||
o.pos = UnityMetaVertexPosition(v.vertex, v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST );
|
||||
return o;
|
||||
}
|
||||
float4 frag(VertexOutput i) : SV_Target {
|
||||
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
|
||||
UnityMetaInput o;
|
||||
UNITY_INITIALIZE_OUTPUT( UnityMetaInput, o );
|
||||
|
||||
o.Emission = 0;
|
||||
|
||||
float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex));
|
||||
float3 diffColor = (_MainTex_var.rgb*_Color.rgb*i.vertexColor.rgb);
|
||||
float specularMonochrome;
|
||||
float3 specColor;
|
||||
diffColor = DiffuseAndSpecularFromMetallic( diffColor, _Metallic, specColor, specularMonochrome );
|
||||
float roughness = _Gloss;
|
||||
o.Albedo = diffColor + specColor * roughness * roughness * 0.5;
|
||||
|
||||
return UnityMetaFragment( o );
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
FallBack "Standard"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a6e79a67e3129f409bae52acc3ab06b
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,65 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "Hidden/ProBuilder/pb_TransparentOverlay"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bc7ec57068c16b3448b8c7a9206eaf1d
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,57 @@
|
||||
// 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" "RenderType"="Geometry" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Back
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7eb90c4fea16d34ab4d7caa19b870a3
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,53 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "ProBuilder/UnlitVertexColor"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="Transparent" }
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite On
|
||||
Cull Off
|
||||
|
||||
Pass
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84f04ba86cd824249bb1c2029be83101
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,85 @@
|
||||
Shader "Hidden/ProBuilder/VertexPicker"
|
||||
{
|
||||
Properties {}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"ProBuilderPicker"="VertexPass"
|
||||
"RenderType"="Transparent"
|
||||
"IgnoreProjector"="True"
|
||||
"DisableBatching"="True"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset -1, -1
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Vertices"
|
||||
AlphaTest Greater .25
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
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 *= .95;
|
||||
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.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;
|
||||
|
||||
o.pos = clip;
|
||||
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: c59eb027aca1897448cd55f6fcb6e88f
|
||||
timeCreated: 1508535911
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,89 @@
|
||||
Shader "Hidden/ProBuilder/pb_VertexShader"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Scale("Scale", Range(1,7)) = 3.3
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"IgnoreProjector"="True"
|
||||
"RenderType"="Transparent"
|
||||
"DisableBatching"="True"
|
||||
}
|
||||
|
||||
Lighting Off
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
Cull Off
|
||||
Blend Off
|
||||
Offset -1,-1
|
||||
|
||||
Pass
|
||||
{
|
||||
AlphaTest Greater .25
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
float _Scale;
|
||||
|
||||
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)
|
||||
{
|
||||
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.texcoord1.xy * _Scale;
|
||||
clip.z -= (.0001 + v.normal.x) * ortho;
|
||||
|
||||
clip.xy /= _ScreenParams.xy;
|
||||
clip.xy = (clip.xy - .5) / .5;
|
||||
clip.xy *= clip.w;
|
||||
|
||||
o.pos = clip;
|
||||
o.uv = v.texcoord.xy;
|
||||
o.color = v.color;
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i) : COLOR
|
||||
{
|
||||
return i.color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f9be32eb523431f43a8462b09a99a767
|
||||
timeCreated: 1508535912
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user