Initial Commit
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
/************************************************************************************
|
||||
|
||||
Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
See SampleFramework license.txt for license terms. Unless required by applicable law
|
||||
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied. See the license for specific
|
||||
language governing permissions and limitations under the license.
|
||||
|
||||
************************************************************************************/
|
||||
|
||||
|
||||
Shader "Oculus Sample/Button Glow" {
|
||||
Properties{
|
||||
_ColorMask("Texture", 2D) = "white" {}
|
||||
_Color("Color", Color) = (0.5, 0.5, 0.5, 0.5)
|
||||
}
|
||||
SubShader {
|
||||
Tags{"Queue" = "Transparent" "RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True" "PreviewType" = "Plane"}
|
||||
LOD 100 Blend SrcAlpha OneMinusSrcAlpha Cull Off Lighting Off ZWrite Off
|
||||
|
||||
Pass {
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata {
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : SV_POSITION;
|
||||
};
|
||||
|
||||
sampler2D _ColorMask;
|
||||
float4 _ColorMask_ST;
|
||||
fixed4 _Color;
|
||||
|
||||
v2f vert(appdata v) {
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _ColorMask);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag(v2f i) : SV_Target {
|
||||
fixed4 colMask = tex2D(_ColorMask, i.uv);
|
||||
return fixed4(_Color.rgb, colMask.r * 1.0);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e030bde756726c94bba808165a905b79
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,81 @@
|
||||
/************************************************************************************
|
||||
|
||||
Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
See SampleFramework license.txt for license terms. Unless required by applicable law
|
||||
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied. See the license for specific
|
||||
language governing permissions and limitations under the license.
|
||||
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus Sample/Procedural Gradient Skybox"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_TopColor ("Top Color", Color) = (1, 1, 1, 0)
|
||||
_HorizonColor ("Horizon Color", Color) = (1, 1, 1, 0)
|
||||
_BottomColor ("Bottom Color", Color) = (1, 1, 1, 0)
|
||||
_TopExponent ("Top Exponent", Float) = 0.5
|
||||
_BottomExponent ("Bottom Exponent", Float) = 0.5
|
||||
_AmplFactor ("Amplification", Float) = 1.0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags{"RenderType" ="Background" "Queue" = "Background"}
|
||||
ZWrite Off Cull Off
|
||||
Fog { Mode Off }
|
||||
LOD 100
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct vertIn
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float3 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct vertOut
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float3 uv: TEXCOORD0;
|
||||
};
|
||||
|
||||
vertOut vert (vertIn v)
|
||||
{
|
||||
vertOut o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = v.uv;
|
||||
return o;
|
||||
}
|
||||
|
||||
half _TopExponent;
|
||||
half _BottomExponent;
|
||||
fixed4 _TopColor;
|
||||
fixed4 _HorizonColor;
|
||||
fixed4 _BottomColor;
|
||||
half _AmplFactor;
|
||||
|
||||
fixed4 frag (vertOut i) : SV_Target
|
||||
{
|
||||
float interpUv = normalize (i.uv).y;
|
||||
// top goes from 0->1 going down toward horizon
|
||||
float topLerp = 1.0f - pow (min (1.0f, 1.0f - interpUv), _TopExponent);
|
||||
// bottom goes from 0->1 going up toward horizon
|
||||
float bottomLerp = 1.0f - pow (min (1.0f, 1.0f + interpUv), _BottomExponent);
|
||||
// last lerp param is horizon. all must add up to 1.0
|
||||
float horizonLerp = 1.0f - topLerp - bottomLerp;
|
||||
return (_TopColor * topLerp + _HorizonColor * horizonLerp + _BottomColor * bottomLerp) *
|
||||
_AmplFactor;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a26f6c3a227968248908d2fc42ae06e9
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,63 @@
|
||||
/************************************************************************************
|
||||
|
||||
Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
See SampleFramework license.txt for license terms. Unless required by applicable law
|
||||
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied. See the license for specific
|
||||
language governing permissions and limitations under the license.
|
||||
|
||||
************************************************************************************/
|
||||
|
||||
// does baked lighting + one directional light + reflection probe
|
||||
Shader "Oculus Sample/Train Props Shader" {
|
||||
Properties {
|
||||
[PowerSlider(6.0)] _Shininess("Shininess", Range(0.02, 1)) = 0.03
|
||||
_MainTex("Base (RGB) Gloss (A)", 2D) = "white" {}
|
||||
_Color("Color", Color) = (0.5, 0.5, 0.5, 0.5)
|
||||
_BumpMap("Normal map", 2D) = "bump" {}
|
||||
_ReflectionMap("Reflection map", CUBE) = "" {}
|
||||
[MaterialToggle] _ReflectionMapEnabled("Enable Reflection map", Float) = 0
|
||||
}
|
||||
SubShader {
|
||||
Tags{"RenderType" = "Opaque"}
|
||||
LOD 300
|
||||
|
||||
CGPROGRAM
|
||||
#include "UnityCG.cginc"
|
||||
// no deferred. support lightmaps and one light. use half vector instead of
|
||||
// view vector (less accurate but faster)
|
||||
#pragma surface surf BlinnPhong exclude_path:prepass noforwardadd halfasview
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct Input {
|
||||
float2 uv_MainTex;
|
||||
float3 worldRefl;
|
||||
float3 viewDir;
|
||||
INTERNAL_DATA
|
||||
};
|
||||
|
||||
half _Shininess;
|
||||
fixed4 _Color;
|
||||
sampler2D _BumpMap;
|
||||
samplerCUBE _ReflectionMap;
|
||||
fixed _ReflectionMapEnabled;
|
||||
|
||||
void surf(Input IN, inout SurfaceOutput o) {
|
||||
fixed4 albedo = tex2D(_MainTex, IN.uv_MainTex)*_Color;
|
||||
fixed gloss = albedo.a*_Shininess;
|
||||
fixed4 fakeReflec = texCUBE(_ReflectionMap, WorldReflectionVector(IN, o.Normal));
|
||||
|
||||
o.Albedo = albedo.rgb;
|
||||
o.Gloss = gloss;
|
||||
o.Alpha = gloss;
|
||||
o.Specular = gloss;
|
||||
o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex));
|
||||
o.Emission = _ReflectionMapEnabled * gloss * fakeReflec.rgb;
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
|
||||
FallBack "Mobile/VertexLit"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f4b0404f9d6f0f745a9d6caa997ff40d
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
/************************************************************************************
|
||||
|
||||
Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
See SampleFramework license.txt for license terms. Unless required by applicable law
|
||||
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied. See the license for specific
|
||||
language governing permissions and limitations under the license.
|
||||
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus Sample/Train Smoke"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex ("Texture", 2D) = "white" {}
|
||||
_TintColor ("Tint Color", Color) = (0.5, 0.5, 0.5, 0.5)
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags{"Queue" = "Transparent" "RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True" "PreviewType" = "Plane"}
|
||||
LOD 100
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Cull Off
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
// In the future, we can play with particle instancing, see:
|
||||
// see https://docs.unity3d.com/Manual/PartSysInstancing.html
|
||||
// for now we cannot, because our minimum supported Unity version doesn't support it
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct vertIn
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
};
|
||||
|
||||
struct vertOut
|
||||
{
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 clipPos : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
};
|
||||
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
fixed4 _TintColor;
|
||||
|
||||
vertOut vert (vertIn vIn)
|
||||
{
|
||||
vertOut vOut;
|
||||
UNITY_SETUP_INSTANCE_ID(vIn);
|
||||
UNITY_INITIALIZE_OUTPUT(vertOut, vOut);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(vOut);
|
||||
|
||||
vOut.clipPos = UnityObjectToClipPos(vIn.vertex);
|
||||
vOut.uv = TRANSFORM_TEX(vIn.uv, _MainTex);
|
||||
vOut.color = vIn.color * _TintColor;
|
||||
return vOut;
|
||||
}
|
||||
|
||||
fixed4 frag (vertOut vOut) : SV_Target
|
||||
{
|
||||
fixed4 fragColor = 2.0f * vOut.color * tex2D(_MainTex, vOut.uv);
|
||||
// don't amplify opacity
|
||||
fragColor.a = saturate(fragColor.a);
|
||||
return fragColor;
|
||||
}
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc74b8c94f33483478bd98d895293fd7
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
/************************************************************************************
|
||||
|
||||
Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
|
||||
|
||||
See SampleFramework license.txt for license terms. Unless required by applicable law
|
||||
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied. See the license for specific
|
||||
language governing permissions and limitations under the license.
|
||||
|
||||
************************************************************************************/
|
||||
|
||||
Shader "Oculus Sample/Xing Light"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_MainTex("Base (RGB) Alpha (A)", 2D) = "white" {}
|
||||
_Color("Tint Color", Color) = (0.5, 0.5, 0.5, 0.5)
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags{"Queue" = "Transparent" "RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True" "PreviewType" = "Plane"}
|
||||
LOD 100
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
Cull Back
|
||||
Lighting Off
|
||||
ZWrite Off
|
||||
|
||||
Pass
|
||||
{
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
fixed4 _Color;
|
||||
sampler2D _MainTex;
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
|
||||
return o;
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
return _Color * tex2D(_MainTex, i.uv);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20db1f0dad220cf4e8e49b6e6db7b68c
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user