Added Unity project files
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc0291dab65abd3469d9bde663254303
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,96 @@
|
||||
struct appdata
|
||||
{
|
||||
float4 vertex : POSITION;
|
||||
half3 normal : NORMAL;
|
||||
half4 tangent : TANGENT;
|
||||
float2 uv : TEXCOORD0;
|
||||
float2 uv1 : TEXCOORD1;
|
||||
half3 color : COLOR;
|
||||
|
||||
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||
VRCHAT_ATLAS_VERTEX_INPUT
|
||||
};
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 uv : TEXCOORD0;
|
||||
float3 worldPos : TEXCOORD1;
|
||||
half3 normal : TEXCOORD2;
|
||||
half4 tangent : TEXCOORD3;
|
||||
half3 viewDir : TEXCOORD4;
|
||||
half3 color : COLOR;
|
||||
|
||||
#if !defined(UNITY_PASS_SHADOWCASTER)
|
||||
UNITY_LIGHTING_COORDS(5, 6)
|
||||
UNITY_FOG_COORDS(7)
|
||||
#endif
|
||||
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
VRCHAT_ATLAS_VERTEX_OUTPUT
|
||||
};
|
||||
|
||||
struct LightVectors
|
||||
{
|
||||
bool lightEnv;
|
||||
half3 lightDir;
|
||||
half3 lightCol;
|
||||
half3 viewDir;
|
||||
half3 stereoViewDir;
|
||||
half3 fixedVector;
|
||||
half3 reflViewDir;
|
||||
half3 reflLightDir;
|
||||
};
|
||||
|
||||
struct Surface
|
||||
{
|
||||
half4 albedoMap;
|
||||
half3 emissionMap;
|
||||
half occlusionMap;
|
||||
half matcapMask;
|
||||
uint matcapType;
|
||||
half matcapStrength;
|
||||
|
||||
uint detailMode;
|
||||
half detailMaskMap;
|
||||
half4 detailAlbedoMap;
|
||||
|
||||
half3 normalMap;
|
||||
#if defined(USE_NORMAL_MAPS) && defined(USE_DETAIL_MAPS)
|
||||
half3 detailNormalMap;
|
||||
#endif
|
||||
|
||||
half alpha;
|
||||
half shadowBoost;
|
||||
half shadowAlbedo;
|
||||
half minBrightness;
|
||||
bool limitBrightness;
|
||||
|
||||
float roughness;
|
||||
half metallic;
|
||||
|
||||
half specularSharpness;
|
||||
half reflectance;
|
||||
half3 rimColor;
|
||||
half rimAlbedoTint;
|
||||
half rimIntensity;
|
||||
half rimRange;
|
||||
half rimSharpness;
|
||||
bool rimEnvironmental;
|
||||
//half cutoff;
|
||||
};
|
||||
|
||||
struct DotProducts {
|
||||
half ndl; // Surface Normal . Light Direction -1 to 1 "raw"
|
||||
half ndl01; // Surface Normal . Light Direction 0 to 1 remapped "lambert wrapped"
|
||||
half clampedNdl; // Surface Normal . Light Direction 0 to 1 clamped "lambert"
|
||||
half vdn; // View Direction . Light Direction
|
||||
half svdn; // Stereo View Direction . Light Direction, used for things that need to be "stereo convergent" for VR
|
||||
half vdh; // View Direction . halfway Direction
|
||||
half ndh; // Surface Normal . halfway Direction
|
||||
};
|
||||
|
||||
struct VertexLightInformation {
|
||||
half3 Direction[4];
|
||||
half3 ColorFalloff[4];
|
||||
};
|
||||
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0870a6b2d2db6db4d988d61ccf544270
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,170 @@
|
||||
// Samplers
|
||||
sampler2D _MainTex,
|
||||
#if defined(USE_EMISSION_MAP)
|
||||
_EmissionMap,
|
||||
#endif
|
||||
#if defined(USE_OCCLUSION_MAP)
|
||||
_OcclusionMap,
|
||||
#endif
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
_BumpMap,
|
||||
#endif
|
||||
#if defined(USE_SPECULAR)
|
||||
_MetallicMap,
|
||||
_GlossMap,
|
||||
#endif
|
||||
#if defined(USE_DETAIL_MAPS)
|
||||
_DetailAlbedoMap,
|
||||
_DetailMask,
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
_DetailNormalMap,
|
||||
#endif
|
||||
#endif
|
||||
#if defined(USE_MATCAP)
|
||||
_Matcap,
|
||||
_MatcapMask,
|
||||
#endif
|
||||
_HueShiftMask,
|
||||
_Ramp,
|
||||
_ColorMask;
|
||||
|
||||
// Properties
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _MainTex_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _Ramp_ST);
|
||||
|
||||
#if defined(USE_EMISSION_MAP)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _EmissionMap_ST);
|
||||
#endif
|
||||
|
||||
#if defined(USE_OCCLUSION_MAP)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _OcclusionMap_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _OcclusionMapChannel);
|
||||
#endif
|
||||
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _BumpMap_ST);
|
||||
#endif
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _MetallicMap_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _MetallicMapChannel);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _GlossMap_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _GlossMapChannel);
|
||||
#endif
|
||||
|
||||
#if defined(USE_DETAIL_MAPS)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _DetailMask_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _DetailMaskChannel);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _DetailAlbedoMap_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _DetailMode);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _DetailUV);
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _DetailNormalMap_ST);
|
||||
#endif
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _DetailHueShift);
|
||||
#endif
|
||||
|
||||
#if defined(USE_MATCAP)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _MatcapMask_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _MatcapMaskChannel);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _MatcapType);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _MatcapStrength);
|
||||
#endif
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _ColorMask_ST);
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _HueShiftMask_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _HueShiftMaskChannel);
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _Color);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _BumpScale);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _VertexColor);
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _ShadowBoost);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _ShadowAlbedo);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _MinBrightness);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _LimitBrightness);
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _HueShift);
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half3, _RimColor);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _RimAlbedoTint);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _RimIntensity);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _RimRange);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _RimSharpness);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _RimEnvironmental);
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _ColorMaskColor1);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _ColorMaskEmissionStrength1);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _ColorMaskColor2);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _ColorMaskEmissionStrength2);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _ColorMaskColor3);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _ColorMaskEmissionStrength3);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _ColorMaskColor4);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _ColorMaskEmissionStrength4);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _ColorMaskBlendMode);
|
||||
|
||||
#define COLORMASK_BLEND_MULTIPLY 0
|
||||
#define COLORMASK_BLEND_ADDITIVE 1
|
||||
|
||||
//VRCHAT_DEFINE_ATLAS_PROPERTY(half, _Cutoff);
|
||||
//VRCHAT_DEFINE_ATLAS_PROPERTY(half, _AlphaToMask);
|
||||
|
||||
#if defined(USE_EMISSION_MAP)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _EmissionColor);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _EmissionStrength);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _EmissionUV);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _EmissionHueShift);
|
||||
#endif
|
||||
|
||||
#if defined(USE_OCCLUSION_MAP)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _OcclusionStrength);
|
||||
#endif
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _MetallicStrength);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _GlossStrength);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _SpecularSharpness);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _Reflectance);
|
||||
#endif
|
||||
|
||||
#if defined(USE_DETAIL_MAPS)
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _DetailNormalMapScale);
|
||||
#endif
|
||||
|
||||
// Atlas Texture Modes
|
||||
#if defined(VRCHAT_ATLASING_ENABLED)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_MainTex);
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_Ramp);
|
||||
|
||||
#if defined(USE_EMISSION_MAP)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_EmissionMap);
|
||||
#endif
|
||||
|
||||
#if defined(USE_OCCLUSION_MAP)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_OcclusionMap);
|
||||
#endif
|
||||
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_BumpMap);
|
||||
#endif
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_MetallicMap);
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_GlossMap);
|
||||
#endif
|
||||
|
||||
#if defined(USE_DETAIL_MAPS)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_DetailAlbedoMap);
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_DetailMask);
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_DetailNormalMap);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(USE_MATCAP)
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_MatcapMask);
|
||||
#endif
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_HueShiftMask);
|
||||
#endif
|
||||
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbbab985bea92fc48b01b6760c828d8b
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,581 @@
|
||||
float2 SelectUV(float4 fullUV, uint idx)
|
||||
{
|
||||
return idx == 0 ? fullUV.xy : fullUV.zw;
|
||||
}
|
||||
|
||||
half3 MaybeSaturate(half3 value, bool apply)
|
||||
{
|
||||
return apply ? saturate(value) : value;
|
||||
}
|
||||
|
||||
#define SAMPLE_MASK(texName, uv) \
|
||||
(tex2D(texName, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(uv, texName))[VRCHAT_GET_ATLAS_PROPERTY(texName##Channel)])
|
||||
|
||||
#define SAMPLE_MASK_GRAD(texName, uv, ddx, ddy) \
|
||||
(tex2Dgrad(texName, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(uv, texName), ddx, ddy)[VRCHAT_GET_ATLAS_PROPERTY(texName##Channel)])
|
||||
|
||||
half3 F_Schlick(half3 f0, half vdh, half vdn)
|
||||
{
|
||||
return f0 + (1.0 - f0) * pow((1.0 - vdh) * (1-vdn), 5.0);
|
||||
}
|
||||
|
||||
half V_SmithGGXCorrelated(half NoV, half NoL, half roughness)
|
||||
{
|
||||
half v = 0.5 / lerp(2 * NoL * NoV, NoL + NoV, roughness);
|
||||
return saturate(v);
|
||||
}
|
||||
|
||||
#if defined(SHADER_API_MOBILE)
|
||||
#define FLOAT_MIN (1e-4 * 0.2f)
|
||||
#else
|
||||
#define FLOAT_MIN 1e-6
|
||||
#endif
|
||||
|
||||
// adapted from UnityStandardBRDF.cginc, but with a better epsilon to prevent precision issues on mobile
|
||||
float VRC_GGXTerm(float NdotH, float roughness)
|
||||
{
|
||||
float a2 = roughness * roughness;
|
||||
float d = (NdotH * a2 - NdotH) * NdotH + 1.0f;
|
||||
return UNITY_INV_PI * a2 / (d * d + FLOAT_MIN);
|
||||
}
|
||||
|
||||
void GetSurfaceNormals(Surface surface, inout half3 bitangent, inout half3 tangent, inout half3 normal)
|
||||
{
|
||||
#if defined(USE_DETAIL_MAPS) && defined(USE_NORMAL_MAPS)
|
||||
half3 blendedNormal = BlendNormals(surface.normalMap, surface.detailNormalMap);
|
||||
#else
|
||||
half3 blendedNormal = surface.normalMap;
|
||||
#endif
|
||||
half3 calcedNormal = normalize(blendedNormal.x * tangent + blendedNormal.y * bitangent + blendedNormal.z * normal);
|
||||
|
||||
half3 bumpedTangent = cross(bitangent, calcedNormal);
|
||||
half3 bumpedBitangent = cross(calcedNormal, bumpedTangent);
|
||||
|
||||
normal = calcedNormal;
|
||||
tangent = bumpedTangent;
|
||||
bitangent = bumpedBitangent;
|
||||
}
|
||||
|
||||
// From Valve's whitepaper on VR Rendering
|
||||
// https://media.steampowered.com/apps/valve/2015/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf
|
||||
float GetGeometricSpecularAA(half3 normal)
|
||||
{
|
||||
half3 vNormalWsDdx = ddx(normal.xyz);
|
||||
half3 vNormalWsDdy = ddy(normal.xyz);
|
||||
float flGeometricRoughnessFactor = pow(saturate(max(dot(vNormalWsDdx.xyz,vNormalWsDdx.xyz), dot(vNormalWsDdy.xyz,vNormalWsDdy.xyz))), 0.333);
|
||||
return max(0, flGeometricRoughnessFactor);
|
||||
}
|
||||
|
||||
// stolen^Wadapted from VRChat-Mobile-StandardLite
|
||||
half shEvaluateDiffuseL1Geomerics(half L0, half3 L1, half3 n)
|
||||
{
|
||||
// avg direction of incoming light and directional brightness
|
||||
half3 R1 = 0.5f * L1;
|
||||
half lenR1 = length(R1);
|
||||
|
||||
// linear angle between normal and direction 0-1, saturate fix from filamented
|
||||
half q = dot(Unity_SafeNormalize(R1), n) * 0.5 + 0.5;
|
||||
q = isnan(q) ? 1 : q;
|
||||
q = saturate(q);
|
||||
|
||||
return (L0 <= 0.f) ? 0.f : ( 4. * lenR1 * pow(q, (2 * lenR1) / L0 + 1) + ( L0 * (L0 - lenR1) )/(L0 + lenR1));
|
||||
}
|
||||
|
||||
half3 shEvalFull(half3 normal)
|
||||
{
|
||||
return half3(
|
||||
shEvaluateDiffuseL1Geomerics(unity_SHAr.w, unity_SHAr.xyz, normal),
|
||||
shEvaluateDiffuseL1Geomerics(unity_SHAg.w, unity_SHAg.xyz, normal),
|
||||
shEvaluateDiffuseL1Geomerics(unity_SHAb.w, unity_SHAb.xyz, normal)
|
||||
);
|
||||
}
|
||||
|
||||
// Get the most intense light Dir from probes OR from a light source
|
||||
half3 GetLightDir(const bool lightEnv, float3 worldPos)
|
||||
{
|
||||
// switch between using probes or actual light direction
|
||||
float3 lightDir = lightEnv ? UnityWorldSpaceLightDir(worldPos) : unity_SHAr.xyz + unity_SHAg.xyz + unity_SHAb.xyz;
|
||||
// if the average length of the light probes is null, and we don't have a directional light in the scene, fall back to our fallback lightDir
|
||||
#if !defined(POINT) && !defined(SPOT) && !defined(VERTEXLIGHT_ON)
|
||||
if(length(unity_SHAr.xyz*unity_SHAr.w + unity_SHAg.xyz*unity_SHAg.w + unity_SHAb.xyz*unity_SHAb.w) == 0 && length(lightDir) < 0.1)
|
||||
{
|
||||
return half3(0.577, 0.577, 0.577);
|
||||
}
|
||||
#endif
|
||||
|
||||
return Unity_SafeNormalize(lightDir);
|
||||
}
|
||||
|
||||
half3 GetLightCol(const bool lightEnv, half3 lightColor, half3 lightDir)
|
||||
{
|
||||
UNITY_BRANCH
|
||||
if (lightEnv)
|
||||
{
|
||||
return lightColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
// no realtime light, use ambient or probe
|
||||
// calculates brightest SH, vs average in GetIndirectDiffuse ("light" vs "shadow" from probes)
|
||||
half4 lightDir4 = float4(lightDir, 1.0);
|
||||
return shEvalFull(lightDir) + max(SHEvalLinearL2(lightDir4), 0);
|
||||
}
|
||||
}
|
||||
|
||||
// VRC mirror support
|
||||
float _VRChatMirrorMode;
|
||||
float3 _VRChatMirrorCameraPos;
|
||||
half3 GetStereoViewDir(float3 worldPos)
|
||||
{
|
||||
float3 cameraPos = _VRChatMirrorMode ? _VRChatMirrorCameraPos :
|
||||
#ifdef USING_STEREO_MATRICES
|
||||
(unity_StereoWorldSpaceCameraPos[0] + unity_StereoWorldSpaceCameraPos[1]) * 0.5f;
|
||||
#else
|
||||
_WorldSpaceCameraPos;
|
||||
#endif
|
||||
|
||||
half3 viewDir = cameraPos - worldPos;
|
||||
return normalize(viewDir);
|
||||
}
|
||||
|
||||
#if defined(VERTEXLIGHT_ON)
|
||||
// Partially lifted vertex light support from XSToon: https://github.com/Xiexe/Xiexes-Unity-Shaders
|
||||
void Get4VertexLightsColFalloff(inout VertexLightInformation vLight, float3 worldPos, half3 normal)
|
||||
{
|
||||
half4 toLightX = unity_4LightPosX0 - worldPos.x;
|
||||
half4 toLightY = unity_4LightPosY0 - worldPos.y;
|
||||
half4 toLightZ = unity_4LightPosZ0 - worldPos.z;
|
||||
|
||||
half4 lengthSq = 0;
|
||||
lengthSq += toLightX * toLightX;
|
||||
lengthSq += toLightY * toLightY;
|
||||
lengthSq += toLightZ * toLightZ;
|
||||
|
||||
half4 atten = sqrt(1.0 / (1.0 + lengthSq * unity_4LightAtten0));
|
||||
|
||||
vLight.ColorFalloff[0] = saturate(unity_LightColor[0]) * atten.x;
|
||||
vLight.ColorFalloff[1] = saturate(unity_LightColor[1]) * atten.y;
|
||||
vLight.ColorFalloff[2] = saturate(unity_LightColor[2]) * atten.z;
|
||||
vLight.ColorFalloff[3] = saturate(unity_LightColor[3]) * atten.w;
|
||||
}
|
||||
|
||||
void GetVertexLightsDir(inout VertexLightInformation vLights, float3 worldPos)
|
||||
{
|
||||
float3 toLightX = float3(unity_4LightPosX0.x, unity_4LightPosY0.x, unity_4LightPosZ0.x);
|
||||
float3 toLightY = float3(unity_4LightPosX0.y, unity_4LightPosY0.y, unity_4LightPosZ0.y);
|
||||
float3 toLightZ = float3(unity_4LightPosX0.z, unity_4LightPosY0.z, unity_4LightPosZ0.z);
|
||||
float3 toLightW = float3(unity_4LightPosX0.w, unity_4LightPosY0.w, unity_4LightPosZ0.w);
|
||||
|
||||
half3 dirX = normalize(toLightX - worldPos);
|
||||
half3 dirY = normalize(toLightY - worldPos);
|
||||
half3 dirZ = normalize(toLightZ - worldPos);
|
||||
half3 dirW = normalize(toLightW - worldPos);
|
||||
|
||||
vLights.Direction[0] = dirX;
|
||||
vLights.Direction[1] = dirY;
|
||||
vLights.Direction[2] = dirZ;
|
||||
vLights.Direction[3] = dirW;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
half3 GetSpecularFresnel(DotProducts dotProducts, half3 f0)
|
||||
{
|
||||
return F_Schlick(f0, dotProducts.vdh, dotProducts.vdn);
|
||||
}
|
||||
|
||||
half3 GetDirectSpecular(Surface surface, DotProducts d, float3 fresnel)
|
||||
{
|
||||
half3 specular = half3(0,0,0);
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
float rough = max(surface.roughness * surface.roughness, 0.0045);
|
||||
|
||||
float V = V_SmithGGXCorrelated(d.vdn, d.ndl, rough);
|
||||
float D = VRC_GGXTerm(d.ndh, rough);
|
||||
half3 directSpecular = max(0, (D * V) * fresnel);
|
||||
half3 directSpecularSharp = smoothstep(0.5, 0.51, directSpecular);
|
||||
|
||||
specular = lerp(directSpecular, directSpecularSharp, surface.specularSharpness);
|
||||
#endif
|
||||
|
||||
return specular;
|
||||
}
|
||||
#endif
|
||||
|
||||
half3 GetIndirectDiffuse()
|
||||
{
|
||||
half3 ambient = half3(0,0,0);
|
||||
#if defined(UNITY_PASS_FORWARDBASE)
|
||||
// SH average only, dodges a ShadeSH9 for efficiency but means we approximate lightprobes
|
||||
ambient = half3(unity_SHAr.w, unity_SHAg.w, unity_SHAb.w);
|
||||
#endif
|
||||
return ambient;
|
||||
}
|
||||
|
||||
//Reflection direction, worldPos, unity_SpecCube0_ProbePosition, unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax
|
||||
half3 GetReflectionUV(half3 direction, float3 position, half4 cubemapPosition, half3 boxMin, half3 boxMax)
|
||||
{
|
||||
#if UNITY_SPECCUBE_BOX_PROJECTION
|
||||
UNITY_BRANCH
|
||||
if (cubemapPosition.w > 0) {
|
||||
half3 factors = ((direction > 0 ? boxMax : boxMin) - position) / direction;
|
||||
half scalar = min(min(factors.x, factors.y), factors.z);
|
||||
direction = direction * scalar + (position - cubemapPosition);
|
||||
}
|
||||
#endif
|
||||
return direction;
|
||||
}
|
||||
|
||||
half3 GetBoxProjection (half3 direction, float3 position, half4 cubemapPosition, half3 boxMin, half3 boxMax)
|
||||
{
|
||||
#if defined(UNITY_SPECCUBE_BOX_PROJECTION)
|
||||
UNITY_BRANCH
|
||||
if (cubemapPosition.w > 0) {
|
||||
half3 factors =
|
||||
((direction > 0 ? boxMax : boxMin) - position) / direction;
|
||||
half scalar = min(min(factors.x, factors.y), factors.z);
|
||||
direction = direction * scalar + (position - cubemapPosition);
|
||||
}
|
||||
#endif
|
||||
return direction;
|
||||
}
|
||||
|
||||
half3 GetIndirectSpecular(Surface surface, half3 reflDir, float3 worldPos, half3 normal)
|
||||
{
|
||||
half3 spec = half3(0,0,0);
|
||||
#if defined(USE_SPECULAR)
|
||||
#if defined(UNITY_PASS_FORWARDBASE)
|
||||
half3 indirectSpecular;
|
||||
Unity_GlossyEnvironmentData envData;
|
||||
envData.roughness = surface.roughness;
|
||||
envData.reflUVW = GetBoxProjection(
|
||||
reflDir, worldPos,
|
||||
unity_SpecCube0_ProbePosition,
|
||||
unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax
|
||||
);
|
||||
|
||||
half3 probe0 = Unity_GlossyEnvironment(UNITY_PASS_TEXCUBE(unity_SpecCube0), unity_SpecCube0_HDR, envData);
|
||||
half interpolator = unity_SpecCube0_BoxMin.w;
|
||||
UNITY_BRANCH
|
||||
if (interpolator < 0.99999)
|
||||
{
|
||||
envData.reflUVW = GetBoxProjection(
|
||||
reflDir, worldPos,
|
||||
unity_SpecCube1_ProbePosition,
|
||||
unity_SpecCube1_BoxMin, unity_SpecCube1_BoxMax
|
||||
);
|
||||
half3 probe1 = Unity_GlossyEnvironment(UNITY_PASS_TEXCUBE_SAMPLER(unity_SpecCube1, unity_SpecCube0), unity_SpecCube0_HDR, envData);
|
||||
indirectSpecular = lerp(probe1, probe0, interpolator);
|
||||
}
|
||||
else
|
||||
{
|
||||
indirectSpecular = probe0;
|
||||
}
|
||||
half horizon = min(1 + dot(reflDir, normal), 1);
|
||||
indirectSpecular *= horizon * horizon;
|
||||
spec = indirectSpecular;
|
||||
#endif
|
||||
#endif
|
||||
return spec;
|
||||
}
|
||||
|
||||
half3 GetRimLight(Surface surface, half attenuation, half svdn, half3 lightCol, half3 indirectCol)
|
||||
{
|
||||
half3 rimlight = half3(0,0,0);
|
||||
|
||||
#if defined(UNITY_PASS_FORWARDBASE) && !defined(VRCHAT_PASS_OUTLINE)
|
||||
UNITY_BRANCH if (USE_RIMLIGHT)
|
||||
{
|
||||
half rimIntensity = saturate((1 - svdn));
|
||||
rimIntensity = smoothstep(surface.rimRange - surface.rimSharpness, surface.rimRange + surface.rimSharpness, rimIntensity);
|
||||
rimlight = rimIntensity * surface.rimIntensity * surface.rimColor * (surface.rimEnvironmental ? lightCol + indirectCol : 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
return rimlight;
|
||||
}
|
||||
|
||||
half3 SampleShadowRampTexture(half uv)
|
||||
{
|
||||
return tex2Dlod(_Ramp, float4(VRCHAT_TRANSFORM_ATLAS_TEX_MODE(float2(uv, 0.5), _Ramp), 0, 0));
|
||||
}
|
||||
|
||||
// math adapted from https://gist.github.com/mairod/a75e7b44f68110e1576d77419d608786?permalink_comment_id=3180018#gistcomment-3180018
|
||||
// rotates in YIQ color space for efficiency
|
||||
half3 ApplyHue(half3 col, half hueAngle, half mask)
|
||||
{
|
||||
UNITY_BRANCH
|
||||
if (hueAngle == 0)
|
||||
{
|
||||
return col;
|
||||
}
|
||||
else
|
||||
{
|
||||
const half3 k = 0.57735;
|
||||
half sinAngle = sin(hueAngle);
|
||||
half cosAngle = cos(hueAngle);
|
||||
half3 shifted = col * cosAngle + cross(k, col) * sinAngle + k * dot(k, col) * (1.0 - cosAngle);
|
||||
return lerp(col, shifted, mask);
|
||||
}
|
||||
}
|
||||
|
||||
half2 GetVRMatcapUV(half3 worldUp, half3 viewDirection, half3 normalDirection)
|
||||
{
|
||||
half3 worldViewUp = normalize(worldUp - viewDirection * dot(viewDirection, worldUp));
|
||||
half3 worldViewRight = normalize(cross(viewDirection, worldViewUp));
|
||||
half2 matcapUV = half2(dot(worldViewRight, normalDirection), dot(worldViewUp, normalDirection)) * 0.5 + 0.5;
|
||||
return matcapUV;
|
||||
}
|
||||
|
||||
half GetAlpha(Surface s, half3 vpos)
|
||||
{
|
||||
half alpha = 1;
|
||||
|
||||
#if defined(_ALPHATEST_ON)
|
||||
if(_AlphaToMask == 1)
|
||||
{
|
||||
#if defined(UNITY_PASS_SHADOWCASTER)
|
||||
clip(s.albedoMap.a - s.cutoff);
|
||||
#else
|
||||
alpha = s.albedoMap.a * s.alpha;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
clip(s.albedoMap.a - s.cutoff);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_ALPHAPREMULTIPLY_ON)
|
||||
alpha = s.albedoMap.a;
|
||||
#if defined(UNITY_PASS_SHADOWCASTER)
|
||||
half dither = GetDither(vpos.xy);
|
||||
clip(alpha - dither);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_ALPHABLEND_ON)
|
||||
alpha = s.alpha;
|
||||
#if defined(UNITY_PASS_SHADOWCASTER)
|
||||
half dither = GetDither(vpos.xy);
|
||||
clip(alpha - dither);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return alpha;
|
||||
}
|
||||
|
||||
#if defined(USE_DETAIL_MAPS)
|
||||
void ApplyDetailMap(Surface surface, inout half4 albedo)
|
||||
{
|
||||
half mask = surface.detailMaskMap;
|
||||
switch (surface.detailMode)
|
||||
{
|
||||
case 0: // AlphaBlended
|
||||
albedo.rgb = lerp(albedo.rgb, surface.detailAlbedoMap.rgb, surface.detailAlbedoMap.a * mask);
|
||||
break;
|
||||
case 1: // Additive
|
||||
albedo.rgb += surface.detailAlbedoMap.rgb * mask;
|
||||
break;
|
||||
case 2: // Multiply
|
||||
albedo.rgb *= LerpWhiteTo(surface.detailAlbedoMap.rgb, mask);
|
||||
break;
|
||||
case 3: // MultiplyX2
|
||||
albedo.rgb *= LerpWhiteTo(surface.detailAlbedoMap.rgb * unity_ColorSpaceDouble.rgb, mask);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
float3 BlendAdditive(float3 base, float3 blend)
|
||||
{
|
||||
return min(1, base + blend);
|
||||
}
|
||||
|
||||
void ApplyColorMask(
|
||||
half4 colorMask,
|
||||
half4 colorMaskColor1,
|
||||
half4 colorMaskColor2,
|
||||
half4 colorMaskColor3,
|
||||
half4 colorMaskColor4,
|
||||
uint blendMode,
|
||||
inout half3 albedo,
|
||||
inout half3 emission)
|
||||
{
|
||||
const float3 grayscaleVector = float3(0.3, 0.59, 0.11);
|
||||
half grayscale = dot(albedo, grayscaleVector);
|
||||
|
||||
half opacity1 = colorMask.r * colorMaskColor1.a;
|
||||
half opacity2 = colorMask.g * colorMaskColor2.a;
|
||||
half opacity3 = colorMask.b * colorMaskColor3.a;
|
||||
half opacity4 = colorMask.a * colorMaskColor4.a;
|
||||
|
||||
UNITY_BRANCH
|
||||
if (blendMode == COLORMASK_BLEND_MULTIPLY)
|
||||
{
|
||||
albedo = lerp(albedo, grayscale * colorMaskColor1.rgb, opacity1);
|
||||
albedo = lerp(albedo, grayscale * colorMaskColor2.rgb, opacity2);
|
||||
albedo = lerp(albedo, grayscale * colorMaskColor3.rgb, opacity3);
|
||||
albedo = lerp(albedo, grayscale * colorMaskColor4.rgb, opacity4);
|
||||
}
|
||||
else if (blendMode == COLORMASK_BLEND_ADDITIVE)
|
||||
{
|
||||
albedo = lerp(albedo, BlendAdditive(grayscale, colorMaskColor1.rgb), opacity1);
|
||||
albedo = lerp(albedo, BlendAdditive(grayscale, colorMaskColor2.rgb), opacity2);
|
||||
albedo = lerp(albedo, BlendAdditive(grayscale, colorMaskColor3.rgb), opacity3);
|
||||
albedo = lerp(albedo, BlendAdditive(grayscale, colorMaskColor4.rgb), opacity4);
|
||||
}
|
||||
|
||||
emission += colorMaskColor1.rgb * colorMask.r * _ColorMaskEmissionStrength1;
|
||||
emission += colorMaskColor2.rgb * colorMask.g * _ColorMaskEmissionStrength2;
|
||||
emission += colorMaskColor3.rgb * colorMask.b * _ColorMaskEmissionStrength3;
|
||||
emission += colorMaskColor4.rgb * colorMask.a * _ColorMaskEmissionStrength4;
|
||||
}
|
||||
|
||||
LightVectors PopulateLightingVectors(Surface surface, float3 worldPos, half3 worldNormal, half3 tangent, half3 bitangent)
|
||||
{
|
||||
LightVectors lv = (LightVectors)0;
|
||||
|
||||
lv.lightEnv = any(_WorldSpaceLightPos0.xyz);
|
||||
lv.lightDir = GetLightDir(lv.lightEnv, worldPos);
|
||||
lv.lightCol = GetLightCol(lv.lightEnv, _LightColor0.rgb, lv.lightDir);
|
||||
lv.viewDir = normalize(_WorldSpaceCameraPos - worldPos);
|
||||
lv.stereoViewDir = GetStereoViewDir(worldPos);
|
||||
lv.fixedVector = normalize(lv.lightDir + lv.viewDir);
|
||||
lv.reflViewDir = reflect(-lv.viewDir, worldNormal);
|
||||
lv.reflLightDir = reflect(lv.lightDir, worldNormal);
|
||||
|
||||
return lv;
|
||||
}
|
||||
|
||||
LightVectors PopulateVertexLightingVectors(LightVectors sharedLightVectors, half3 lightDir, half3 lightCol, half3 worldNormal)
|
||||
{
|
||||
LightVectors lv = (LightVectors)0;
|
||||
|
||||
lv.lightEnv = sharedLightVectors.lightEnv;
|
||||
lv.lightDir = lightDir;
|
||||
lv.lightCol = lightCol;
|
||||
lv.viewDir = sharedLightVectors.viewDir;
|
||||
lv.stereoViewDir = sharedLightVectors.stereoViewDir;
|
||||
lv.fixedVector = normalize(lv.lightDir + lv.viewDir);
|
||||
lv.reflViewDir = sharedLightVectors.reflViewDir;
|
||||
lv.reflLightDir = reflect(lv.lightDir, worldNormal);
|
||||
|
||||
return lv;
|
||||
}
|
||||
|
||||
DotProducts PopulateLightingDotProducts(LightVectors lv, half3 worldNormal, half3 tangent, half3 bitangent)
|
||||
{
|
||||
DotProducts d = (DotProducts)0;
|
||||
|
||||
d.ndl = dot(lv.lightDir, worldNormal); // -1 to 1
|
||||
d.ndl01 = d.ndl * 0.5 + 0.5; // 0 to 1 remapped
|
||||
d.clampedNdl = saturate(d.ndl); // 0 to 1 clamped
|
||||
d.vdn = abs(dot(lv.viewDir, worldNormal));
|
||||
d.svdn = abs(dot(lv.stereoViewDir, worldNormal));
|
||||
d.vdh = dot(lv.viewDir, lv.fixedVector);
|
||||
d.ndh = dot(worldNormal, lv.fixedVector);
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
#if defined(UNITY_PASS_FORWARDBASE)
|
||||
half3 GetDiffuseBRDFBase(Surface surface, DotProducts dotProducts, LightVectors lightVectors, half3 indirectDiffuse, half3 albedo, half attenuation, half occlusion)
|
||||
{
|
||||
// attenuation is on shadow ramp
|
||||
half3 ramp = SampleShadowRampTexture(dotProducts.ndl01 * attenuation);
|
||||
half3 brightness = ramp * occlusion;
|
||||
|
||||
// don't just multiply brightness, this tends to look bad for toon-style skin and materials
|
||||
// instead, color the shadows with albedo + detail
|
||||
brightness = min(1, brightness + surface.shadowBoost);
|
||||
half3 coloredContribution = lerp(albedo.rgb * surface.shadowAlbedo, 1, brightness);
|
||||
|
||||
// clamp light intensity to 0-1 if _LimitBrightness is set
|
||||
return albedo * MaybeSaturate((coloredContribution * lightVectors.lightCol) + indirectDiffuse, surface.limitBrightness) * surface.alpha;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(UNITY_PASS_FORWARDADD) || defined(VERTEXLIGHT_ON)
|
||||
half3 GetDiffuseBRDFAdd(Surface surface, DotProducts dotProducts, LightVectors lightVectors, half3 indirectDiffuse, half3 albedo, half attenuation, half occlusion)
|
||||
{
|
||||
// attenuation is on brightness
|
||||
half3 ramp = SampleShadowRampTexture(dotProducts.ndl01);
|
||||
half3 brightness = ramp * attenuation * occlusion;
|
||||
|
||||
// in add passes we need to pre-multiply attenuation so we start at 0 intensity
|
||||
brightness = min(1, brightness + surface.shadowBoost * attenuation);
|
||||
half3 coloredContribution = lerp(albedo.rgb * surface.shadowAlbedo * attenuation, 1, brightness);
|
||||
|
||||
// clamp light intensity to 0-1 if _LimitBrightness is set
|
||||
return albedo * MaybeSaturate((coloredContribution * lightVectors.lightCol), surface.limitBrightness) * surface.alpha;
|
||||
}
|
||||
#endif
|
||||
|
||||
half3 GetSpecularBRDF(Surface surface, DotProducts dotProducts, LightVectors lv, half attenuation, float3 worldPos, half3 worldNormal, half3 vertexLightSpec, half3 fresnel)
|
||||
{
|
||||
half3 specularBRDF = 0;
|
||||
#if defined(USE_SPECULAR)
|
||||
half3 directSpecular = GetDirectSpecular(surface, dotProducts, fresnel) * attenuation * dotProducts.clampedNdl * lv.lightCol;
|
||||
half3 indirectSpecular = GetIndirectSpecular(surface, lv.reflViewDir, worldPos, worldNormal) * fresnel;
|
||||
specularBRDF = max(0, (indirectSpecular + directSpecular + vertexLightSpec));
|
||||
|
||||
#if defined(_ALPHAPREMULTIPLY_ON)
|
||||
specularBRDF *= surface.alpha;
|
||||
#endif
|
||||
#endif
|
||||
return specularBRDF;
|
||||
}
|
||||
|
||||
#if defined(USE_MATCAP)
|
||||
void ApplyMatcap(Surface surface, LightVectors lv, half3 worldNormal, inout half3 albedo)
|
||||
{
|
||||
const half3 upVector = half3(0,1,0);
|
||||
half2 matcapUV = GetVRMatcapUV(upVector, lv.viewDir, worldNormal);
|
||||
half3 matcap = tex2D(_Matcap, matcapUV).rgb;
|
||||
half strength = surface.matcapStrength * surface.matcapMask;
|
||||
switch (surface.matcapType)
|
||||
{
|
||||
case 0: // Additive (base pass only)
|
||||
#if defined(UNITY_PASS_FORWARDBASE)
|
||||
albedo += matcap * strength;
|
||||
#endif
|
||||
break;
|
||||
case 1: // Multiplicative
|
||||
albedo *= lerp(1, matcap, strength);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void PopulateVertexLights(Surface surface, LightVectors lv, float3 worldPos, half3 worldNormal, half3 tangent, half3 bitangent, half3 f0, half3 albedo, half occlusion, inout half3 vertexLightDiff, inout half3 vertexLightSpec)
|
||||
{
|
||||
#if defined(VERTEXLIGHT_ON)
|
||||
VertexLightInformation vLight = (VertexLightInformation)0;
|
||||
LightVectors vLightVectors = (LightVectors)0;
|
||||
DotProducts vDotProducts = (DotProducts)0;
|
||||
|
||||
Get4VertexLightsColFalloff(/* inout */ vLight, worldPos, worldNormal);
|
||||
GetVertexLightsDir(/* inout */ vLight, worldPos);
|
||||
|
||||
UNITY_LOOP
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
vLightVectors = PopulateVertexLightingVectors(lv, vLight.Direction[i], vLight.ColorFalloff[i], worldNormal);
|
||||
vDotProducts = PopulateLightingDotProducts(vLightVectors, worldNormal, tangent, bitangent);
|
||||
|
||||
// run the full BRDF, just pretend it's a FORWARDADD pass - our lighting model is cheap enough that this should be fine
|
||||
vertexLightDiff += GetDiffuseBRDFAdd(surface, vDotProducts, vLightVectors, 0, albedo, vLight.ColorFalloff[i], occlusion);
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
half3 vFresnel = GetSpecularFresnel(vDotProducts, f0);
|
||||
half3 vLspec = GetDirectSpecular(surface, vDotProducts, vFresnel) * vDotProducts.clampedNdl;
|
||||
vertexLightSpec += vLspec * vLight.ColorFalloff[i];
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
vertexLightDiff = 0;
|
||||
vertexLightSpec = 0;
|
||||
#endif
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 22d0da77cb6061342968d9087151cdd1
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,71 @@
|
||||
half4 VRChatLightingBRDF(UNITY_POSITION(vpos), v2f i, Surface surface)
|
||||
{
|
||||
UNITY_LIGHT_ATTENUATION(attenuation, i, i.worldPos.xyz);
|
||||
// fix for rare bug where light atten is 0 when there is no directional light in the scene
|
||||
#ifdef UNITY_PASS_FORWARDBASE
|
||||
if(all(_LightColor0.rgb == 0.0)) { attenuation = 1.0; }
|
||||
#endif
|
||||
|
||||
#if !defined(UNITY_PASS_SHADOWCASTER)
|
||||
half3 worldNormal = i.normal;
|
||||
half3 tangent = i.tangent.xyz;
|
||||
half3 bitangent = cross(worldNormal, tangent) * sign(i.tangent.w);
|
||||
float3 worldPos = i.worldPos;
|
||||
GetSurfaceNormals(surface, bitangent, tangent, worldNormal);
|
||||
|
||||
LightVectors lightVectors = PopulateLightingVectors(surface, worldPos, worldNormal, tangent, bitangent);
|
||||
DotProducts dotProducts = PopulateLightingDotProducts(lightVectors, worldNormal, tangent, bitangent);
|
||||
|
||||
half4 albedo = surface.albedoMap;
|
||||
#if defined(USE_DETAIL_MAPS)
|
||||
ApplyDetailMap(surface, /* inout */ albedo);
|
||||
#endif
|
||||
half3 diffuseColor = albedo.rgb;
|
||||
albedo.rgb *= (1.0 - surface.metallic);
|
||||
surface.alpha = GetAlpha(surface, i.pos);
|
||||
half occlusion = surface.occlusionMap;
|
||||
|
||||
half3 emission = 0;
|
||||
#if defined(USE_EMISSION_MAP) && defined(UNITY_PASS_FORWARDBASE) // We don't want emission in shadow or add pass.
|
||||
emission = surface.emissionMap;
|
||||
#endif
|
||||
|
||||
// minimum brightness has a max of 0.1 so just apply it unconditionally, little risk of blowing anything out
|
||||
emission += surface.minBrightness * albedo;
|
||||
|
||||
// f0 is specular color
|
||||
half3 f0 = half3(0,0,0);
|
||||
half3 fresnel = half3(0,0,0);
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
f0 = 0.16 * surface.reflectance * surface.reflectance * (1.0 - surface.metallic) + diffuseColor * surface.metallic;
|
||||
fresnel = GetSpecularFresnel(dotProducts, f0) * saturate((surface.reflectance + surface.metallic) * 4.0f);
|
||||
#endif
|
||||
|
||||
#if defined(USE_MATCAP)
|
||||
ApplyMatcap(surface, lightVectors, worldNormal, /* inout */ albedo.rgb);
|
||||
#endif
|
||||
|
||||
half3 vertexLightDiff = 0;
|
||||
half3 vertexLightSpec = 0;
|
||||
PopulateVertexLights(surface, lightVectors, worldPos, worldNormal, tangent, bitangent, f0, albedo, occlusion, vertexLightDiff, vertexLightSpec);
|
||||
|
||||
half3 indirectDiffuse = GetIndirectDiffuse() * occlusion;
|
||||
#if defined(UNITY_PASS_FORWARDBASE)
|
||||
half3 diffuseBRDF = GetDiffuseBRDFBase(surface, dotProducts, lightVectors, indirectDiffuse, albedo, attenuation, occlusion);
|
||||
#else
|
||||
half3 diffuseBRDF = GetDiffuseBRDFAdd(surface, dotProducts, lightVectors, indirectDiffuse, albedo, attenuation, occlusion);
|
||||
#endif
|
||||
half3 specularBRDF = GetSpecularBRDF(surface, dotProducts, lightVectors, attenuation, worldPos, worldNormal, vertexLightSpec, fresnel);
|
||||
half3 rimLight = GetRimLight(surface, attenuation, dotProducts.svdn, lightVectors.lightCol, indirectDiffuse);
|
||||
rimLight *= LerpWhiteTo(diffuseColor, surface.rimAlbedoTint);
|
||||
|
||||
half3 litFragment = diffuseBRDF + specularBRDF + vertexLightDiff + emission + rimLight;
|
||||
|
||||
half4 finalColor = half4(litFragment, surface.alpha);
|
||||
UNITY_APPLY_FOG(i.fogCoord, finalColor);
|
||||
return finalColor;
|
||||
#else
|
||||
return half4(0, 0, 0, GetAlpha(surface, i.pos));
|
||||
#endif
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e9e977e5b9ee48488ee8f6748a0f2bd
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,93 @@
|
||||
struct v2f_outline
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
half3 color : TEXCOORD1;
|
||||
|
||||
UNITY_FOG_COORDS(2)
|
||||
|
||||
UNITY_VERTEX_OUTPUT_STEREO
|
||||
VRCHAT_ATLAS_VERTEX_OUTPUT
|
||||
};
|
||||
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _OutlineThickness);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half3, _OutlineColor);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half, _OutlineFromAlbedo);
|
||||
|
||||
sampler2D _OutlineMask;
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(half4, _OutlineMask_ST);
|
||||
VRCHAT_DEFINE_ATLAS_PROPERTY(uint, _OutlineMaskChannel);
|
||||
VRCHAT_DEFINE_ATLAS_TEXTUREMODE(_OutlineMask);
|
||||
|
||||
// When an avatar scales really small, the outline (since it's calculated in world space) becomes really thick.
|
||||
// This function clamps the outline scale based on the screen-space length of the normal offset, avoiding that
|
||||
// issue at the cost of a bit of a fudge factor chosen to accomodate the typical avatar scale range in VRChat.
|
||||
float4 GetScreenSpaceClampedOffsetClipPosition(float3 worldPos, float3 offsetWorldPos, float thickness)
|
||||
{
|
||||
float4 clipPos = UnityWorldToClipPos(float4(worldPos, 1));
|
||||
float4 offsetClipPos = UnityWorldToClipPos(float4(offsetWorldPos, 1));
|
||||
float dist = distance(clipPos.xy / clipPos.w, offsetClipPos.xy / offsetClipPos.w);
|
||||
if (dist <= 0.0001f) // avoid division by zero
|
||||
return offsetClipPos;
|
||||
float clampedDistance = min(dist, 0.05f * thickness);
|
||||
return lerp(clipPos, offsetClipPos, clampedDistance / dist);
|
||||
}
|
||||
|
||||
v2f_outline vert_outline (appdata v)
|
||||
{
|
||||
v2f_outline o = (v2f_outline)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
VRCHAT_ATLAS_INITIALIZE_VERTEX_OUTPUT(v, o);
|
||||
VRCHAT_SETUP_ATLAS_INDEX_POST_VERTEX(o);
|
||||
|
||||
uint maskChannel = VRCHAT_GET_ATLAS_PROPERTY(_OutlineMaskChannel);
|
||||
float mask = tex2Dlod(_OutlineMask, half4(v.uv, 0, 0))[maskChannel];
|
||||
float thickness = VRCHAT_GET_ATLAS_PROPERTY(_OutlineThickness);
|
||||
|
||||
if (thickness <= 0)
|
||||
{
|
||||
o.pos = float4(0, 0, 0, 0);
|
||||
return o;
|
||||
}
|
||||
|
||||
float3 worldNormal = UnityObjectToWorldNormal(v.normal);
|
||||
float3 worldPos = mul(unity_ObjectToWorld, float4(v.vertex.xyz, 1)).xyz;
|
||||
float3 offsetWorldPos = worldPos + worldNormal * thickness * mask * 0.01;
|
||||
|
||||
o.pos = GetScreenSpaceClampedOffsetClipPosition(worldPos, offsetWorldPos, thickness);
|
||||
o.uv = v.uv;
|
||||
|
||||
UNITY_BRANCH if (VRCHAT_GET_ATLAS_PROPERTY(_VertexColor))
|
||||
o.color = v.color;
|
||||
else
|
||||
o.color = half3(1, 1, 1);
|
||||
|
||||
UNITY_TRANSFER_FOG(o, o.pos);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag_outline (v2f_outline i) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
VRCHAT_SETUP_ATLAS_INDEX_POST_VERTEX(i);
|
||||
|
||||
half3 outlineColor = VRCHAT_GET_ATLAS_PROPERTY(_OutlineColor);
|
||||
half outlineFromAlbedo = VRCHAT_GET_ATLAS_PROPERTY(_OutlineFromAlbedo);
|
||||
|
||||
half3 color = outlineColor;
|
||||
|
||||
UNITY_BRANCH if (outlineFromAlbedo)
|
||||
{
|
||||
half3 albedo = tex2D(_MainTex, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(i.uv, _MainTex)).rgb;
|
||||
albedo *= VRCHAT_GET_ATLAS_PROPERTY(_Color).rgb;
|
||||
albedo *= i.color;
|
||||
color = lerp(color, albedo, outlineFromAlbedo);
|
||||
}
|
||||
|
||||
half4 finalColor = half4(color, 1);
|
||||
UNITY_APPLY_FOG(i.fogCoord, finalColor);
|
||||
return finalColor;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 934af42828b554d499e6b39635b75760
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,20 @@
|
||||
// atlasing support
|
||||
#ifndef VRCHAT_ATLASING_INCLUDED
|
||||
#define VRCHAT_ATLASING_INCLUDED
|
||||
|
||||
#ifdef VRCHAT_ATLASING_ENABLED
|
||||
// TODO
|
||||
#else
|
||||
#define VRCHAT_DEFINE_ATLAS_PROPERTY(type, name) type name
|
||||
#define VRCHAT_DEFINE_ATLAS_TEXTUREMODE(name)
|
||||
#define VRCHAT_GET_ATLAS_PROPERTY(name) name
|
||||
#define VRCHAT_ATLAS_VERTEX_INPUT
|
||||
#define VRCHAT_ATLAS_VERTEX_OUTPUT
|
||||
#define VRCHAT_TRANSFORM_ATLAS_TEX(tex, name) (tex.xy * name##_ST.xy + name##_ST.zw)
|
||||
#define VRCHAT_TRANSFORM_ATLAS_TEX_MODE(tex, name) (tex.xy * name##_ST.xy + name##_ST.zw)
|
||||
#define VRCHAT_ATLAS_INITIALIZE_VERTEX_OUTPUT(input, output)
|
||||
#define VRCHAT_ATLAS_TRANSFER_VERTEX_OUTPUT(input, output)
|
||||
#define VRCHAT_SETUP_ATLAS_INDEX_POST_VERTEX(input)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79e7b17e52656104da27c3a02065ebc9
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,150 @@
|
||||
v2f vert (appdata v)
|
||||
{
|
||||
v2f o = (v2f)0;
|
||||
|
||||
UNITY_SETUP_INSTANCE_ID(v);
|
||||
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||||
VRCHAT_ATLAS_INITIALIZE_VERTEX_OUTPUT(v, o);
|
||||
VRCHAT_SETUP_ATLAS_INDEX_POST_VERTEX(o);
|
||||
|
||||
o.pos = UnityObjectToClipPos(v.vertex);
|
||||
o.uv.xy = v.uv;
|
||||
o.uv.zw = v.uv1;
|
||||
|
||||
UNITY_BRANCH if (VRCHAT_GET_ATLAS_PROPERTY(_VertexColor))
|
||||
o.color = v.color;
|
||||
else
|
||||
o.color = half4(1, 1, 1, 1);
|
||||
|
||||
#if !defined(UNITY_PASS_SHADOWCASTER)
|
||||
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
|
||||
o.viewDir = normalize(UnityWorldSpaceViewDir(o.worldPos));
|
||||
half3 wnormal = UnityObjectToWorldNormal(v.normal);
|
||||
half3 tangent = UnityObjectToWorldDir(v.tangent.xyz);
|
||||
o.normal = wnormal;
|
||||
o.tangent.xyz = tangent;
|
||||
o.tangent.w = v.tangent.w * unity_WorldTransformParams.w;
|
||||
|
||||
UNITY_TRANSFER_SHADOW(o, o.uv);
|
||||
UNITY_TRANSFER_FOG(o, o.pos);
|
||||
#else
|
||||
TRANSFER_SHADOW_CASTER_NOPOS(o, o.pos);
|
||||
#endif
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
half4 frag (v2f i, uint facing : SV_IsFrontFace) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
|
||||
VRCHAT_SETUP_ATLAS_INDEX_POST_VERTEX(i);
|
||||
|
||||
Surface surface = (Surface)0;
|
||||
|
||||
float2 uv0 = i.uv.xy;
|
||||
|
||||
//surface.cutoff = material.cutoff;
|
||||
|
||||
surface.albedoMap = tex2D(_MainTex, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(uv0, _MainTex))
|
||||
* VRCHAT_GET_ATLAS_PROPERTY(_Color)
|
||||
* half4(i.color, 1);
|
||||
|
||||
#if !defined(UNITY_PASS_SHADOWCASTER)
|
||||
float2 hueShiftDdx = ddx(uv0);
|
||||
float2 hueShiftDdy = ddy(uv0);
|
||||
half hueShiftMask = 0;
|
||||
UNITY_BRANCH if (USE_HUE_SHIFT)
|
||||
{
|
||||
hueShiftMask = SAMPLE_MASK_GRAD(_HueShiftMask, uv0, hueShiftDdx, hueShiftDdy);
|
||||
surface.albedoMap.rgb = ApplyHue(surface.albedoMap.rgb, VRCHAT_GET_ATLAS_PROPERTY(_HueShift), hueShiftMask);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
half bumpScale = VRCHAT_GET_ATLAS_PROPERTY(_BumpScale);
|
||||
surface.normalMap = UnpackScaleNormal(tex2D(_BumpMap, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(uv0, _BumpMap)), bumpScale);
|
||||
#else
|
||||
surface.normalMap = half3(0, 0, 1);
|
||||
#endif
|
||||
|
||||
if (!facing)
|
||||
{
|
||||
// flip normal direction for backfaces
|
||||
surface.normalMap = -surface.normalMap;
|
||||
}
|
||||
|
||||
surface.shadowBoost = VRCHAT_GET_ATLAS_PROPERTY(_ShadowBoost);
|
||||
surface.shadowAlbedo = VRCHAT_GET_ATLAS_PROPERTY(_ShadowAlbedo);
|
||||
surface.minBrightness = VRCHAT_GET_ATLAS_PROPERTY(_MinBrightness);
|
||||
surface.limitBrightness = VRCHAT_GET_ATLAS_PROPERTY(_LimitBrightness);
|
||||
|
||||
#if defined(USE_EMISSION_MAP)
|
||||
uint emissionUVidx = VRCHAT_GET_ATLAS_PROPERTY(_EmissionUV);
|
||||
float2 emissionUV = SelectUV(i.uv, emissionUVidx);
|
||||
surface.emissionMap = tex2D(_EmissionMap, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(emissionUV, _EmissionMap)).rgb
|
||||
* VRCHAT_GET_ATLAS_PROPERTY(_EmissionColor)
|
||||
* VRCHAT_GET_ATLAS_PROPERTY(_EmissionStrength);
|
||||
UNITY_BRANCH if (USE_HUE_SHIFT)
|
||||
surface.emissionMap.rgb = ApplyHue(surface.emissionMap.rgb, VRCHAT_GET_ATLAS_PROPERTY(_EmissionHueShift), hueShiftMask);
|
||||
#endif
|
||||
|
||||
#if !defined(UNITY_PASS_SHADOWCASTER)
|
||||
float2 colorMaskUv = VRCHAT_TRANSFORM_ATLAS_TEX_MODE(uv0, _ColorMask);
|
||||
float2 colorMaskDdx = ddx(colorMaskUv);
|
||||
float2 colorMaskDdy = ddy(colorMaskUv);
|
||||
UNITY_BRANCH if (USE_COLOR_MASK)
|
||||
{
|
||||
half4 colorMask = tex2Dgrad(_ColorMask, colorMaskUv, colorMaskDdx, colorMaskDdy);
|
||||
ApplyColorMask(colorMask, _ColorMaskColor1, _ColorMaskColor2, _ColorMaskColor3, _ColorMaskColor4, _ColorMaskBlendMode, /*inout*/ surface.albedoMap.rgb, /*inout*/ surface.emissionMap.rgb);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_OCCLUSION_MAP)
|
||||
surface.occlusionMap = lerp(1, SAMPLE_MASK(_OcclusionMap, uv0), VRCHAT_GET_ATLAS_PROPERTY(_OcclusionStrength));
|
||||
#else
|
||||
surface.occlusionMap = 1;
|
||||
#endif
|
||||
|
||||
#if defined(UNITY_PASS_FORWARDBASE) && !defined(VRCHAT_PASS_OUTLINE)
|
||||
UNITY_BRANCH if (USE_RIMLIGHT)
|
||||
{
|
||||
surface.rimColor = VRCHAT_GET_ATLAS_PROPERTY(_RimColor);
|
||||
surface.rimAlbedoTint = VRCHAT_GET_ATLAS_PROPERTY(_RimAlbedoTint);
|
||||
surface.rimIntensity = VRCHAT_GET_ATLAS_PROPERTY(_RimIntensity);
|
||||
surface.rimRange = 1 - VRCHAT_GET_ATLAS_PROPERTY(_RimRange);
|
||||
surface.rimSharpness = VRCHAT_GET_ATLAS_PROPERTY(_RimSharpness);
|
||||
surface.rimEnvironmental = VRCHAT_GET_ATLAS_PROPERTY(_RimEnvironmental);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_DETAIL_MAPS)
|
||||
uint detailUVidx = VRCHAT_GET_ATLAS_PROPERTY(_DetailUV);
|
||||
float2 detailUV = SelectUV(i.uv, detailUVidx);
|
||||
surface.detailMode = VRCHAT_GET_ATLAS_PROPERTY(_DetailMode);
|
||||
surface.detailMaskMap = SAMPLE_MASK(_DetailMask, uv0); // always use uv0 for mask
|
||||
surface.detailAlbedoMap = tex2D(_DetailAlbedoMap, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(detailUV, _DetailAlbedoMap));
|
||||
#if defined(USE_NORMAL_MAPS)
|
||||
half detailNormalMapScale = VRCHAT_GET_ATLAS_PROPERTY(_DetailNormalMapScale) * surface.detailMaskMap;
|
||||
surface.detailNormalMap = UnpackScaleNormal(tex2D(_DetailNormalMap, VRCHAT_TRANSFORM_ATLAS_TEX_MODE(detailUV, _DetailNormalMap)), detailNormalMapScale);
|
||||
#endif
|
||||
UNITY_BRANCH if (USE_HUE_SHIFT)
|
||||
surface.detailAlbedoMap.rgb = ApplyHue(surface.detailAlbedoMap.rgb, VRCHAT_GET_ATLAS_PROPERTY(_DetailHueShift), hueShiftMask);
|
||||
#endif
|
||||
|
||||
#if defined(USE_SPECULAR)
|
||||
surface.metallic = SAMPLE_MASK(_MetallicMap, uv0) * VRCHAT_GET_ATLAS_PROPERTY(_MetallicStrength);
|
||||
float glossMap = SAMPLE_MASK(_GlossMap, uv0);
|
||||
float smoothness = glossMap * VRCHAT_GET_ATLAS_PROPERTY(_GlossStrength);
|
||||
surface.roughness = 1 - max(smoothness, GetGeometricSpecularAA(i.normal));
|
||||
surface.reflectance = glossMap * VRCHAT_GET_ATLAS_PROPERTY(_Reflectance);
|
||||
surface.specularSharpness = VRCHAT_GET_ATLAS_PROPERTY(_SpecularSharpness);
|
||||
#endif
|
||||
|
||||
#if defined(USE_MATCAP)
|
||||
surface.matcapMask = SAMPLE_MASK(_MatcapMask, uv0);
|
||||
surface.matcapType = VRCHAT_GET_ATLAS_PROPERTY(_MatcapType);
|
||||
surface.matcapStrength = VRCHAT_GET_ATLAS_PROPERTY(_MatcapStrength);
|
||||
#endif
|
||||
|
||||
return VRChatLightingBRDF(i.pos, i, surface);
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92b2c32677a9f3c4594a620e606ce309
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51ca8b33f002e3e459db426abb4997b0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b472e790e18a5534e90b40b0403ecad5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,153 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ed41581528c4fa4fa11970aca4edb8d
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1,153 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 348500adef1d2da428abc7b720b8b699
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 2
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Server
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 7.2 KiB |
@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 636cf1b5dfca6f54b94ca3d2ff8216c9
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 2
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 63
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 7.4 KiB |
@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f304bf7a07313d43b8562d9eabce646
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 128
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 2
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfafc89321615114fb6dbecdba0c8214
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d1b50be612cf1248b6e101f8d1c5b53
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d6a7a9ec31ab7448a777f0e2daef4af
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 12
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 0
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 0
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 32
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,239 @@
|
||||
// A fairly feature-full shader for toon-style shading in VRChat. Allowed on mobile avatars.
|
||||
Shader "VRChat/Mobile/Toon Standard"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Enum(Off, 0, Front, 1, Back, 2)] _Culling ("Culling", Int) = 2
|
||||
//[Enum(Opaque, 0)] _BlendMode("Blend Mode", Int) = 0
|
||||
//[Enum(Opaque, 0, Cutout, 1, Cutout Plus, 2, Transparent, 3, Fade, 4)] _BlendMode("Blend Mode", Int) = 0
|
||||
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Main Texture", 2D) = "white" {}
|
||||
//_Cutoff ("Alpha Cutoff", Range(0,1)) = 0.5
|
||||
[ToggleUI] _VertexColor ("Apply Vertex Color", Float) = 0.0
|
||||
|
||||
_Ramp ("Shadow Ramp", 2D) = "white" {}
|
||||
_ShadowBoost ("Shadow Boost", Range(0,1)) = 0.0
|
||||
_ShadowAlbedo ("Shadow Tint", Range(0,1)) = 0.5
|
||||
[PowerSlider(2)] _MinBrightness ("Min Brightness", Range(0,0.1)) = 0.0
|
||||
[ToggleUI] _LimitBrightness ("Limit Brightness", Float) = 1.0
|
||||
|
||||
[Normal] _BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
_BumpScale ("Normal Scale", Float) = 1.0
|
||||
|
||||
_MetallicMap ("Metallic Map", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _MetallicMapChannel ("Color Channel", Int) = 0
|
||||
_MetallicStrength ("Metallic Strength", Range(0,1)) = 0
|
||||
_GlossMap ("Gloss Map", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _GlossMapChannel ("Color Channel", Int) = 3
|
||||
_GlossStrength ("Gloss Strength", Range(0,1)) = 0.5
|
||||
_Reflectance ("Reflectance", Range(0,1)) = 0.5
|
||||
_SpecularSharpness("Sharpness", Range(0,1)) = 0
|
||||
|
||||
_Matcap ("Matcap", 2D) = "white" {}
|
||||
_MatcapMask ("Matcap Mask", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _MatcapMaskChannel ("Color Channel", Int) = 0
|
||||
[Enum(Additive, 0, Multiplicative, 1)] _MatcapType ("Matcap Type", Int) = 0
|
||||
_MatcapStrength ("Matcap Strength", Range(0,1)) = 1.0
|
||||
|
||||
_RimColor("Color", Color) = (1,1,1,1)
|
||||
_RimAlbedoTint("Albedo Tint", Range(0,1)) = 0.0
|
||||
_RimIntensity("Intensity", Range(0,1)) = 0.5
|
||||
_RimRange("Range", Range(0,1)) = 0.3
|
||||
_RimSharpness("Softness", Range(0,1)) = 0.1
|
||||
[ToggleUI] _RimEnvironmental("Environmental", Float) = 0.0
|
||||
|
||||
_EmissionMap ("Emission Map", 2D) = "white" {}
|
||||
_EmissionColor ("Emission Color", Color) = (0,0,0)
|
||||
_EmissionStrength ("Strength", Range(0, 2)) = 1
|
||||
[Enum(UV0, 0, UV1, 1)] _EmissionUV ("UV Map", Int) = 0
|
||||
|
||||
_OcclusionMap ("Occlusion Map", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _OcclusionMapChannel ("Color Channel", Int) = 1
|
||||
_OcclusionStrength ("Occlusion Strength", Range(0,1)) = 1
|
||||
|
||||
[Enum(AlphaBlended, 0, Additive, 1, Multiply, 2, MultiplyX2, 3)] _DetailMode ("Detail Mode", Int) = 0
|
||||
_DetailMask ("Detail Mask", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _DetailMaskChannel ("Color Channel", Int) = 3
|
||||
_DetailAlbedoMap ("Detail Texture", 2D) = "black" {}
|
||||
_DetailNormalMap ("Detail Normal Map", 2D) = "bump" {}
|
||||
_DetailNormalMapScale ("Detail Normal Scale", Float) = 1.0
|
||||
[Enum(UV0, 0, UV1, 1)] _DetailUV ("UV Map", Int) = 0
|
||||
|
||||
_HueShift ("Albedo Hue Shift", Range(0,6.283185)) = 0
|
||||
_DetailHueShift ("Detail Hue Shift", Range(0,6.283185)) = 0
|
||||
_EmissionHueShift ("Emission Hue Shift", Range(0,6.283185)) = 0
|
||||
_HueShiftMask ("Hue Shift Mask", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _HueShiftMaskChannel ("Color Channel", Int) = 1
|
||||
|
||||
_ColorMask ("Color Mask", 2D) = "black" {}
|
||||
_ColorMaskColor1("Color 1", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength1("Color 1 Emission", Range(0,2)) = 0
|
||||
_ColorMaskColor2("Color 2", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength2("Color 2 Emission", Range(0,2)) = 0
|
||||
_ColorMaskColor3("Color 3", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength3("Color 3 Emission", Range(0,2)) = 0
|
||||
_ColorMaskColor4("Color 4", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength4("Color 4 Emission", Range(0,2)) = 0
|
||||
|
||||
[Enum(Multiply, 0, Additive, 1)] _ColorMaskBlendMode("Color Mask Blend Mode", Int) = 0
|
||||
|
||||
//[Enum(UnityEngine.Rendering.BlendMode)]_SrcBlend ("__src", int) = 1
|
||||
//[Enum(UnityEngine.Rendering.BlendMode)]_DstBlend ("__dst", int) = 0
|
||||
//[Enum(Off,0,On,1)]_ZWrite ("__zw", int) = 1
|
||||
//_AlphaToMask ("Alpha To Mask", Int) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Cull [_Culling]
|
||||
//AlphaToMask [_AlphaToMask]
|
||||
AlphaToMask Off
|
||||
|
||||
Tags { "VRCFallback" = "toonstandard" "RenderType" = "Opaque" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
|
||||
//Blend [_SrcBlend] [_DstBlend]
|
||||
Blend One Zero
|
||||
//ZWrite [_ZWrite]
|
||||
ZWrite On
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_fog
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma multi_compile _ VERTEXLIGHT_ON
|
||||
//#pragma shader_feature_local_fragment _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
//#pragma multi_compile _ VRCHAT_ATLASING_ENABLED
|
||||
|
||||
#pragma shader_feature_local_fragment _ USE_SPECULAR
|
||||
#pragma shader_feature_local_fragment _ USE_MATCAP
|
||||
#pragma shader_feature_local_fragment _ USE_DETAIL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_NORMAL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_OCCLUSION_MAP
|
||||
#pragma dynamic_branch_local_fragment _ USE_RIMLIGHT
|
||||
#pragma dynamic_branch_local_fragment _ USE_HUE_SHIFT
|
||||
#pragma dynamic_branch_local_fragment _ USE_COLOR_MASK
|
||||
|
||||
// this one is practically free in terms of performance, so save some variants by always enabling it for now
|
||||
#define USE_EMISSION_MAP
|
||||
|
||||
// disable variants that are not needed, including realtime shadows (not supported)
|
||||
#pragma skip_variants LIGHTMAP_ON DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED STEREO_CUBEMAP_RENDER_ON
|
||||
#pragma skip_variants SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING
|
||||
|
||||
#ifndef UNITY_PASS_FORWARDBASE
|
||||
#define UNITY_PASS_FORWARDBASE
|
||||
#endif
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "./CG/VRCAtlasingShim.cginc"
|
||||
#include "./CG/DataStructs.cginc"
|
||||
#include "./CG/Definitions.cginc"
|
||||
#include "./CG/Helpers.cginc"
|
||||
#include "./CG/Lighting.cginc"
|
||||
#include "./CG/VertexFragment.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "FWDADD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
|
||||
//Blend [_SrcBlend] One
|
||||
Blend One One
|
||||
ZWrite Off
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_fog
|
||||
#pragma multi_compile_fwdadd_fullshadow
|
||||
//#pragma shader_feature_local_fragment _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
//#pragma multi_compile _ VRCHAT_ATLASING_ENABLED
|
||||
|
||||
#pragma shader_feature_local_fragment _ USE_SPECULAR
|
||||
#pragma shader_feature_local_fragment _ USE_MATCAP
|
||||
#pragma shader_feature_local_fragment _ USE_DETAIL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_NORMAL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_OCCLUSION_MAP
|
||||
#pragma dynamic_branch_local_fragment _ USE_RIMLIGHT
|
||||
#pragma dynamic_branch_local_fragment _ USE_HUE_SHIFT
|
||||
#pragma dynamic_branch_local_fragment _ USE_COLOR_MASK
|
||||
|
||||
// disable variants that are not needed, including realtime shadows (not supported)
|
||||
#pragma skip_variants LIGHTMAP_ON DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED STEREO_CUBEMAP_RENDER_ON
|
||||
#pragma skip_variants SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING
|
||||
|
||||
#ifndef UNITY_PASS_FORWARDADD
|
||||
#define UNITY_PASS_FORWARDADD
|
||||
#endif
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "./CG/VRCAtlasingShim.cginc"
|
||||
#include "./CG/DataStructs.cginc"
|
||||
#include "./CG/Definitions.cginc"
|
||||
#include "./CG/Helpers.cginc"
|
||||
#include "./CG/Lighting.cginc"
|
||||
#include "./CG/VertexFragment.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "SHADOWCASTER"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_shadowcaster
|
||||
//#pragma shader_feature_local_fragment _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
//#pragma multi_compile _ VRCHAT_ATLASING_ENABLED
|
||||
|
||||
#ifndef UNITY_PASS_SHADOWCASTER
|
||||
#define UNITY_PASS_SHADOWCASTER
|
||||
#endif
|
||||
|
||||
// disable variants that are not needed, including realtime shadows (not supported)
|
||||
#pragma skip_variants LIGHTMAP_ON DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED STEREO_CUBEMAP_RENDER_ON
|
||||
#pragma skip_variants SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING
|
||||
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "./CG/VRCAtlasingShim.cginc"
|
||||
#include "./CG/DataStructs.cginc"
|
||||
#include "./CG/Definitions.cginc"
|
||||
#include "./CG/Helpers.cginc"
|
||||
#include "./CG/Lighting.cginc"
|
||||
#include "./CG/VertexFragment.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
Fallback "VRChat/Mobile/Diffuse"
|
||||
CustomEditor "VRC.ToonStandard.ToonStandardShaderEditor"
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e765db0afa7ecfc44ade2e4e2491f65a
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures:
|
||||
- _MainTex: {instanceID: 0}
|
||||
- _Ramp: {fileID: 2800000, guid: 636cf1b5dfca6f54b94ca3d2ff8216c9, type: 3}
|
||||
- _BumpMap: {instanceID: 0}
|
||||
- _MetallicMap: {instanceID: 0}
|
||||
- _GlossMap: {instanceID: 0}
|
||||
- _Matcap: {instanceID: 0}
|
||||
- _MatcapMask: {instanceID: 0}
|
||||
- _EmissionMap: {instanceID: 0}
|
||||
- _OcclusionMap: {instanceID: 0}
|
||||
- _DetailMask: {instanceID: 0}
|
||||
- _DetailAlbedoMap: {instanceID: 0}
|
||||
- _DetailNormalMap: {instanceID: 0}
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,286 @@
|
||||
// A fairly feature-full shader for toon-style shading in VRChat. Outline variant is PC-only, but placed in `Mobile` folder for consistency.
|
||||
Shader "VRChat/Mobile/Toon Standard (Outline)"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
[Enum(Off, 0, Front, 1, Back, 2)] _Culling ("Culling", Int) = 2
|
||||
//[Enum(Opaque, 0)] _BlendMode("Blend Mode", Int) = 0
|
||||
//[Enum(Opaque, 0, Cutout, 1, Cutout Plus, 2, Transparent, 3, Fade, 4)] _BlendMode("Blend Mode", Int) = 0
|
||||
|
||||
_Color ("Main Color", Color) = (1,1,1,1)
|
||||
_MainTex ("Main Texture", 2D) = "white" {}
|
||||
//_Cutoff ("Alpha Cutoff", Range(0,1)) = 0.5
|
||||
[ToggleUI] _VertexColor ("Apply Vertex Color", Float) = 0.0
|
||||
|
||||
_Ramp ("Shadow Ramp", 2D) = "white" {}
|
||||
_ShadowBoost ("Shadow Boost", Range(0,1)) = 0.0
|
||||
_ShadowAlbedo ("Shadow Tint", Range(0,1)) = 0.5
|
||||
[PowerSlider(2)] _MinBrightness ("Min Brightness", Range(0,0.1)) = 0.0
|
||||
[ToggleUI] _LimitBrightness ("Limit Brightness", Float) = 1.0
|
||||
|
||||
[Normal] _BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
_BumpScale ("Normal Scale", Float) = 1.0
|
||||
|
||||
_MetallicMap ("Metallic Map", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _MetallicMapChannel ("Color Channel", Int) = 0
|
||||
_MetallicStrength ("Metallic Strength", Range(0,1)) = 0
|
||||
_GlossMap ("Gloss Map", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _GlossMapChannel ("Color Channel", Int) = 3
|
||||
_GlossStrength ("Gloss Strength", Range(0,1)) = 0.5
|
||||
_Reflectance ("Reflectance", Range(0,1)) = 0.5
|
||||
_SpecularSharpness("Sharpness", Range(0,1)) = 0
|
||||
|
||||
_Matcap ("Matcap", 2D) = "white" {}
|
||||
_MatcapMask ("Matcap Mask", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _MatcapMaskChannel ("Color Channel", Int) = 0
|
||||
[Enum(Additive, 0, Multiplicative, 1)] _MatcapType ("Matcap Type", Int) = 0
|
||||
_MatcapStrength ("Matcap Strength", Range(0,1)) = 1.0
|
||||
|
||||
_RimColor("Color", Color) = (1,1,1,1)
|
||||
_RimAlbedoTint("Albedo Tint", Range(0,1)) = 0.0
|
||||
_RimIntensity("Intensity", Range(0,1)) = 0.5
|
||||
_RimRange("Range", Range(0,1)) = 0.3
|
||||
_RimSharpness("Softness", Range(0,1)) = 0.1
|
||||
[ToggleUI] _RimEnvironmental("Environmental", Float) = 0.0
|
||||
|
||||
_EmissionMap ("Emission Map", 2D) = "white" {}
|
||||
_EmissionColor ("Emission Color", Color) = (0,0,0)
|
||||
_EmissionStrength ("Strength", Range(0, 2)) = 1
|
||||
[Enum(UV0, 0, UV1, 1)] _EmissionUV ("UV Map", Int) = 0
|
||||
|
||||
_OcclusionMap ("Occlusion Map", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _OcclusionMapChannel ("Color Channel", Int) = 1
|
||||
_OcclusionStrength ("Occlusion Strength", Range(0,1)) = 1
|
||||
|
||||
[Enum(AlphaBlended, 0, Additive, 1, Multiply, 2, MultiplyX2, 3)] _DetailMode ("Detail Mode", Int) = 0
|
||||
_DetailMask ("Detail Mask", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _DetailMaskChannel ("Color Channel", Int) = 3
|
||||
_DetailAlbedoMap ("Detail Texture", 2D) = "black" {}
|
||||
_DetailNormalMap ("Detail Normal Map", 2D) = "bump" {}
|
||||
_DetailNormalMapScale ("Detail Normal Scale", Float) = 1.0
|
||||
[Enum(UV0, 0, UV1, 1)] _DetailUV ("UV Map", Int) = 0
|
||||
|
||||
_HueShift ("Albedo Hue Shift", Range(0,6.283185)) = 0
|
||||
_DetailHueShift ("Detail Hue Shift", Range(0,6.283185)) = 0
|
||||
_EmissionHueShift ("Emission Hue Shift", Range(0,6.283185)) = 0
|
||||
_HueShiftMask ("Hue Shift Mask", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _HueShiftMaskChannel ("Color Channel", Int) = 1
|
||||
|
||||
_OutlineMask ("Thickness", 2D) = "white" {}
|
||||
[Enum(Red, 0, Green, 1, Blue, 2, Alpha, 3)] _OutlineMaskChannel ("Color Channel", Int) = 0
|
||||
[PowerSlider(2)] _OutlineThickness ("Thickness Multiplier", Range(0, 0.5)) = 0.05
|
||||
_OutlineColor ("Color", Color) = (0,0,0,1)
|
||||
_OutlineFromAlbedo ("Color From Albedo", Range(0,1)) = 0.0
|
||||
|
||||
_ColorMask ("Color Mask", 2D) = "black" {}
|
||||
_ColorMaskColor1("Color 1", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength1("Color 1 Emission", Range(0,2)) = 0
|
||||
_ColorMaskColor2("Color 2", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength2("Color 2 Emission", Range(0,2)) = 0
|
||||
_ColorMaskColor3("Color 3", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength3("Color 3 Emission", Range(0,2)) = 0
|
||||
_ColorMaskColor4("Color 4", Color) = (1,1,1,1)
|
||||
_ColorMaskEmissionStrength4("Color 4 Emission", Range(0,2)) = 0
|
||||
|
||||
[Enum(Multiply, 0, Additive, 1)] _ColorMaskBlendMode("Color Mask Blend Mode", Int) = 0
|
||||
|
||||
//[Enum(UnityEngine.Rendering.BlendMode)]_SrcBlend ("__src", int) = 1
|
||||
//[Enum(UnityEngine.Rendering.BlendMode)]_DstBlend ("__dst", int) = 0
|
||||
//[Enum(Off,0,On,1)]_ZWrite ("__zw", int) = 1
|
||||
//_AlphaToMask ("Alpha To Mask", Int) = 0
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Cull [_Culling]
|
||||
//AlphaToMask [_AlphaToMask]
|
||||
AlphaToMask Off
|
||||
|
||||
Tags { "VRCFallback" = "toonstandard" "RenderType" = "Opaque" }
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
|
||||
//Blend [_SrcBlend] [_DstBlend]
|
||||
Blend One Zero
|
||||
//ZWrite [_ZWrite]
|
||||
ZWrite On
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_fog
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma multi_compile _ VERTEXLIGHT_ON
|
||||
//#pragma shader_feature_local_fragment _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
//#pragma multi_compile _ VRCHAT_ATLASING_ENABLED
|
||||
|
||||
#pragma shader_feature_local_fragment _ USE_SPECULAR
|
||||
#pragma shader_feature_local_fragment _ USE_MATCAP
|
||||
#pragma shader_feature_local_fragment _ USE_DETAIL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_NORMAL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_OCCLUSION_MAP
|
||||
#pragma dynamic_branch_local_fragment _ USE_RIMLIGHT
|
||||
#pragma dynamic_branch_local_fragment _ USE_HUE_SHIFT
|
||||
#pragma dynamic_branch_local_fragment _ USE_COLOR_MASK
|
||||
|
||||
// this one is practically free in terms of performance, so save some variants by always enabling it for now
|
||||
#define USE_EMISSION_MAP
|
||||
|
||||
// disable variants that are not needed, including realtime shadows (not supported)
|
||||
#pragma skip_variants LIGHTMAP_ON DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED STEREO_CUBEMAP_RENDER_ON
|
||||
#pragma skip_variants SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING
|
||||
|
||||
#ifndef UNITY_PASS_FORWARDBASE
|
||||
#define UNITY_PASS_FORWARDBASE
|
||||
#endif
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "./CG/VRCAtlasingShim.cginc"
|
||||
#include "./CG/DataStructs.cginc"
|
||||
#include "./CG/Definitions.cginc"
|
||||
#include "./CG/Helpers.cginc"
|
||||
#include "./CG/Lighting.cginc"
|
||||
#include "./CG/VertexFragment.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD_OUTLINE"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
|
||||
Blend One Zero
|
||||
ZWrite On
|
||||
|
||||
Cull Front
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert_outline
|
||||
#pragma fragment frag_outline
|
||||
#pragma multi_compile_fog
|
||||
#pragma multi_compile_fwdbase
|
||||
#pragma multi_compile _ VERTEXLIGHT_ON
|
||||
//#pragma multi_compile _ VRCHAT_ATLASING_ENABLED
|
||||
|
||||
// disable variants that are not needed, including realtime shadows (not supported)
|
||||
#pragma skip_variants LIGHTMAP_ON DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED STEREO_CUBEMAP_RENDER_ON
|
||||
#pragma skip_variants SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING
|
||||
|
||||
#define VRCHAT_PASS_OUTLINE
|
||||
#ifndef UNITY_PASS_FORWARDBASE
|
||||
#define UNITY_PASS_FORWARDBASE
|
||||
#endif
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "./CG/VRCAtlasingShim.cginc"
|
||||
#include "./CG/DataStructs.cginc"
|
||||
#include "./CG/Definitions.cginc"
|
||||
#include "./CG/Helpers.cginc"
|
||||
#include "./CG/Outlines.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "FWDADD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
|
||||
//Blend [_SrcBlend] One
|
||||
Blend One One
|
||||
ZWrite Off
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_fog
|
||||
#pragma multi_compile_fwdadd_fullshadow
|
||||
//#pragma shader_feature_local_fragment _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
//#pragma multi_compile _ VRCHAT_ATLASING_ENABLED
|
||||
|
||||
#pragma shader_feature_local_fragment _ USE_SPECULAR
|
||||
#pragma shader_feature_local_fragment _ USE_MATCAP
|
||||
#pragma shader_feature_local_fragment _ USE_DETAIL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_NORMAL_MAPS
|
||||
#pragma shader_feature_local_fragment _ USE_OCCLUSION_MAP
|
||||
#pragma dynamic_branch_local_fragment _ USE_RIMLIGHT
|
||||
#pragma dynamic_branch_local_fragment _ USE_HUE_SHIFT
|
||||
#pragma dynamic_branch_local_fragment _ USE_COLOR_MASK
|
||||
|
||||
// disable variants that are not needed, including realtime shadows (not supported)
|
||||
#pragma skip_variants LIGHTMAP_ON DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED STEREO_CUBEMAP_RENDER_ON
|
||||
#pragma skip_variants SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING
|
||||
|
||||
#ifndef UNITY_PASS_FORWARDADD
|
||||
#define UNITY_PASS_FORWARDADD
|
||||
#endif
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "./CG/VRCAtlasingShim.cginc"
|
||||
#include "./CG/DataStructs.cginc"
|
||||
#include "./CG/Definitions.cginc"
|
||||
#include "./CG/Helpers.cginc"
|
||||
#include "./CG/Lighting.cginc"
|
||||
#include "./CG/VertexFragment.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "SHADOWCASTER"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
ZWrite On
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma target 3.0
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma multi_compile_shadowcaster
|
||||
//#pragma shader_feature_local_fragment _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON
|
||||
//#pragma multi_compile _ VRCHAT_ATLASING_ENABLED
|
||||
|
||||
#ifndef UNITY_PASS_SHADOWCASTER
|
||||
#define UNITY_PASS_SHADOWCASTER
|
||||
#endif
|
||||
|
||||
// disable variants that are not needed, including realtime shadows (not supported)
|
||||
#pragma skip_variants LIGHTMAP_ON DYNAMICLIGHTMAP_ON DIRLIGHTMAP_COMBINED STEREO_CUBEMAP_RENDER_ON
|
||||
#pragma skip_variants SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING
|
||||
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
#include "UnityPBSLighting.cginc"
|
||||
#include "AutoLight.cginc"
|
||||
#include "Lighting.cginc"
|
||||
#include "./CG/VRCAtlasingShim.cginc"
|
||||
#include "./CG/DataStructs.cginc"
|
||||
#include "./CG/Definitions.cginc"
|
||||
#include "./CG/Helpers.cginc"
|
||||
#include "./CG/Lighting.cginc"
|
||||
#include "./CG/VertexFragment.cginc"
|
||||
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
Fallback "VRChat/Mobile/Diffuse"
|
||||
CustomEditor "VRC.ToonStandard.ToonStandardShaderEditor"
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 051a0ed2f2aedd741aa8186ae92f97e0
|
||||
ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures:
|
||||
- _MainTex: {instanceID: 0}
|
||||
- _Ramp: {fileID: 2800000, guid: 636cf1b5dfca6f54b94ca3d2ff8216c9, type: 3}
|
||||
- _BumpMap: {instanceID: 0}
|
||||
- _MetallicMap: {instanceID: 0}
|
||||
- _GlossMap: {instanceID: 0}
|
||||
- _Matcap: {instanceID: 0}
|
||||
- _MatcapMask: {instanceID: 0}
|
||||
- _EmissionMap: {instanceID: 0}
|
||||
- _OcclusionMap: {instanceID: 0}
|
||||
- _DetailMask: {instanceID: 0}
|
||||
- _DetailAlbedoMap: {instanceID: 0}
|
||||
- _DetailNormalMap: {instanceID: 0}
|
||||
- _HueShiftMask: {instanceID: 0}
|
||||
- _OutlineMask: {instanceID: 0}
|
||||
nonModifiableTextures: []
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||