Updated oculus stuff

This commit is contained in:
Chris Midkiff
2018-10-09 20:59:57 -04:00
parent 1e7362c19f
commit 9b7f63739e
957 changed files with 128988 additions and 588 deletions

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b7b5af4818686f84f844c1ae9df0f700
folderAsset: yes
timeCreated: 1466716731
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 03c5cda4272cb2746a668ce131f04c0f
folderAsset: yes
timeCreated: 1466717994
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,318 @@
#ifndef AVATAR_UTIL_CG_INCLUDED
#define AVATAR_UTIL_CG_INCLUDED
#include "UnityCG.cginc"
#define SAMPLE_MODE_COLOR 0
#define SAMPLE_MODE_TEXTURE 1
#define SAMPLE_MODE_TEXTURE_SINGLE_CHANNEL 2
#define SAMPLE_MODE_PARALLAX 3
#define SAMPLE_MODE_RSRM 4
#define MASK_TYPE_NONE 0
#define MASK_TYPE_POSITIONAL 1
#define MASK_TYPE_REFLECTION 2
#define MASK_TYPE_FRESNEL 3
#define MASK_TYPE_PULSE 4
#define BLEND_MODE_ADD 0
#define BLEND_MODE_MULTIPLY 1
#ifdef LAYERS_1
#define LAYER_COUNT 1
#elif LAYERS_2
#define LAYER_COUNT 2
#elif LAYERS_3
#define LAYER_COUNT 3
#elif LAYERS_4
#define LAYER_COUNT 4
#elif LAYERS_5
#define LAYER_COUNT 5
#elif LAYERS_6
#define LAYER_COUNT 6
#elif LAYERS_7
#define LAYER_COUNT 7
#elif LAYERS_8
#define LAYER_COUNT 8
#endif
#define DECLARE_LAYER_UNIFORMS(index) \
int _LayerSampleMode##index; \
int _LayerBlendMode##index; \
int _LayerMaskType##index; \
fixed4 _LayerColor##index; \
sampler2D _LayerSurface##index; \
float4 _LayerSurface##index##_ST; \
float4 _LayerSampleParameters##index; \
float4 _LayerMaskParameters##index; \
float4 _LayerMaskAxis##index;
DECLARE_LAYER_UNIFORMS(0)
DECLARE_LAYER_UNIFORMS(1)
DECLARE_LAYER_UNIFORMS(2)
DECLARE_LAYER_UNIFORMS(3)
DECLARE_LAYER_UNIFORMS(4)
DECLARE_LAYER_UNIFORMS(5)
DECLARE_LAYER_UNIFORMS(6)
DECLARE_LAYER_UNIFORMS(7)
struct VertexOutput
{
float4 pos : SV_POSITION;
float2 texcoord : TEXCOORD0;
float3 worldPos : TEXCOORD1;
float3 worldNormal : TEXCOORD2;
float3 viewDir : TEXCOORD3;
float4 vertColor : COLOR;
#if NORMAL_MAP_ON || PARALLAX_ON
float3 worldTangent : TANGENT;
float3 worldBitangent : TEXCOORD5;
#endif
};
float _Alpha;
int _BaseMaskType;
float4 _BaseMaskParameters;
float4 _BaseMaskAxis;
fixed4 _DarkMultiplier;
fixed4 _BaseColor;
sampler2D _AlphaMask;
float4 _AlphaMask_ST;
sampler2D _AlphaMask2;
float4 _AlphaMask2_ST;
sampler2D _NormalMap;
float4 _NormalMap_ST;
sampler2D _ParallaxMap;
float4 _ParallaxMap_ST;
sampler2D _RoughnessMap;
float4 _RoughnessMap_ST;
float4x4 _ProjectorWorldToLocal;
VertexOutput vert(appdata_full v)
{
VertexOutput o;
UNITY_INITIALIZE_OUTPUT(VertexOutput, o);
o.texcoord = v.texcoord.xy;
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
o.vertColor = v.color;
o.viewDir = normalize(_WorldSpaceCameraPos.xyz - o.worldPos);
o.worldNormal = normalize(mul(unity_ObjectToWorld, float4(v.normal, 0.0)).xyz);
#if NORMAL_MAP_ON || PARALLAX_ON
o.worldTangent = normalize(mul(unity_ObjectToWorld, float4(v.tangent.xyz, 0.0)).xyz);
o.worldBitangent = normalize(cross(o.worldNormal, o.worldTangent) * v.tangent.w);
#endif
o.pos = UnityObjectToClipPos(v.vertex);
return o;
}
#ifndef NORMAL_MAP_ON
#define COMPUTE_NORMAL IN.worldNormal
#else
#define COMPUTE_NORMAL normalize(mul(lerp(float3(0, 0, 1), surfaceNormal, normalMapStrength), tangentTransform))
#endif
float3 ComputeColor(
VertexOutput IN,
float2 uv,
#if PARALLAX_ON || NORMAL_MAP_ON
float3x3 tangentTransform,
#endif
#ifdef NORMAL_MAP_ON
float3 surfaceNormal,
#endif
sampler2D surface,
float4 surface_ST,
fixed4 color,
int sampleMode,
float4 sampleParameters
) {
if (sampleMode == SAMPLE_MODE_TEXTURE) {
float2 panning = _Time.g * sampleParameters.xy;
return tex2D(surface, (uv + panning) * surface_ST.xy + surface_ST.zw).rgb * color.rgb;
}
else if (sampleMode == SAMPLE_MODE_TEXTURE_SINGLE_CHANNEL) {
float4 channelMask = sampleParameters;
float4 channels = tex2D(surface, uv * surface_ST.xy + surface_ST.zw);
return dot(channels, channelMask) * color.rgb;
}
#ifdef PARALLAX_ON
else if (sampleMode == SAMPLE_MODE_PARALLAX) {
float parallaxMinHeight = sampleParameters.x;
float parallaxMaxHeight = sampleParameters.y;
float parallaxValue = tex2D(_ParallaxMap, TRANSFORM_TEX(uv, _ParallaxMap)).r;
float scaledHeight = lerp(parallaxMinHeight, parallaxMaxHeight, parallaxValue);
float2 parallaxUV = mul(tangentTransform, IN.viewDir).xy * scaledHeight;
return tex2D(surface, (uv * surface_ST.xy + surface_ST.zw) + parallaxUV).rgb * color.rgb;
}
#endif
else if (sampleMode == SAMPLE_MODE_RSRM) {
float roughnessMin = sampleParameters.x;
float roughnessMax = sampleParameters.y;
#ifdef ROUGHNESS_ON
float roughnessValue = tex2D(_RoughnessMap, TRANSFORM_TEX(uv, _RoughnessMap)).r;
float scaledRoughness = lerp(roughnessMin, roughnessMax, roughnessValue);
#else
float scaledRoughness = roughnessMin;
#endif
#ifdef NORMAL_MAP_ON
float normalMapStrength = sampleParameters.z;
#endif
float3 viewReflect = reflect(-IN.viewDir, COMPUTE_NORMAL);
float viewAngle = viewReflect.y * 0.5 + 0.5;
return tex2D(surface, float2(scaledRoughness, viewAngle)).rgb * color.rgb;
}
return color.rgb;
}
float ComputeMask(
VertexOutput IN,
#ifdef NORMAL_MAP_ON
float3x3 tangentTransform,
float3 surfaceNormal,
#endif
int maskType,
float4 layerParameters,
float3 maskAxis
) {
if (maskType == MASK_TYPE_POSITIONAL) {
float centerDistance = layerParameters.x;
float fadeAbove = layerParameters.y;
float fadeBelow = layerParameters.z;
float3 objPos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz;
float d = dot(objPos, maskAxis);
if (d > centerDistance) {
return saturate(1.0 - (d - centerDistance) / fadeAbove);
}
else {
return saturate(1.0 - (centerDistance - d) / fadeBelow);
}
}
else if (maskType == MASK_TYPE_REFLECTION) {
float fadeStart = layerParameters.x;
float fadeEnd = layerParameters.y;
#ifdef NORMAL_MAP_ON
float normalMapStrength = layerParameters.z;
#endif
float power = layerParameters.w;
float3 viewReflect = reflect(-IN.viewDir, COMPUTE_NORMAL);
float d = max(0.0, dot(viewReflect, maskAxis));
return saturate(1.0 - (d - fadeStart) / (fadeEnd - fadeStart));
}
else if (maskType == MASK_TYPE_FRESNEL) {
float power = layerParameters.x;
float fadeStart = layerParameters.y;
float fadeEnd = layerParameters.z;
#ifdef NORMAL_MAP_ON
float normalMapStrength = layerParameters.w;
#endif
float d = saturate(1.0 - max(0.0, dot(IN.viewDir, COMPUTE_NORMAL)));
float p = pow(d, power);
return saturate(lerp(fadeStart, fadeEnd, p));
}
else if (maskType == MASK_TYPE_PULSE) {
float distance = layerParameters.x;
float speed = layerParameters.y;
float power = layerParameters.z;
float3 objPos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz;
float d = dot(objPos, maskAxis);
float theta = 6.2831 * frac((d - _Time.g * speed) / distance);
return saturate(pow((sin(theta) * 0.5 + 0.5), power));
}
else {
return 1.0;
}
}
float3 ComputeBlend(float3 source, float3 blend, float mask, int blendMode) {
if (blendMode == BLEND_MODE_MULTIPLY) {
return source * (blend * mask);
}
else {
return source + (blend * mask);
}
}
float4 ComputeSurface(VertexOutput IN)
{
#if PROJECTOR_ON
float3 projectorPos = mul(_ProjectorWorldToLocal, float4(IN.worldPos, 1.0)).xyz;
if (abs(projectorPos.x) > 1.0 || abs(projectorPos.y) > 1.0 || abs(projectorPos.z) > 1.0)
{
discard;
}
float2 uv = projectorPos.xy * 0.5 + 0.5;
#else
float2 uv = IN.texcoord.xy;
#endif
fixed4 c = _BaseColor;
IN.worldNormal = normalize(IN.worldNormal);
#if PARALLAX_ON || NORMAL_MAP_ON
float3x3 tangentTransform = float3x3(IN.worldTangent, IN.worldBitangent, IN.worldNormal);
#endif
#ifdef NORMAL_MAP_ON
float3 surfaceNormal = UnpackNormal(tex2D(_NormalMap, TRANSFORM_TEX(uv, _NormalMap)));
#endif
#if PARALLAX_ON || NORMAL_MAP_ON
#ifndef NORMAL_MAP_ON
#define COLOR_INPUTS IN, uv, tangentTransform
#define MASK_INPUTS IN
#else
#define COLOR_INPUTS IN, uv, tangentTransform, surfaceNormal
#define MASK_INPUTS IN, tangentTransform, surfaceNormal
#endif
#else
#define COLOR_INPUTS IN, uv
#define MASK_INPUTS IN
#endif
#define LAYER_COLOR(index) ComputeColor(COLOR_INPUTS, _LayerSurface##index, _LayerSurface##index##_ST, _LayerColor##index, _LayerSampleMode##index, _LayerSampleParameters##index)
#define LAYER_MASK(index) ComputeMask(MASK_INPUTS, _LayerMaskType##index, _LayerMaskParameters##index, _LayerMaskAxis##index##.xyz)
#define LAYER_BLEND(index, c) ComputeBlend(c, LAYER_COLOR(index), LAYER_MASK(index), _LayerBlendMode##index)
c.rgb = LAYER_BLEND(0, c.rgb);
#if LAYER_COUNT > 1
c.rgb = LAYER_BLEND(1, c.rgb);
#endif
#if LAYER_COUNT > 2
c.rgb = LAYER_BLEND(2, c.rgb);
#endif
#if LAYER_COUNT > 3
c.rgb = LAYER_BLEND(3, c.rgb);
#endif
#if LAYER_COUNT > 4
c.rgb = LAYER_BLEND(4, c.rgb);
#endif
#if LAYER_COUNT > 5
c.rgb = LAYER_BLEND(5, c.rgb);
#endif
#if LAYER_COUNT > 6
c.rgb = LAYER_BLEND(6, c.rgb);
#endif
#if LAYER_COUNT > 7
c.rgb = LAYER_BLEND(7, c.rgb);
#endif
#ifdef VERTALPHA_ON
float scaledValue = IN.vertColor.a * 2.0;
float alpha0weight = max(0.0, 1.0 - scaledValue);
float alpha2weight = max(0.0, scaledValue - 1.0);
float alpha1weight = 1.0 - alpha0weight - alpha2weight;
c.a = _Alpha * c.a * (tex2D(_AlphaMask, TRANSFORM_TEX(uv, _AlphaMask)).r * alpha1weight + tex2D(_AlphaMask2, TRANSFORM_TEX(uv, _AlphaMask2)).r * alpha2weight + alpha0weight) * ComputeMask(MASK_INPUTS, _BaseMaskType, _BaseMaskParameters, _BaseMaskAxis);
#else
c.a = _Alpha * c.a * tex2D(_AlphaMask, TRANSFORM_TEX(uv, _AlphaMask)).r * IN.vertColor.a * ComputeMask(MASK_INPUTS, _BaseMaskType, _BaseMaskParameters, _BaseMaskAxis);
#endif
c.rgb = lerp(c.rgb, c.rgb * _DarkMultiplier, IN.vertColor.r);
return c;
}
#endif

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 462c52c09cf9a244bbc11a016d763ea7
timeCreated: 1443137462
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,141 @@
Shader "OvrAvatar/AvatarSurfaceShader" {
Properties{
// Global parameters
_Alpha("Alpha", Range(0.0, 1.0)) = 1.0
_DarkMultiplier("Dark Multiplier", Color) = (0.6, 0.6, 0.6, 1.0)
_BaseColor("Base Color", Color) = (0.0, 0.0, 0.0, 0.0)
_BaseMaskType("Base Mask Type", Int) = 0
_BaseMaskParameters("Base Mask Parameters", Vector) = (0, 0, 0, 0)
_BaseMaskAxis("Base Mask Axis", Vector) = (0, 1, 0, 0)
_AlphaMask("Alpha Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "" {}
_ParallaxMap("Parallax Map", 2D) = "" {}
_RoughnessMap("Roughness Map", 2D) = "" {}
// Layer 0 parameters
_LayerSampleMode0("Layer Sample Mode 0", Int) = 0
_LayerBlendMode0("Layer Blend Mode 0", Int) = 0
_LayerMaskType0("Layer Mask Type 0", Int) = 0
_LayerColor0("Layer Color 0", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface0("Layer Surface 0", 2D) = "" {}
_LayerSampleParameters0("Layer Sample Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskParameters0("Layer Mask Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskAxis0("Layer Mask Axis 0", Vector) = (0, 1, 0, 0)
// Layer 1 parameters
_LayerSampleMode1("Layer Sample Mode 1", Int) = 0
_LayerBlendMode1("Layer Blend Mode 1", Int) = 0
_LayerMaskType1("Layer Mask Type 1", Int) = 0
_LayerColor1("Layer Color 1", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface1("Layer Surface 1", 2D) = "" {}
_LayerSampleParameters1("Layer Sample Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskParameters1("Layer Mask Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskAxis1("Layer Mask Axis 1", Vector) = (0, 1, 0, 0)
// Layer 2 parameters
_LayerSampleMode2("Layer Sample Mode 2", Int) = 0
_LayerBlendMode2("Layer Blend Mode 2", Int) = 0
_LayerMaskType2("Layer Mask Type 2", Int) = 0
_LayerColor2("Layer Color 2", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface2("Layer Surface 2", 2D) = "" {}
_LayerSampleParameters2("Layer Sample Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskParameters2("Layer Mask Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskAxis2("Layer Mask Axis 2", Vector) = (0, 1, 0, 0)
// Layer 3 parameters
_LayerSampleMode3("Layer Sample Mode 3", Int) = 0
_LayerBlendMode3("Layer Blend Mode 3", Int) = 0
_LayerMaskType3("Layer Mask Type 3", Int) = 0
_LayerColor3("Layer Color 3", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface3("Layer Surface 3", 2D) = "" {}
_LayerSampleParameters3("Layer Sample Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskParameters3("Layer Mask Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskAxis3("Layer Mask Axis 3", Vector) = (0, 1, 0, 0)
// Layer 4 parameters
_LayerSampleMode4("Layer Sample Mode 4", Int) = 0
_LayerBlendMode4("Layer Blend Mode 4", Int) = 0
_LayerMaskType4("Layer Mask Type 4", Int) = 0
_LayerColor4("Layer Color 4", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface4("Layer Surface 4", 2D) = "" {}
_LayerSampleParameters4("Layer Sample Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskParameters4("Layer Mask Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskAxis4("Layer Mask Axis 4", Vector) = (0, 1, 0, 0)
// Layer 5 parameters
_LayerSampleMode5("Layer Sample Mode 5", Int) = 0
_LayerBlendMode5("Layer Blend Mode 5", Int) = 0
_LayerMaskType5("Layer Mask Type 5", Int) = 0
_LayerColor5("Layer Color 5", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface5("Layer Surface 5", 2D) = "" {}
_LayerSampleParameters5("Layer Sample Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskParameters5("Layer Mask Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskAxis5("Layer Mask Axis 5", Vector) = (0, 1, 0, 0)
// Layer 6 parameters
_LayerSampleMode6("Layer Sample Mode 6", Int) = 0
_LayerBlendMode6("Layer Blend Mode 6", Int) = 0
_LayerMaskType6("Layer Mask Type 6", Int) = 0
_LayerColor6("Layer Color 6", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface6("Layer Surface 6", 2D) = "" {}
_LayerSampleParameters6("Layer Sample Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskParameters6("Layer Mask Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskAxis6("Layer Mask Axis 6", Vector) = (0, 1, 0, 0)
// Layer 7 parameters
_LayerSampleMode7("Layer Sample Mode 7", Int) = 0
_LayerBlendMode7("Layer Blend Mode 7", Int) = 0
_LayerMaskType7("Layer Mask Type 7", Int) = 0
_LayerColor7("Layer Color 7", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface7("Layer Surface 7", 2D) = "" {}
_LayerSampleParameters7("Layer Sample Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskParameters7("Layer Mask Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskAxis7("Layer Mask Axis 7", Vector) = (0, 1, 0, 0)
}
SubShader
{
Tags
{
"Queue" = "Transparent"
"RenderType" = "Transparent"
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
LOD 200
Pass
{
Name "FORWARD"
Tags
{
"LightMode" = "ForwardBase"
}
CGPROGRAM
#pragma only_renderers d3d11 gles3 gles
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile PROJECTOR_OFF PROJECTOR_ON
#pragma multi_compile NORMAL_MAP_OFF NORMAL_MAP_ON
#pragma multi_compile PARALLAX_OFF PARALLAX_ON
#pragma multi_compile ROUGHNESS_OFF ROUGHNESS_ON
#pragma multi_compile VERTALPHA_OFF VERTALPHA_ON
#pragma multi_compile LAYERS_1 LAYERS_2 LAYERS_3 LAYERS_4 LAYERS_5 LAYERS_6 LAYERS_7 LAYERS_8
#include "Assets/Oculus/Avatar/Content/Materials/AvatarMaterialStateShader.cginc"
float4 frag(VertexOutput IN) : COLOR
{
return ComputeSurface(IN);
}
ENDCG
}
}
FallBack "Diffuse"
CustomEditor "AvatarMaterialEditor"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d0f6e1942d3d1f946a96fd8a00175474
timeCreated: 1470862124
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,79 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "OvrAvatar/AvatarSurfaceShaderPBS" {
Properties{
// Global parameters
_Alpha("Alpha", Range(0.0, 1.0)) = 1.0
_Albedo("Albedo (RGB)", 2D) = "" {}
_Surface("Metallic (R) Occlusion (G) and Smoothness (A)", 2D) = "" {}
}
SubShader{
Tags {
"Queue" = "Transparent"
"RenderType" = "Transparent"
}
Pass {
ZWrite On
Cull Off
ColorMask 0
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#include "UnityCG.cginc"
struct v2f {
float4 position : SV_POSITION;
};
v2f vert(appdata_full v) {
// Output
v2f output;
output.position = UnityObjectToClipPos(v.vertex);
return output;
}
float4 frag(v2f input) : COLOR {
return 0;
}
ENDCG
}
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard vertex:vert nolightmap alpha noforwardadd
float _Alpha;
sampler2D _Albedo;
float4 _Albedo_ST;
sampler2D _Surface;
float4 _Surface_ST;
struct Input {
float2 texcoord;
};
void vert(inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input, o);
o.texcoord = v.texcoord.xy;
}
void surf (Input IN, inout SurfaceOutputStandard o) {
o.Albedo = tex2D(_Albedo, TRANSFORM_TEX(IN.texcoord, _Albedo)).rgb;
float4 surfaceParams = tex2D(_Surface, TRANSFORM_TEX(IN.texcoord, _Surface));
o.Metallic = surfaceParams.r;
o.Occlusion = surfaceParams.g;
o.Smoothness = surfaceParams.a;
o.Alpha = _Alpha;
}
#pragma only_renderers d3d11 gles3 gles
ENDCG
}
FallBack "Diffuse"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d7662dbac0646464a9b4a48e93989adb
timeCreated: 1470862124
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,39 @@
Shader "OvrAvatar/AvatarSurfaceShaderPBSV2" {
Properties {
_AlbedoMultiplier ("Albedo Multiplier", Color) = (1,1,1,1)
_Albedo ("Albedo (RGB)", 2D) = "white" {}
_Metallicness("Metallicness", 2D) = "grey" {}
_GlossinessScale ("Glossiness Scale", Range(0,1)) = 0.5
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _Albedo;
sampler2D _Metallicness;
struct Input {
float2 uv_Albedo;
};
float _GlossinessScale;
float4 _AlbedoMultiplier;
void surf (Input IN, inout SurfaceOutputStandard o) {
fixed4 c = tex2D (_Albedo, IN.uv_Albedo) * _AlbedoMultiplier;
o.Albedo = c.rgb;
o.Metallic = tex2D (_Metallicness, IN.uv_Albedo).r;
o.Smoothness = _GlossinessScale;
o.Alpha = 1.0;
}
ENDCG
}
FallBack "Diffuse"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 3934b2d879c6eb94eb26fa19814c7fcd
timeCreated: 1512064795
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,175 @@
Shader "OvrAvatar/AvatarSurfaceShaderSelfOccluding" {
Properties{
// Global parameters
_Alpha("Alpha", Range(0.0, 1.0)) = 1.0
_DarkMultiplier("Dark Multiplier", Color) = (0.6, 0.6, 0.6, 1.0)
_BaseColor("Base Color", Color) = (0.0, 0.0, 0.0, 0.0)
_BaseMaskType("Base Mask Type", Int) = 0
_BaseMaskParameters("Base Mask Parameters", Vector) = (0, 0, 0, 0)
_BaseMaskAxis("Base Mask Axis", Vector) = (0, 1, 0, 0)
_AlphaMask("Alpha Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "" {}
_ParallaxMap("Parallax Map", 2D) = "" {}
_RoughnessMap("Roughness Map", 2D) = "" {}
// Layer 0 parameters
_LayerSampleMode0("Layer Sample Mode 0", Int) = 0
_LayerBlendMode0("Layer Blend Mode 0", Int) = 0
_LayerMaskType0("Layer Mask Type 0", Int) = 0
_LayerColor0("Layer Color 0", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface0("Layer Surface 0", 2D) = "" {}
_LayerSampleParameters0("Layer Sample Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskParameters0("Layer Mask Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskAxis0("Layer Mask Axis 0", Vector) = (0, 1, 0, 0)
// Layer 1 parameters
_LayerSampleMode1("Layer Sample Mode 1", Int) = 0
_LayerBlendMode1("Layer Blend Mode 1", Int) = 0
_LayerMaskType1("Layer Mask Type 1", Int) = 0
_LayerColor1("Layer Color 1", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface1("Layer Surface 1", 2D) = "" {}
_LayerSampleParameters1("Layer Sample Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskParameters1("Layer Mask Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskAxis1("Layer Mask Axis 1", Vector) = (0, 1, 0, 0)
// Layer 2 parameters
_LayerSampleMode2("Layer Sample Mode 2", Int) = 0
_LayerBlendMode2("Layer Blend Mode 2", Int) = 0
_LayerMaskType2("Layer Mask Type 2", Int) = 0
_LayerColor2("Layer Color 2", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface2("Layer Surface 2", 2D) = "" {}
_LayerSampleParameters2("Layer Sample Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskParameters2("Layer Mask Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskAxis2("Layer Mask Axis 2", Vector) = (0, 1, 0, 0)
// Layer 3 parameters
_LayerSampleMode3("Layer Sample Mode 3", Int) = 0
_LayerBlendMode3("Layer Blend Mode 3", Int) = 0
_LayerMaskType3("Layer Mask Type 3", Int) = 0
_LayerColor3("Layer Color 3", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface3("Layer Surface 3", 2D) = "" {}
_LayerSampleParameters3("Layer Sample Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskParameters3("Layer Mask Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskAxis3("Layer Mask Axis 3", Vector) = (0, 1, 0, 0)
// Layer 4 parameters
_LayerSampleMode4("Layer Sample Mode 4", Int) = 0
_LayerBlendMode4("Layer Blend Mode 4", Int) = 0
_LayerMaskType4("Layer Mask Type 4", Int) = 0
_LayerColor4("Layer Color 4", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface4("Layer Surface 4", 2D) = "" {}
_LayerSampleParameters4("Layer Sample Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskParameters4("Layer Mask Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskAxis4("Layer Mask Axis 4", Vector) = (0, 1, 0, 0)
// Layer 5 parameters
_LayerSampleMode5("Layer Sample Mode 5", Int) = 0
_LayerBlendMode5("Layer Blend Mode 5", Int) = 0
_LayerMaskType5("Layer Mask Type 5", Int) = 0
_LayerColor5("Layer Color 5", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface5("Layer Surface 5", 2D) = "" {}
_LayerSampleParameters5("Layer Sample Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskParameters5("Layer Mask Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskAxis5("Layer Mask Axis 5", Vector) = (0, 1, 0, 0)
// Layer 6 parameters
_LayerSampleMode6("Layer Sample Mode 6", Int) = 0
_LayerBlendMode6("Layer Blend Mode 6", Int) = 0
_LayerMaskType6("Layer Mask Type 6", Int) = 0
_LayerColor6("Layer Color 6", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface6("Layer Surface 6", 2D) = "" {}
_LayerSampleParameters6("Layer Sample Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskParameters6("Layer Mask Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskAxis6("Layer Mask Axis 6", Vector) = (0, 1, 0, 0)
// Layer 7 parameters
_LayerSampleMode7("Layer Sample Mode 7", Int) = 0
_LayerBlendMode7("Layer Blend Mode 7", Int) = 0
_LayerMaskType7("Layer Mask Type 7", Int) = 0
_LayerColor7("Layer Color 7", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface7("Layer Surface 7", 2D) = "" {}
_LayerSampleParameters7("Layer Sample Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskParameters7("Layer Mask Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskAxis7("Layer Mask Axis 7", Vector) = (0, 1, 0, 0)
}
SubShader
{
Tags
{
"Queue" = "Transparent"
"RenderType" = "Transparent"
}
Pass
{
ZWrite On
Cull Off
ColorMask 0
Offset 1, 1
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#include "UnityCG.cginc"
struct v2f
{
float4 position : SV_POSITION;
};
v2f vert(appdata_full v)
{
// Output
v2f output;
output.position = UnityObjectToClipPos(v.vertex);
return output;
}
float4 frag(v2f input) : COLOR
{
return 0;
}
ENDCG
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
LOD 200
Pass
{
Name "FORWARD"
Tags
{
"LightMode" = "ForwardBase"
}
CGPROGRAM
#pragma only_renderers d3d11 gles3 gles
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile PROJECTOR_OFF PROJECTOR_ON
#pragma multi_compile NORMAL_MAP_OFF NORMAL_MAP_ON
#pragma multi_compile PARALLAX_OFF PARALLAX_ON
#pragma multi_compile ROUGHNESS_OFF ROUGHNESS_ON
#pragma multi_compile VERTALPHA_OFF VERTALPHA_ON
#pragma multi_compile LAYERS_1 LAYERS_2 LAYERS_3 LAYERS_4 LAYERS_5 LAYERS_6 LAYERS_7 LAYERS_8
#include "Assets/Oculus/Avatar/Content/Materials/AvatarMaterialStateShader.cginc"
float4 frag(VertexOutput IN) : SV_Target
{
return ComputeSurface(IN);
}
ENDCG
}
}
FallBack "Diffuse"
CustomEditor "AvatarMaterialEditor"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 10513ef587704324487f3061a7e6699d
timeCreated: 1470862124
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: e2c4ef7503877e647b22a4089384f04f
folderAsset: yes
timeCreated: 1466717433
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,793 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &157742
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 448722}
- component: {fileID: 11477770}
m_Layer: 0
m_Name: controller_right
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &158226
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 463470}
- component: {fileID: 11437430}
- component: {fileID: 8254050}
- component: {fileID: 11441414}
m_Layer: 0
m_Name: LocalAvatar
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &184120
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 400938}
- component: {fileID: 11405130}
m_Layer: 0
m_Name: controller_left
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400938
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 184120}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.15, y: 1.221, z: 0.282}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &448722
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 157742}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.15, y: 1.221, z: 0.282}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &463470
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 158226}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4000010416372058}
- {fileID: 4000014100970646}
- {fileID: 4000013364346644}
- {fileID: 400938}
- {fileID: 4000011212216358}
- {fileID: 448722}
- {fileID: 4581494204247758}
- {fileID: 4468369968689664}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &8254050
AudioSource:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 158226}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
--- !u!114 &11405130
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 184120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 77e19ec58d4a9e844970103e5bd8946a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &11437430
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 158226}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 00f3402a2ea5bff4880c0313515240cd, type: 3}
m_Name:
m_EditorClassIdentifier:
DefaultBodyMaterialManager: {fileID: 114949324920430652}
DefaultHandMaterialManager: {fileID: 114029231360713414}
Driver: {fileID: 11441414}
Base: {fileID: 114000010884708534}
Body: {fileID: 114000012186362028}
ControllerLeft: {fileID: 11405130}
ControllerRight: {fileID: 11477770}
HandLeft: {fileID: 114000011404857786}
HandRight: {fileID: 114000010372160784}
RecordPackets: 0
UseSDKPackets: 1
StartWithControllers: 0
FirstPersonLayer:
layerIndex: 0
ThirdPersonLayer:
layerIndex: 0
ShowFirstPerson: 1
ShowThirdPerson: 0
Capabilities: -1
SurfaceShader: {fileID: 4800000, guid: 73f67c4e7bf718b4385aa6b1f8a06591, type: 3}
SurfaceShaderSelfOccluding: {fileID: 4800000, guid: 69f342b79d37541489919a19cfd8a924,
type: 3}
SurfaceShaderPBS: {fileID: 4800000, guid: 5e52aa58207bbf24d8eb8ec969e9ae88, type: 3}
SurfaceShaderPBSV2Single: {fileID: 4800000, guid: c26fc51e445dcfd4db09305d861dc11c,
type: 3}
SurfaceShaderPBSV2Combined: {fileID: 4800000, guid: 37d2b8298f61cd2469465fc36108675d,
type: 3}
SurfaceShaderPBSV2Simple: {fileID: 4800000, guid: 36b8b481cf607814a8cec318f0148d63,
type: 3}
SurfaceShaderPBSV2Loading: {fileID: 4800000, guid: 822f5e641dc5dd54ca9555b727b3277f,
type: 3}
oculusUserID: 0
LeftHandCustomPose: {fileID: 0}
RightHandCustomPose: {fileID: 0}
PacketSettings:
UpdateRate: 0.033333335
VoiceAmplitude: 0
EnableMouthVertexAnimation: 0
--- !u!114 &11441414
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 158226}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ac27124318cf8e84aa7350c2ac1cdb80, type: 3}
m_Name:
m_EditorClassIdentifier:
Mode: 0
--- !u!114 &11477770
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 157742}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 77e19ec58d4a9e844970103e5bd8946a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 158226}
m_IsPrefabParent: 1
--- !u!1 &1000010482306814
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000011212216358}
- component: {fileID: 114000010372160784}
m_Layer: 0
m_Name: hand_right
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000010910743596
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000010416372058}
- component: {fileID: 114000010884708534}
m_Layer: 0
m_Name: base
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000011125779090
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000013364346644}
- component: {fileID: 114000011404857786}
m_Layer: 0
m_Name: hand_left
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1000012026592076
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4000014100970646}
- component: {fileID: 114000012186362028}
m_Layer: 0
m_Name: body
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1098047352992398
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4581494204247758}
- component: {fileID: 114949324920430652}
m_Layer: 0
m_Name: DefaultBodyMaterialManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1231602751420816
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 4468369968689664}
- component: {fileID: 114029231360713414}
m_Layer: 0
m_Name: DefaultHandMaterialManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000010416372058
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010910743596}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4000011212216358
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010482306814}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.15, y: 1.221, z: 0.282}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4000013364346644
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011125779090}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.15, y: 1.221, z: 0.282}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4000014100970646
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012026592076}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.6, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4468369968689664
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1231602751420816}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &4581494204247758
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1098047352992398}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 463470}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &114000010372160784
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010482306814}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e53b07ad62d980a4da9fffff0b05fd2e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114000010884708534
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000010910743596}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a0e33623ec5372748b5703f61a4df82d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114000011404857786
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000011125779090}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e53b07ad62d980a4da9fffff0b05fd2e, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114000012186362028
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1000012026592076}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: eb7a6650b6cb46545967d3b380b7396c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &114029231360713414
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1231602751420816}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a139d83bf6796734db220df8a5bfacbd, type: 3}
m_Name:
m_EditorClassIdentifier:
DiffuseFallbacks:
- {fileID: 2800000, guid: 7d8da3d06466cc04da8c020819170a59, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: b3e87b1024f5fa8408d004b398e7b0c0, type: 3}
NormalFallbacks:
- {fileID: 2800000, guid: 93a54b3b63bcc6d49b16f6bdb655b940, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 22a046c12fc7f3c4d98a98add109fa96, type: 3}
BodyColorTints:
- {r: 0.9764706, g: 0.8509804, b: 0.6862745, a: 1}
- {r: 1, g: 0.9529412, b: 0.92156863, a: 1}
- {r: 0.9764706, g: 0.9019608, b: 0.6745098, a: 1}
- {r: 0.7647059, g: 0.6039216, b: 0.2509804, a: 1}
- {r: 0.45490196, g: 0.1882353, b: 0, a: 1}
- {r: 0.22352941, g: 0.023529412, b: 0.011764706, a: 1}
LocalAvatarConfig:
ComponentMaterialProperties: []
MaterialPropertyBlock:
Colors: []
DiffuseIntensities: []
RimIntensities: []
BacklightIntensities: []
ReflectionIntensities: []
DefaultAvatarConfig:
ComponentMaterialProperties:
- TypeIndex: 0
Color: {r: 1, g: 0.9529412, b: 0.92156863, a: 1}
Textures: []
DiffuseIntensity: 0.301
RimIntensity: 5
BacklightIntensity: 1
ReflectionIntensity: 0
- TypeIndex: 1
Color: {r: 1, g: 1, b: 1, a: 1}
Textures: []
DiffuseIntensity: 0.1
RimIntensity: 2
BacklightIntensity: 0.7
ReflectionIntensity: 0.3
- TypeIndex: 2
Color: {r: 0.80784315, g: 0.80784315, b: 0.80784315, a: 1}
Textures: []
DiffuseIntensity: 0
RimIntensity: 2.84
BacklightIntensity: 0.7
ReflectionIntensity: 0.4
- TypeIndex: 3
Color: {r: 0.22352941, g: 0.11372549, b: 0, a: 1}
Textures: []
DiffuseIntensity: 0.15
RimIntensity: 4
BacklightIntensity: 0.7
ReflectionIntensity: 0
- TypeIndex: 4
Color: {r: 0.22352941, g: 0.023529412, b: 0.011764706, a: 1}
Textures: []
DiffuseIntensity: 0.15
RimIntensity: 4
BacklightIntensity: 0.7
ReflectionIntensity: 0
MaterialPropertyBlock:
Colors:
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
- {x: 0, y: 0, z: 0, w: 0}
DiffuseIntensities:
- 0
- 0
- 0
- 0
- 0
RimIntensities:
- 0
- 0
- 0
- 0
- 0
BacklightIntensities:
- 0
- 0
- 0
- 0
- 0
ReflectionIntensities:
- 0
- 0
- 0
- 0
- 0
--- !u!114 &114949324920430652
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1098047352992398}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a139d83bf6796734db220df8a5bfacbd, type: 3}
m_Name:
m_EditorClassIdentifier:
DiffuseFallbacks:
- {fileID: 2800000, guid: 7d8da3d06466cc04da8c020819170a59, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: b3e87b1024f5fa8408d004b398e7b0c0, type: 3}
NormalFallbacks:
- {fileID: 2800000, guid: 93a54b3b63bcc6d49b16f6bdb655b940, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 22a046c12fc7f3c4d98a98add109fa96, type: 3}
BodyColorTints:
- {r: 0.9764706, g: 0.8509804, b: 0.6862745, a: 1}
- {r: 1, g: 0.9529412, b: 0.92156863, a: 1}
- {r: 0.9764706, g: 0.9019608, b: 0.6745098, a: 1}
- {r: 0.7647059, g: 0.6039216, b: 0.2509804, a: 1}
- {r: 0.45490196, g: 0.1882353, b: 0, a: 1}
- {r: 0.22352941, g: 0.023529412, b: 0.011764706, a: 1}
LocalAvatarConfig:
ComponentMaterialProperties:
- TypeIndex: 0
Color: {r: 1, g: 0.86, b: 0.77, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0.3
RimIntensity: 5
BacklightIntensity: 1
ReflectionIntensity: 0
- TypeIndex: 1
Color: {r: 1, g: 1, b: 1, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0.1
RimIntensity: 2
BacklightIntensity: 0.7
ReflectionIntensity: 0.3
- TypeIndex: 2
Color: {r: 1, g: 1, b: 1, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0
RimIntensity: 2.84
BacklightIntensity: 0.7
ReflectionIntensity: 0.4
- TypeIndex: 3
Color: {r: 0.6235, g: 0.4627, b: 0.3412, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0.15
RimIntensity: 4
BacklightIntensity: 0.7
ReflectionIntensity: 0
- TypeIndex: 4
Color: {r: -5.3487954e+9, g: 771.1758, b: -5.6686517e+23, a: 4.9667446e-34}
Textures:
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
DiffuseIntensity: 0.15
RimIntensity: 4
BacklightIntensity: 0.7
ReflectionIntensity: 0
MaterialPropertyBlock:
Colors:
- {x: 1, y: 0.86, z: 0.77, w: 1}
- {x: 1, y: 1, z: 1, w: 1}
- {x: 1, y: 1, z: 1, w: 1}
- {x: 0.6235, y: 0.4627, z: 0.3412, w: 1}
- {x: -0.025753247, y: -2.0311036e-13, z: -6.2685677e-31, w: -2.0021067e+22}
DiffuseIntensities:
- 0.3
- 0.1
- 0
- 0.15
- 0.15
RimIntensities:
- 5
- 2
- 2.84
- 4
- 4
BacklightIntensities:
- 1
- 0.7
- 0.7
- 0.7
- 0.7
ReflectionIntensities:
- 0
- 0.3
- 0.4
- 0
- 0
DefaultAvatarConfig:
ComponentMaterialProperties:
- TypeIndex: 0
Color: {r: 1, g: 0.86, b: 0.77, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0.3
RimIntensity: 5
BacklightIntensity: 1
ReflectionIntensity: 0
- TypeIndex: 1
Color: {r: 1, g: 1, b: 1, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0.1
RimIntensity: 2
BacklightIntensity: 0.7
ReflectionIntensity: 0.3
- TypeIndex: 2
Color: {r: 1, g: 1, b: 1, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0
RimIntensity: 2.84
BacklightIntensity: 0.7
ReflectionIntensity: 0.4
- TypeIndex: 3
Color: {r: 0.6235, g: 0.4627, b: 0.3412, a: 1}
Textures:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
DiffuseIntensity: 0.15
RimIntensity: 4
BacklightIntensity: 0.7
ReflectionIntensity: 0
- TypeIndex: 4
Color: {r: -5.3487954e+9, g: 771.1758, b: -5.6686517e+23, a: 4.9667446e-34}
Textures:
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
- {fileID: 2800000, guid: 9fb4a3be60417d043865e457a9d51e63, type: 3}
- {fileID: 2800000, guid: 502d438d2584976448c3cdb146ed836d, type: 3}
DiffuseIntensity: 0.15
RimIntensity: 4
BacklightIntensity: 0.7
ReflectionIntensity: 0
MaterialPropertyBlock:
Colors:
- {x: 1, y: 0.86, z: 0.77, w: 1}
- {x: 1, y: 1, z: 1, w: 1}
- {x: 1, y: 1, z: 1, w: 1}
- {x: 0.6235, y: 0.4627, z: 0.3412, w: 1}
- {x: -0.025753247, y: -2.0311036e-13, z: -6.2685677e-31, w: -2.0021067e+22}
DiffuseIntensities:
- 0.3
- 0.1
- 0
- 0.15
- 0.15
RimIntensities:
- 5
- 2
- 2.84
- 4
- 4
BacklightIntensities:
- 1
- 0.7
- 0.7
- 0.7
- 0.7
ReflectionIntensities:
- 0
- 0.3
- 0.4
- 0
- 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 84c8b8609f9bb434eaf5248f17ff1293
timeCreated: 1466806466
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 90bf33f968e6bb44ea0208fc82c90a44
timeCreated: 1468001728
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: bdcbd118b7677cd4095ea9260191f2f6
folderAsset: yes
timeCreated: 1536104808
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -0,0 +1,59 @@
fileFormatVersion: 2
guid: 502d438d2584976448c3cdb146ed836d
timeCreated: 1518638636
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,59 @@
fileFormatVersion: 2
guid: b3e87b1024f5fa8408d004b398e7b0c0
timeCreated: 1518638636
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,68 @@
fileFormatVersion: 2
guid: 7d8da3d06466cc04da8c020819170a59
timeCreated: 1534371261
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
fileFormatVersion: 2
guid: 9fb4a3be60417d043865e457a9d51e63
timeCreated: 1518638636
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,59 @@
fileFormatVersion: 2
guid: 22a046c12fc7f3c4d98a98add109fa96
timeCreated: 1518638636
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -0,0 +1,68 @@
fileFormatVersion: 2
guid: 93a54b3b63bcc6d49b16f6bdb655b940
timeCreated: 1534371337
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6f6a577c077cce945b722f02f34c29f3
folderAsset: yes
timeCreated: 1472072258
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,633 @@
using UnityEngine;
using UnityEditor;
using NUnit.Framework;
using System.Linq;
using System.Collections.Generic;
using System;
public class AvatarMaterialEditor : MaterialEditor {
static Dictionary<Material, int> layerVisibilityMasks = new Dictionary<Material, int>();
const int MaxLayerCount = 8;
private const string NormalMapPrefix = "NORMAL_MAP";
private const string ParallaxPrefix = "PARALLAX";
private const string RoughnessPrefix = "ROUGHNESS";
private const string LayerKeywordPrefix = "LAYERS_";
private const string AlphaMaskUniform = "_AlphaMask";
private const string DarkMultUniform = "_DarkMultiplier";
private const string BaseColorUniform = "_BaseColor";
private const string BaseMaskTypeUniform = "_BaseMaskType";
private const string BaseMaskParametersUniform = "_BaseMaskParameters";
private const string BaseMaskAxisUniform = "_BaseMaskAxis";
private const string NormalMapUniform = "_NormalMap";
private const string ParallaxMapUniform = "_ParallaxMap";
private const string RoughnessMapUniform = "_RoughnessMap";
private const string LayerSurfacePrefix = "_LayerSurface";
private const string LayerColorPrefix = "_LayerColor";
private const string LayerSampleParametersPrefix = "_LayerSampleParameters";
private const string LayerMaskTypePrefix = "_LayerMaskType";
private const string LayerMaskParametersPrefix = "_LayerMaskParameters";
private const string LayerMaskAxisPrefix = "_LayerMaskAxis";
private const string LayerBlendModePrefix = "_LayerBlendMode";
private const string LayerSampleModePrefix = "_LayerSampleMode";
enum LayerSampleMode : int
{
Color,
Texture,
TextureSingleChannel,
Parallax,
RSRM,
Count
}
static readonly string[] layerSampleModeLabels = new string[(int)LayerSampleMode.Count] { "Color", "Texture", "Texture (single channel)", "Parallax", "RSRM" };
enum LayerMaskType : int
{
None,
Positional,
ViewReflection,
Fresnel,
Pulse,
Count
}
static readonly string[] layerMaskTypeLabels = new string[(int)LayerMaskType.Count] { "None", "Positional", "View reflection", "Fresnel", "Pulse" };
enum LayerBlendMode : int
{
Add,
Multiply,
Count
}
static readonly string[] layerBlendModeLabels = new string[(int)LayerBlendMode.Count] { "Add", "Multiply" };
Material[] previewMaterials = new Material[MaxLayerCount];
Vector4[,] sampleParametersCache = new Vector4[MaxLayerCount, (int)LayerSampleMode.Count];
Vector4[][] maskParametersCache = new Vector4[MaxLayerCount][];
Vector4[][] maskAxisCache = new Vector4[MaxLayerCount][];
Vector4[] baseMaskParametersCache = new Vector4[(int)LayerMaskType.Count];
Vector4[] baseMaskAxisCache = new Vector4[(int)LayerMaskType.Count];
PreviewRenderUtility previewUtility;
Mesh previewMesh;
static readonly Vector4 PositionalMaskDefaults = new Vector4(0.0f, 1.0f, 1.0f, 0.0f);
static readonly Vector4 ViewReflectionMaskDefaults = new Vector4(1.0f, 0.0f, 1.0f, 0.0f);
static readonly Vector4 FresnelMaskDefaults = new Vector4(1.0f, 0.0f, 1.0f, 1.0f);
static readonly Vector4 PulseMaskDefaults = new Vector4(1.0f, 0.0f, 1.0f, 0.0f);
static readonly Vector4 MaskAxisDefault = new Vector4(0.0f, 1.0f, 0.0f, 0.0f);
void Init()
{
if (previewUtility == null)
{
previewUtility = new PreviewRenderUtility();
GameObject gameObject = (GameObject)EditorGUIUtility.LoadRequired("Previews/PreviewMaterials.fbx");
previewMesh = gameObject.transform.Find("sphere").GetComponent<MeshFilter>().sharedMesh;
}
baseMaskParametersCache[(int)LayerMaskType.Positional] = PositionalMaskDefaults;
baseMaskParametersCache[(int)LayerMaskType.ViewReflection] = ViewReflectionMaskDefaults;
baseMaskParametersCache[(int)LayerMaskType.Fresnel] = FresnelMaskDefaults;
baseMaskParametersCache[(int)LayerMaskType.Pulse] = PulseMaskDefaults;
baseMaskAxisCache[(int)LayerMaskType.Positional] = MaskAxisDefault;
baseMaskAxisCache[(int)LayerMaskType.ViewReflection] = MaskAxisDefault;
for (int i = 0; i < MaxLayerCount; ++i)
{
sampleParametersCache[i, (int)LayerSampleMode.Color] = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
sampleParametersCache[i, (int)LayerSampleMode.Texture] = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
sampleParametersCache[i, (int)LayerSampleMode.TextureSingleChannel] = new Vector4(1.0f, 0.0f, 0.0f, 0.0f);
sampleParametersCache[i, (int)LayerSampleMode.Parallax] = new Vector4(0.0f, 1.0f, 0.0f, 0.0f);
sampleParametersCache[i, (int)LayerSampleMode.RSRM] = new Vector4(0.0f, 1.0f, 1.0f, 0.0f);
Vector4[] parametersCache = new Vector4[(int)LayerMaskType.Count];
parametersCache[(int)LayerMaskType.Positional] = PositionalMaskDefaults;
parametersCache[(int)LayerMaskType.ViewReflection] = ViewReflectionMaskDefaults;
parametersCache[(int)LayerMaskType.Fresnel] = FresnelMaskDefaults;
parametersCache[(int)LayerMaskType.Pulse] = PulseMaskDefaults;
maskParametersCache[i] = parametersCache;
Vector4[] axisCache = new Vector4[(int)LayerMaskType.Count];
axisCache[(int)LayerMaskType.Positional] = MaskAxisDefault;
axisCache[(int)LayerMaskType.ViewReflection] = MaskAxisDefault;
axisCache[(int)LayerMaskType.Pulse] = MaskAxisDefault;
maskAxisCache[i] = axisCache;
}
}
static class AvatarMaterialEditorGUILayout
{
public static bool KeywordToggle(string label, Material material, string keywordPrefix)
{
bool isEnabled = material.IsKeywordEnabled(keywordPrefix + "_ON");
bool newIsEnabled = EditorGUILayout.Toggle(label, isEnabled);
if (newIsEnabled != isEnabled)
{
Undo.RecordObject(material, label + " change");
if (newIsEnabled)
{
material.EnableKeyword(keywordPrefix + "_ON");
material.DisableKeyword(keywordPrefix + "_OFF");
}
else
{
material.EnableKeyword(keywordPrefix + "_OFF");
material.DisableKeyword(keywordPrefix + "_ON");
}
}
return newIsEnabled;
}
public static Color ColorField(string label, Material material, string propertyName)
{
Color color = material.GetColor(propertyName);
Color newColor = EditorGUILayout.ColorField(label, color);
if (newColor != color)
{
Undo.RecordObject(material, label + " change");
material.SetColor(propertyName, newColor);
}
return newColor;
}
internal static int IntField(string label, Material material, string propertyName, string[] valueNames)
{
int currentValue = material.GetInt(propertyName);
int newValue = EditorGUILayout.Popup(label, currentValue, valueNames);
if (newValue != currentValue)
{
Undo.RecordObject(material, label + " change");
material.SetInt(propertyName, newValue);
}
return newValue;
}
internal static Vector2 Vector2Field(string label, Material material, string propertyName)
{
Vector4 currentValue = material.GetVector(propertyName);
Vector2 currentVec2 = new Vector2(currentValue.x, currentValue.y);
Vector2 newVec2 = EditorGUILayout.Vector2Field(label, currentVec2);
if (newVec2 != currentVec2)
{
Undo.RecordObject(material, label + " change");
material.SetVector(propertyName, new Vector4(newVec2.x, newVec2.y, currentValue.z, currentValue.w));
}
return newVec2;
}
internal static Vector3 Vector3Field(string label, Material material, string propertyName)
{
Vector4 currentValue = material.GetVector(propertyName);
Vector3 currentVec3 = new Vector3(currentValue.x, currentValue.y, currentValue.z);
Vector3 newVec3 = EditorGUILayout.Vector3Field(label, currentVec3);
if (newVec3 != currentVec3)
{
Undo.RecordObject(material, label + " change");
material.SetVector(propertyName, new Vector4(newVec3.x, newVec3.y, newVec3.z, currentValue.w));
}
return newVec3;
}
internal static float VectorComponentField(string label, Material material, string propertyName, int componentIndex)
{
Vector4 currentValue = material.GetVector(propertyName);
float currentComponent = currentValue[componentIndex];
float newComponent = EditorGUILayout.FloatField(label, currentComponent);
if (newComponent != currentComponent)
{
Undo.RecordObject(material, label + " change");
currentValue[componentIndex] = newComponent;
material.SetVector(propertyName, currentValue);
}
return newComponent;
}
internal static Vector4 ChannelMaskField(string label, Material material, string propertyName)
{
Vector4 currentValue = material.GetVector(propertyName);
int currentChannel = 0;
for (int i = 0; i < 4; ++i)
{
if (currentValue[i] != 0)
{
currentChannel = i;
break;
}
}
int newChannel = EditorGUILayout.IntPopup(label, currentChannel, new string[] { "R", "G", "B", "A" }, new int[] { 0, 1, 2, 3 });
if (newChannel != currentChannel)
{
Vector4 channelMask = Vector4.zero;
channelMask[newChannel] = 1.0f;
Undo.RecordObject(material, label + " change");
currentValue = channelMask;
material.SetVector(propertyName, currentValue);
}
return currentValue;
}
}
void MaskField(
string label,
Material material,
string maskTypePropertyName,
string maskParametersPropertyName,
string maskAxisPropertyName,
Vector4[] axisCache,
Vector4[] parameterCache,
bool normalMapEnabled)
{
EditorGUI.BeginChangeCheck();
LayerMaskType maskType = (LayerMaskType)AvatarMaterialEditorGUILayout.IntField(label, material, maskTypePropertyName, layerMaskTypeLabels);
if (EditorGUI.EndChangeCheck())
{
material.SetVector(maskAxisPropertyName, axisCache[(int)maskType]);
material.SetVector(maskParametersPropertyName, parameterCache[(int)maskType]);
}
// Show mask-specific controls
EditorGUI.BeginChangeCheck();
switch (maskType)
{
case LayerMaskType.Positional:
AvatarMaterialEditorGUILayout.Vector3Field("Axis", material, maskAxisPropertyName);
AvatarMaterialEditorGUILayout.VectorComponentField("Center distance", material, maskParametersPropertyName, 0);
AvatarMaterialEditorGUILayout.VectorComponentField("Fade above", material, maskParametersPropertyName, 1);
AvatarMaterialEditorGUILayout.VectorComponentField("Fade below", material, maskParametersPropertyName, 2);
break;
case LayerMaskType.ViewReflection:
AvatarMaterialEditorGUILayout.Vector3Field("Axis", material, maskAxisPropertyName);
AvatarMaterialEditorGUILayout.VectorComponentField("Fade begin", material, maskParametersPropertyName, 0);
AvatarMaterialEditorGUILayout.VectorComponentField("Fade end", material, maskParametersPropertyName, 1);
if (normalMapEnabled)
{
AvatarMaterialEditorGUILayout.VectorComponentField("Normal map strength", material, maskParametersPropertyName, 2);
}
break;
case LayerMaskType.Fresnel:
AvatarMaterialEditorGUILayout.VectorComponentField("Power", material, maskParametersPropertyName, 0);
AvatarMaterialEditorGUILayout.VectorComponentField("Fade begin", material, maskParametersPropertyName, 1);
AvatarMaterialEditorGUILayout.VectorComponentField("Fade end", material, maskParametersPropertyName, 2);
if (normalMapEnabled)
{
AvatarMaterialEditorGUILayout.VectorComponentField("Normal map strength", material, maskParametersPropertyName, 3);
}
break;
case LayerMaskType.Pulse:
AvatarMaterialEditorGUILayout.Vector3Field("Axis", material, maskAxisPropertyName);
AvatarMaterialEditorGUILayout.VectorComponentField("Pulse distance", material, maskParametersPropertyName, 0);
AvatarMaterialEditorGUILayout.VectorComponentField("Pulse speed", material, maskParametersPropertyName, 1);
AvatarMaterialEditorGUILayout.VectorComponentField("Power", material, maskParametersPropertyName, 2);
break;
}
if (EditorGUI.EndChangeCheck())
{
parameterCache[(int)maskType] = material.GetVector(maskParametersPropertyName);
axisCache[(int)maskType] = material.GetVector(maskAxisPropertyName);
}
}
public override void OnInspectorGUI()
{
Init();
if (!isVisible)
{
return;
}
SetDefaultGUIWidths();
Material material = target as Material;
int layerCount = MaxLayerCount;
while (layerCount > 0 && !material.IsKeywordEnabled(GetPropertyName(LayerKeywordPrefix, layerCount)))
{
--layerCount;
}
if (layerCount == 0)
{
layerCount = 1;
material.EnableKeyword("LAYERS_" + layerCount);
}
EditorGUILayout.LabelField("Global material properties");
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
TextureField("AlphaMask", material, AlphaMaskUniform);
AvatarMaterialEditorGUILayout.ColorField("DarkMultiplier", material, DarkMultUniform);
AvatarMaterialEditorGUILayout.ColorField("BaseColor", material, BaseColorUniform);
bool normalMapEnabled = AvatarMaterialEditorGUILayout.KeywordToggle("Normal map enabled", material, NormalMapPrefix);
if (normalMapEnabled)
{
TextureField("Normal map", material, NormalMapUniform);
}
bool parallaxEnabled = AvatarMaterialEditorGUILayout.KeywordToggle("Parallax enabled", material, ParallaxPrefix);
if (parallaxEnabled)
{
TextureField("Parallax map", material, ParallaxMapUniform);
}
bool roughnessEnabled = AvatarMaterialEditorGUILayout.KeywordToggle("Roughness enabled", material, RoughnessPrefix);
if (roughnessEnabled)
{
TextureField("Roughness map", material, RoughnessMapUniform);
}
MaskField("Base mask type", material, BaseMaskTypeUniform, BaseMaskParametersUniform, BaseMaskAxisUniform, baseMaskAxisCache, baseMaskParametersCache, normalMapEnabled);
EditorGUILayout.EndVertical();
int layerVisibilityMask = 0;
layerVisibilityMasks.TryGetValue(material, out layerVisibilityMask);
EditorGUILayout.LabelField("Layers");
EditorGUI.indentLevel++;
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
int? removeLayerIndex = null;
int? swapSource = null;
int? swapTarget = null;
for (int i = 0; i < layerCount; ++i)
{
// Draw the preview material
if (previewMaterials[i] == null)
previewMaterials[i] = CreatePreviewMaterial(material, i);
const int previewSize = 64;
const int buttonSize = 20;
Rect layerHeaderRect = GUILayoutUtility.GetRect(previewSize, previewSize, GUILayout.ExpandWidth(true));
// Draw the preview texture
#if UNITY_2017_1_OR_NEWER
Camera cam = previewUtility.camera;
#else
Camera cam = previewUtility.m_Camera;
#endif
cam.transform.position = Vector3.forward * 5.0f;
cam.transform.rotation = Quaternion.identity;
cam.transform.LookAt(Vector3.zero);
previewUtility.BeginStaticPreview(new Rect(0, 0, previewSize, previewSize));
previewUtility.DrawMesh(previewMesh, Vector3.zero, Quaternion.identity, previewMaterials[i], 0);
cam.Render();
Texture preview = previewUtility.EndStaticPreview();
GUI.Label(new Rect(layerHeaderRect.xMax - previewSize - buttonSize, layerHeaderRect.y, previewSize, previewSize), preview);
float yButton = layerHeaderRect.y;
EditorGUI.BeginDisabledGroup(layerCount <= 1);
if (GUI.Button(new Rect(layerHeaderRect.xMax - buttonSize, yButton, buttonSize, buttonSize), new GUIContent("X", "Remove layer")))
{
removeLayerIndex = i;
}
yButton += buttonSize + 4;
EditorGUI.EndDisabledGroup();
EditorGUI.BeginDisabledGroup(i == 0);
if (GUI.Button(new Rect(layerHeaderRect.xMax - buttonSize, yButton, buttonSize, buttonSize), new GUIContent("^", "Move layer up")))
{
swapSource = i;
swapTarget = i - 1;
}
yButton += buttonSize;
EditorGUI.EndDisabledGroup();
EditorGUI.BeginDisabledGroup(i == layerCount - 1);
if (GUI.Button(new Rect(layerHeaderRect.xMax - buttonSize, yButton, buttonSize, buttonSize), new GUIContent("v", "Move layer down")))
{
swapSource = i;
swapTarget = i + 1;
}
yButton += buttonSize;
EditorGUI.EndDisabledGroup();
// Create a toggleable group for the layer
int layerMaskBit = 1 << i;
bool layerVisible = (layerVisibilityMask & layerMaskBit) != 0;
layerVisible = EditorGUI.Foldout(layerHeaderRect, layerVisible, string.Format("Layer {0}", i + 1));
if (layerVisible)
layerVisibilityMask |= layerMaskBit;
else
layerVisibilityMask &= ~layerMaskBit;
if (layerVisible)
{
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
EditorGUI.BeginChangeCheck();
{
// Handle the blend mode
AvatarMaterialEditorGUILayout.IntField("Blend mode", material, GetPropertyName(LayerBlendModePrefix, i), layerBlendModeLabels);
// Handle the sample mode selector
string layerSampleParametersProperty = GetPropertyName(LayerSampleParametersPrefix, i);
EditorGUI.BeginChangeCheck();
LayerSampleMode sampleMode = (LayerSampleMode)AvatarMaterialEditorGUILayout.IntField("Sample mode", material, GetPropertyName(LayerSampleModePrefix, i), layerSampleModeLabels);
if (EditorGUI.EndChangeCheck())
{
material.SetVector(layerSampleParametersProperty, sampleParametersCache[i, (int)sampleMode]);
}
// Show the mode-specific sample controls
EditorGUI.BeginChangeCheck();
AvatarMaterialEditorGUILayout.ColorField("Surface color", material, GetPropertyName(LayerColorPrefix, i));
switch (sampleMode) {
case LayerSampleMode.Texture:
TextureField("Surface texture", material, GetPropertyName(LayerSurfacePrefix, i));
AvatarMaterialEditorGUILayout.Vector2Field("Panning speed", material, layerSampleParametersProperty);
break;
case LayerSampleMode.TextureSingleChannel:
TextureField("Surface texture", material, GetPropertyName(LayerSurfacePrefix, i));
AvatarMaterialEditorGUILayout.ChannelMaskField("Channel", material, layerSampleParametersProperty);
break;
case LayerSampleMode.Parallax:
TextureField("Surface texture", material, GetPropertyName(LayerSurfacePrefix, i));
AvatarMaterialEditorGUILayout.VectorComponentField("Parallax min height", material, layerSampleParametersProperty, 0);
AvatarMaterialEditorGUILayout.VectorComponentField("Parallax max height", material, layerSampleParametersProperty, 1);
break;
case LayerSampleMode.RSRM:
TextureField("RSRM texture", material, GetPropertyName(LayerSurfacePrefix, i));
if (roughnessEnabled)
{
AvatarMaterialEditorGUILayout.VectorComponentField("Roughness min", material, layerSampleParametersProperty, 0);
AvatarMaterialEditorGUILayout.VectorComponentField("Roughness max", material, layerSampleParametersProperty, 1);
}
else
{
AvatarMaterialEditorGUILayout.VectorComponentField("Roughness", material, layerSampleParametersProperty, 0);
}
if (normalMapEnabled)
{
AvatarMaterialEditorGUILayout.VectorComponentField("Normal map strength", material, layerSampleParametersProperty, 2);
}
break;
}
if (EditorGUI.EndChangeCheck())
{
sampleParametersCache[i, (int)sampleMode] = material.GetVector(layerSampleParametersProperty);
}
// Handle the mask mode selector
string maskParametersName = GetPropertyName(LayerMaskParametersPrefix, i);
string maskAxisName = GetPropertyName(LayerMaskAxisPrefix, i);
MaskField("Mask Type", material, GetPropertyName(LayerMaskTypePrefix, i), maskParametersName, maskAxisName, maskAxisCache[i], maskParametersCache[i], normalMapEnabled);
}
if (EditorGUI.EndChangeCheck())
{
previewMaterials[i] = null;
}
EditorGUILayout.EndVertical();
}
}
layerVisibilityMasks[material] = layerVisibilityMask;
if (layerCount < MaxLayerCount)
{
if (GUILayout.Button("Add layer"))
{
Undo.RecordObject(material, "Add layer");
SetLayerCount(material, layerCount + 1);
removeLayerIndex = null;
}
}
if (removeLayerIndex.HasValue)
{
Undo.RecordObject(material, "Remove layer");
for (int i = removeLayerIndex.Value; i < layerCount - 1; ++i)
{
CopyAttributes(material, i + 1, i);
}
SetLayerCount(material, layerCount - 1);
}
if (swapSource.HasValue && swapTarget.HasValue)
{
Undo.RecordObject(material, string.Format("Swap layers {1} and {0}", swapSource.Value, swapTarget.Value));
SwapAttributes(material, swapSource.Value, swapTarget.Value);
}
EditorGUI.indentLevel--;
EditorGUILayout.EndVertical();
EditorUtility.SetDirty(target);
}
public Texture TextureField(string label, Material material, string propertyName)
{
Texture texture = material.GetTexture(propertyName);
MaterialProperty property = MaterialEditor.GetMaterialProperty(new[] { material }, propertyName);
Texture newTexture = base.TextureProperty(property, label);
if (newTexture != texture)
{
Undo.RecordObject(material, label + " change");
material.SetTexture(propertyName, newTexture);
}
return newTexture;
}
private Material CreatePreviewMaterial(Material material, int layerIndex)
{
Material previewMaterial = new Material(material);
CopyAttributes(previewMaterial, layerIndex, 0);
SetLayerCount(previewMaterial, 1);
previewMaterial.SetVector(DarkMultUniform, new Vector4(0.6f, 0.6f, 0.6f, 1.0f));
previewMaterial.SetVector(BaseColorUniform, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));
previewMaterial.SetTexture(AlphaMaskUniform, EditorGUIUtility.whiteTexture);
return previewMaterial;
}
private void SetLayerCount(Material material, int layerCount)
{
for (int i = 0; i < MaxLayerCount; ++i)
{
string layerCountProperty = GetPropertyName("LAYERS_", i + 1);
if (i + 1 == layerCount)
material.EnableKeyword(layerCountProperty);
else
material.DisableKeyword(layerCountProperty);
}
}
private static string GetPropertyName(string baseName, int index)
{
return string.Format("{0}{1}", baseName, index);
}
class LayerAttributes
{
public Texture surface { get; private set; }
public Color color { get; private set; }
public LayerMaskType maskType { get; private set; }
public Vector4 maskParameters { get; private set; }
public Vector4 maskAxis { get; private set; }
public LayerSampleMode sampleMode { get; private set; }
public Vector4 sampleParameters { get; private set; }
public LayerBlendMode blendMode { get; private set; }
public LayerAttributes()
{
this.surface = null;
this.color = Color.white;
this.maskType = (int)LayerMaskType.None;
this.maskParameters = Vector4.zero;
this.maskAxis = new Vector4(0.0f, 1.0f, 0.0f, 0.0f);
this.sampleMode = (int)LayerSampleMode.Color;
this.sampleParameters = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
this.blendMode = (int)LayerBlendMode.Add;
}
public LayerAttributes(
Texture surface,
Color color,
LayerMaskType maskType,
Vector3 maskParameters,
Vector4 maskAxis,
LayerSampleMode sampleMode,
Vector4 sampleParameters,
LayerBlendMode blendMode
) {
this.surface = surface;
this.color = color;
this.maskType = maskType;
this.maskParameters = maskParameters;
this.maskAxis = maskAxis;
this.sampleMode = sampleMode;
this.sampleParameters = sampleParameters;
this.blendMode = blendMode;
}
}
private void CopyAttributes(Material material, int sourceIndex, int targetIndex)
{
LayerAttributes attributes = GetLayerAttributes(material, sourceIndex);
SetLayerAttributes(material, targetIndex, attributes);
previewMaterials[targetIndex] = null;
}
private void SwapAttributes(Material material, int sourceIndex, int targetIndex)
{
LayerAttributes sourceAttributes = GetLayerAttributes(material, sourceIndex);
LayerAttributes targetAttributes = GetLayerAttributes(material, targetIndex);
SetLayerAttributes(material, sourceIndex, targetAttributes);
SetLayerAttributes(material, targetIndex, sourceAttributes);
previewMaterials[sourceIndex] = null;
previewMaterials[targetIndex] = null;
}
private static LayerAttributes GetLayerAttributes(Material material, int layerIndex)
{
return new LayerAttributes(
material.GetTexture(GetPropertyName(LayerSurfacePrefix, layerIndex)),
material.GetColor(GetPropertyName(LayerColorPrefix, layerIndex)),
(LayerMaskType)material.GetInt(GetPropertyName(LayerMaskTypePrefix, layerIndex)),
material.GetVector(GetPropertyName(LayerMaskParametersPrefix, layerIndex)),
material.GetVector(GetPropertyName(LayerMaskAxisPrefix, layerIndex)),
(LayerSampleMode)material.GetInt(GetPropertyName(LayerSampleModePrefix, layerIndex)),
material.GetVector(GetPropertyName(LayerSampleParametersPrefix, layerIndex)),
(LayerBlendMode)material.GetInt(GetPropertyName(LayerBlendModePrefix, layerIndex))
);
}
private static void SetLayerAttributes(Material material, int layerIndex, LayerAttributes attributes)
{
material.SetTexture(GetPropertyName(LayerSurfacePrefix, layerIndex), attributes.surface);
material.SetColor(GetPropertyName(LayerColorPrefix, layerIndex), attributes.color);
material.SetInt(GetPropertyName(LayerMaskTypePrefix, layerIndex), (int)attributes.maskType);
material.SetVector(GetPropertyName(LayerMaskParametersPrefix, layerIndex), attributes.maskParameters);
material.SetVector(GetPropertyName(LayerMaskAxisPrefix, layerIndex), attributes.maskAxis);
material.SetInt(GetPropertyName(LayerSampleModePrefix, layerIndex), (int)attributes.sampleMode);
material.SetVector(GetPropertyName(LayerSampleParametersPrefix, layerIndex), attributes.sampleParameters);
material.SetInt(GetPropertyName(LayerBlendModePrefix, layerIndex), (int)attributes.blendMode);
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: fdddb32bde2072f4da6baf73fd9ebddc
timeCreated: 1470865818
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 7e0c9e63876be544fb12244c66f5bced
folderAsset: yes
timeCreated: 1522867061
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c75924ae6be2e4d4a8c9021c599ac872
folderAsset: yes
timeCreated: 1522867080
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,25 @@
fileFormatVersion: 2
guid: 0dc1a28a4f6367642b859b703b901f30
timeCreated: 1516392277
licenseType: Store
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
Android:
enabled: 1
settings:
CPU: ARMv7
Any:
enabled: 0
settings: {}
Editor:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 3eeca1466db69a046849a21351c6ab64
folderAsset: yes
timeCreated: 1536104808
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: a082ff1bb115495438c0dbd2a47e2b0f
folderAsset: yes
timeCreated: 1525971172
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,318 @@
#ifndef AVATAR_UTIL_CG_INCLUDED
#define AVATAR_UTIL_CG_INCLUDED
#include "UnityCG.cginc"
#define SAMPLE_MODE_COLOR 0
#define SAMPLE_MODE_TEXTURE 1
#define SAMPLE_MODE_TEXTURE_SINGLE_CHANNEL 2
#define SAMPLE_MODE_PARALLAX 3
#define SAMPLE_MODE_RSRM 4
#define MASK_TYPE_NONE 0
#define MASK_TYPE_POSITIONAL 1
#define MASK_TYPE_REFLECTION 2
#define MASK_TYPE_FRESNEL 3
#define MASK_TYPE_PULSE 4
#define BLEND_MODE_ADD 0
#define BLEND_MODE_MULTIPLY 1
#ifdef LAYERS_1
#define LAYER_COUNT 1
#elif LAYERS_2
#define LAYER_COUNT 2
#elif LAYERS_3
#define LAYER_COUNT 3
#elif LAYERS_4
#define LAYER_COUNT 4
#elif LAYERS_5
#define LAYER_COUNT 5
#elif LAYERS_6
#define LAYER_COUNT 6
#elif LAYERS_7
#define LAYER_COUNT 7
#elif LAYERS_8
#define LAYER_COUNT 8
#endif
#define DECLARE_LAYER_UNIFORMS(index) \
int _LayerSampleMode##index; \
int _LayerBlendMode##index; \
int _LayerMaskType##index; \
fixed4 _LayerColor##index; \
sampler2D _LayerSurface##index; \
float4 _LayerSurface##index##_ST; \
float4 _LayerSampleParameters##index; \
float4 _LayerMaskParameters##index; \
float4 _LayerMaskAxis##index;
DECLARE_LAYER_UNIFORMS(0)
DECLARE_LAYER_UNIFORMS(1)
DECLARE_LAYER_UNIFORMS(2)
DECLARE_LAYER_UNIFORMS(3)
DECLARE_LAYER_UNIFORMS(4)
DECLARE_LAYER_UNIFORMS(5)
DECLARE_LAYER_UNIFORMS(6)
DECLARE_LAYER_UNIFORMS(7)
struct VertexOutput
{
float4 pos : SV_POSITION;
float2 texcoord : TEXCOORD0;
float3 worldPos : TEXCOORD1;
float3 worldNormal : TEXCOORD2;
float3 viewDir : TEXCOORD3;
float4 vertColor : COLOR;
#if NORMAL_MAP_ON || PARALLAX_ON
float3 worldTangent : TANGENT;
float3 worldBitangent : TEXCOORD5;
#endif
};
float _Alpha;
int _BaseMaskType;
float4 _BaseMaskParameters;
float4 _BaseMaskAxis;
fixed4 _DarkMultiplier;
fixed4 _BaseColor;
sampler2D _AlphaMask;
float4 _AlphaMask_ST;
sampler2D _AlphaMask2;
float4 _AlphaMask2_ST;
sampler2D _NormalMap;
float4 _NormalMap_ST;
sampler2D _ParallaxMap;
float4 _ParallaxMap_ST;
sampler2D _RoughnessMap;
float4 _RoughnessMap_ST;
float4x4 _ProjectorWorldToLocal;
VertexOutput vert(appdata_full v)
{
VertexOutput o;
UNITY_INITIALIZE_OUTPUT(VertexOutput, o);
o.texcoord = v.texcoord.xy;
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
o.vertColor = v.color;
o.viewDir = normalize(_WorldSpaceCameraPos.xyz - o.worldPos);
o.worldNormal = normalize(mul(unity_ObjectToWorld, float4(v.normal, 0.0)).xyz);
#if NORMAL_MAP_ON || PARALLAX_ON
o.worldTangent = normalize(mul(unity_ObjectToWorld, float4(v.tangent.xyz, 0.0)).xyz);
o.worldBitangent = normalize(cross(o.worldNormal, o.worldTangent) * v.tangent.w);
#endif
o.pos = UnityObjectToClipPos(v.vertex);
return o;
}
#ifndef NORMAL_MAP_ON
#define COMPUTE_NORMAL IN.worldNormal
#else
#define COMPUTE_NORMAL normalize(mul(lerp(float3(0, 0, 1), surfaceNormal, normalMapStrength), tangentTransform))
#endif
float3 ComputeColor(
VertexOutput IN,
float2 uv,
#if PARALLAX_ON || NORMAL_MAP_ON
float3x3 tangentTransform,
#endif
#ifdef NORMAL_MAP_ON
float3 surfaceNormal,
#endif
sampler2D surface,
float4 surface_ST,
fixed4 color,
int sampleMode,
float4 sampleParameters
) {
if (sampleMode == SAMPLE_MODE_TEXTURE) {
float2 panning = _Time.g * sampleParameters.xy;
return tex2D(surface, (uv + panning) * surface_ST.xy + surface_ST.zw).rgb * color.rgb;
}
else if (sampleMode == SAMPLE_MODE_TEXTURE_SINGLE_CHANNEL) {
float4 channelMask = sampleParameters;
float4 channels = tex2D(surface, uv * surface_ST.xy + surface_ST.zw);
return dot(channels, channelMask) * color.rgb;
}
#ifdef PARALLAX_ON
else if (sampleMode == SAMPLE_MODE_PARALLAX) {
float parallaxMinHeight = sampleParameters.x;
float parallaxMaxHeight = sampleParameters.y;
float parallaxValue = tex2D(_ParallaxMap, TRANSFORM_TEX(uv, _ParallaxMap)).r;
float scaledHeight = lerp(parallaxMinHeight, parallaxMaxHeight, parallaxValue);
float2 parallaxUV = mul(tangentTransform, IN.viewDir).xy * scaledHeight;
return tex2D(surface, (uv * surface_ST.xy + surface_ST.zw) + parallaxUV).rgb * color.rgb;
}
#endif
else if (sampleMode == SAMPLE_MODE_RSRM) {
float roughnessMin = sampleParameters.x;
float roughnessMax = sampleParameters.y;
#ifdef ROUGHNESS_ON
float roughnessValue = tex2D(_RoughnessMap, TRANSFORM_TEX(uv, _RoughnessMap)).r;
float scaledRoughness = lerp(roughnessMin, roughnessMax, roughnessValue);
#else
float scaledRoughness = roughnessMin;
#endif
#ifdef NORMAL_MAP_ON
float normalMapStrength = sampleParameters.z;
#endif
float3 viewReflect = reflect(-IN.viewDir, COMPUTE_NORMAL);
float viewAngle = viewReflect.y * 0.5 + 0.5;
return tex2D(surface, float2(scaledRoughness, viewAngle)).rgb * color.rgb;
}
return color.rgb;
}
float ComputeMask(
VertexOutput IN,
#ifdef NORMAL_MAP_ON
float3x3 tangentTransform,
float3 surfaceNormal,
#endif
int maskType,
float4 layerParameters,
float3 maskAxis
) {
if (maskType == MASK_TYPE_POSITIONAL) {
float centerDistance = layerParameters.x;
float fadeAbove = layerParameters.y;
float fadeBelow = layerParameters.z;
float3 objPos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz;
float d = dot(objPos, maskAxis);
if (d > centerDistance) {
return saturate(1.0 - (d - centerDistance) / fadeAbove);
}
else {
return saturate(1.0 - (centerDistance - d) / fadeBelow);
}
}
else if (maskType == MASK_TYPE_REFLECTION) {
float fadeStart = layerParameters.x;
float fadeEnd = layerParameters.y;
#ifdef NORMAL_MAP_ON
float normalMapStrength = layerParameters.z;
#endif
float power = layerParameters.w;
float3 viewReflect = reflect(-IN.viewDir, COMPUTE_NORMAL);
float d = max(0.0, dot(viewReflect, maskAxis));
return saturate(1.0 - (d - fadeStart) / (fadeEnd - fadeStart));
}
else if (maskType == MASK_TYPE_FRESNEL) {
float power = layerParameters.x;
float fadeStart = layerParameters.y;
float fadeEnd = layerParameters.z;
#ifdef NORMAL_MAP_ON
float normalMapStrength = layerParameters.w;
#endif
float d = saturate(1.0 - max(0.0, dot(IN.viewDir, COMPUTE_NORMAL)));
float p = pow(d, power);
return saturate(lerp(fadeStart, fadeEnd, p));
}
else if (maskType == MASK_TYPE_PULSE) {
float distance = layerParameters.x;
float speed = layerParameters.y;
float power = layerParameters.z;
float3 objPos = mul(unity_WorldToObject, float4(IN.worldPos, 1.0)).xyz;
float d = dot(objPos, maskAxis);
float theta = 6.2831 * frac((d - _Time.g * speed) / distance);
return saturate(pow((sin(theta) * 0.5 + 0.5), power));
}
else {
return 1.0;
}
}
float3 ComputeBlend(float3 source, float3 blend, float mask, int blendMode) {
if (blendMode == BLEND_MODE_MULTIPLY) {
return source * (blend * mask);
}
else {
return source + (blend * mask);
}
}
float4 ComputeSurface(VertexOutput IN)
{
#if PROJECTOR_ON
float3 projectorPos = mul(_ProjectorWorldToLocal, float4(IN.worldPos, 1.0)).xyz;
if (abs(projectorPos.x) > 1.0 || abs(projectorPos.y) > 1.0 || abs(projectorPos.z) > 1.0)
{
discard;
}
float2 uv = projectorPos.xy * 0.5 + 0.5;
#else
float2 uv = IN.texcoord.xy;
#endif
fixed4 c = _BaseColor;
IN.worldNormal = normalize(IN.worldNormal);
#if PARALLAX_ON || NORMAL_MAP_ON
float3x3 tangentTransform = float3x3(IN.worldTangent, IN.worldBitangent, IN.worldNormal);
#endif
#ifdef NORMAL_MAP_ON
float3 surfaceNormal = UnpackNormal(tex2D(_NormalMap, TRANSFORM_TEX(uv, _NormalMap)));
#endif
#if PARALLAX_ON || NORMAL_MAP_ON
#ifndef NORMAL_MAP_ON
#define COLOR_INPUTS IN, uv, tangentTransform
#define MASK_INPUTS IN
#else
#define COLOR_INPUTS IN, uv, tangentTransform, surfaceNormal
#define MASK_INPUTS IN, tangentTransform, surfaceNormal
#endif
#else
#define COLOR_INPUTS IN, uv
#define MASK_INPUTS IN
#endif
#define LAYER_COLOR(index) ComputeColor(COLOR_INPUTS, _LayerSurface##index, _LayerSurface##index##_ST, _LayerColor##index, _LayerSampleMode##index, _LayerSampleParameters##index)
#define LAYER_MASK(index) ComputeMask(MASK_INPUTS, _LayerMaskType##index, _LayerMaskParameters##index, _LayerMaskAxis##index##.xyz)
#define LAYER_BLEND(index, c) ComputeBlend(c, LAYER_COLOR(index), LAYER_MASK(index), _LayerBlendMode##index)
c.rgb = LAYER_BLEND(0, c.rgb);
#if LAYER_COUNT > 1
c.rgb = LAYER_BLEND(1, c.rgb);
#endif
#if LAYER_COUNT > 2
c.rgb = LAYER_BLEND(2, c.rgb);
#endif
#if LAYER_COUNT > 3
c.rgb = LAYER_BLEND(3, c.rgb);
#endif
#if LAYER_COUNT > 4
c.rgb = LAYER_BLEND(4, c.rgb);
#endif
#if LAYER_COUNT > 5
c.rgb = LAYER_BLEND(5, c.rgb);
#endif
#if LAYER_COUNT > 6
c.rgb = LAYER_BLEND(6, c.rgb);
#endif
#if LAYER_COUNT > 7
c.rgb = LAYER_BLEND(7, c.rgb);
#endif
#ifdef VERTALPHA_ON
float scaledValue = IN.vertColor.a * 2.0;
float alpha0weight = max(0.0, 1.0 - scaledValue);
float alpha2weight = max(0.0, scaledValue - 1.0);
float alpha1weight = 1.0 - alpha0weight - alpha2weight;
c.a = _Alpha * c.a * (tex2D(_AlphaMask, TRANSFORM_TEX(uv, _AlphaMask)).r * alpha1weight + tex2D(_AlphaMask2, TRANSFORM_TEX(uv, _AlphaMask2)).r * alpha2weight + alpha0weight) * ComputeMask(MASK_INPUTS, _BaseMaskType, _BaseMaskParameters, _BaseMaskAxis);
#else
c.a = _Alpha * c.a * tex2D(_AlphaMask, TRANSFORM_TEX(uv, _AlphaMask)).r * IN.vertColor.a * ComputeMask(MASK_INPUTS, _BaseMaskType, _BaseMaskParameters, _BaseMaskAxis);
#endif
c.rgb = lerp(c.rgb, c.rgb * _DarkMultiplier, IN.vertColor.r);
return c;
}
#endif

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 80b6b34e742970d4bb0cdef9c74b04ae
timeCreated: 1525971186
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,141 @@
Shader "OvrAvatar/AvatarSurfaceShader" {
Properties{
// Global parameters
_Alpha("Alpha", Range(0.0, 1.0)) = 1.0
_DarkMultiplier("Dark Multiplier", Color) = (0.6, 0.6, 0.6, 1.0)
_BaseColor("Base Color", Color) = (0.0, 0.0, 0.0, 0.0)
_BaseMaskType("Base Mask Type", Int) = 0
_BaseMaskParameters("Base Mask Parameters", Vector) = (0, 0, 0, 0)
_BaseMaskAxis("Base Mask Axis", Vector) = (0, 1, 0, 0)
_AlphaMask("Alpha Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "" {}
_ParallaxMap("Parallax Map", 2D) = "" {}
_RoughnessMap("Roughness Map", 2D) = "" {}
// Layer 0 parameters
_LayerSampleMode0("Layer Sample Mode 0", Int) = 0
_LayerBlendMode0("Layer Blend Mode 0", Int) = 0
_LayerMaskType0("Layer Mask Type 0", Int) = 0
_LayerColor0("Layer Color 0", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface0("Layer Surface 0", 2D) = "" {}
_LayerSampleParameters0("Layer Sample Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskParameters0("Layer Mask Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskAxis0("Layer Mask Axis 0", Vector) = (0, 1, 0, 0)
// Layer 1 parameters
_LayerSampleMode1("Layer Sample Mode 1", Int) = 0
_LayerBlendMode1("Layer Blend Mode 1", Int) = 0
_LayerMaskType1("Layer Mask Type 1", Int) = 0
_LayerColor1("Layer Color 1", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface1("Layer Surface 1", 2D) = "" {}
_LayerSampleParameters1("Layer Sample Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskParameters1("Layer Mask Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskAxis1("Layer Mask Axis 1", Vector) = (0, 1, 0, 0)
// Layer 2 parameters
_LayerSampleMode2("Layer Sample Mode 2", Int) = 0
_LayerBlendMode2("Layer Blend Mode 2", Int) = 0
_LayerMaskType2("Layer Mask Type 2", Int) = 0
_LayerColor2("Layer Color 2", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface2("Layer Surface 2", 2D) = "" {}
_LayerSampleParameters2("Layer Sample Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskParameters2("Layer Mask Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskAxis2("Layer Mask Axis 2", Vector) = (0, 1, 0, 0)
// Layer 3 parameters
_LayerSampleMode3("Layer Sample Mode 3", Int) = 0
_LayerBlendMode3("Layer Blend Mode 3", Int) = 0
_LayerMaskType3("Layer Mask Type 3", Int) = 0
_LayerColor3("Layer Color 3", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface3("Layer Surface 3", 2D) = "" {}
_LayerSampleParameters3("Layer Sample Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskParameters3("Layer Mask Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskAxis3("Layer Mask Axis 3", Vector) = (0, 1, 0, 0)
// Layer 4 parameters
_LayerSampleMode4("Layer Sample Mode 4", Int) = 0
_LayerBlendMode4("Layer Blend Mode 4", Int) = 0
_LayerMaskType4("Layer Mask Type 4", Int) = 0
_LayerColor4("Layer Color 4", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface4("Layer Surface 4", 2D) = "" {}
_LayerSampleParameters4("Layer Sample Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskParameters4("Layer Mask Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskAxis4("Layer Mask Axis 4", Vector) = (0, 1, 0, 0)
// Layer 5 parameters
_LayerSampleMode5("Layer Sample Mode 5", Int) = 0
_LayerBlendMode5("Layer Blend Mode 5", Int) = 0
_LayerMaskType5("Layer Mask Type 5", Int) = 0
_LayerColor5("Layer Color 5", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface5("Layer Surface 5", 2D) = "" {}
_LayerSampleParameters5("Layer Sample Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskParameters5("Layer Mask Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskAxis5("Layer Mask Axis 5", Vector) = (0, 1, 0, 0)
// Layer 6 parameters
_LayerSampleMode6("Layer Sample Mode 6", Int) = 0
_LayerBlendMode6("Layer Blend Mode 6", Int) = 0
_LayerMaskType6("Layer Mask Type 6", Int) = 0
_LayerColor6("Layer Color 6", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface6("Layer Surface 6", 2D) = "" {}
_LayerSampleParameters6("Layer Sample Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskParameters6("Layer Mask Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskAxis6("Layer Mask Axis 6", Vector) = (0, 1, 0, 0)
// Layer 7 parameters
_LayerSampleMode7("Layer Sample Mode 7", Int) = 0
_LayerBlendMode7("Layer Blend Mode 7", Int) = 0
_LayerMaskType7("Layer Mask Type 7", Int) = 0
_LayerColor7("Layer Color 7", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface7("Layer Surface 7", 2D) = "" {}
_LayerSampleParameters7("Layer Sample Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskParameters7("Layer Mask Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskAxis7("Layer Mask Axis 7", Vector) = (0, 1, 0, 0)
}
SubShader
{
Tags
{
"Queue" = "Transparent"
"RenderType" = "Transparent"
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
LOD 200
Pass
{
Name "FORWARD"
Tags
{
"LightMode" = "ForwardBase"
}
CGPROGRAM
#pragma only_renderers d3d11 gles3 gles
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile PROJECTOR_OFF PROJECTOR_ON
#pragma multi_compile NORMAL_MAP_OFF NORMAL_MAP_ON
#pragma multi_compile PARALLAX_OFF PARALLAX_ON
#pragma multi_compile ROUGHNESS_OFF ROUGHNESS_ON
#pragma multi_compile VERTALPHA_OFF VERTALPHA_ON
#pragma multi_compile LAYERS_1 LAYERS_2 LAYERS_3 LAYERS_4 LAYERS_5 LAYERS_6 LAYERS_7 LAYERS_8
#include "Assets/Oculus/Avatar/Resources/Materials/AvatarMaterialStateShader.cginc"
float4 frag(VertexOutput IN) : COLOR
{
return ComputeSurface(IN);
}
ENDCG
}
}
FallBack "Diffuse"
CustomEditor "AvatarMaterialEditor"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 73f67c4e7bf718b4385aa6b1f8a06591
timeCreated: 1525971190
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,79 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "OvrAvatar/AvatarSurfaceShaderPBS" {
Properties{
// Global parameters
_Alpha("Alpha", Range(0.0, 1.0)) = 1.0
_Albedo("Albedo (RGB)", 2D) = "" {}
_Surface("Metallic (R) Occlusion (G) and Smoothness (A)", 2D) = "" {}
}
SubShader{
Tags {
"Queue" = "Transparent"
"RenderType" = "Transparent"
}
Pass {
ZWrite On
Cull Off
ColorMask 0
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#include "UnityCG.cginc"
struct v2f {
float4 position : SV_POSITION;
};
v2f vert(appdata_full v) {
// Output
v2f output;
output.position = UnityObjectToClipPos(v.vertex);
return output;
}
float4 frag(v2f input) : COLOR {
return 0;
}
ENDCG
}
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard vertex:vert nolightmap alpha noforwardadd
float _Alpha;
sampler2D _Albedo;
float4 _Albedo_ST;
sampler2D _Surface;
float4 _Surface_ST;
struct Input {
float2 texcoord;
};
void vert(inout appdata_full v, out Input o) {
UNITY_INITIALIZE_OUTPUT(Input, o);
o.texcoord = v.texcoord.xy;
}
void surf (Input IN, inout SurfaceOutputStandard o) {
o.Albedo = tex2D(_Albedo, TRANSFORM_TEX(IN.texcoord, _Albedo)).rgb;
float4 surfaceParams = tex2D(_Surface, TRANSFORM_TEX(IN.texcoord, _Surface));
o.Metallic = surfaceParams.r;
o.Occlusion = surfaceParams.g;
o.Smoothness = surfaceParams.a;
o.Alpha = _Alpha;
}
#pragma only_renderers d3d11 gles3 gles
ENDCG
}
FallBack "Diffuse"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5e52aa58207bbf24d8eb8ec969e9ae88
timeCreated: 1525971190
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,39 @@
Shader "OvrAvatar/AvatarSurfaceShaderPBSV2" {
Properties {
_AlbedoMultiplier ("Albedo Multiplier", Color) = (1,1,1,1)
_Albedo ("Albedo (RGB)", 2D) = "white" {}
_Metallicness("Metallicness", 2D) = "grey" {}
_GlossinessScale ("Glossiness Scale", Range(0,1)) = 0.5
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
// Physically based Standard lighting model, and enable shadows on all light types
#pragma surface surf Standard fullforwardshadows
// Use shader model 3.0 target, to get nicer looking lighting
#pragma target 3.0
sampler2D _Albedo;
sampler2D _Metallicness;
struct Input {
float2 uv_Albedo;
};
float _GlossinessScale;
float4 _AlbedoMultiplier;
void surf (Input IN, inout SurfaceOutputStandard o) {
fixed4 c = tex2D (_Albedo, IN.uv_Albedo) * _AlbedoMultiplier;
o.Albedo = c.rgb;
o.Metallic = tex2D (_Metallicness, IN.uv_Albedo).r;
o.Smoothness = _GlossinessScale;
o.Alpha = 1.0;
}
ENDCG
}
FallBack "Diffuse"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 176faebcc612eb147900defeda2149cb
timeCreated: 1525971187
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,175 @@
Shader "OvrAvatar/AvatarSurfaceShaderSelfOccluding" {
Properties{
// Global parameters
_Alpha("Alpha", Range(0.0, 1.0)) = 1.0
_DarkMultiplier("Dark Multiplier", Color) = (0.6, 0.6, 0.6, 1.0)
_BaseColor("Base Color", Color) = (0.0, 0.0, 0.0, 0.0)
_BaseMaskType("Base Mask Type", Int) = 0
_BaseMaskParameters("Base Mask Parameters", Vector) = (0, 0, 0, 0)
_BaseMaskAxis("Base Mask Axis", Vector) = (0, 1, 0, 0)
_AlphaMask("Alpha Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "" {}
_ParallaxMap("Parallax Map", 2D) = "" {}
_RoughnessMap("Roughness Map", 2D) = "" {}
// Layer 0 parameters
_LayerSampleMode0("Layer Sample Mode 0", Int) = 0
_LayerBlendMode0("Layer Blend Mode 0", Int) = 0
_LayerMaskType0("Layer Mask Type 0", Int) = 0
_LayerColor0("Layer Color 0", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface0("Layer Surface 0", 2D) = "" {}
_LayerSampleParameters0("Layer Sample Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskParameters0("Layer Mask Parameters 0", Vector) = (0, 0, 0, 0)
_LayerMaskAxis0("Layer Mask Axis 0", Vector) = (0, 1, 0, 0)
// Layer 1 parameters
_LayerSampleMode1("Layer Sample Mode 1", Int) = 0
_LayerBlendMode1("Layer Blend Mode 1", Int) = 0
_LayerMaskType1("Layer Mask Type 1", Int) = 0
_LayerColor1("Layer Color 1", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface1("Layer Surface 1", 2D) = "" {}
_LayerSampleParameters1("Layer Sample Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskParameters1("Layer Mask Parameters 1", Vector) = (0, 0, 0, 0)
_LayerMaskAxis1("Layer Mask Axis 1", Vector) = (0, 1, 0, 0)
// Layer 2 parameters
_LayerSampleMode2("Layer Sample Mode 2", Int) = 0
_LayerBlendMode2("Layer Blend Mode 2", Int) = 0
_LayerMaskType2("Layer Mask Type 2", Int) = 0
_LayerColor2("Layer Color 2", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface2("Layer Surface 2", 2D) = "" {}
_LayerSampleParameters2("Layer Sample Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskParameters2("Layer Mask Parameters 2", Vector) = (0, 0, 0, 0)
_LayerMaskAxis2("Layer Mask Axis 2", Vector) = (0, 1, 0, 0)
// Layer 3 parameters
_LayerSampleMode3("Layer Sample Mode 3", Int) = 0
_LayerBlendMode3("Layer Blend Mode 3", Int) = 0
_LayerMaskType3("Layer Mask Type 3", Int) = 0
_LayerColor3("Layer Color 3", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface3("Layer Surface 3", 2D) = "" {}
_LayerSampleParameters3("Layer Sample Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskParameters3("Layer Mask Parameters 3", Vector) = (0, 0, 0, 0)
_LayerMaskAxis3("Layer Mask Axis 3", Vector) = (0, 1, 0, 0)
// Layer 4 parameters
_LayerSampleMode4("Layer Sample Mode 4", Int) = 0
_LayerBlendMode4("Layer Blend Mode 4", Int) = 0
_LayerMaskType4("Layer Mask Type 4", Int) = 0
_LayerColor4("Layer Color 4", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface4("Layer Surface 4", 2D) = "" {}
_LayerSampleParameters4("Layer Sample Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskParameters4("Layer Mask Parameters 4", Vector) = (0, 0, 0, 0)
_LayerMaskAxis4("Layer Mask Axis 4", Vector) = (0, 1, 0, 0)
// Layer 5 parameters
_LayerSampleMode5("Layer Sample Mode 5", Int) = 0
_LayerBlendMode5("Layer Blend Mode 5", Int) = 0
_LayerMaskType5("Layer Mask Type 5", Int) = 0
_LayerColor5("Layer Color 5", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface5("Layer Surface 5", 2D) = "" {}
_LayerSampleParameters5("Layer Sample Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskParameters5("Layer Mask Parameters 5", Vector) = (0, 0, 0, 0)
_LayerMaskAxis5("Layer Mask Axis 5", Vector) = (0, 1, 0, 0)
// Layer 6 parameters
_LayerSampleMode6("Layer Sample Mode 6", Int) = 0
_LayerBlendMode6("Layer Blend Mode 6", Int) = 0
_LayerMaskType6("Layer Mask Type 6", Int) = 0
_LayerColor6("Layer Color 6", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface6("Layer Surface 6", 2D) = "" {}
_LayerSampleParameters6("Layer Sample Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskParameters6("Layer Mask Parameters 6", Vector) = (0, 0, 0, 0)
_LayerMaskAxis6("Layer Mask Axis 6", Vector) = (0, 1, 0, 0)
// Layer 7 parameters
_LayerSampleMode7("Layer Sample Mode 7", Int) = 0
_LayerBlendMode7("Layer Blend Mode 7", Int) = 0
_LayerMaskType7("Layer Mask Type 7", Int) = 0
_LayerColor7("Layer Color 7", Color) = (1.0, 1.0, 1.0, 1.0)
_LayerSurface7("Layer Surface 7", 2D) = "" {}
_LayerSampleParameters7("Layer Sample Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskParameters7("Layer Mask Parameters 7", Vector) = (0, 0, 0, 0)
_LayerMaskAxis7("Layer Mask Axis 7", Vector) = (0, 1, 0, 0)
}
SubShader
{
Tags
{
"Queue" = "Transparent"
"RenderType" = "Transparent"
}
Pass
{
ZWrite On
Cull Off
ColorMask 0
Offset 1, 1
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#include "UnityCG.cginc"
struct v2f
{
float4 position : SV_POSITION;
};
v2f vert(appdata_full v)
{
// Output
v2f output;
output.position = UnityObjectToClipPos(v.vertex);
return output;
}
float4 frag(v2f input) : COLOR
{
return 0;
}
ENDCG
}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
LOD 200
Pass
{
Name "FORWARD"
Tags
{
"LightMode" = "ForwardBase"
}
CGPROGRAM
#pragma only_renderers d3d11 gles3 gles
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile PROJECTOR_OFF PROJECTOR_ON
#pragma multi_compile NORMAL_MAP_OFF NORMAL_MAP_ON
#pragma multi_compile PARALLAX_OFF PARALLAX_ON
#pragma multi_compile ROUGHNESS_OFF ROUGHNESS_ON
#pragma multi_compile VERTALPHA_OFF VERTALPHA_ON
#pragma multi_compile LAYERS_1 LAYERS_2 LAYERS_3 LAYERS_4 LAYERS_5 LAYERS_6 LAYERS_7 LAYERS_8
#include "Assets/Oculus/Avatar/Resources/Materials/AvatarMaterialStateShader.cginc"
float4 frag(VertexOutput IN) : SV_Target
{
return ComputeSurface(IN);
}
ENDCG
}
}
FallBack "Diffuse"
CustomEditor "AvatarMaterialEditor"
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 69f342b79d37541489919a19cfd8a924
timeCreated: 1525971190
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ced8ef067736a0b468cde573cc63e3ec
folderAsset: yes
timeCreated: 1525971173
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,217 @@
//
// *** OvrAvatar Mobile Combined Mesh shader ***
// *** Texture array approach for rendering a combined mesh avatar ***
//
// This is a Unity vertex-fragnment shader implementation for our 1.5 skin shaded avatar look.
// The benefit of using this version is performance as it bypasses the PBR lighting model and
// so is generally recommended for use on mobile.
//
// This is the texture array version of the shader, which will draw all pre-combined
// components in one draw call. This is coupled with OvrAvatarMaterialManager to populate the
// shader properties.
//
// Shader keywords:
// - SECONDARY_LIGHT_ON SECONDARY_LIGHT_OFF
// Enable SECONDARY_LIGHT_ON for a second "light" as expressed by _SecondaryLightDirection
// and _SecondaryLightColor to influence the standard rim effect. This is designed for use in video watching
// experiences to sample the screen color and apply this to the rim term.
// - NO_BACKLIGHT_ON NO_BACKLIGHT_OFF
// This effect is active by default: NO_BACKLIGHT_OFF is the default and enables the effect. Enable NO_BACKLIGHT_ON
// to disable illumination from the rear of the main light direction. This mobile shader supports one directional
// light. This can cause the un-illuminated side of the avatar to lose definition.
//
// Notes:
// - The primary light in your scene will be used to calculate lighting.
// - We don't have a mouth bone, but the vertex shader will animate the vertices around the mouth
// area according to the _Voice value. This should be set according to local microphone value
// range between 0-1.
Shader "OvrAvatar/Avatar_Mobile_CombinedMesh"
{
Properties
{
_MainTex("Main Texture Array", 2DArray) = "white" {}
_NormalMap("Normal Map Array", 2DArray) = "bump" {}
_RoughnessMap("Roughness Map Array", 2DArray) = "black" {}
_Dimmer("Dimmer", Range(0.0,1.0)) = 1.0
_Alpha("Alpha", Range(0.0,1.0)) = 1.0
_Voice("Voice", Range(0.0,1.0)) = 1.0
[HideInInspector] _MouthPosition("Mouth position", Vector) = (0,0,0,1)
[HideInInspector] _MouthDirection("Mouth direction", Vector) = (0,0,0,1)
[HideInInspector] _MouthEffectDistance("Mouth Effect Distance", Float) = 0.03
[HideInInspector] _MouthEffectScale("Mouth Effect Scaler", Float) = 1
// Index into the texture array needs an offset for precision
_Slices("Texture Array Slices", int) = 4.97
}
SubShader
{
Pass
{
Tags
{
"LightMode" = "ForwardBase" "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True"
}
LOD 100
ZWrite On
ZTest LEqual
Cull Back
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.5
#pragma fragmentoption ARB_precision_hint_fastest
#pragma multi_compile SECONDARY_LIGHT_OFF SECONDARY_LIGHT_ON
#pragma multi_compile BACKLIGHT_OFF BACKLIGHT_ON
#include "UnityCG.cginc"
#include "UnityLightingCommon.cginc"
UNITY_DECLARE_TEX2DARRAY(_MainTex);
UNITY_DECLARE_TEX2DARRAY(_NormalMap);
uniform float4 _NormalMap_ST;
UNITY_DECLARE_TEX2DARRAY(_RoughnessMap);
uniform int _Slices;
uniform float4 _BaseColor[5];
uniform float _DiffuseIntensity[5];
uniform float _RimIntensity[5];
uniform float _BacklightIntensity[5];
uniform float _ReflectionIntensity[5];
uniform float3 _SecondaryLightDirection;
uniform float4 _SecondaryLightColor;
uniform float _Dimmer;
uniform float _Alpha;
uniform float _Voice;
uniform float4 _MouthPosition;
uniform float4 _MouthDirection;
uniform float _MouthEffectDistance;
uniform float _MouthEffectScale;
static const fixed MOUTH_ZSCALE = 0.5f;
static const fixed MOUTH_DROPOFF = 0.01f;
struct appdata
{
float4 vertex: POSITION;
float3 normal: NORMAL;
float4 tangent: TANGENT;
float2 texcoord: TEXCOORD0;
float4 vertexColor : COLOR0;
};
struct v2f
{
float4 pos : SV_POSITION;
float3 uv : TEXCOORD0;
float4 posWorld: TEXCOORD1;
float3 normalDir: TEXCOORD2;
float3 tangentDir: TEXCOORD3;
float3 bitangentDir: TEXCOORD4;
};
v2f vert(appdata v)
{
v2f o;
// Mouth vertex animation with voip
float4 worldVert = mul(unity_ObjectToWorld, v.vertex);;
float3 delta = _MouthPosition - worldVert;
delta.z *= MOUTH_ZSCALE;
float dist = length(delta);
float scaledMouthDropoff = _MouthEffectScale * MOUTH_DROPOFF;
float scaledMouthEffect = _MouthEffectScale * _MouthEffectDistance;
float displacement = _Voice * smoothstep(scaledMouthEffect + scaledMouthDropoff, scaledMouthEffect, dist);
worldVert.xyz -= _MouthDirection * displacement;
v.vertex = mul(unity_WorldToObject, worldVert);
// Calculate tangents for normal mapping
o.normalDir = normalize(UnityObjectToWorldNormal(v.normal));
o.tangentDir = normalize(mul(unity_ObjectToWorld, half4(v.tangent.xyz, 0.0)).xyz);
o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
o.posWorld = worldVert;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv.xy = v.texcoord;
o.uv.z = v.vertexColor.x * _Slices;
return o;
}
fixed4 frag(v2f i) : COLOR
{
// Light direction
float3 lightDirection = _WorldSpaceLightPos0.xyz;
// Unpack normal map
float3 transformedNormalUV = i.uv;
transformedNormalUV.xy = float2(TRANSFORM_TEX(i.uv.xy, _NormalMap));
float3 normalMap = UNITY_SAMPLE_TEX2DARRAY(_NormalMap, transformedNormalUV).rgb * 2 - 1;
// Calculate normal
float3x3 tangentTransform = float3x3(i.tangentDir, i.bitangentDir, i.normalDir);
float3 normalDirection = normalize(mul(normalMap.rgb, tangentTransform));
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
// Apply view, normal, and lighting dependent terms
float VdotN = saturate(dot(viewDirection, normalDirection));
float NdotL = saturate(dot(normalDirection, lightDirection));
float LightColorNdotL = NdotL * _LightColor0;
// Sample the default reflection cubemap using the reflection vector
float3 worldReflection = reflect(-viewDirection, normalDirection);
half4 skyData = UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, worldReflection);
// Decode cubemap data into actual color
half3 reflectionColor = DecodeHDR(skyData, unity_SpecCube0_HDR);
// Calculate color for each component
float4 col;
// Get index into texture array
int componentIndex = floor(i.uv.z + 0.5);
// Diffuse texture sample
col = UNITY_SAMPLE_TEX2DARRAY(_MainTex, i.uv);
// Multiply in color tint (don't need to deal with gamma/linear here as conversion already done)
col.rgb *= _BaseColor[componentIndex];
// Main light
col.rgb += _DiffuseIntensity[componentIndex] * LightColorNdotL;
#ifdef NO_BACKLIGHT_ON
//NO_BACKLIGHT_ON disables the rear illumination
#else
// Illuminate from behind
float3 reverseLightDirection = lightDirection * -1;
float NdotInvL = saturate(dot(normalDirection, normalize(reverseLightDirection)));
col.rgb += (_DiffuseIntensity[componentIndex] * _BacklightIntensity[componentIndex]) * NdotInvL * _LightColor0;
#endif
// Rim term
#ifdef SECONDARY_LIGHT_ON
// Secondary light proxy (direction and color) passed into the rim term
NdotL = saturate(dot(normalDirection, _SecondaryLightDirection));
col.rgb += pow(1.0 - VdotN, _RimIntensity[componentIndex]) * NdotL * _SecondaryLightColor;
#else
col.rgb += pow(1.0 - VdotN, _RimIntensity[componentIndex]) * LightColorNdotL;
#endif
// Reflection
col.rgb += reflectionColor * UNITY_SAMPLE_TEX2DARRAY(_RoughnessMap, i.uv).a * _ReflectionIntensity[componentIndex];
// Global dimmer
col.rgb *= _Dimmer;
// Global alpha
col.a *= _Alpha;
#if !defined(UNITY_COLORSPACE_GAMMA)
col.rgb = GammaToLinearSpace(col.rgb);
#endif
// Return clamped final color
return saturate(col);
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 37d2b8298f61cd2469465fc36108675d
timeCreated: 1526311739
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,165 @@
//
// *** OvrAvatar Mobile Single Component Loading shader ***
//
// Cut-down single component version of the avatar shader to be used during loading.
// See main mobile shader for implementation notes.
Shader "OvrAvatar/Avatar_Mobile_Loader"
{
Properties
{
_NormalMap("Normal Map", 2D) = "bump" {}
_BaseColor("Color Tint", Color) = (1.0,1.0,1.0,1.0)
_Dimmer("Dimmer", Range(0.0,1.0)) = 1.0
_LoadingDimmer("Loading Dimmer", Range(0.0,1.0)) = 1.0
_Alpha("Alpha", Range(0.0,1.0)) = 1.0
_DiffuseIntensity("Diffuse Intensity", Range(0.0,1.0)) = 0.3
_RimIntensity("Rim Intensity", Range(0.0,10.0)) = 5.0
_BacklightIntensity("Backlight Intensity", Range(0.0,1.0)) = 1.0
_Voice("Voice", Range(0.0,1.0)) = 0.0
[HideInInspector] _MouthPosition("Mouth position", Vector) = (0,0,0,1)
[HideInInspector] _MouthDirection("Mouth direction", Vector) = (0,0,0,1)
[HideInInspector] _MouthEffectDistance("Mouth Effect Distance", Float) = 0.03
[HideInInspector] _MouthEffectScale("Mouth Effect Scaler", Float) = 1
}
SubShader
{
Pass
{
Tags
{
"LightMode" = "ForwardBase" "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True"
}
LOD 100
ZWrite On
ZTest LEqual
Cull Back
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.5
#pragma fragmentoption ARB_precision_hint_fastest
#pragma multi_compile NO_BACKLIGHT_OFF NO_BACKLIGHT_ON
#include "UnityCG.cginc"
#include "UnityLightingCommon.cginc"
uniform sampler2D _NormalMap;
uniform float4 _NormalMap_ST;
uniform float4 _BaseColor;
uniform float _Dimmer;
uniform float _LoadingDimmer;
uniform float _Alpha;
uniform float _RimIntensity;
uniform float _DiffuseIntensity;
uniform float _BacklightIntensity;
uniform float _Voice;
uniform float4 _MouthPosition;
uniform float4 _MouthDirection;
uniform float _MouthEffectDistance;
uniform float _MouthEffectScale;
static const fixed MOUTH_ZSCALE = 0.5f;
static const fixed MOUTH_DROPOFF = 0.01f;
struct appdata
{
float4 vertex: POSITION;
float3 normal: NORMAL;
float4 tangent: TANGENT;
float4 uv: TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 822f5e641dc5dd54ca9555b727b3277f
timeCreated: 1526311739
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,204 @@
// *** OvrAvatar Mobile Single Component shader ***
//
// This is a Unity vertex-fragnment shader implementation for our 1.5 skin shaded avatar look.
// The benefit of using this version is performance as it bypasses the PBR lighting model and
// so is generally recommended for use on mobile.
//
// Shader keywords:
// - SECONDARY_LIGHT_ON SECONDARY_LIGHT_OFF
// Enable SECONDARY_LIGHT_ON for a second "light" as expressed by _SecondaryLightDirection
// and _SecondaryLightColor to influence the standard rim effect. This is designed for use in video watching
// experiences to sample the screen color and apply this to the rim term.
// - NO_BACKLIGHT_ON NO_BACKLIGHT_OFF
// This effect is active by default: NO_BACKLIGHT_OFF is the default and enables the effect. Enable NO_BACKLIGHT_ON
// to disable illumination from the rear of the main light direction. This mobile shader supports one directional
// light. This can cause the un-illuminated side of the avatar to lose definition.
// Notes:
// - The primary light in your scene will be used to calculate lighting.
// - We don't have a mouth bone, but the vertex shader will animate the vertices around the mouth
// area according to the _Voice value. This should be set according to local microphone value
// range between 0-1.
Shader "OvrAvatar/Avatar_Mobile_SingleComponent"
{
Properties
{
_MainTex("Main Texture", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "bump" {}
_RoughnessMap("Roughness Map", 2D) = "black" {}
_BaseColor("Color Tint", Color) = (1.0,1.0,1.0,1.0)
_Dimmer("Dimmer", Range(0.0,1.0)) = 1.0
_Alpha("Alpha", Range(0.0,1.0)) = 1.0
_DiffuseIntensity("Diffuse Intensity", Range(0.0,1.0)) = 0.3
_RimIntensity("Rim Intensity", Range(0.0,10.0)) = 5.0
_BacklightIntensity("Backlight Intensity", Range(0.0,1.0)) = 1.0
_ReflectionIntensity("Reflection Intensity", Range(0.0,1.0)) = 0.0
_Voice("Voice", Range(0.0,1.0)) = 0.0
[HideInInspector] _MouthPosition("Mouth position", Vector) = (0,0,0,1)
[HideInInspector] _MouthDirection("Mouth direction", Vector) = (0,0,0,1)
[HideInInspector] _MouthEffectDistance("Mouth Effect Distance", Float) = 0.03
[HideInInspector] _MouthEffectScale("Mouth Effect Scaler", Float) = 1
}
SubShader
{
Pass
{
Tags
{
"LightMode" = "ForwardBase" "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True"
}
LOD 100
ZWrite On
ZTest LEqual
Cull Back
ColorMask RGB
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.5
#pragma fragmentoption ARB_precision_hint_fastest
#pragma multi_compile SECONDARY_LIGHT_OFF SECONDARY_LIGHT_ON
#pragma multi_compile NO_BACKLIGHT_OFF NO_BACKLIGHT_ON
#include "UnityCG.cginc"
#include "UnityLightingCommon.cginc"
uniform sampler2D _MainTex;
uniform sampler2D _NormalMap;
uniform float4 _NormalMap_ST;
uniform sampler2D _RoughnessMap;
uniform float4 _BaseColor;
uniform float _DiffuseIntensity;
uniform float _RimIntensity;
uniform float _BacklightIntensity;
uniform float _ReflectionIntensity;
uniform float3 _SecondaryLightDirection;
uniform float4 _SecondaryLightColor;
uniform float _Dimmer;
uniform float _Alpha;
uniform float _Voice;
uniform float4 _MouthPosition;
uniform float4 _MouthDirection;
uniform float _MouthEffectDistance;
uniform float _MouthEffectScale;
static const fixed MOUTH_ZSCALE = 0.5f;
static const fixed MOUTH_DROPOFF = 0.01f;
struct appdata
{
float4 vertex: POSITION;
float3 normal: NORMAL;
float4 tangent: TANGENT;
float4 uv: TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 posWorld: TEXCOORD1;
float3 normalDir: TEXCOORD2;
float3 tangentDir: TEXCOORD3;
float3 bitangentDir: TEXCOORD4;
};
v2f vert(appdata v)
{
v2f o;
// Mouth vertex animation with voip
float4 worldVert = mul(unity_ObjectToWorld, v.vertex);;
float3 delta = _MouthPosition - worldVert;
delta.z *= MOUTH_ZSCALE;
float dist = length(delta);
float scaledMouthDropoff = _MouthEffectScale * MOUTH_DROPOFF;
float scaledMouthEffect = _MouthEffectScale * _MouthEffectDistance;
float displacement = _Voice * smoothstep(scaledMouthEffect + scaledMouthDropoff, scaledMouthEffect, dist);
worldVert.xyz -= _MouthDirection * displacement;
v.vertex = mul(unity_WorldToObject, worldVert);
// Calculate tangents for normal mapping
o.normalDir = normalize(UnityObjectToWorldNormal(v.normal));
o.tangentDir = normalize(mul(unity_ObjectToWorld, half4(v.tangent.xyz, 0.0)).xyz);
o.bitangentDir = normalize(cross(o.normalDir, o.tangentDir) * v.tangent.w);
o.posWorld = worldVert;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag(v2f i) : COLOR
{
// Light directions
float3 lightDirection = _WorldSpaceLightPos0.xyz;
// Calculate normal
float3 normalMap = tex2D(_NormalMap, TRANSFORM_TEX(i.uv, _NormalMap)) * 2 - 1;
float3x3 tangentTransform = float3x3(i.tangentDir, i.bitangentDir, i.normalDir);
float3 normalDirection = normalize(mul(normalMap.rgb, tangentTransform));
float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
// Apply view, normal, and lighting dependent terms
float VdotN = saturate(dot(viewDirection, normalDirection));
float NdotL = saturate(dot(normalDirection, lightDirection));
float LightColorNdotL = NdotL * _LightColor0;
// Sample the default reflection cubemap using the reflection vector
float3 worldReflection = reflect(-viewDirection, normalDirection);
half4 skyData = UNITY_SAMPLE_TEXCUBE(unity_SpecCube0, worldReflection);
// Decode cubemap data into actual color
half3 reflectionColor = DecodeHDR(skyData, unity_SpecCube0_HDR);
// Calculate color
float4 col;
// Diffuse texture sample
col = tex2D(_MainTex, i.uv);
#if !defined(UNITY_COLORSPACE_GAMMA)
_BaseColor.rgb = LinearToGammaSpace(_BaseColor.rgb);
#endif
// Multiply in color tint
col.rgb *= _BaseColor;
// Main light
col.rgb += _DiffuseIntensity * LightColorNdotL;
#ifdef NO_BACKLIGHT_ON
//NO_BACKLIGHT_ON disables the rear illumination
#else
// Illuminate main light from behind of NO_BACKLIGHT_ON is disabled
float3 reverseLightDirection = lightDirection * -1;
float NdotInvL = saturate(dot(normalDirection, normalize(reverseLightDirection)));
col.rgb += (_DiffuseIntensity * _BacklightIntensity) * NdotInvL *_LightColor0;
#endif
// Rim term
#ifdef SECONDARY_LIGHT_ON
// Secondary light proxy (direction and color) passed into the rim term
NdotL = saturate(dot(normalDirection, _SecondaryLightDirection));
col.rgb += pow(1.0 - VdotN, _RimIntensity) * NdotL * _SecondaryLightColor;
#else
col.rgb += pow(1.0 - VdotN, _RimIntensity) * LightColorNdotL;
#endif
// Reflection
col.rgb += reflectionColor * tex2D(_RoughnessMap, i.uv).a * _ReflectionIntensity;
// Global dimmer
col.rgb *= _Dimmer;
// Global alpha
col.a *= _Alpha;
#if !defined(UNITY_COLORSPACE_GAMMA)
col.rgb = GammaToLinearSpace(col.rgb);
#endif
// Return clamped final color
return saturate(col);
}
ENDCG
}
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c26fc51e445dcfd4db09305d861dc11c
timeCreated: 1526311739
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,108 @@
//
// OvrAvatar PC single component shader
//
// This is a Unity Surface shader implementation for our 1.5 skin shaded avatar look.
// The benefit of using this version is that it uses the full Unity PBR lighting under the hood.
// The Mobile shader is strongly recommended for use on mobile platforms for performance.
//
// Notes:
// - Use Mobile shader if you need mouth vertex movement.
Shader "OvrAvatar/Avatar_PC_SingleComponent"
{
Properties
{
[NoScaleOffset] _MainTex("Color (RGB)", 2D) = "white" {}
[NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {}
[NoScaleOffset] _RoughnessMap("Roughness Map", 2D) = "black" {}
_BaseColor("Color Tint", Color) = (0.95,0.77,0.63)
_Dimmer("Dimmer", Range(0.0,1.0)) = 1.0
_Alpha("Alpha", Range(0.0,1.0)) = 1.0
_DiffuseIntensity("Diffuse Intensity", Range(0.0,1.0)) = 0.3
_RimIntensity("Rim Intensity", Range(0.0,10.0)) = 5.0
}
SubShader
{
Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" }
LOD 100
Blend SrcAlpha OneMinusSrcAlpha
// Render the back facing parts of the object then set on backface culling.
// This fixes broken faces with convex meshes when using the alpha path.
Pass
{
Color(0,0,0,0)
}
CGPROGRAM
#pragma surface surf Standard alpha:fade
#pragma target 3.0
#pragma fragmentoption ARB_precision_hint_fastest
// Set this shader keyword if you are using Linear color space
#pragma multi_compile COLORSPACE_LINEAR_OFF COLORSPACE_LINEAR_ON
// (Optional) Set this shader keyword if your scene only has one light
#pragma multi_compile SINGLE_LIGHT_OFF SINGLE_LIGHT_ON
#include "UnityCG.cginc"
sampler2D _MainTex;
sampler2D _NormalMap;
sampler2D _RoughnessMap;
float4 _BaseColor;
float _Dimmer;
float _Alpha;
float _DiffuseIntensity;
float _RimIntensity;
struct Input
{
float2 uv_MainTex;
float2 uv_NormalMap;
float2 uv_RoughnessMap;
float3 viewDir;
float3 worldNormal; INTERNAL_DATA
};
void surf(Input IN, inout SurfaceOutputStandard o)
{
// Unpack normal map
o.Normal = tex2D(_NormalMap, IN.uv_NormalMap) * 2 - 1;
// Diffuse texture sample
float4 col = tex2D(_MainTex, IN.uv_MainTex);
// Convert _BaseColor to gamma color space if we are in linear
// Albedo texture is already in correct color space
#if !defined(UNITY_COLORSPACE_GAMMA)
_BaseColor.rgb = LinearToGammaSpace(_BaseColor.rgb);
#endif
// Adjust color tint with NdotL
float NdotL = saturate(dot(WorldNormalVector(IN, o.Normal), _WorldSpaceLightPos0.xyz));
_BaseColor.rgb += _DiffuseIntensity * NdotL;
// Multiply in color tint
o.Albedo = col.rgb * _BaseColor;
// Rim term
float VdotN = saturate(dot(normalize(IN.viewDir), o.Normal));
o.Albedo += pow(1.0 - VdotN, _RimIntensity) * NdotL * _LightColor0;
// Sample roughness map and set smoothness and metallic
float4 roughnessSample = tex2D(_RoughnessMap, IN.uv_RoughnessMap);
o.Smoothness = roughnessSample.a;
o.Metallic = roughnessSample.r;
// Global dimmer
o.Albedo *= _Dimmer;
// Global alpha
o.Alpha = col.a * _Alpha;
// Convert back to linear color space if we are in linear
#if !defined(UNITY_COLORSPACE_GAMMA)
o.Albedo = GammaToLinearSpace(o.Albedo);
#endif
}
ENDCG
}
}

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 36b8b481cf607814a8cec318f0148d63
timeCreated: 1525971189
licenseType: Store
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b18c7ae976868a4499e2dbd7f60e92a4
folderAsset: yes
timeCreated: 1467313717
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2856d681f3672e641a2e57df9676108c
folderAsset: yes
timeCreated: 1468456735
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2a83dd010542d2744bf59af99b4bc47c
timeCreated: 1468457372
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6b1bc2f99b5a3a042aed559717762f28
folderAsset: yes
timeCreated: 1536104808
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cfdeeba4226b23c4691e78d2432e7d88
timeCreated: 1532560992
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,41 @@
This Cross Platform Unity scene demonstrates how to use Oculus Avatar SDK without the Oculus Platform SDK.
Setup instructions:
1 - Create a new Unity Project
2 - Import the Oculus Avatar SDK Unity package: https://developer.oculus.com/downloads/package/oculus-avatar-sdk/
3 - Open this CrossPlatform scene (in Assets/Oculus/Avatar/Samples/CrossPlatform)
4 - Import Oculus Utilities for Unity: https://developer.oculus.com/downloads/package/oculus-utilities-for-unity-5/
5 - Do *not* import the Oculus Platform SDK for Unity!
6 - Delete the imported SocialStarter folder from Assets/Oculus/Avatar/Samples (it demos Platform features, we don't need it for this)
7 - Use the Oculus Dashboard (https://dashboard.oculus.com/) to create a placeholder Rift app and copy the App ID
8 - Paste the App ID in Unity under Oculus Avatars > Edit Configuration > Oculus Rift App Id
9 - Enable OpenVR:
Open PlayerSettings in the Inspector tab (menu Edit > Project Settings > Player)
In PlayerSettings expand XR Settings
Under Virtual Reality SDKs, add OpenVR
10 - Click Play
Changing Avatar customization:
1 - Note the "LocalAvatar" GameObjects in the scene. Each Avatar has distinct customization.
2 - Inspect each LocalAvatar GameObject and observe the attached Ovr Avatar Script component and the "Oculus User ID" property set on each.
3 - Create your own test accounts to customize your Avatars.
4 - Use your own User IDs in this sample scene. (You will have to leave and reenter Play mode to apply Avatar User ID changes.)
Redistribution:
When packaging a Cross Platform application using Oculus Avatars, you will need to include:
* libovravatar.dll
* OvrAvatarAssets.zip
On a computer with the Oculus launcher, these files can be found in "C:\Program Files\Oculus\Support\oculus-runtime" by default.
You also need to include the Oculus Avatar SDK License, found here: https://developer.oculus.com/licenses/avatar-sdk-1.0/
In your Unity project's Assets folder, add these files to a Plugins directory.
NOTE: Unity's Build will only copy DLL files in a Plugins directory over to the output Plugins directory.
You must manually copy OvrAvatarAssets.zip to the output Plugins directory.
You can automate this process with a script adding a custom build command,
see the Unity docs here: https://docs.unity3d.com/Manual/BuildPlayerPipeline.html

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5569c00e32b73d845831ece15c9f1e36
timeCreated: 1532561014
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b8c4b9475079cf040953bf344ff4e44f
folderAsset: yes
timeCreated: 1477955918
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 697c6df5e1eddad40b634d311b0bb2e5
timeCreated: 1477966491
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 85678699140c6c3429a87f4d679b1a17
folderAsset: yes
timeCreated: 1477957292
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
using UnityEngine;
using System.Collections;
using System;
public class PoseEditHelper : MonoBehaviour {
public Transform poseRoot;
void OnDrawGizmos()
{
if (poseRoot != null)
{
DrawJoints(poseRoot);
}
}
private void DrawJoints(Transform joint)
{
Gizmos.DrawWireSphere(joint.position, 0.005f);
for (int i = 0; i < joint.childCount; ++i)
{
Transform child = joint.GetChild(i);
if (child.name.EndsWith("_grip") || child.name.EndsWith("hand_ignore"))
{
continue;
}
Gizmos.DrawLine(joint.position, child.position);
DrawJoints(child);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6bc5b4ba964e02b4ea773b2aaca7dc67
timeCreated: 1477957304
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2883b756c033a864ca988b3f522f3339
folderAsset: yes
timeCreated: 1467313725
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,501 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
SceneSettings:
m_ObjectHideFlags: 0
m_PVSData:
m_PVSObjectsArray: []
m_PVSPortalsArray: []
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18053587, g: 0.22601774, b: 0.30718702, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 4
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_DirectLightInLightProbes: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_LightingDataAsset: {fileID: 0}
m_RuntimeCPUUsage: 25
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
accuratePlacement: 0
minRegionArea: 2
cellSize: 0.16666667
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!4 &369561663 stripped
Transform:
m_PrefabParentObject: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_PrefabInternal: {fileID: 395836775}
--- !u!1001 &395836775
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1310461517}
m_Modifications:
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.w
value: -0.00000016292068
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 158226, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_Name
value: LittleAvatar
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: -180
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.y
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 11437430, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: ShowThirdPerson
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11437430, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: ShowFirstPerson
value: 0
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 8254050, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_IsPrefabParent: 0
--- !u!1 &957641525
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 957641529}
- 33: {fileID: 957641528}
- 65: {fileID: 957641527}
- 23: {fileID: 957641526}
m_Layer: 0
m_Name: MediumPedestal
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!23 &957641526
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!65 &957641527
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &957641528
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &957641529
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -2, z: 0}
m_LocalScale: {x: 2, y: 4, z: 2}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
--- !u!1001 &1239677853
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalPosition.z
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: _trackingOriginType
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1310461516
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1310461517}
- 33: {fileID: 1310461520}
- 65: {fileID: 1310461519}
- 23: {fileID: 1310461518}
m_Layer: 0
m_Name: LittlePedestal
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1310461517
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.5, z: 0.5}
m_LocalScale: {x: 0.5, y: 1, z: 0.5}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 369561663}
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!23 &1310461518
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!65 &1310461519
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1310461520
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1658970730
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1658970732}
- 108: {fileID: 1658970731}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1658970731
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1658970730}
m_Enabled: 1
serializedVersion: 7
m_Type: 1
m_Color: {r: 0.5955882, g: 0.5955882, b: 0.5955882, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1658970732
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1658970730}
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1001 &2053404217
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.z
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_IsPrefabParent: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c65ef87480e70eb43931036c9c66d08d
timeCreated: 1466730185
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f26892c9951b6f54c82a5f1bf34e8d8a
folderAsset: yes
timeCreated: 1468000039
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aa35ff5ba76fb384d839383c84209da9
timeCreated: 1468000130
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: edf34aa3892fd9f4eb0795663f7e3ffc
folderAsset: yes
timeCreated: 1468000607
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,155 @@
using UnityEngine;
using System.Collections;
using System;
using System.IO;
using Oculus.Avatar;
using System.Runtime.InteropServices;
using System.Collections.Generic;
public class RemoteLoopbackManager : MonoBehaviour
{
class PacketLatencyPair
{
public byte[] PacketData;
public float FakeLatency;
};
public OvrAvatar LocalAvatar;
public OvrAvatar LoopbackAvatar;
[System.Serializable]
public class SimulatedLatencySettings
{
[Range(0.0f, 0.5f)]
public float FakeLatencyMax = 0.25f; //250 ms max latency
[Range(0.0f, 0.5f)]
public float FakeLatencyMin = 0.002f; //2ms min latency
[Range(0.0f, 1.0f)]
public float LatencyWeight = 0.25f; // How much the latest sample impacts the current latency
[Range(0,10)]
public int MaxSamples = 4; //How many samples in our window
internal float AverageWindow = 0f;
internal float LatencySum = 0f;
internal LinkedList<float> LatencyValues = new LinkedList<float>();
public float NextValue()
{
AverageWindow = LatencySum / (float)LatencyValues.Count;
float RandomLatency = UnityEngine.Random.Range(FakeLatencyMin, FakeLatencyMax);
float FakeLatency = AverageWindow * (1f - LatencyWeight) + LatencyWeight * RandomLatency;
if (LatencyValues.Count >= MaxSamples)
{
LatencySum -= LatencyValues.First.Value;
LatencyValues.RemoveFirst();
}
LatencySum += FakeLatency;
LatencyValues.AddLast(FakeLatency);
return FakeLatency;
}
};
public SimulatedLatencySettings LatencySettings = new SimulatedLatencySettings();
private int PacketSequence = 0;
LinkedList<PacketLatencyPair> packetQueue = new LinkedList<PacketLatencyPair>();
void Start()
{
LocalAvatar.RecordPackets = true;
LocalAvatar.PacketRecorded += OnLocalAvatarPacketRecorded;
float FirstValue = UnityEngine.Random.Range(LatencySettings.FakeLatencyMin, LatencySettings.FakeLatencyMax);
LatencySettings.LatencyValues.AddFirst(FirstValue);
LatencySettings.LatencySum += FirstValue;
}
void OnLocalAvatarPacketRecorded(object sender, OvrAvatar.PacketEventArgs args)
{
using (MemoryStream outputStream = new MemoryStream())
{
BinaryWriter writer = new BinaryWriter(outputStream);
if (LocalAvatar.UseSDKPackets)
{
var size = CAPI.ovrAvatarPacket_GetSize(args.Packet.ovrNativePacket);
byte[] data = new byte[size];
CAPI.ovrAvatarPacket_Write(args.Packet.ovrNativePacket, size, data);
writer.Write(PacketSequence++);
writer.Write(size);
writer.Write(data);
}
else
{
writer.Write(PacketSequence++);
args.Packet.Write(outputStream);
}
SendPacketData(outputStream.ToArray());
}
}
void Update()
{
if (packetQueue.Count > 0)
{
List<PacketLatencyPair> deadList = new List<PacketLatencyPair>();
foreach (var packet in packetQueue)
{
packet.FakeLatency -= Time.deltaTime;
if (packet.FakeLatency < 0f)
{
ReceivePacketData(packet.PacketData);
deadList.Add(packet);
}
}
foreach (var packet in deadList)
{
packetQueue.Remove(packet);
}
}
}
void SendPacketData(byte[] data)
{
PacketLatencyPair PacketPair = new PacketLatencyPair();
PacketPair.PacketData = data;
PacketPair.FakeLatency = LatencySettings.NextValue();
packetQueue.AddLast(PacketPair);
}
void ReceivePacketData(byte[] data)
{
using (MemoryStream inputStream = new MemoryStream(data))
{
BinaryReader reader = new BinaryReader(inputStream);
int sequence = reader.ReadInt32();
OvrAvatarPacket avatarPacket;
if (LoopbackAvatar.UseSDKPackets)
{
int size = reader.ReadInt32();
byte[] sdkData = reader.ReadBytes(size);
IntPtr packet = CAPI.ovrAvatarPacket_Read((UInt32)data.Length, sdkData);
avatarPacket = new OvrAvatarPacket { ovrNativePacket = packet };
}
else
{
avatarPacket = OvrAvatarPacket.Read(inputStream);
}
LoopbackAvatar.GetComponent<OvrAvatarRemoteDriver>().QueuePacket(sequence, avatarPacket);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1675d6690178fd0459887aed66409f70
timeCreated: 1468000639
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0a4d3ea1f23c09f4594a99508091bd1a
folderAsset: yes
timeCreated: 1520618017
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2946f922e51b0d347bf529b7a7e2667e
folderAsset: yes
timeCreated: 1520618026
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,771 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 0
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &8653650
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 8653655}
- component: {fileID: 8653654}
- component: {fileID: 8653653}
- component: {fileID: 8653652}
- component: {fileID: 8653651}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &8653651
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 0
--- !u!124 &8653652
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 1
--- !u!92 &8653653
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 1
--- !u!20 &8653654
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &8653655
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &206856059
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 206856064}
- component: {fileID: 206856063}
- component: {fileID: 206856062}
- component: {fileID: 206856061}
- component: {fileID: 206856060}
m_Layer: 0
m_Name: RoomCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &206856060
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
--- !u!92 &206856061
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
--- !u!124 &206856062
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
--- !u!20 &206856063
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &206856064
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: -9.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &780482174
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 780482176}
- component: {fileID: 780482175}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &780482175
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 780482174}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &780482176
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 780482174}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &840719025
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 840719029}
- component: {fileID: 840719028}
- component: {fileID: 840719027}
- component: {fileID: 840719026}
m_Layer: 0
m_Name: HelpPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &840719026
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 4c18da23435024b43a2b78449cbb6ed0, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!64 &840719027
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &840719028
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &840719029
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1390249324
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 100014, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_TagString
value: MainCamera
objectReference: {fileID: 0}
- target: {fileID: 100010, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_TagString
value: MainCamera
objectReference: {fileID: 0}
- target: {fileID: 11400002, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: _trackingOriginType
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1390249325 stripped
GameObject:
m_PrefabParentObject: {fileID: 100014, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_PrefabInternal: {fileID: 1390249324}
--- !u!1 &1390249326 stripped
GameObject:
m_PrefabParentObject: {fileID: 100010, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_PrefabInternal: {fileID: 1390249324}
--- !u!20 &1390249327
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1390249325}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 2
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!20 &1390249328
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1390249326}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 1
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1 &1390249329 stripped
GameObject:
m_PrefabParentObject: {fileID: 100008, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_PrefabInternal: {fileID: 1390249324}
--- !u!114 &1390249330
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1390249329}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 043fbfd0ae7027742bace7a3691feb13, type: 3}
m_Name:
m_EditorClassIdentifier:
localAvatarPrefab: {fileID: 11437430, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
remoteAvatarPrefab: {fileID: 11464902, guid: 90bf33f968e6bb44ea0208fc82c90a44, type: 2}
helpPanel: {fileID: 840719025}
riftMaterial: {fileID: 2100000, guid: 3480b18dc3be4c2498fb60a71184a4d1, type: 2}
gearMaterial: {fileID: 2100000, guid: ce189bc65dde82740a5f34ef75bf87aa, type: 2}
roomSphere: {fileID: 1902705651}
roomFloor: {fileID: 2115777246}
spyCamera: {fileID: 206856063}
--- !u!1 &1902705651
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1902705655}
- component: {fileID: 1902705654}
- component: {fileID: 1902705653}
- component: {fileID: 1902705652}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &1902705652
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 296de5be1228bf34380061dd6e6b0f49, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &1902705653
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1902705654
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1902705655
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3, y: 6, z: 3}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2115777246
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2115777250}
- component: {fileID: 2115777249}
- component: {fileID: 2115777248}
- component: {fileID: 2115777247}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &2115777247
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c466b89bb972b8a42bd266c102f8f2cb, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!64 &2115777248
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &2115777249
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &2115777250
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 7, y: 1, z: 7}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 236a5f96528802e47a70d6e47ebd3c16
timeCreated: 1496779803
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 777b874d432a52044991fe1a0210200c
folderAsset: yes
timeCreated: 1496779985
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GearHelp
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 0453138effcc80349b11371805f72f5b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 09c03a3c5049d234590b91bbc6e84462
timeCreated: 1497549036
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Help
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: c8f5462cc092d0c40ad71773132863e0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4c18da23435024b43a2b78449cbb6ed0
timeCreated: 1496780065
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Offline_Mat
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 296de5be1228bf34380061dd6e6b0f49
timeCreated: 1496780100
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Plane_Mat
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 0, g: 0.25517225, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c466b89bb972b8a42bd266c102f8f2cb
timeCreated: 1496780131
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f05e47c366870a44ab2b3b5a8a64e107
folderAsset: yes
timeCreated: 1496780004
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,231 @@
using UnityEngine;
using System;
using Oculus.Platform;
using Oculus.Platform.Models;
// Helper class to manage a Peer-to-Peer connection to the other user.
// The connection is used to send and received the Transforms for the
// Avatars. The Transforms are sent via unreliable UDP at a fixed
// frequency.
public class P2PManager
{
// packet header is a message type byte
private enum MessageType : byte
{
Update = 1,
};
public P2PManager()
{
Net.SetPeerConnectRequestCallback(PeerConnectRequestCallback);
Net.SetConnectionStateChangedCallback(ConnectionStateChangedCallback);
}
#region Connection Management
public void ConnectTo(ulong userID)
{
// ID comparison is used to decide who calls Connect and who calls Accept
if (SocialPlatformManager.MyID < userID)
{
Net.Connect(userID);
SocialPlatformManager.LogOutput("P2P connect to " + userID);
}
}
public void Disconnect(ulong userID)
{
if (userID != 0)
{
Net.Close(userID);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(userID);
if (remote != null)
{
remote.p2pConnectionState = PeerConnectionState.Unknown;
}
}
}
void PeerConnectRequestCallback(Message<NetworkingPeer> msg)
{
SocialPlatformManager.LogOutput("P2P request from " + msg.Data.ID);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(msg.Data.ID);
if (remote != null)
{
SocialPlatformManager.LogOutput("P2P request accepted from " + msg.Data.ID);
Net.Accept(msg.Data.ID);
}
}
void ConnectionStateChangedCallback(Message<NetworkingPeer> msg)
{
SocialPlatformManager.LogOutput("P2P state to " + msg.Data.ID + " changed to " + msg.Data.State);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(msg.Data.ID);
if (remote != null)
{
remote.p2pConnectionState = msg.Data.State;
if (msg.Data.State == PeerConnectionState.Timeout &&
// ID comparison is used to decide who calls Connect and who calls Accept
SocialPlatformManager.MyID < msg.Data.ID)
{
// keep trying until hangup!
Net.Connect(msg.Data.ID);
SocialPlatformManager.LogOutput("P2P re-connect to " + msg.Data.ID);
}
}
}
#endregion
#region Message Sending
public void SendAvatarUpdate(ulong userID, Transform bodyTransform, UInt32 sequence, byte[] avatarPacket)
{
const int UPDATE_DATA_LENGTH = 41;
byte[] sendBuffer = new byte[avatarPacket.Length + UPDATE_DATA_LENGTH];
int offset = 0;
PackByte((byte)MessageType.Update, sendBuffer, ref offset);
PackULong(SocialPlatformManager.MyID, sendBuffer, ref offset);
PackFloat(bodyTransform.localPosition.x, sendBuffer, ref offset);
PackFloat(bodyTransform.localPosition.y, sendBuffer, ref offset);
PackFloat(bodyTransform.localPosition.z, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.x, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.y, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.z, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.w, sendBuffer, ref offset);
PackUInt32(sequence, sendBuffer, ref offset);
Debug.Assert(offset == UPDATE_DATA_LENGTH);
Buffer.BlockCopy(avatarPacket, 0, sendBuffer, offset, avatarPacket.Length);
Net.SendPacket(userID, sendBuffer, SendPolicy.Unreliable);
}
#endregion
#region Message Receiving
public void GetRemotePackets()
{
Packet packet;
while ((packet = Net.ReadPacket()) != null)
{
byte[] receiveBuffer = new byte[packet.Size];
packet.ReadBytes(receiveBuffer);
int offset = 0;
MessageType messageType = (MessageType)ReadByte(receiveBuffer, ref offset);
ulong remoteUserID = ReadULong(receiveBuffer, ref offset);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(remoteUserID);
if (remote == null)
{
SocialPlatformManager.LogOutput("Unknown remote player: " + remoteUserID);
continue;
}
if (messageType == MessageType.Update)
{
processAvatarPacket(remote, ref receiveBuffer, ref offset);
}
else
{
SocialPlatformManager.LogOutput("Invalid packet type: " + packet.Size);
continue;
}
}
}
public void processAvatarPacket(RemotePlayer remote, ref byte[] packet, ref int offset)
{
if (remote == null)
return;
remote.receivedBodyPositionPrior = remote.receivedBodyPosition;
remote.receivedBodyPosition.x = ReadFloat(packet, ref offset);
remote.receivedBodyPosition.y = ReadFloat(packet, ref offset);
remote.receivedBodyPosition.z = ReadFloat(packet, ref offset);
remote.receivedBodyRotationPrior = remote.receivedBodyRotation;
remote.receivedBodyRotation.x = ReadFloat(packet, ref offset);
remote.receivedBodyRotation.y = ReadFloat(packet, ref offset);
remote.receivedBodyRotation.z = ReadFloat(packet, ref offset);
remote.receivedBodyRotation.w = ReadFloat(packet, ref offset);
remote.RemoteAvatar.transform.localPosition = remote.receivedBodyPosition;
remote.RemoteAvatar.transform.localRotation = remote.receivedBodyRotation;
// forward the remaining data to the avatar system
int sequence = (int)ReadUInt32(packet, ref offset);
byte[] remainingAvatarBuffer = new byte[packet.Length - offset];
Buffer.BlockCopy(packet, offset, remainingAvatarBuffer, 0, remainingAvatarBuffer.Length);
IntPtr avatarPacket = Oculus.Avatar.CAPI.ovrAvatarPacket_Read((UInt32)remainingAvatarBuffer.Length, remainingAvatarBuffer);
var ovravatarPacket = new OvrAvatarPacket { ovrNativePacket = avatarPacket };
remote.RemoteAvatar.GetComponent<OvrAvatarRemoteDriver>().QueuePacket(sequence, ovravatarPacket);
}
#endregion
#region Serialization
void PackByte(byte b, byte[] buf, ref int offset)
{
buf[offset] = b;
offset += sizeof(byte);
}
byte ReadByte(byte[] buf, ref int offset)
{
byte val = buf[offset];
offset += sizeof(byte);
return val;
}
void PackFloat(float f, byte[] buf, ref int offset)
{
Buffer.BlockCopy(BitConverter.GetBytes(f), 0, buf, offset, sizeof(float));
offset += sizeof(float);
}
float ReadFloat(byte[] buf, ref int offset)
{
float val = BitConverter.ToSingle(buf, offset);
offset += sizeof(float);
return val;
}
void PackULong(ulong u, byte[] buf, ref int offset)
{
Buffer.BlockCopy(BitConverter.GetBytes(u), 0, buf, offset, sizeof(ulong));
offset += sizeof(ulong);
}
ulong ReadULong(byte[] buf, ref int offset)
{
ulong val = BitConverter.ToUInt64(buf, offset);
offset += sizeof(ulong);
return val;
}
void PackUInt32(UInt32 u, byte[] buf, ref int offset)
{
Buffer.BlockCopy(BitConverter.GetBytes(u), 0, buf, offset, sizeof(UInt32));
offset += sizeof(UInt32);
}
UInt32 ReadUInt32(byte[] buf, ref int offset)
{
UInt32 val = BitConverter.ToUInt32(buf, offset);
offset += sizeof(UInt32);
return val;
}
#endregion
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: e5d77a60e86b5bd4a999ef6c83f9e651
timeCreated: 1521151723
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,101 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Oculus.Platform;
using Oculus.Platform.Models;
public class PlayerController : SocialPlatformManager
{
// Secondary camera to debug and view the whole scene from above
public Camera spyCamera;
// The OVRCameraRig for the main player so we can disable it
private GameObject cameraRig;
private bool showUI = true;
public override void Awake()
{
base.Awake();
cameraRig = localPlayerHead.gameObject;
}
// Use this for initialization
public override void Start()
{
base.Start();
spyCamera.enabled = false;
}
// Update is called once per frame
public override void Update()
{
base.Update();
checkInput();
}
// Check for input from the touch controllers
void checkInput()
{
if (UnityEngine.Application.platform == RuntimePlatform.Android)
{
// GearVR Controller
// Bring up friend invite list
if (OVRInput.GetDown(OVRInput.Button.Back))
{
Rooms.LaunchInvitableUserFlow(roomManager.roomID);
}
// Toggle Camera
if (OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad))
{
ToggleCamera();
}
// Toggle Help UI
if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger))
{
ToggleUI();
}
}
else
{
// PC Touch
// Bring up friend invite list
if (OVRInput.GetDown(OVRInput.Button.Three))
{
Rooms.LaunchInvitableUserFlow (roomManager.roomID);
}
// Toggle Camera
if (OVRInput.GetDown(OVRInput.Button.Four))
{
ToggleCamera();
}
// Toggle Help UI
if (OVRInput.GetDown(OVRInput.Button.PrimaryThumbstick))
{
ToggleUI();
}
}
}
void ToggleCamera()
{
spyCamera.enabled = !spyCamera.enabled;
localAvatar.ShowThirdPerson = !localAvatar.ShowThirdPerson;
cameraRig.SetActive(!cameraRig.activeSelf);
}
void ToggleUI()
{
showUI = !showUI;
helpPanel.SetActive(showUI);
localAvatar.ShowLeftController(showUI);
}
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 043fbfd0ae7027742bace7a3691feb13
timeCreated: 1521151723
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More