You've already forked UniversalViewer
Initial files
This commit is contained in:
8
Assets/Scripts/RuntimeGizmo/Shader/Resources.meta
Normal file
8
Assets/Scripts/RuntimeGizmo/Shader/Resources.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 56308c649022e5e4c98212e0685bf28d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
20
Assets/Scripts/RuntimeGizmo/Shader/Resources/Lines.shader
Normal file
20
Assets/Scripts/RuntimeGizmo/Shader/Resources/Lines.shader
Normal file
@@ -0,0 +1,20 @@
|
||||
Shader "Custom/Lines"
|
||||
{
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite Off
|
||||
ZTest Always
|
||||
Cull Off
|
||||
Fog { Mode Off }
|
||||
|
||||
BindChannels
|
||||
{
|
||||
Bind "vertex", vertex
|
||||
Bind "color", color
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6a31e6e67bc4dc748a0e31657ba5c58e
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
57
Assets/Scripts/RuntimeGizmo/Shader/Resources/Outline.shader
Normal file
57
Assets/Scripts/RuntimeGizmo/Shader/Resources/Outline.shader
Normal file
@@ -0,0 +1,57 @@
|
||||
//Taken and modified from github.com/Shrimpey/Outlined-Diffuse-Shader-Fixed/blob/master/CustomOutline.shader
|
||||
|
||||
Shader "Custom/Outline" {
|
||||
Properties {
|
||||
_OutlineColor ("Outline Color", Color) = (1,.5,0,1)
|
||||
_Outline ("Outline width", Range (0, 1)) = .1
|
||||
}
|
||||
|
||||
CGINCLUDE
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata {
|
||||
float4 vertex : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 pos : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
v.vertex *= ( 1 + _Outline);
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
|
||||
o.color = _OutlineColor;
|
||||
return o;
|
||||
}
|
||||
ENDCG
|
||||
|
||||
SubShader {
|
||||
Tags { "DisableBatching" = "True" }
|
||||
Pass {
|
||||
Name "OUTLINE"
|
||||
Tags {"LightMode" = "UniversalForward" }
|
||||
Cull Front
|
||||
ZWrite On
|
||||
ColorMask RGB
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
half4 frag(v2f i) :COLOR { return i.color; }
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Diffuse"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d6bfa5d6b2b72a4eb8c7cfb922661de
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user