plantilla base para movimiento básico
This commit is contained in:
Robii Aragon
2026-02-05 05:07:55 -08:00
parent ed7b223c04
commit fd87a6ffd5
14441 changed files with 13711084 additions and 20 deletions

View File

@@ -0,0 +1,94 @@
Shader "Custom/Drunk"
{
Properties
{
_MainTex ("Texture", 2D) = "black" {}
_HorizontalAmount("Horizontal Amount", Float) = 1
_VerticalAmount("Vertical Amount", Float) = 1
_HorizontalMultiplier("Horizontal Multiplier", Float) = 1
_VerticalMultiplier("Vertical Multiplier", Float) = 1
_HorizontalSpeed("Horizontal Speed", Float) = 1
_VerticalSpeed("Vertical Speed", Float) = 1
_BlurAmount("Blur Amount", Float) = 1
_BlurSpeed("Blur Speed", Float) = 1
_BrightAmount("Bright Amount", Float) = 1
_BrightMultipler("Bright Multiplier", Float) = 1
_ReverseImageX("Reverse Image X", Float) = 1
_ReverseImageY("Reverse Image Y", Float) = 1
}
Subshader
{
Pass
{
CGPROGRAM
#pragma vertex vertex_shader
#pragma fragment pixel_shader
#pragma target 2.0
sampler2D _MainTex;
float _HorizontalAmount;
float _VerticalAmount;
float _HorizontalMultiplier;
float _VerticalMultiplier;
float _HorizontalSpeed;
float _VerticalSpeed;
float _BlurAmount;
float _BlurSpeed;
float _ReverseImageX;
float _ReverseImageY;
float _BrightMultipler;
float _BrightAmount;
float _BrightLerp;
float4 vertex_shader (float4 vertex:POSITION):SV_POSITION
{
return UnityObjectToClipPos(vertex);
}
float4 pixel_shader (float4 vertex:POSITION):COLOR
{
vector <float,2> uv = vertex.xy/_ScreenParams.xy;
uv.x+= cos(uv.y*_HorizontalMultiplier+_Time.g * _HorizontalSpeed)*_HorizontalAmount;
uv.y+= sin(uv.x*_VerticalMultiplier+_Time.g * _VerticalSpeed)*_VerticalAmount;
float offset = sin(_Time.g *_BlurSpeed) * _BlurAmount;
float2 value = float2(uv.x,uv.y);
if(_ReverseImageX==1){
value.x = 1-value.x;
}
if(_ReverseImageY==1){
value.y = 1-value.y;
}
uv =value;
float4 a = tex2D(_MainTex,uv);
float4 b = tex2D(_MainTex,uv-float2(sin(offset),0.0));
float4 c = tex2D(_MainTex,uv+float2(sin(offset),0.0));
float4 d = tex2D(_MainTex,uv-float2(0.0,sin(offset)));
float4 e = tex2D(_MainTex,uv+float2(0.0,sin(offset)));
_BrightLerp = sin(_BrightLerp + _Time.g *_BrightMultipler);
return (a+b+c+d+e)/(_BrightAmount + _BrightLerp);
}
ENDCG
}
}
}

View File

@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 8bc1e122868716b439be367920784483
timeCreated: 1595248561
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/Camera Effects/Drunk.shader
uploadId: 814740

View File

@@ -0,0 +1,71 @@
Shader "Custom/Night Vision" {
Properties
{
_Color("Color", Color) = (0,1,0,1)
_MainTex ("Texture", 2D) = "white" {}
_Range("Range", Float) = 0.01
_ColorMultiplier("Color Multiplier", Float) = 1
_ColorMask("Color Mask", 2D) = "white" {}
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float2 uv_depth : TEXCOORD1;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
o.uv_depth = v.uv;
return o;
}
sampler2D _MainTex;
sampler2D _ColorMask;
sampler2D_float _CameraDepthTexture;
float _Range;
float _ColorMultiplier;
fixed4 _Color;
fixed lum(fixed3 color) {
//Source: http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
return 0.299*color.r + 0.587*color.g + 0.114*color.b;
}
fixed4 frag (v2f i) : SV_Target
{
float depth = DecodeFloatRG(tex2D(_CameraDepthTexture, i.uv));
float linearDepth = Linear01Depth(depth); // 1 is close, 0 is far after being flipped
linearDepth = max(0, (_Range - linearDepth) / _Range);
fixed4 col = tex2D(_MainTex, i.uv);
fixed4 mask = tex2D(_ColorMask, i.uv);
// just invert the colors
fixed color = (lum(col) * _ColorMultiplier) + linearDepth;
return _Color * color * mask;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 56fa0faf116d96f4090b4bc0a4e87325
timeCreated: 1576468312
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/Camera Effects/Night Vision.shader
uploadId: 814740

View File

@@ -0,0 +1,90 @@
Shader "Custom/Oil Paint" {
Properties
{
_MainTex("Texture", 2D) = "white" {}
_Radius ("Range", Range(0, 10)) = 5
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vertex_shader
#pragma fragment pixel_shader
sampler2D _MainTex;
float4 _MainTex_TexelSize;
int _Radius;
struct structure
{
float4 vertex:SV_POSITION;
float2 uv : TEXCOORD0;
};
structure vertex_shader(float4 vertex:POSITION,float2 uv:TEXCOORD0)
{
structure vs;
vs.vertex = UnityObjectToClipPos(vertex);
vs.uv = uv;
return vs;
}
struct region
{
int x1, y1, x2, y2;
};
float4 pixel_shader(structure ps) : SV_Target
{
float2 uv = ps.uv;
float n = float((_Radius + 1) * (_Radius + 1));
float4 color = tex2D(_MainTex, uv);
float3 m[4];
float3 s[4];
int k;
for (k = 0; k < 4; ++k)
{
m[k] = float3(0, 0, 0);
s[k] = float3(0, 0, 0);
}
region R[4] =
{
{-_Radius, -_Radius, 0, 0},
{ 0, -_Radius, _Radius, 0},
{ 0, 0, _Radius, _Radius},
{-_Radius, 0, 0, _Radius}
};
for (k = 0; k < 4; ++k)
{
for (int j = R[k].y1; j <= R[k].y2; ++j)
{
for (int i = R[k].x1; i <= R[k].x2; ++i)
{
float3 c = tex2Dlod(_MainTex,float4(uv+(float2(i*_MainTex_TexelSize.x,j*_MainTex_TexelSize.y)),0,0)).rgb;
m[k] += c;
s[k] += c * c;
}
}
}
float min = 1e+2;
float s2;
for (k = 0; k < 4; ++k)
{
m[k] /= n;
s[k] = abs(s[k] / n - m[k] * m[k]);
s2 = s[k].r + s[k].g + s[k].b;
if (s2 < min)
{
min = s2;
color.rgb = m[k].rgb;
}
}
return color;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: ad66d6a96a3bcca448172b0c4b87759a
timeCreated: 1581685729
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/Camera Effects/Oil Paint.shader
uploadId: 814740

View File

@@ -0,0 +1,35 @@
Shader "Custom/Pixel Shader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_TintColor ("Tint Color", Color) = (1.0, 0.6, 0.6, 1.0)
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
float2 BlockCount;
float2 BlockSize;
float4 _TintColor;
fixed4 frag (v2f_img i) : SV_Target
{
float2 blockPos = floor(i.uv * BlockCount);
float2 blockCenter = blockPos * BlockSize + BlockSize * 0.5;
float4 tex = tex2D(_MainTex, blockCenter) + _TintColor;
return tex;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: d898036ff45644449b713953ad715cdf
timeCreated: 1576370686
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/Camera Effects/Pixel Shader.shader
uploadId: 814740

View File

@@ -0,0 +1,51 @@
Shader "Custom/Solid Shader" {
Properties
{
_MainTex("Texture", 2D) = "white" {}
_SprTex("Texture", 2D) = "white" {}
_TintColor ("Tint Color", Color) = (1.0, 0.6, 0.6, 1.0)
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
sampler2D _SprTex;
float4 _Color = float4(1, 1, 1, 1);
float2 BlockCount;
float2 BlockSize;
float4 _TintColor;
fixed4 frag(v2f_img i) : SV_Target
{
float2 blockPos = floor(i.uv * BlockCount);
float2 blockCenter = blockPos * BlockSize + BlockSize * 0.5;
float4 del = float4(1, 1, 1, 1) - _Color;
float4 tex = tex2D(_MainTex, blockCenter) - del + _TintColor;
float grayscale = dot(tex.rgb, float3(0.3, 0.59, 0.11));
grayscale = clamp(grayscale, 0.0, 1.0);
float dx = floor(grayscale * 16.0);
float2 sprPos = i.uv;
sprPos -= blockPos*BlockSize;
sprPos.x /= 16;
sprPos *= BlockCount;
sprPos.x += 1.0 / 16.0 * dx;
float4 tex2 = tex2D(_SprTex, sprPos);
return tex2;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 65d6cb0bb6081d24487c0074a04b10d4
timeCreated: 1576379478
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/Camera Effects/Solid Shader.shader
uploadId: 814740

View File

@@ -0,0 +1,7 @@
Shader "Mask/SplitScreen" {
//Simple depthmask shader
SubShader {
Tags {Queue = Background}
Pass {ColorMask 0}
}
}

View File

@@ -0,0 +1,16 @@
fileFormatVersion: 2
guid: 6b73ee78dd84dda41870788279c4f257
timeCreated: 1575072298
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/Camera Effects/SplitScreenMask.shader
uploadId: 814740

View File

@@ -0,0 +1,92 @@
Shader "Custom/Underwater Shader Effect" {
// simple masked blur shader.
// MainTex is used by unity to input camera image
// Amount is the amount of blur
// Mask is an image that uses brightness of pixel
// to determine how much of the blur is applied to pixel
// white = no blur, black = full blur, values inbetween = mix
// written by christian franz, you have permission to use as you
// see fit.
Properties
{
_MainTex ("Texture", 2D) = "white" {} // bit input from Unity
_Amount ("Amount", Range(1, 100)) = 7 // how much blurring
_Mask("Mask", 2D) = "white" {} // blend mask, white = no blur, black = full blur
_TintColor ("Tint Color", Color) = (1.0, 0.6, 0.6, 1.0)
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f {
float2 uv : TEXCOORD0;
float2 muv : TEXCOORD1;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
sampler2D _Mask;
float _Amount;
// implicit defines
float4 _MainTex_ST, _Mask_ST, _MainTex_TexelSize;
float4 _TintColor;
v2f vert (appdata v) {
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.muv = TRANSFORM_TEX(v.uv, _Mask);
return o;
}
fixed4 frag (v2f i) : SV_Target {
fixed4 col = fixed4(0, 0, 0, 1.0);
// sum all pixels from -Amount to Amount
// horizontally
for (int index = -_Amount; index <= _Amount; index++) {
float2 uv = i.uv + float2(index * _MainTex_TexelSize.x, 0);
col += tex2D(_MainTex, uv);
}
// vertically
for (int index = -_Amount; index <= _Amount; index++) {
float2 uv = i.uv + float2(0, index * _MainTex_TexelSize.y);
col += tex2D(_MainTex, uv);
}
// now divide by the number of samples. Samples is 2 * 2 * amount + 1: Amount = 1: -1, 0, 1 = 3 samples * 2 (horizontally, vertically)
col /= (_Amount * 4 + 2);
// now sample the original value
float4 orig = tex2D(_MainTex, i.uv);
float4 mask = tex2D(_Mask, i.muv);
float unblurred = mask.r ;
float blurred = (1.0 - unblurred);
col = col * blurred + orig * unblurred + _TintColor;
return col;
}
ENDCG
}
}
}

View File

@@ -0,0 +1,17 @@
fileFormatVersion: 2
guid: 4ec89f1ec0118114f8de64e5b1a651ad
timeCreated: 1628329108
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/Camera Effects/Underwater Shader
Effect.shader
uploadId: 814740