Repair shader

This commit is contained in:
haitem 2021-01-30 19:02:37 +01:00
parent 77456cec41
commit d2bd761e2f
5 changed files with 70 additions and 209 deletions

View File

@ -66,7 +66,7 @@ Material:
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Outline: 0.25
- _Outline: 0.1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1

8
Assets/Scenes/Filip.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 89e3b8217119e5342a8150f4a2b3cc44
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -283,87 +283,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 597897b562955934fae65d62e0a8e3cd, type: 3}
--- !u!1001 &791294013
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1737216246128126191, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_Icon
value:
objectReference: {fileID: 4162164826716764455, guid: 0000000000000000d000000000000000,
type: 0}
- target: {fileID: 4715133416468503816, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_Icon
value:
objectReference: {fileID: 4162164826716764455, guid: 0000000000000000d000000000000000,
type: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_RootOrder
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalPosition.x
value: -7.06
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827164, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8224448297729827165, guid: 08d7423eab725344da0bad3b29f907dd,
type: 3}
propertyPath: m_Name
value: SawRiding
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 08d7423eab725344da0bad3b29f907dd, type: 3}
--- !u!1 &964739489
GameObject:
m_ObjectHideFlags: 0
@ -604,72 +523,3 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0d7691d0b9091aa4dba16f262d8daf1b, type: 3}
--- !u!1001 &8810309420367969849
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_RootOrder
value: 5
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalPosition.x
value: 2.64
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466072, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8810309419999466073, guid: 75a5dff38607d264bbf318173d359a5e,
type: 3}
propertyPath: m_Name
value: Saw
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 75a5dff38607d264bbf318173d359a5e, type: 3}

View File

@ -71,7 +71,7 @@ public class ObjectManager : MonoBehaviour
playerManager = collision.gameObject.GetComponent<PlayerManager>();
if (playerManager.activeAbility.Count > 0 && playerManager.activeAbility[0] == 2)
{
meshRenderer.materials[1].SetFloat("_Outline", 0.25f);
meshRenderer.materials[1].SetFloat("_Outline", 0.1f);
}
else
{

View File

@ -1,82 +1,85 @@
Shader "Outlined/Silhouette Only"
{
Properties{
_OutlineColor("Outline Color", Color) = (0,0,0,1)
_Outline("Outline width", Range(0.0, 1.0)) = .005
}
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
CGINCLUDE
Shader "Outlined/Silhouette Only" {
Properties{
_OutlineColor("Outline Color", Color) = (0,0,0,1)
_Outline("Outline width", Range(0.0, 1)) = .005
}
CGINCLUDE
#include "UnityCG.cginc"
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
};
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
};
struct v2f {
float4 pos : POSITION;
float4 color : COLOR;
};
struct v2f {
float4 pos : POSITION;
float4 color : COLOR;
};
uniform float _Outline;
uniform float4 _OutlineColor;
uniform float _Outline;
uniform float4 _OutlineColor;
v2f vert(appdata v) {
// just make a copy of incoming vertex data but scaled according to normal direction
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
v2f vert(appdata v) {
// just make a copy of incoming vertex data but scaled according to normal direction
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
float3 norm = mul((float3x3)UNITY_MATRIX_IT_MV, v.normal);
float2 offset = TransformViewToProjection(norm.xy);
float3 norm = mul((float3x3)UNITY_MATRIX_IT_MV, v.normal);
float2 offset = TransformViewToProjection(norm.xy);
o.pos.xy += offset * o.pos.z * _Outline;
o.color = _OutlineColor;
return o;
}
ENDCG
o.pos.xy += offset * o.pos.z * _Outline;
o.color = _OutlineColor;
return o;
}
ENDCG
SubShader{
Tags { "Queue" = "Transparent" }
SubShader{
Tags { "Queue" = "Transparent" }
Pass {
Name "BASE"
Cull Back
Blend Zero One
Pass {
Name "BASE"
Cull Back
Blend Zero One
// uncomment this to hide inner details:
//Offset -8, -8
// uncomment this to hide inner details:
//Offset -8, -8
SetTexture[_OutlineColor] {
ConstantColor(0,0,0,0)
Combine constant
}
}
SetTexture[_OutlineColor] {
ConstantColor(0,0,0,0)
Combine constant
}
}
// note that a vertex shader is specified here but it's using the one above
Pass {
Name "OUTLINE"
Tags { "LightMode" = "Always" }
Cull Front
// note that a vertex shader is specified here but its using the one above
Pass {
Name "OUTLINE"
Tags { "LightMode" = "Always" }
Cull Off
Offset 4,4
// you can choose what kind of blending mode you want for the outline
//Blend SrcAlpha OneMinusSrcAlpha // Normal
//Blend One One // Additive
Blend One OneMinusDstColor // Soft Additive
//Blend DstColor Zero // Multiplicative
//Blend DstColor SrcColor // 2x Multiplicative
// you can choose what kind of blending mode you want for the outline
//Blend SrcAlpha OneMinusSrcAlpha // Normal
//Blend One One // Additive
Blend One OneMinusDstColor // Soft Additive
//Blend DstColor Zero // Multiplicative
//Blend DstColor SrcColor // 2x Multiplicative
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
half4 frag(v2f i) :COLOR {
return i.color;
return i.color;
}
ENDCG
}
}
}
}
Fallback "Diffuse"
}
Fallback "Diffuse"
}