Skip to content

Commit

Permalink
Lots of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chibiskuld committed May 31, 2021
1 parent 0bb2f00 commit 3af1efb
Show file tree
Hide file tree
Showing 30 changed files with 1,323 additions and 371 deletions.
103 changes: 0 additions & 103 deletions ExampleMaterials/FlatColorTrail.mat

This file was deleted.

84 changes: 0 additions & 84 deletions ExampleMaterials/GradientTrail.mat

This file was deleted.

57 changes: 0 additions & 57 deletions ExampleMaterials/GradientTrail.shader

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RainbowTrail
m_Shader: {fileID: 10755, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_Name: Marker
m_Shader: {fileID: 4800000, guid: 62fedb3dd4a69b4429fc3b7e2031dfa9, type: 3}
m_ShaderKeywords: _MODE_RAINBOW
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
m_CustomRenderQueue: 2000
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
Expand Down Expand Up @@ -68,7 +68,7 @@ Material:
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _Mode: 2
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
Expand All @@ -78,7 +78,7 @@ Material:
- _ZWrite: 1
- __dirty: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 0, b: 0, a: 0}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _From: {r: 0, g: 0, b: 0, a: 0}
- _To: {r: 0, g: 0, b: 0, a: 0}
File renamed without changes.
98 changes: 98 additions & 0 deletions ExampleMaterials/Marker.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
Shader "Skuld/Skuld's Marker"
{
Properties
{
[HDR]_Color("Color",Color) = (.5,0,1,1)
[KeywordEnum(TrailColor,SolidColor,Rainbow)] _Mode("Mode:", Int) = 2
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
cull Off

Pass
{
CGPROGRAM
#include "UnityCG.cginc"
#include "UnityLightingCommon.cginc"
#include "AutoLight.cginc"
#include "UnityPBSLighting.cginc"

#pragma target 3.5
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile

#include "UnityCG.cginc"
float4 _Color;
int _Mode;
sampler2D _MainTex;


struct appdata
{
float2 uv : TEXCOORD0;
float4 vertex : POSITION;
float4 color : COLOR;
};

struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float3 color : VCOLOR;
};

v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
o.color = v.color;
return o;
}

float3 shiftColor(float3 inColor, float shift)
{
float r = shift * 0.01745329251994329576923690768489;
float u = cos(r);
float w = sin(r);
float3 ret;
ret.r = (.299 + .701 * u + .168 * w)*inColor.r
+ (.587 - .587 * u + .330 * w)*inColor.g
+ (.114 - .114 * u - .497 * w)*inColor.b;
ret.g = (.299 - .299 * u - .328 * w)*inColor.r
+ (.587 + .413 * u + .035 * w)*inColor.g
+ (.114 - .114 * u + .292 * w)*inColor.b;
ret.b = (.299 - .3 * u + 1.25 * w)*inColor.r
+ (.587 - .588 * u - 1.05 * w)*inColor.g
+ (.114 + .886 * u - .203 * w)*inColor.b;
return ret;
}

float4 frag (v2f i) : SV_Target
{
// sample the texture
float4 col = _Color;
switch (_Mode) {
case 0:
col.rgb = i.color;
break;
case 1:
col = _Color;
break;
case 2:
col.rgb = float3(1, 0, 0);
float n = (i.uv.x * 2000.0f) + (_Time.z * 25.0f);
col.rgb = shiftColor(col.rgb, n);
break;
}

return col;
}
ENDCG
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3af1efb

Please sign in to comment.