Initialer Upload neues Unity-Projekt
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
uniform half _DitherStrength;
|
||||
|
||||
inline half DitherAnimatedNoise(half2 screenPos) {
|
||||
half noise = frac(
|
||||
dot(uint3(screenPos, floor(fmod(_Time.y * 10, 4))), uint3(2, 7, 23) / 17.0f));
|
||||
noise -= 0.5; // remap from [0..1[ to [-0.5..0.5[
|
||||
half noiseScaled = (noise / _DitherStrength);
|
||||
return noiseScaled;
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad62366434a0c0d43828de4737c3ed09
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,90 @@
|
||||
/************************************************************************************
|
||||
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
|
||||
https://developer.oculus.com/licenses/oculussdk/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
ANY KIND, either express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus/Interaction/deskShadow"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex("MainTex", 2D) = "white" {}
|
||||
_Color("Shadow Color", Color) = (0, 0, 0, 0)
|
||||
|
||||
[HideInInspector] _texcoord("", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0"}
|
||||
LOD 100
|
||||
|
||||
CGINCLUDE
|
||||
#pragma target 3.0
|
||||
ENDCG
|
||||
Blend DstColor Zero
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Base"
|
||||
CGPROGRAM
|
||||
|
||||
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
|
||||
//only defining to not throw compilation error over Unity 5.5
|
||||
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
|
||||
#endif
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_instancing
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityShaderVariables.cginc"
|
||||
|
||||
struct vertexInput
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct vertexOutput
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
uniform half4 _MainTex_ST;
|
||||
uniform half4 _Color;
|
||||
|
||||
vertexOutput vert(vertexInput v)
|
||||
{
|
||||
vertexOutput o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag(vertexOutput i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
half4 mainTexture = tex2D(_MainTex, i.texcoord.xy);
|
||||
half4 finalColor = lerp (_Color, half4(1, 1, 1, 1), mainTexture.r) ;
|
||||
return finalColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f78749865658de149abef9e52614f8fe
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
101
Assets/Oculus/Interaction/Samples/Shaders/SkyboxGradient.shader
Normal file
101
Assets/Oculus/Interaction/Samples/Shaders/SkyboxGradient.shader
Normal file
@ -0,0 +1,101 @@
|
||||
/************************************************************************************
|
||||
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
|
||||
https://developer.oculus.com/licenses/oculussdk/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
ANY KIND, either express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus/Interaction/SkyboxGradient"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_TopColor("Top Color", Color) = (1, 0.3, 0.3, 1)
|
||||
_MiddleColor("MiddleColor", Color) = (1.0, 1.0, 1)
|
||||
_BottomColor("Bottom Color", Color) = (0.3, 0.3, 1, 1)
|
||||
_Direction("Direction", Vector) = (0, 1, 0)
|
||||
|
||||
_DitherStrength("Dither Strength", int) = 16
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"RenderType" = "Background"
|
||||
"Queue" = "Background"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
ZWrite Off
|
||||
Cull Off
|
||||
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "InteractionCG.cginc"
|
||||
|
||||
uniform half3 _TopColor;
|
||||
uniform half3 _BottomColor;
|
||||
uniform half3 _MiddleColor;
|
||||
uniform float3 _Direction;
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float3 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 texcoord : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
VertexOutput vert(VertexInput v)
|
||||
{
|
||||
VertexOutput o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(VertexOutput i) : SV_TARGET
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
|
||||
float3 texcoord = normalize(i.texcoord);
|
||||
half ditherNoise = DitherAnimatedNoise(i.vertex.xy);
|
||||
|
||||
float range = dot(texcoord, _Direction) + ditherNoise;
|
||||
|
||||
half bottomRange = saturate(-range);
|
||||
half middleRange = 1 - abs(range);
|
||||
half topRange = saturate(range);
|
||||
|
||||
half3 finalColor = _BottomColor.rgb * bottomRange
|
||||
+ _MiddleColor.rgb * middleRange
|
||||
+_TopColor.rgb * topRange;
|
||||
|
||||
return half4(finalColor,1);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e03ad77781c41da4092efe96d548a1f7
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
112
Assets/Oculus/Interaction/Samples/Shaders/StencilSky.shader
Normal file
112
Assets/Oculus/Interaction/Samples/Shaders/StencilSky.shader
Normal file
@ -0,0 +1,112 @@
|
||||
/************************************************************************************
|
||||
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
|
||||
https://developer.oculus.com/licenses/oculussdk/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
ANY KIND, either express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus/Interaction/Stencil Sky"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex("MainTex", 2D) = "white" {}
|
||||
_ColorLight("Light Color", Color) = (0,0,0,0)
|
||||
_ColorDark("Dark Color", Color) = (0, 0, 0, 0)
|
||||
_DitherStrength("Dither Strength", int) = 16
|
||||
[IntRange] _StencilRef("Stencil Reference Value", Range(0, 255)) = 0
|
||||
|
||||
[HideInInspector] _texcoord("", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
|
||||
|
||||
Stencil{
|
||||
Ref[_StencilRef]
|
||||
Comp Equal
|
||||
}
|
||||
|
||||
// Tags{"Queue" = "Geometry+502"}
|
||||
// has to be this high because the stencil buffer writer needs to be 2501 in order to
|
||||
// sort back to front
|
||||
|
||||
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+502"}
|
||||
LOD 100
|
||||
|
||||
CGINCLUDE
|
||||
#pragma target 3.0
|
||||
ENDCG
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Base"
|
||||
CGPROGRAM
|
||||
|
||||
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
|
||||
//only defining to not throw compilation error over Unity 5.5
|
||||
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
|
||||
#endif
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_instancing
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityShaderVariables.cginc"
|
||||
#include "InteractionCG.cginc"
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half2 texcoord : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
uniform half4 _MainTex_ST;
|
||||
uniform half4 _ColorLight;
|
||||
uniform half4 _ColorDark;
|
||||
|
||||
VertexOutput vert(VertexInput v)
|
||||
{
|
||||
VertexOutput o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(VertexOutput i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
half ditherNoise = DitherAnimatedNoise(i.vertex.xy);
|
||||
half4 mainTexture = tex2D(_MainTex, i.texcoord.xy);
|
||||
half4 finalColor = lerp(_ColorDark, _ColorLight, mainTexture.r + ditherNoise);
|
||||
UNITY_OPAQUE_ALPHA(finalColor.a);
|
||||
return finalColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2402243f452b96b408e8405082fd5ce6
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,77 @@
|
||||
/************************************************************************************
|
||||
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
|
||||
https://developer.oculus.com/licenses/oculussdk/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
ANY KIND, either express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus/Interaction/StencilWriter"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[IntRange] _StencilRef("Stencil Reference Value", Range(0,255)) = 0
|
||||
}
|
||||
|
||||
SubShader{
|
||||
|
||||
Tags {"Queue" = "Geometry+501"} // stuck way up here so that it sorts with transparent objects
|
||||
|
||||
ZWrite Off
|
||||
|
||||
ColorMask 0 // Don't write to any colour channels
|
||||
Stencil
|
||||
{
|
||||
Ref[_StencilRef]
|
||||
Comp Always
|
||||
Pass Replace
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
half4 vertex : POSITION;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
half4 pos : SV_POSITION;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
VertexOutput vert(VertexInput v)
|
||||
{
|
||||
VertexOutput o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(VertexOutput i) : COLOR
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4afa4535914e1924cb7bef9318c2018c
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
109
Assets/Oculus/Interaction/Samples/Shaders/floor.shader
Normal file
109
Assets/Oculus/Interaction/Samples/Shaders/floor.shader
Normal file
@ -0,0 +1,109 @@
|
||||
/************************************************************************************
|
||||
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
|
||||
https://developer.oculus.com/licenses/oculussdk/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
ANY KIND, either express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus/Interaction/floor"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex("MainTex", 2D) = "white" {}
|
||||
_ColorLight("Light Color", Color) = (1, 1, 1, 1)
|
||||
_ColorDark("Dark Color", Color) = (0, 0, 0, 1)
|
||||
_DetailTex("Detail Texture", 2D) = "white" {}
|
||||
_DetailTexIntensity("Detail Texture Intensity", Range(0, 1)) = 1
|
||||
_DitherStrength("Dither Strength", int) = 16
|
||||
|
||||
[HideInInspector] _texcoord("", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0"}
|
||||
LOD 100
|
||||
|
||||
CGINCLUDE
|
||||
#pragma target 3.0
|
||||
ENDCG
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Base"
|
||||
CGPROGRAM
|
||||
|
||||
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
|
||||
//only defining to not throw compilation error over Unity 5.5
|
||||
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
|
||||
#endif
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_instancing
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityShaderVariables.cginc"
|
||||
#include "InteractionCG.cginc"
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
half4 vertexColor : COLOR;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half2 texcoord : TEXCOORD1;
|
||||
half4 vertexColor : COLOR;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
uniform half4 _MainTex_ST;
|
||||
uniform half4 _ColorLight;
|
||||
uniform half4 _ColorDark;
|
||||
uniform sampler2D _DetailTex;
|
||||
uniform half _DetailTexIntensity;
|
||||
uniform half4 _DetailTex_ST;
|
||||
|
||||
VertexOutput vert(VertexInput v)
|
||||
{
|
||||
VertexOutput o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
o.vertexColor = v.vertexColor;
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(VertexOutput i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
half ditherNoise = DitherAnimatedNoise(i.vertex.xy);
|
||||
half4 detailTexture =
|
||||
tex2D(_DetailTex, (i.texcoord.xy * _DetailTex_ST.xy) + _DetailTex_ST.zw);
|
||||
detailTexture = saturate(detailTexture + (1 - _DetailTexIntensity));
|
||||
half4 mainTexture = tex2D(_MainTex, i.texcoord.xy);
|
||||
half4 finalColor = lerp(_ColorDark, _ColorLight, (mainTexture.r * detailTexture.r) + ditherNoise);
|
||||
finalColor.a = i.vertexColor.r + ditherNoise;
|
||||
return finalColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
10
Assets/Oculus/Interaction/Samples/Shaders/floor.shader.meta
Normal file
10
Assets/Oculus/Interaction/Samples/Shaders/floor.shader.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c1b3671e5e09b745962f635c3f2a747
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
106
Assets/Oculus/Interaction/Samples/Shaders/room.shader
Normal file
106
Assets/Oculus/Interaction/Samples/Shaders/room.shader
Normal file
@ -0,0 +1,106 @@
|
||||
/************************************************************************************
|
||||
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
Your use of this SDK or tool is subject to the Oculus SDK License Agreement, available at
|
||||
https://developer.oculus.com/licenses/oculussdk/
|
||||
|
||||
Unless required by applicable law or agreed to in writing, the Utilities SDK distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
ANY KIND, either express or implied. See the License for the specific language governing
|
||||
permissions and limitations under the License.
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus/Interaction/Room"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex("MainTex", 2D) = "white" {}
|
||||
_DetailTex("Detail Texture", 2D) = "white" {}
|
||||
_DetailTexIntensity("Detail Texture Intensity", Range(0, 1)) = 1
|
||||
|
||||
_ColorLight("Light Color", Color) = (1, 1, 1, 1)
|
||||
_ColorDark("Dark Color", Color) = (0, 0, 0, 1)
|
||||
_DitherStrength("Dither Strength", int) = 16
|
||||
|
||||
[HideInInspector] _texcoord("", 2D) = "white" {}
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0"}
|
||||
LOD 100
|
||||
|
||||
CGINCLUDE
|
||||
#pragma target 3.0
|
||||
ENDCG
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Base"
|
||||
CGPROGRAM
|
||||
|
||||
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
|
||||
//only defining to not throw compilation error over Unity 5.5
|
||||
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
|
||||
#endif
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_instancing
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityShaderVariables.cginc"
|
||||
#include "InteractionCG.cginc"
|
||||
|
||||
struct VertexInput
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half2 texcoord : TEXCOORD0;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
half2 texcoord : TEXCOORD1;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
uniform half4 _MainTex_ST;
|
||||
uniform sampler2D _DetailTex;
|
||||
uniform half _DetailTexIntensity;
|
||||
uniform half4 _DetailTex_ST;
|
||||
uniform half4 _ColorLight;
|
||||
uniform half4 _ColorDark;
|
||||
|
||||
VertexOutput vert(VertexInput v)
|
||||
{
|
||||
VertexOutput o;
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||||
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.texcoord = v.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag(VertexOutput i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_INSTANCE_ID(i);
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
half ditherNoise = DitherAnimatedNoise(i.vertex.xy);
|
||||
half4 mainTexture = tex2D(_MainTex, i.texcoord.xy);
|
||||
half4 detailTexture =
|
||||
tex2D(_DetailTex, (i.texcoord.xy * _DetailTex_ST.xy) + _DetailTex_ST.zw);
|
||||
detailTexture = saturate(pow(detailTexture, _DetailTexIntensity));
|
||||
half4 finalColor = lerp(_ColorDark, _ColorLight, (mainTexture.r* detailTexture.r) + ditherNoise);
|
||||
UNITY_OPAQUE_ALPHA(finalColor.a);
|
||||
return finalColor;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
FallBack "Diffuse"
|
||||
}
|
||||
10
Assets/Oculus/Interaction/Samples/Shaders/room.shader.meta
Normal file
10
Assets/Oculus/Interaction/Samples/Shaders/room.shader.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a14dede2360c664f97c90665c986e32
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
preprocessorOverride: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user