mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
6360d222b0 | |||
00acb45e18 | |||
8acf17f189 | |||
4ed4676488 | |||
6d33d6e524 | |||
2e32de00e7 | |||
e9f593cb0e | |||
32097e8baf | |||
ccd71208dc | |||
fae34be358 | |||
26b59400e9 |
@ -23,5 +23,8 @@ dependencies: # Configure dependencies
|
||||
url: http://taniwha.org/~bill/Shabby_v0.1.2.zip
|
||||
zip: true
|
||||
deploy:
|
||||
SpaceDock:
|
||||
enabled: true # activate/deactivate this deployment script
|
||||
mod-id: 2451 # The Spacedock mod ID for deployment
|
||||
GitHub:
|
||||
enabled: true # activate/deactivate this deployment script
|
@ -14,10 +14,10 @@ Shader "ConformalDecals/Decal Back"
|
||||
_Shininess ("Shininess", Range (0.03, 10)) = 0.4
|
||||
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
}
|
||||
|
||||
SubShader
|
||||
|
@ -3,22 +3,22 @@ Shader "ConformalDecals/Feature/Bumped"
|
||||
Properties
|
||||
{
|
||||
[Header(Texture Maps)]
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_DecalBumpMap("Decal Bump Map", 2D) = "bump" {}
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_DecalBumpMap("Decal Bump Map", 2D) = "bump" {}
|
||||
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
|
||||
[Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", int) = 2
|
||||
[Toggle(DECAL_PREVIEW)] _Preview ("Preview", int) = 0
|
||||
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
@ -29,8 +29,8 @@ Shader "ConformalDecals/Feature/Bumped"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
@ -78,8 +78,8 @@ Shader "ConformalDecals/Feature/Bumped"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
|
@ -3,25 +3,25 @@ Shader "ConformalDecals/Paint/Diffuse"
|
||||
Properties
|
||||
{
|
||||
[Header(Texture Maps)]
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
|
||||
[Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", int) = 2
|
||||
[Toggle(DECAL_PREVIEW)] _Preview ("Preview", int) = 0
|
||||
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
@ -32,8 +32,8 @@ Shader "ConformalDecals/Paint/Diffuse"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
@ -86,8 +86,8 @@ Shader "ConformalDecals/Paint/Diffuse"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
|
@ -3,27 +3,27 @@ Shader "ConformalDecals/Paint/DiffuseSDF"
|
||||
Properties
|
||||
{
|
||||
[Header(Texture Maps)]
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_Smoothness ("SDF smoothness", Range(0,1)) = 0.15
|
||||
_SmoothnessMipScale ("Smoothness fadeout", Range(0,1)) = 0.1
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
|
||||
[Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", int) = 2
|
||||
[Toggle(DECAL_PREVIEW)] _Preview ("Preview", int) = 0
|
||||
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
@ -34,8 +34,8 @@ Shader "ConformalDecals/Paint/DiffuseSDF"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
@ -95,8 +95,8 @@ Shader "ConformalDecals/Paint/DiffuseSDF"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
|
@ -3,16 +3,16 @@ Shader "ConformalDecals/Paint/Specular"
|
||||
Properties
|
||||
{
|
||||
[Header(Texture Maps)]
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
_SpecMap("Specular Map", 2D) = "black" {}
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
_SpecMap("Specular Map", 2D) = "black" {}
|
||||
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
|
||||
[Header(Specularity)]
|
||||
_SpecColor ("_SpecColor", Color) = (0.25, 0.25, 0.25, 1)
|
||||
@ -21,12 +21,12 @@ Shader "ConformalDecals/Paint/Specular"
|
||||
[Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", int) = 2
|
||||
[Toggle(DECAL_PREVIEW)] _Preview ("Preview", int) = 0
|
||||
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
@ -37,8 +37,8 @@ Shader "ConformalDecals/Paint/Specular"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
@ -100,8 +100,8 @@ Shader "ConformalDecals/Paint/Specular"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
|
@ -3,18 +3,18 @@ Shader "ConformalDecals/Paint/SpecularSDF"
|
||||
Properties
|
||||
{
|
||||
[Header(Texture Maps)]
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
_SpecMap("Specular Map", 2D) = "black" {}
|
||||
_Decal("Decal Texture", 2D) = "gray" {}
|
||||
_BumpMap("Bump Map", 2D) = "bump" {}
|
||||
_SpecMap("Specular Map", 2D) = "black" {}
|
||||
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
||||
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
||||
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
|
||||
_Smoothness ("SDF smoothness", Range(0,1)) = 0.15
|
||||
_SmoothnessMipScale ("Smoothness fadeout", Range(0,1)) = 0.1
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
_DecalOpacity("Opacity", Range(0,1) ) = 1
|
||||
_Background("Background Color", Color) = (0.9,0.9,0.9,0.7)
|
||||
|
||||
[Header(Specularity)]
|
||||
_SpecColor ("_SpecColor", Color) = (0.25, 0.25, 0.25, 1)
|
||||
@ -23,12 +23,12 @@ Shader "ConformalDecals/Paint/SpecularSDF"
|
||||
[Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", int) = 2
|
||||
[Toggle(DECAL_PREVIEW)] _Preview ("Preview", int) = 0
|
||||
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
[Header(Effects)]
|
||||
[PerRendererData]_Opacity("_Opacity", Range(0,1) ) = 1
|
||||
[PerRendererData]_Color("_Color", Color) = (1,1,1,1)
|
||||
[PerRendererData]_RimFalloff("_RimFalloff", Range(0.01,5) ) = 0.1
|
||||
[PerRendererData]_RimColor("_RimColor", Color) = (0,0,0,0)
|
||||
[PerRendererData]_UnderwaterFogFactor ("Underwater Fog Factor", Range(0,1)) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
@ -39,8 +39,8 @@ Shader "ConformalDecals/Paint/SpecularSDF"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
@ -108,8 +108,8 @@ Shader "ConformalDecals/Paint/SpecularSDF"
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
|
@ -91,17 +91,17 @@ inline float CalcMipLevel(float2 texture_coord) {
|
||||
// modifed version of the KSP BlinnPhong because it does some weird things
|
||||
inline fixed4 LightingBlinnPhongDecal(SurfaceOutput s, fixed3 lightDir, half3 viewDir, fixed atten)
|
||||
{
|
||||
s.Normal = normalize(s.Normal);
|
||||
half3 h = normalize(lightDir + viewDir);
|
||||
s.Normal = normalize(s.Normal);
|
||||
half3 h = normalize(lightDir + viewDir);
|
||||
|
||||
fixed diff = max(0, dot(s.Normal, lightDir));
|
||||
fixed diff = max(0, dot(s.Normal, lightDir));
|
||||
|
||||
float nh = max(0, dot(s.Normal, h));
|
||||
float spec = pow(nh, s.Specular*128.0) * s.Gloss;
|
||||
float nh = max(0, dot(s.Normal, h));
|
||||
float spec = pow(nh, s.Specular*128.0) * s.Gloss;
|
||||
|
||||
fixed4 c = 0;
|
||||
c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * _SpecColor.rgb * spec) * (atten);
|
||||
return c;
|
||||
fixed4 c = 0;
|
||||
c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * _SpecColor.rgb * spec) * (atten);
|
||||
return c;
|
||||
}
|
||||
|
||||
// declare surf function,
|
||||
|
@ -3,18 +3,18 @@
|
||||
|
||||
inline fixed4 LightingBlinnPhongSmooth(SurfaceOutput s, fixed3 lightDir, half3 viewDir, fixed atten)
|
||||
{
|
||||
s.Normal = normalize(s.Normal);
|
||||
half3 h = normalize(lightDir + viewDir);
|
||||
s.Normal = normalize(s.Normal);
|
||||
half3 h = normalize(lightDir + viewDir);
|
||||
|
||||
fixed diff = max(0, dot(s.Normal, lightDir));
|
||||
fixed diff = max(0, dot(s.Normal, lightDir));
|
||||
|
||||
float nh = max(0, dot(s.Normal, h));
|
||||
float spec = pow(nh, s.Specular*128.0) * s.Gloss;
|
||||
float nh = max(0, dot(s.Normal, h));
|
||||
float spec = pow(nh, s.Specular*128.0) * s.Gloss;
|
||||
|
||||
fixed4 c;
|
||||
c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * _SpecColor.rgb * spec) * (atten);
|
||||
c.a = s.Alpha + _LightColor0.a * _SpecColor.a * spec * atten;
|
||||
return c;
|
||||
fixed4 c;
|
||||
c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * _SpecColor.rgb * spec) * (atten);
|
||||
c.a = s.Alpha + _LightColor0.a * _SpecColor.a * spec * atten;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ inline fixed4 LightingBlinnPhongSmooth(SurfaceOutput s, fixed3 lightDir, half3 v
|
||||
|
||||
inline half4 LightingUnlit(SurfaceOutput s, half3 lightDir, half atten)
|
||||
{
|
||||
// half diff = max (0, dot (s.Normal, lightDir));
|
||||
// half diff = max (0, dot (s.Normal, lightDir));
|
||||
|
||||
half4 c;
|
||||
c.rgb = s.Albedo;
|
||||
c.a = s.Alpha;
|
||||
return c;
|
||||
half4 c;
|
||||
c.rgb = s.Albedo;
|
||||
c.a = s.Alpha;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
@ -35,10 +35,10 @@ inline half4 LightingUnlit(SurfaceOutput s, half3 lightDir, half atten)
|
||||
|
||||
inline half4 LightingUnlit_PrePass(SurfaceOutput s, half4 light)
|
||||
{
|
||||
half4 c;
|
||||
c.rgb = s.Albedo;
|
||||
c.a = s.Alpha;
|
||||
return c;
|
||||
half4 c;
|
||||
c.rgb = s.Albedo;
|
||||
c.a = s.Alpha;
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
@ -53,21 +53,21 @@ fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten) { retur
|
||||
float4 _Color;
|
||||
half _LightBoost;
|
||||
half4 LightingLightWrapped(SurfaceOutput s, half3 lightDir, half3 viewDir, half atten) {
|
||||
float3 w = _Color.rgb*0.5;
|
||||
half3 NdotL = dot(s.Normal, lightDir);
|
||||
float3 w = _Color.rgb*0.5;
|
||||
half3 NdotL = dot(s.Normal, lightDir);
|
||||
|
||||
//Specular term
|
||||
half3 h = normalize(lightDir + viewDir);
|
||||
s.Normal = normalize(s.Normal);
|
||||
float NdotH = dot(s.Normal, h);
|
||||
float spec = pow(max(NdotH, 0), s.Specular * 128.0) * s.Gloss;
|
||||
fixed3 specColor = _SpecColor.rgb * _LightColor0.rgb;
|
||||
//Specular term
|
||||
half3 h = normalize(lightDir + viewDir);
|
||||
s.Normal = normalize(s.Normal);
|
||||
float NdotH = dot(s.Normal, h);
|
||||
float spec = pow(max(NdotH, 0), s.Specular * 128.0) * s.Gloss;
|
||||
fixed3 specColor = _SpecColor.rgb * _LightColor0.rgb;
|
||||
|
||||
half3 diff = NdotL * (1 - w) + w;
|
||||
half4 c;
|
||||
c.rgb = ((s.Albedo * _LightColor0.rgb * diff) + (specColor * spec)) * (atten * _LightBoost);
|
||||
c.a = s.Alpha + (_LightColor0.a * _SpecColor.a * spec * atten);
|
||||
return c;
|
||||
half3 diff = NdotL * (1 - w) + w;
|
||||
half4 c;
|
||||
c.rgb = ((s.Albedo * _LightColor0.rgb * diff) + (specColor * spec)) * (atten * _LightBoost);
|
||||
c.a = s.Alpha + (_LightColor0.a * _SpecColor.a * spec * atten);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
@ -84,19 +84,19 @@ float _UnderwaterFogFactor;
|
||||
|
||||
float4 UnderwaterFog(float3 worldPos, float3 color)
|
||||
{
|
||||
float3 toPixel = worldPos - _LocalCameraPos.xyz;
|
||||
float toPixelLength = length(toPixel); ///< Comment out the math--looks better without it.
|
||||
//float angleDot = dot(_LocalCameraDir.xyz, toPixel / toPixelLength);
|
||||
//angleDot = lerp(0.00000001, angleDot, saturate(sign(angleDot)));
|
||||
//float waterDist = -_LocalCameraPos.w / angleDot;
|
||||
//float dist = min(toPixelLength, waterDist);
|
||||
float3 toPixel = worldPos - _LocalCameraPos.xyz;
|
||||
float toPixelLength = length(toPixel); ///< Comment out the math--looks better without it.
|
||||
//float angleDot = dot(_LocalCameraDir.xyz, toPixel / toPixelLength);
|
||||
//angleDot = lerp(0.00000001, angleDot, saturate(sign(angleDot)));
|
||||
//float waterDist = -_LocalCameraPos.w / angleDot;
|
||||
//float dist = min(toPixelLength, waterDist);
|
||||
|
||||
|
||||
float underwaterDetection = _UnderwaterFogFactor * _LocalCameraDir.w; ///< sign(1 - sign(_LocalCameraPos.w));
|
||||
float albedoLerpValue = underwaterDetection * (_UnderwaterMaxAlbedoFog * saturate(toPixelLength * _UnderwaterAlbedoDistanceScalar));
|
||||
float alphaFactor = 1 - underwaterDetection * (_UnderwaterMaxAlphaFog * saturate((toPixelLength - _UnderwaterMinAlphaFogDistance) * _UnderwaterAlphaDistanceScalar));
|
||||
float underwaterDetection = _UnderwaterFogFactor * _LocalCameraDir.w; ///< sign(1 - sign(_LocalCameraPos.w));
|
||||
float albedoLerpValue = underwaterDetection * (_UnderwaterMaxAlbedoFog * saturate(toPixelLength * _UnderwaterAlbedoDistanceScalar));
|
||||
float alphaFactor = 1 - underwaterDetection * (_UnderwaterMaxAlphaFog * saturate((toPixelLength - _UnderwaterMinAlphaFogDistance) * _UnderwaterAlphaDistanceScalar));
|
||||
|
||||
return float4(lerp(color, _UnderwaterFogColor.rgb, albedoLerpValue), alphaFactor);
|
||||
return float4(lerp(color, _UnderwaterFogColor.rgb, albedoLerpValue), alphaFactor);
|
||||
}
|
||||
|
||||
#endif
|
@ -2,22 +2,23 @@ Shader "ConformalDecals/SelectionGlow"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Header(Effects)]
|
||||
_RimEdgeGlow("Rim Edge Glow", Range(0, 1)) = 0.45
|
||||
_RimEdgePow("Rim Edge Falloff", Range(0,5)) = 5
|
||||
_RimEdgeOpacity("Rim Edge Opacity", Range(0,1)) = 0.2
|
||||
_RimFalloff("Rim Falloff", Range(0.01,5) ) = 0.1
|
||||
_RimColor("Rim Color", Color) = (0,0,0,0)
|
||||
_RimOpacity("Rim Opacity", Range(0,1)) = 0.5
|
||||
[Header(Effects)]
|
||||
_RimEdgeGlow("Rim Edge Glow", Range(0, 1)) = 0.45
|
||||
_RimEdgePow("Rim Edge Falloff", Range(0,5)) = 5
|
||||
_RimEdgeOpacity("Rim Edge Opacity", Range(0,1)) = 0.2
|
||||
_RimFalloff("Rim Falloff", Range(0.01,5) ) = 0.1
|
||||
_RimColor("Rim Color", Color) = (0,0,0,0)
|
||||
_RimOpacity("Rim Opacity", Range(0,1)) = 0.5
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Transparent" }
|
||||
Cull Back
|
||||
ZWrite Off
|
||||
|
||||
Pass
|
||||
{
|
||||
Blend One One
|
||||
Blend One One
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
{
|
||||
"MAJOR":0,
|
||||
"MINOR":1,
|
||||
"PATCH":0,
|
||||
"PATCH":2,
|
||||
"BUILD":0
|
||||
},
|
||||
"KSP_VERSION":
|
||||
|
11
README.md
11
README.md
@ -1,16 +1,21 @@
|
||||
# Conformal Decals v0.1.0
|
||||
# Conformal Decals v0.1.2
|
||||
[](https://travis-ci.org/drewcassidy/KSP-Conformal-Decals) [](https://creativecommons.org/licenses/by-sa/4.0/) [](https://www.gnu.org/licenses/gpl-3.0)
|
||||
|
||||

|
||||
|
||||
Conformal Decals adds a set of decal stickers to KSP, as well as providing a framework for creating your own decals which conform to the surface of the parts they are attached to.
|
||||
|
||||
## Dependencies
|
||||
|
||||
Required:
|
||||
- KSP (1.8.0 to 1.9.0)
|
||||
- KSP (1.8.x to 1.9.x)
|
||||
- B9 Part Switch (2.16.0). Bundled with release.
|
||||
- ModuleManager (4.1.3). Bundled with release.
|
||||
- Shabby (0.1.2). Bundled with release.
|
||||
|
||||
Optional:
|
||||
- Wild Blue Tools. For custom decals category in the VAB and SPH.
|
||||
|
||||
## Credits
|
||||
|
||||
- Art and Plugin code: Andrew Cassidy (Cineboxandrew)
|
||||
@ -27,6 +32,6 @@ Art assets and configuration files are licensed CC-BY-SA 4.0, as described in th
|
||||
Plugin code is distributed under the GPL v3, as described in the LICENSE-SOURCE.md file
|
||||
|
||||
Any bundled mods are distributed under their own license:
|
||||
- ModuleManager by blowfish and sarbian is distributed under a Creative Commons Sharealike license. More details, including source code, can be found here: https://forum.kerbalspaceprogram.com/index.php?/topic/50533-*
|
||||
- ModuleManager by blowfish and sarbian is distributed under a Creative Commons Sharealike license. More details, including source code, can be found [here](https://forum.kerbalspaceprogram.com/index.php?/topic/50533-*).
|
||||
- B9PartSwitch by blowfish is distributed under the LGPL v3 license.
|
||||
- Shabby by taniwha is distributed under the GPL v3 license.
|
@ -68,6 +68,6 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>sh -e -c "cp -v '$(TargetPath)' '$(SolutionDir)/../Distribution/GameData/ConformalDecals/Plugins'"</PostBuildEvent>
|
||||
<PostBuildEvent>sh -e -c "cp -v '$(TargetPath)' '$(SolutionDir)/../GameData/ConformalDecals/Plugins'"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
@ -95,6 +95,7 @@ namespace ConformalDecals {
|
||||
materialProperties.AddOrGetTextureProperty("_Decal", true).TextureUrl = newFlagUrl;
|
||||
|
||||
UpdateMaterials();
|
||||
UpdateScale();
|
||||
}
|
||||
|
||||
private void SetFlagSymmetryCounterparts(string newFlagUrl) {
|
||||
|
@ -1,3 +1,17 @@
|
||||
v0.1.2
|
||||
------
|
||||
|
||||
Fixes:
|
||||
- Disabled writing to the zbuffer in the decal bounds shader. Should fix any issues with Scatterer or EVE.
|
||||
|
||||
v0.1.1
|
||||
------
|
||||
|
||||
Fixes:
|
||||
- Fixed flag decal not adjusting to new texture sizes immediately.
|
||||
- Fixed decal bounds being visible on launch.
|
||||
- Fixed decal bounds being visible in the part icon.
|
||||
|
||||
v0.1.0
|
||||
------
|
||||
|
||||
|
Reference in New Issue
Block a user