Upgraded original RothenburgAR to Unity version 2017.4.5f1 (and upgrading from standalone vuforia to the version integrated in unity)
This commit is contained in:
57
Assets/Vuforia/Shaders/BrightTexture.shader
Normal file
57
Assets/Vuforia/Shaders/BrightTexture.shader
Normal file
@@ -0,0 +1,57 @@
|
||||
//==============================================================================
|
||||
//Copyright (c) 2013-2014 Qualcomm Connected Experiences, Inc.
|
||||
//All Rights Reserved.
|
||||
//==============================================================================
|
||||
|
||||
Shader "Custom/BrightTexture" {
|
||||
Properties {
|
||||
_MainTex ("Base (RGB)", 2D) = "white" {}
|
||||
}
|
||||
SubShader {
|
||||
|
||||
Pass{
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos (v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
half4 c = tex2D (_MainTex, i.uv);
|
||||
|
||||
float scale = 0.2f;
|
||||
c.rgb = c.rgb * scale + 1.0f - scale;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
2
Assets/Vuforia/Shaders/BrightTexture.shader.meta
Normal file
2
Assets/Vuforia/Shaders/BrightTexture.shader.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e6d3c0df88f3ab458512f8282e449af
|
||||
71
Assets/Vuforia/Shaders/CameraDiffuse.shader
Normal file
71
Assets/Vuforia/Shaders/CameraDiffuse.shader
Normal file
@@ -0,0 +1,71 @@
|
||||
//========================================================================
|
||||
// Copyright (c) 2017 PTC Inc. All Rights Reserved.
|
||||
//
|
||||
// Vuforia is a trademark of PTC Inc., registered in the United States and other
|
||||
// countries.
|
||||
//=========================================================================
|
||||
|
||||
Shader "Custom/CameraDiffuse"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MaterialColor ("Color", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
CGINCLUDE
|
||||
|
||||
uniform float4 _MaterialColor;
|
||||
|
||||
ENDCG
|
||||
|
||||
SubShader
|
||||
{
|
||||
Pass
|
||||
{
|
||||
// indicate that our pass is the "base" pass in forward
|
||||
// rendering pipeline. It gets ambient and main directional
|
||||
// light data set up; light direction in _WorldSpaceLightPos0
|
||||
// and color in _LightColor0
|
||||
Tags {"LightMode"="ForwardBase"}
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc" // for UnityObjectToWorldNormal
|
||||
#include "UnityLightingCommon.cginc" // for _LightColor0
|
||||
|
||||
struct v2f
|
||||
{
|
||||
fixed4 diff : COLOR0; // diffuse lighting color
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
v2f vert (appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
|
||||
|
||||
// get vertex normal in world space
|
||||
half3 worldNormal = UnityObjectToWorldNormal(v.normal);
|
||||
|
||||
float3 worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
|
||||
// compute world space view direction
|
||||
float3 worldViewDir = normalize(UnityWorldSpaceViewDir(worldPos));
|
||||
// dot product between normal and light direction for
|
||||
// standard diffuse (Lambert) lighting
|
||||
half nl = max(0, dot(worldNormal, worldViewDir));
|
||||
|
||||
// factor in the material color
|
||||
o.diff = lerp(_MaterialColor, nl * _MaterialColor, 0.2);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
return i.diff;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
9
Assets/Vuforia/Shaders/CameraDiffuse.shader.meta
Normal file
9
Assets/Vuforia/Shaders/CameraDiffuse.shader.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a890b01c666b2a4dbdfe1eb6a476078
|
||||
timeCreated: 1496997307
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/Vuforia/Shaders/ColoredLines.shader
Normal file
22
Assets/Vuforia/Shaders/ColoredLines.shader
Normal file
@@ -0,0 +1,22 @@
|
||||
//===============================================================================
|
||||
//Copyright (c) 2015-2016 PTC Inc. All Rights Reserved.
|
||||
//
|
||||
//Confidential and Proprietary - Protected under copyright and other laws.
|
||||
//Vuforia is a trademark of PTC Inc., registered in the United States and other
|
||||
//countries.
|
||||
//===============================================================================
|
||||
|
||||
Shader "Custom/ColoredLines" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
Lighting Off
|
||||
Cull Off
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Color [_Color]
|
||||
}
|
||||
}
|
||||
}
|
||||
5
Assets/Vuforia/Shaders/ColoredLines.shader.meta
Normal file
5
Assets/Vuforia/Shaders/ColoredLines.shader.meta
Normal file
@@ -0,0 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c3430c603e3a4f54c86671122d3dfa1c
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
78
Assets/Vuforia/Shaders/DepthContour.shader
Normal file
78
Assets/Vuforia/Shaders/DepthContour.shader
Normal file
@@ -0,0 +1,78 @@
|
||||
/*========================================================================
|
||||
Copyright (c) 2017 PTC Inc. All Rights Reserved.
|
||||
|
||||
Vuforia is a trademark of PTC Inc., registered in the United States and other
|
||||
countries.
|
||||
=========================================================================*/
|
||||
Shader "Custom/DepthContour" {
|
||||
Properties{
|
||||
_ContourColor("Contour Color", Color) = (1,1,1,1)
|
||||
_SurfaceColor("Surface Color", Color) = (0.5,0.5,0.5,1)
|
||||
_DepthThreshold("Depth Threshold", Float) = 0.002
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags { "Queue" = "Geometry" "RenderType" = "Transparent" }
|
||||
|
||||
Pass {
|
||||
Cull Back
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
uniform sampler2D _CameraDepthTexture;
|
||||
uniform float4 _ContourColor;
|
||||
uniform float4 _SurfaceColor;
|
||||
uniform float _DepthThreshold;
|
||||
|
||||
struct v2f {
|
||||
float4 pos : SV_POSITION;
|
||||
float4 screenPos : TEXCOORD0;
|
||||
float depth : TEXCOORD1;
|
||||
};
|
||||
|
||||
v2f vert(appdata_base v)
|
||||
{
|
||||
v2f o;
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.screenPos = ComputeScreenPos(o.pos);
|
||||
|
||||
COMPUTE_EYEDEPTH(o.depth);
|
||||
o.depth = (o.depth - _ProjectionParams.y) / (_ProjectionParams.z - _ProjectionParams.y);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(v2f i) : COLOR
|
||||
{
|
||||
float2 uv = i.screenPos.xy / i.screenPos.w;
|
||||
float du = 1.0 / _ScreenParams.x;
|
||||
float dv = 1.0 / _ScreenParams.y;
|
||||
float2 uv_X1 = uv + float2(du, 0.0);
|
||||
float2 uv_Y1 = uv + float2(0.0, dv);
|
||||
float2 uv_X2 = uv + float2(-du, 0.0);
|
||||
float2 uv_Y2 = uv + float2(0.0, -dv);
|
||||
|
||||
float depth0 = Linear01Depth(UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, uv)));
|
||||
float depthX1 = Linear01Depth(UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, uv_X1)));
|
||||
float depthY1 = Linear01Depth(UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, uv_Y1)));
|
||||
float depthX2 = Linear01Depth(UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, uv_X2)));
|
||||
float depthY2 = Linear01Depth(UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, uv_Y2)));
|
||||
|
||||
float farDist = _ProjectionParams.z;
|
||||
float refDepthStep = _DepthThreshold / farDist;
|
||||
float depthStepX = max(abs(depth0 - depthX1), abs(depth0 - depthX2));
|
||||
float depthStepY = max(abs(depth0 - depthY1), abs(depth0 - depthY2));
|
||||
float maxDepthStep = length(float2(depthStepX, depthStepY));
|
||||
half contour = (maxDepthStep > refDepthStep) ? 1.0 : 0.0;
|
||||
return _SurfaceColor * (1.0 - contour) + _ContourColor * contour;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
|
||||
Fallback "Diffuse"
|
||||
}
|
||||
10
Assets/Vuforia/Shaders/DepthContour.shader.meta
Normal file
10
Assets/Vuforia/Shaders/DepthContour.shader.meta
Normal file
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1ded68d068051d4f92650fcddaae5c7
|
||||
timeCreated: 1510068460
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
43
Assets/Vuforia/Shaders/DepthMask.shader
Normal file
43
Assets/Vuforia/Shaders/DepthMask.shader
Normal file
@@ -0,0 +1,43 @@
|
||||
//===============================================================================
|
||||
//Copyright (c) 2015 PTC Inc. All Rights Reserved.
|
||||
//
|
||||
//Confidential and Proprietary - Protected under copyright and other laws.
|
||||
//Vuforia is a trademark of PTC Inc., registered in the United States and other
|
||||
//countries.
|
||||
//===============================================================================
|
||||
//===============================================================================
|
||||
//Copyright (c) 2010-2014 Qualcomm Connected Experiences, Inc.
|
||||
//All Rights Reserved.
|
||||
//Confidential and Proprietary - Qualcomm Connected Experiences, Inc.
|
||||
//===============================================================================
|
||||
|
||||
Shader "DepthMask" {
|
||||
|
||||
SubShader {
|
||||
// Render the mask after regular geometry, but before masked geometry and
|
||||
// transparent things.
|
||||
|
||||
Tags {"Queue" = "Geometry-10" }
|
||||
|
||||
// Turn off lighting, because it's expensive and the thing is supposed to be
|
||||
// invisible anyway.
|
||||
|
||||
Lighting Off
|
||||
|
||||
// Draw into the depth buffer in the usual way. This is probably the default,
|
||||
// but it doesn't hurt to be explicit.
|
||||
|
||||
ZTest LEqual
|
||||
ZWrite On
|
||||
|
||||
// Don't draw anything into the RGBA channels. This is an undocumented
|
||||
// argument to ColorMask which lets us avoid writing to anything except
|
||||
// the depth buffer.
|
||||
|
||||
ColorMask 0
|
||||
|
||||
// Do nothing specific in the pass:
|
||||
|
||||
Pass {}
|
||||
}
|
||||
}
|
||||
2
Assets/Vuforia/Shaders/DepthMask.shader.meta
Normal file
2
Assets/Vuforia/Shaders/DepthMask.shader.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 1
|
||||
guid: 1ce7eb78425fb1540838bc9d5d95857a
|
||||
86
Assets/Vuforia/Shaders/OutlineOpaque.shader
Normal file
86
Assets/Vuforia/Shaders/OutlineOpaque.shader
Normal file
@@ -0,0 +1,86 @@
|
||||
//===============================================================================
|
||||
//Copyright (c) 2017 PTC Inc. All Rights Reserved.
|
||||
//
|
||||
//Confidential and Proprietary - Protected under copyright and other laws.
|
||||
//Vuforia is a trademark of PTC Inc., registered in the United States and other
|
||||
//countries.
|
||||
//===============================================================================
|
||||
//==============================================================================
|
||||
//Copyright (c) 2013-2014 Qualcomm Connected Experiences, Inc.
|
||||
//All Rights Reserved.
|
||||
//==============================================================================
|
||||
|
||||
Shader "Custom/OutlineOpaque"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_SilhouetteSize ("Size", Float) = 0.0
|
||||
_SilhouetteColor ("Color", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
CGINCLUDE
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
struct vertIn
|
||||
{
|
||||
float4 position : POSITION;
|
||||
float3 normal : NORMAL;
|
||||
};
|
||||
|
||||
uniform float _SilhouetteSize;
|
||||
uniform float4 _SilhouetteColor;
|
||||
|
||||
ENDCG
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Geometry" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Cull Back
|
||||
Blend Zero One
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Cull Front
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
v2f vert(vertIn input)
|
||||
{
|
||||
v2f output;
|
||||
// unmodified projected position of the vertex
|
||||
output.position = UnityObjectToClipPos(input.position);
|
||||
output.color = _SilhouetteColor;
|
||||
|
||||
// calculate silhouette in image space
|
||||
float2 silhouette = TransformViewToProjection(mul((float3x3)UNITY_MATRIX_IT_MV, input.normal).xy) * _SilhouetteSize;
|
||||
|
||||
// add silhouette offset
|
||||
output.position.xy += output.position.z * silhouette;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
half4 frag(v2f input) :COLOR
|
||||
{
|
||||
return input.color;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Fallback "Diffuse"
|
||||
}
|
||||
9
Assets/Vuforia/Shaders/OutlineOpaque.shader.meta
Normal file
9
Assets/Vuforia/Shaders/OutlineOpaque.shader.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a81568144a775094bb6b92c7df9fcebe
|
||||
timeCreated: 1484752106
|
||||
licenseType: Pro
|
||||
ShaderImporter:
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
26
Assets/Vuforia/Shaders/Text3D.shader
Normal file
26
Assets/Vuforia/Shaders/Text3D.shader
Normal file
@@ -0,0 +1,26 @@
|
||||
//========================================================================
|
||||
//Copyright (c) 2013-2014 Qualcomm Connected Experiences, Inc.
|
||||
//All Rights Reserved.
|
||||
//Confidential and Proprietary - Protected under copyright and other laws.
|
||||
//========================================================================
|
||||
|
||||
Shader "Custom/Text3D" {
|
||||
Properties {
|
||||
_MainTex ("Base (RGB)", 2D) = "white" {}
|
||||
_Color ("Text Color", Color) = (1,1,1,1)
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags { "Queue"="Geometry+1" "IgnoreProjector"="True" }
|
||||
Lighting Off Offset -1, -1 ZTest LEqual ZWrite On Fog { Mode Off }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Pass {
|
||||
Color [_Color]
|
||||
SetTexture [_MainTex] {
|
||||
combine primary, texture * primary
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
2
Assets/Vuforia/Shaders/Text3D.shader.meta
Normal file
2
Assets/Vuforia/Shaders/Text3D.shader.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1291d28f0c885a84d8c9a67bc6ca0c82
|
||||
33
Assets/Vuforia/Shaders/VertexLitWithZ.shader
Normal file
33
Assets/Vuforia/Shaders/VertexLitWithZ.shader
Normal file
@@ -0,0 +1,33 @@
|
||||
//==============================================================================
|
||||
//Copyright (c) 2013-2014 Qualcomm Connected Experiences, Inc.
|
||||
//All Rights Reserved.
|
||||
//==============================================================================
|
||||
|
||||
Shader "Transparent/VertexLit with Z" {
|
||||
Properties {
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags {"RenderType"="Transparent" "Queue"="Transparent"}
|
||||
// Render into depth buffer only
|
||||
Pass {
|
||||
ColorMask 0
|
||||
}
|
||||
// Render normally
|
||||
Pass {
|
||||
ZWrite On
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ColorMask RGB
|
||||
Material {
|
||||
Diffuse [_Color]
|
||||
Ambient [_Color]
|
||||
}
|
||||
Lighting On
|
||||
SetTexture [_MainTex] {
|
||||
Combine texture * primary DOUBLE, texture * primary
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
4
Assets/Vuforia/Shaders/VertexLitWithZ.shader.meta
Normal file
4
Assets/Vuforia/Shaders/VertexLitWithZ.shader.meta
Normal file
@@ -0,0 +1,4 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c158ceb104c238944a4daf52327953f9
|
||||
ShaderImporter:
|
||||
userData:
|
||||
Reference in New Issue
Block a user