add ckg
plantilla base para movimiento básico
This commit is contained in:
108
Assets/Game Kit Controller/Shaders/Others/Cloak Shader.shader
Normal file
108
Assets/Game Kit Controller/Shaders/Others/Cloak Shader.shader
Normal file
@@ -0,0 +1,108 @@
|
||||
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
|
||||
|
||||
Shader "Custom/Cloak Shader" {
|
||||
Properties {
|
||||
_MainTex ("Tint Color (RGB)", 2D) = "white" {}
|
||||
_ScndTex ("Highlight Color (RGB)", 2D) = "white" {}
|
||||
_BumpAmt ("Distortion", range (0,10000)) = 10
|
||||
_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
}
|
||||
|
||||
Category {
|
||||
|
||||
// This is transparent so objects behind the shader are drawn beforehand.
|
||||
Tags { "Queue"="Transparent" "RenderType"="Opaque" }
|
||||
|
||||
|
||||
SubShader {
|
||||
|
||||
// A pass to grab the scene behind the object and denerate a texture.
|
||||
// The result will be available as _GrabTexture
|
||||
GrabPass {
|
||||
Name "BASE"
|
||||
Tags { "LightMode" = "Always" }
|
||||
}
|
||||
|
||||
// The main pass takes the generated texture and uses the bumpmap
|
||||
// to distort it accordingly
|
||||
Pass {
|
||||
Name "BASE"
|
||||
Tags { "LightMode" = "Always" }
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma fragmentoption ARB_precision_hint_fastest
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
float2 texcoord: TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : POSITION;
|
||||
float4 uvgrab : TEXCOORD0;
|
||||
float2 uvbump : TEXCOORD1;
|
||||
float2 uvmain : TEXCOORD2;
|
||||
float2 uvscnd : TEXCOORD3;
|
||||
};
|
||||
|
||||
float _BumpAmt; //A slider to fine tune the distortion
|
||||
float4 _BumpMap_ST; //Distortion map is a grayscale texture, midgray is neutral.
|
||||
float4 _MainTex_ST; //Darkening texture for color effects and such, white is neutral.
|
||||
float4 _ScndTex_ST; //Texture used for highlights, black is neutral.
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
float scale = -1.0;
|
||||
#else
|
||||
float scale = 1.0;
|
||||
#endif
|
||||
o.uvgrab.xy = (float2(o.vertex.x, o.vertex.y*scale) + o.vertex.w) * 0.5;
|
||||
o.uvgrab.zw = o.vertex.zw;
|
||||
o.uvbump = TRANSFORM_TEX( v.texcoord, _BumpMap );
|
||||
o.uvmain = TRANSFORM_TEX( v.texcoord, _MainTex );
|
||||
o.uvscnd = TRANSFORM_TEX( v.texcoord, _ScndTex );
|
||||
return o;
|
||||
}
|
||||
|
||||
sampler2D _GrabTexture;
|
||||
float4 _GrabTexture_TexelSize;
|
||||
sampler2D _BumpMap;
|
||||
sampler2D _MainTex;
|
||||
sampler2D _ScndTex;
|
||||
|
||||
half4 frag( v2f i ) : COLOR
|
||||
{
|
||||
// math of the distortion
|
||||
half2 bump = UnpackNormal(tex2D( _BumpMap, i.uvbump )).rg; // we could optimize this by just reading the x & y without reconstructing the Z
|
||||
float2 offset = bump * _BumpAmt * _GrabTexture_TexelSize.xy;
|
||||
i.uvgrab.xy = offset * i.uvgrab.z + i.uvgrab.xy;
|
||||
|
||||
half4 col = tex2Dproj( _GrabTexture, UNITY_PROJ_COORD(i.uvgrab));
|
||||
half4 tint = tex2D( _MainTex, i.uvmain );
|
||||
half4 high = tex2D( _ScndTex, i.uvscnd );
|
||||
// Adding the higlight at 20% strentgh then doing the darkening color effect
|
||||
return (col + (high * 0.2)) / tint;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Fallback for Old graphics cards and Unity vanilla fallback
|
||||
|
||||
SubShader {
|
||||
Blend DstColor Zero
|
||||
Pass {
|
||||
Name "BASE"
|
||||
SetTexture [_MainTex] { combine texture }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d043093eec8dbc4e90c6177b5450fab
|
||||
timeCreated: 1579434555
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Shaders/Others/Cloak Shader.shader
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,48 @@
|
||||
Shader "Custom/See Through Surfaces 1" {
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" "Queue"="Geometry+1"}
|
||||
ColorMask 0
|
||||
ZWrite off
|
||||
Stencil {
|
||||
Ref 1
|
||||
Comp always
|
||||
Pass replace
|
||||
}
|
||||
|
||||
CGINCLUDE
|
||||
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) : SV_Target {
|
||||
return half4(1,1,0,1);
|
||||
}
|
||||
ENDCG
|
||||
|
||||
Pass {
|
||||
Cull Front
|
||||
ZTest Less
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDCG
|
||||
}
|
||||
Pass {
|
||||
Cull Back
|
||||
ZTest Greater
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3300c6ff801809478ff7be529195c39
|
||||
timeCreated: 1577735184
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Shaders/Others/See Through Surfaces 1.shader
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,55 @@
|
||||
// Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax.
|
||||
|
||||
Shader "Custom/See Through Surfaces 2" {
|
||||
Properties {
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Albedo (RGB)", 2D) = "white" {}
|
||||
_Glossiness ("Smoothness", Range(0,1)) = 0.5
|
||||
_Metallic ("Metallic", Range(0,1)) = 0.0
|
||||
}
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" "Queue"="Geometry+2"}
|
||||
|
||||
Stencil
|
||||
{
|
||||
Ref 1
|
||||
Comp notequal
|
||||
}
|
||||
|
||||
CGPROGRAM
|
||||
// Physically based Standard lighting model, and enable shadows on all light types
|
||||
#pragma surface surf Standard fullforwardshadows
|
||||
|
||||
// Use shader model 3.0 target, to get nicer looking lighting
|
||||
#pragma target 3.0
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
};
|
||||
|
||||
half _Glossiness;
|
||||
half _Metallic;
|
||||
fixed4 _Color;
|
||||
|
||||
// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
|
||||
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
|
||||
// #pragma instancing_options assumeuniformscaling
|
||||
UNITY_INSTANCING_BUFFER_START(Props)
|
||||
// put more per-instance properties here
|
||||
UNITY_INSTANCING_BUFFER_END(Props)
|
||||
|
||||
void surf (Input IN, inout SurfaceOutputStandard o) {
|
||||
// Albedo comes from a texture tinted by color
|
||||
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
|
||||
o.Albedo = c.rgb;
|
||||
// Metallic and smoothness come from slider variables
|
||||
o.Metallic = _Metallic;
|
||||
o.Smoothness = _Glossiness;
|
||||
o.Alpha = c.a;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d5569c919a21104eb4e629632d04e05
|
||||
timeCreated: 1577735529
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Shaders/Others/See Through Surfaces 2.shader
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,70 @@
|
||||
Shader "Custom/Transparent Diffuse (Improved)" {
|
||||
Properties {
|
||||
_Color("Main Color", Color) = (1, 1, 1, 1)
|
||||
_MainTex("Base (RGB) Trans (A)", 2D) = "white" { }
|
||||
_Glossiness ("Smoothness", Range(0,1)) = 0.5
|
||||
_Metallic ("Metallic", Range(0,1)) = 0.0
|
||||
|
||||
_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="False" "RenderType"="Transparent" }
|
||||
|
||||
// First Pass: Only render alpha (A) channel
|
||||
Pass {
|
||||
ColorMask A
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
fixed4 _Color;
|
||||
|
||||
float4 vert(float4 vertex:POSITION) : SV_POSITION {
|
||||
return UnityObjectToClipPos(vertex);
|
||||
}
|
||||
|
||||
fixed4 frag() : SV_Target {
|
||||
return _Color;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
// Second Pass: Now render color (RGB) channel
|
||||
ColorMask RGB
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf Standard alpha
|
||||
|
||||
sampler2D _MainTex;
|
||||
fixed4 _Color;
|
||||
|
||||
sampler2D _BumpMap;
|
||||
|
||||
half _Glossiness;
|
||||
half _Metallic;
|
||||
|
||||
struct Input {
|
||||
float4 color:COLOR;
|
||||
float2 uv_MainTex;
|
||||
float2 uv_BumpMap;
|
||||
};
|
||||
|
||||
void surf(Input IN, inout SurfaceOutputStandard o) {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
|
||||
o.Albedo = c.rgb;
|
||||
o.Alpha = c.a;
|
||||
o.Metallic = _Metallic;
|
||||
o.Smoothness = _Glossiness;
|
||||
|
||||
o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Fallback "Legacy Shaders/Transparent/Diffuse"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 693cfc83d359c9d42a2c5c7d32819b9b
|
||||
timeCreated: 1582304680
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Shaders/Others/Transparent Diffuse (Improved).shader
|
||||
uploadId: 814740
|
||||
@@ -0,0 +1,80 @@
|
||||
Shader "Custom/Transparent Diffuse Stipple" {
|
||||
Properties {
|
||||
_MainTex("Base (RGB)", 2D) = "white" { }
|
||||
_Color("Main Color", Color) = (1, 1, 1, 1)
|
||||
_Glossiness ("Smoothness", Range(0,1)) = 0.5
|
||||
_Metallic ("Metallic", Range(0,1)) = 0.0
|
||||
|
||||
_BumpMap ("Normalmap", 2D) = "bump" {}
|
||||
|
||||
_TransparentAmount("Transparent Amount", Float) = 1
|
||||
_StippleSize("Stipple Size", Float) = 1
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags { "RenderType"="Opaque" }
|
||||
LOD 200
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
#pragma surface surf Standard fullforwardshadows
|
||||
|
||||
#pragma target 3.0
|
||||
|
||||
float _TransparentAmount;
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
fixed4 _Color;
|
||||
|
||||
sampler2D _BumpMap;
|
||||
|
||||
float _StippleSize;
|
||||
|
||||
half _Glossiness;
|
||||
half _Metallic;
|
||||
|
||||
static const float4x4 kThresholdMatrix = {
|
||||
1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0,
|
||||
13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0,
|
||||
4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0,
|
||||
16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0
|
||||
};
|
||||
|
||||
static const float4x4 kKernelMatrix = {
|
||||
1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1
|
||||
};
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
float4 screenPos;
|
||||
float3 worldPos;
|
||||
float2 uv_BumpMap;
|
||||
};
|
||||
|
||||
void surf (Input IN, inout SurfaceOutputStandard o) {
|
||||
fixed4 c = tex2D(_MainTex, IN.uv_MainTex)* _Color;
|
||||
o.Albedo = c.rgb;
|
||||
o.Alpha = c.a;
|
||||
o.Metallic = _Metallic;
|
||||
o.Smoothness = _Glossiness;
|
||||
|
||||
o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
|
||||
|
||||
// Unproject the screen pixel coordiante
|
||||
float2 pos = IN.screenPos.xy / IN.screenPos.w;
|
||||
pos *= _ScreenParams.xy * _StippleSize;
|
||||
|
||||
// Clip pixel within [start, end] distance from camera
|
||||
float interpDist = _TransparentAmount;
|
||||
|
||||
clip(interpDist - kThresholdMatrix[fmod(pos.x, 4)] * kKernelMatrix[fmod(pos.y, 4)]);
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50ac5df4806168042880d8990e434b64
|
||||
timeCreated: 1582304679
|
||||
licenseType: Store
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 40995
|
||||
packageName: Game Kit Controller - Shooter Melee Adventure Creator 3D + 2.5D
|
||||
packageVersion: 3.77g
|
||||
assetPath: Assets/Game Kit Controller/Shaders/Others/Transparent Diffuse Stipple.shader
|
||||
uploadId: 814740
|
||||
Reference in New Issue
Block a user