diff options
Diffstat (limited to 'VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles')
79 files changed, 6070 insertions, 0 deletions
diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders.meta new file mode 100644 index 00000000..418f945f --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5b46cd018e07ddd4dbffd6b162ff9ec6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes.meta new file mode 100644 index 00000000..934eb57a --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8b63d42191c5daa458a8cae16169460d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiClearCoat.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiClearCoat.cginc new file mode 100644 index 00000000..74814754 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiClearCoat.cginc @@ -0,0 +1,78 @@ +#ifndef POI_CLEARCOAT + #define POI_CLEARCOAT + + samplerCUBE _ClearCoatCubeMap; + float _ClearCoatSampleWorld; + sampler2D _ClearCoatMask; float4 _ClearCoatMask_ST; + sampler2D _ClearCoatSmoothnessMask; float4 _ClearCoatSmoothnessMask_ST; + float _ClearCoatInvertSmoothness; + float _ClearCoat; + float _ClearCoatSmoothness; + float3 _ClearCoatTint; + uint _ClearCoatNormalToUse; + + float lighty_clear_boy_uwu_var; + half3 calculateClearCoatRelfection() + { + float _Smoothness_map_var = (tex2D(_ClearCoatSmoothnessMask, TRANSFORM_TEX(poiMesh.uv[0], _ClearCoatSmoothnessMask))); + if (_ClearCoatInvertSmoothness == 1) + { + _Smoothness_map_var = 1 - _Smoothness_map_var; + } + _Smoothness_map_var *= _ClearCoatSmoothness; + half roughness = 1 - _Smoothness_map_var; + roughness *= 1.7 - 0.7 * roughness; + float3 reflectedDir = _ClearCoatNormalToUse == 0 ? poiCam.vertexReflectionDir : poiCam.reflectionDir; + + float4 envSample = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + + float interpolator = unity_SpecCube0_BoxMin.w; + half3 reflection = 0; + UNITY_BRANCH + if(interpolator < 0.99999) + { + //Probe 1 + float4 reflectionData0 = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + float3 reflectionColor0 = DecodeHDR(reflectionData0, unity_SpecCube0_HDR); + + //Probe 2 + float4 reflectionData1 = UNITY_SAMPLE_TEXCUBE_SAMPLER_LOD(unity_SpecCube1, unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + float3 reflectionColor1 = DecodeHDR(reflectionData1, unity_SpecCube1_HDR); + + reflection = lerp(reflectionColor1, reflectionColor0, interpolator); + } + else + { + float4 reflectionData = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + reflection = DecodeHDR(reflectionData, unity_SpecCube0_HDR); + } + + bool no_probe = unity_SpecCube0_HDR.a == 0 && envSample.a == 0; + lighty_clear_boy_uwu_var = 0; + if (no_probe || _ClearCoatSampleWorld) + { + lighty_clear_boy_uwu_var = 1; + reflection = texCUBElod(_ClearCoatCubeMap, float4(reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS)); + } + + half3 finalreflection = reflection.rgb * _ClearCoatTint; + + return finalreflection; + } + + void calculateAndApplyClearCoat(inout float4 finalColor) + { + half clearCoatMap = tex2D(_ClearCoatMask, TRANSFORM_TEX(poiMesh.uv[0], _ClearCoatMask)); + half3 reflectionColor = calculateClearCoatRelfection(); + + float NormalDotView = abs(dot(_ClearCoat,_ClearCoatNormalToUse == 0 ? poiLight.vNDotV : poiLight.nDotV).r); + #ifdef POI_LIGHTING + finalColor.rgb = lerp(finalColor.rgb, reflectionColor * lerp(1, poiLight.finalLighting, lighty_clear_boy_uwu_var), clearCoatMap * _ClearCoat * clamp(FresnelTerm(_ClearCoat, NormalDotView),0,1)); + //finalColor.rgb += reflectionColor; + //finalColor.rgb = finalColor.rgb * (1- (reflectionColor.r + reflectionColor.g + reflectionColor.b)/3) + reflectionColor * clearCoatMap * lerp(1, poiLight.finalLighting, lighty_clear_boy_uwu_var); + #else + lerp(finalColor.rgb, reflectionColor, clearCoatMap * _ClearCoat * clamp(FresnelTerm(_ClearCoat, NormalDotView),0,1)); + #endif + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiClearCoat.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiClearCoat.cginc.meta new file mode 100644 index 00000000..78c227c2 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiClearCoat.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd79ef0bdcffc3c408f6526743865acf +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiData.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiData.cginc new file mode 100644 index 00000000..dade3f96 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiData.cginc @@ -0,0 +1,104 @@ +#ifndef POI_DATA + #define POI_DATA + + float FadeShadows(float attenuation, float3 worldPosition) + { + float viewZ = dot(_WorldSpaceCameraPos - worldPosition, UNITY_MATRIX_V[2].xyz); + float shadowFadeDistance = UnityComputeShadowFadeDistance(worldPosition, viewZ); + float shadowFade = UnityComputeShadowFade(shadowFadeDistance); + attenuation = saturate(attenuation + shadowFade); + return attenuation; + } + + void calculateAttenuation(v2f i) + { + UNITY_LIGHT_ATTENUATION(attenuation, i, i.worldPos.xyz) + poiLight.attenuation = FadeShadows(attenuation, i.worldPos.xyz); + } + + void calculateLightDirection(v2f i) + { + #ifdef FORWARD_BASE_PASS + poiLight.direction = normalize(_WorldSpaceLightPos0 + unity_SHAr.xyz + unity_SHAg.xyz + unity_SHAb.xyz); + #else + #if defined(POINT) || defined(SPOT) + poiLight.direction = normalize(_WorldSpaceLightPos0.xyz - i.worldPos); + #endif + #endif + } + + void calculateLightColor() + { + #ifdef FORWARD_BASE_PASS + //poiLight.color = saturate(_LightColor0.rgb) + saturate(ShadeSH9(normalize(unity_SHAr + unity_SHAg + unity_SHAb))); + float3 magic = saturate(ShadeSH9(normalize(unity_SHAr + unity_SHAg + unity_SHAb))); + float3 normalLight = saturate(_LightColor0.rgb); + poiLight.color = saturate(magic + normalLight); + #else + #if defined(POINT) || defined(SPOT) + poiLight.color = _LightColor0.rgb; + #endif + #endif + } + + float3 CreateBinormal(float3 normal, float3 tangent, float binormalSign) + { + return cross(normal, tangent.xyz) * (binormalSign * unity_WorldTransformParams.w); + } + + void InitializeMeshData(inout v2f i) + { + poiMesh.vertexNormal = i.normal; + poiMesh.bitangent = i.bitangent; + poiMesh.tangent = i.tangent; + poiMesh.worldPos = i.worldPos; + poiMesh.localPos = i.localPos; + poiMesh.uv[0] = i.uv0; + poiMesh.uv[1] = i.uv1; + poiMesh.uv[2] = i.uv2; + poiMesh.uv[3] = i.uv3; + poiMesh.modelPos = i.modelPos; + } + + void initializeCamera(v2f i) + { + poiCam.viewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + poiCam.forwardDir = getCameraForward(); + poiCam.worldPos = _WorldSpaceCameraPos; + poiCam.tangentViewDir = normalize(i.tangentViewDir); + poiCam.distanceToModel = distance(poiMesh.modelPos, poiCam.worldPos); + poiCam.distanceToVert = distance(poiMesh.worldPos, poiCam.worldPos); + } + + void calculateTangentData() + { + poiTData. tangentTransform = float3x3(poiMesh.tangent, poiMesh.bitangent, poiMesh.vertexNormal); + poiTData.tangentToWorld = transpose(float3x3(poiMesh.tangent, poiMesh.bitangent, poiMesh.vertexNormal)); + } + + void InitData(inout v2f i) + { + UNITY_SETUP_INSTANCE_ID(i); + + calculateAttenuation(i); + calculateLightColor(); + #if defined(VERTEXLIGHT_ON) + poiLight.vertexLightColor = i.vertexLightColor; + #endif + calculateLightDirection(i); + + InitializeMeshData(i); + initializeCamera(i); + calculateTangentData(); + + poiLight.halfDir = Unity_SafeNormalize(poiLight.direction + poiCam.viewDir); + } + + void CalculateReflectionData() + { + #if defined(_METALLICGLOSSMAP) || defined(_COLORCOLOR_ON) + poiCam.reflectionDir = reflect(-poiCam.viewDir, poiMesh.fragmentNormal); + poiCam.vertexReflectionDir = reflect(-poiCam.viewDir, poiMesh.vertexNormal); + #endif + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiData.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiData.cginc.meta new file mode 100644 index 00000000..fcef5adb --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiData.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a045b25b0c6f7a14d92617f3adb89f8a +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDebug.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDebug.cginc new file mode 100644 index 00000000..49f32de7 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDebug.cginc @@ -0,0 +1,123 @@ +#ifndef POI_DEBUG + #define POI_DEBUG + + float _DebugDisplayDebug; + uint _DebugMeshData; + uint _DebugLightingData; + uint _DebugSpecularData; + uint _DebugCameraData; + + void displayDebugInfo(inout float4 finalColor) + { + UNITY_BRANCH + if (_DebugDisplayDebug != 0) + { + //Mesh Data + if (_DebugMeshData == 1) + { + finalColor.rgb = poiMesh.vertexNormal; + return; + } + else if(_DebugMeshData == 2) + { + finalColor.rgb = poiMesh.fragmentNormal; + return; + } + else if(_DebugMeshData == 3) + { + finalColor.rgb = poiMesh.tangent; + return; + } + else if(_DebugMeshData == 4) + { + finalColor.rgb = poiMesh.bitangent; + return; + } + + #ifdef POI_LIGHTING + // Lighting + if (_DebugLightingData == 1) + { + finalColor.rgb = poiLight.attenuation; + return; + } + else if(_DebugLightingData == 2) + { + finalColor.rgb = poiLight.directLighting; + return; + } + else if(_DebugLightingData == 3) + { + finalColor.rgb = poiLight.indirectLighting; + return; + } + else if(_DebugLightingData == 4) + { + finalColor.rgb = poiLight.lightMap; + return; + } + else if(_DebugLightingData == 5) + { + finalColor.rgb = poiLight.rampedLightMap; + return; + } + else if(_DebugLightingData == 6) + { + finalColor.rgb = poiLight.finalLighting; + return; + } + else if(_DebugLightingData == 7) + { + finalColor.rgb = poiLight.nDotL; + return; + } + #endif + + #ifdef POI_SPECULAR + //specular + if (_DebugSpecularData == 1) + { + finalColor.rgb = finalSpecular; + return; + } + else if(_DebugSpecularData == 2) + { + finalColor.rgb = tangentDirectionMap; + return; + } + else if(_DebugSpecularData == 3) + { + finalColor.rgb = shiftTexture; + return; + } + #endif + + if(_DebugCameraData == 1) + { + finalColor.rgb = poiCam.viewDir; + return; + } + else if(_DebugCameraData == 2) + { + finalColor.rgb = poiCam.tangentViewDir; + return; + } + else if(_DebugCameraData == 3) + { + finalColor.rgb = poiCam.forwardDir; + return; + } + else if(_DebugCameraData == 4) + { + finalColor.rgb = poiCam.worldPos; + return; + } + else if(_DebugCameraData == 5) + { + finalColor.rgb = poiCam.viewDotNormal; + return; + } + } + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDebug.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDebug.cginc.meta new file mode 100644 index 00000000..edd99708 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDebug.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c06042e6fcc80524184098c8c337d001 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDissolve.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDissolve.cginc new file mode 100644 index 00000000..3480ac5b --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDissolve.cginc @@ -0,0 +1,200 @@ +#ifndef POI_DISSOLVE + #define POI_DISSOLVE + + uint _DissolveType; + float _DissolveEdgeWidth; + float4 _DissolveEdgeColor; + sampler2D _DissolveEdgeGradient; float4 _DissolveEdgeGradient_ST; + float _DissolveEdgeEmission; + UNITY_DECLARE_TEX2D_NOSAMPLER(_DissolveMask); float4 _DissolveMask_ST; + float4 _DissolveTextureColor; + UNITY_DECLARE_TEX2D_NOSAMPLER(_DissolveToTexture); float4 _DissolveToTexture_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_DissolveNoiseTexture); float4 _DissolveNoiseTexture_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_DissolveDetailNoise); float4 _DissolveDetailNoise_ST; + float4 _DissolvePan; + float _DissolveAlpha; + float _ContinuousDissolve; + float _DissolveDetailStrength; + float _DissolveEdgeHardness; + float _DissolveInvertNoise; + float _DissolveInvertDetailNoise; + float _DissolveToEmissionStrength; + float4 _DissolveToPanning; + // Point to Point + float _DissolveP2PWorldLocal; + float _DissolveP2PEdgeLength; + float4 _DissolveStartPoint; + float4 _DissolveEndPoint; + + // World Dissolve + uint _DissolveWorldShape; + float4 _DissolveShapePosition; + float4 _DissolveShapeRotation; + float _DissolveShapeScale; + float _DissolveInvertShape; + float _DissolveShapeEdgeLength; + + float4 edgeColor; + float edgeAlpha; + float dissolveAlpha; + float4 dissolveToTexture; + //Globals + #ifndef POISHADOW + void calculateDissolve() + { + float dissolveMask = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _DissolveMask)).r; + dissolveToTexture = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveToTexture, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _DissolveToTexture) + _Time.y * _DissolveToPanning.xy) * _DissolveTextureColor; + float dissolveNoiseTexture = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveNoiseTexture, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _DissolveNoiseTexture) + _Time.y * _DissolvePan.xy); + float dissolveDetailNoise = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveDetailNoise, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _DissolveDetailNoise) + _Time.y * _DissolvePan.zw); + + if (_DissolveInvertNoise) + { + dissolveNoiseTexture = 1 - dissolveNoiseTexture; + } + if(_DissolveInvertDetailNoise) + { + dissolveDetailNoise = 1 - dissolveDetailNoise; + } + if(_ContinuousDissolve != 0) + { + _DissolveAlpha = sin(_Time.y * _ContinuousDissolve) * .5 + .5; + } + _DissolveAlpha *= dissolveMask; + dissolveAlpha = _DissolveAlpha; + edgeAlpha = 0; + + UNITY_BRANCH + if(_DissolveType == 1) // Basic + { + _DissolveAlpha = remap(_DissolveAlpha, 0, 1, -_DissolveEdgeWidth, 1); + dissolveAlpha = _DissolveAlpha; + //Adjust detail strength to avoid artifacts + _DissolveDetailStrength *= smoothstep(1, .99, _DissolveAlpha); + float noise = saturate(dissolveNoiseTexture - dissolveDetailNoise * _DissolveDetailStrength); + + noise = saturate(noise + 0.001); + //noise = remap(noise, 0, 1, _DissolveEdgeWidth, 1 - _DissolveEdgeWidth); + dissolveAlpha = dissolveAlpha >= noise; + edgeAlpha = remapClamped(noise, _DissolveAlpha + _DissolveEdgeWidth, _DissolveAlpha, 0, 1) * (1 - dissolveAlpha); + } + else if (_DissolveType == 2) // Point to Point + { + float3 direction; + float3 currentPos; + float distanceTo = 0; + direction = normalize(_DissolveEndPoint - _DissolveStartPoint); + currentPos = lerp(_DissolveStartPoint, _DissolveEndPoint, dissolveAlpha); + if (_DissolveP2PWorldLocal == 0) + { + distanceTo = dot(poiMesh.localPos - currentPos, direction) - dissolveDetailNoise * _DissolveDetailStrength; + edgeAlpha = smoothstep(_DissolveP2PEdgeLength, 0, distanceTo); + dissolveAlpha = step(distanceTo, 0); + edgeAlpha *= 1 - dissolveAlpha; + } + else + { + distanceTo = dot(poiMesh.worldPos - currentPos, direction) - dissolveDetailNoise * _DissolveDetailStrength; + edgeAlpha = smoothstep(_DissolveP2PEdgeLength, 0, distanceTo); + dissolveAlpha = step(distanceTo, 0); + edgeAlpha *= 1 - dissolveAlpha; + } + } + + mainTexture = lerp(mainTexture, dissolveToTexture, dissolveAlpha); + + if(_DissolveEdgeWidth) + { + edgeColor = tex2D(_DissolveEdgeGradient, TRANSFORM_TEX(float2(edgeAlpha, edgeAlpha), _DissolveEdgeGradient)) * _DissolveEdgeColor; + mainTexture.rgb = lerp(mainTexture.rgb, edgeColor.rgb, remapClamped(edgeAlpha, 0, 1 - _DissolveEdgeHardness, 0, 1)); + } + + + + + /* + UNITY_BRANCH + if (_Blend != 0) + { + float blendNoise = tex2D(_BlendNoiseTexture, TRANSFORM_TEX(uv, _BlendNoiseTexture)); + blendAlpha = _BlendAlpha; + if(_AutoBlend > 0) + { + blendAlpha = (clamp(sin(_Time.y * _AutoBlendSpeed / _AutoBlendDelay) * (_AutoBlendDelay + 1), -1, 1) + 1) / 2; + } + blendAlpha = lerp(saturate((blendNoise - 1) + blendAlpha * 2), step((1-blendAlpha) * 1.001, blendNoise), _Blend - 1); + + float4 blendCol = tex2D(_BlendTexture, TRANSFORM_TEX(uv, _BlendTexture)) * _BlendTextureColor; + diffuse = lerp(diffuse, blendCol, blendAlpha); + mainTexture.a = lerp(mainTexture.a, blendCol.a, blendAlpha); + } + */ + } + + void applyDissolveEmission(inout float4 finalColor) + { + finalColor += lerp(0, dissolveToTexture * _DissolveToEmissionStrength, dissolveAlpha) * albedo.a; + finalColor.rgb += lerp(0, edgeColor.rgb * _DissolveEdgeEmission, remapClamped(edgeAlpha, 0, 1 - _DissolveEdgeHardness, 0, 1)) * albedo.a; + } + + #endif + + float calculateShadowDissolveAlpha(float3 worldPos, float3 localPos, float2 uv) + { + float dissolveMask = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveMask, _MainTex, TRANSFORM_TEX(uv, _DissolveMask)).r; + dissolveToTexture = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveToTexture, _MainTex, TRANSFORM_TEX(uv, _DissolveToTexture) + _Time.y * _DissolveToPanning.xy) * _DissolveTextureColor; + float dissolveNoiseTexture = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveNoiseTexture, _MainTex, TRANSFORM_TEX(uv, _DissolveNoiseTexture) + _Time.y * _DissolvePan.xy); + float dissolveDetailNoise = UNITY_SAMPLE_TEX2D_SAMPLER(_DissolveDetailNoise, _MainTex, TRANSFORM_TEX(uv, _DissolveDetailNoise) + _Time.y * _DissolvePan.zw); + + if (_DissolveInvertNoise) + { + dissolveNoiseTexture = 1 - dissolveNoiseTexture; + } + if(_DissolveInvertDetailNoise) + { + dissolveDetailNoise = 1 - dissolveDetailNoise; + } + if(_ContinuousDissolve != 0) + { + _DissolveAlpha = sin(_Time.y * _ContinuousDissolve) * .5 + .5; + } + _DissolveAlpha *= dissolveMask; + dissolveAlpha = _DissolveAlpha; + edgeAlpha = 0; + + UNITY_BRANCH + if(_DissolveType == 1) // Basic + { + _DissolveAlpha = remap(_DissolveAlpha, 0, 1, -_DissolveEdgeWidth, 1); + dissolveAlpha = _DissolveAlpha; + //Adjust detail strength to avoid artifacts + _DissolveDetailStrength *= smoothstep(1, .99, _DissolveAlpha); + float noise = saturate(dissolveNoiseTexture - dissolveDetailNoise * _DissolveDetailStrength); + + noise = saturate(noise + 0.001); + //noise = remap(noise, 0, 1, _DissolveEdgeWidth, 1 - _DissolveEdgeWidth); + dissolveAlpha = dissolveAlpha >= noise; + edgeAlpha = remapClamped(noise, _DissolveAlpha + _DissolveEdgeWidth, _DissolveAlpha, 0, 1) * (1 - dissolveAlpha); + } + else if (_DissolveType == 2) // Point to Point + { + float3 direction; + float3 currentPos; + float distanceTo = 0; + direction = normalize(_DissolveEndPoint - _DissolveStartPoint); + currentPos = lerp(_DissolveStartPoint, _DissolveEndPoint, dissolveAlpha); + if (_DissolveP2PWorldLocal == 0) + { + distanceTo = dot(localPos - currentPos, direction) - dissolveDetailNoise * _DissolveDetailStrength; + dissolveAlpha = step(distanceTo, 0); + } + else + { + distanceTo = dot(worldPos - currentPos, direction) - dissolveDetailNoise * _DissolveDetailStrength; + dissolveAlpha = step(distanceTo, 0); + } + } + + return lerp(1, dissolveToTexture, dissolveAlpha).a; + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDissolve.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDissolve.cginc.meta new file mode 100644 index 00000000..d12d8fba --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDissolve.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf36262bf410e4b4ea5f93bbd85e81e2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDragNDropLighting.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDragNDropLighting.cginc new file mode 100644 index 00000000..3846f604 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDragNDropLighting.cginc @@ -0,0 +1,100 @@ +#ifndef DND_LIGHTING + #define DND_LIGHTING + + sampler2D _ToonRamp; + float _AdditiveSoftness; + float _AdditiveOffset; + float _ForceLightDirection; + float _ShadowStrength; + float _OutlineShadowStrength; + float _ShadowOffset; + float3 _LightDirection; + float _ForceShadowStrength; + float _CastedShadowSmoothing; + float _MinBrightness; + float _MaxBrightness; + float _IndirectContribution; + float _AttenuationMultiplier; + + UNITY_DECLARE_TEX2D_NOSAMPLER(_AOMap); float4 _AOMap_ST; + float _AOStrength; + + float3 ShadeSH9Indirect() + { + return ShadeSH9(half4(0.0, -1.0, 0.0, 1.0)); + } + + float3 ShadeSH9Direct() + { + return ShadeSH9(half4(0.0, 1.0, 0.0, 1.0)); + } + + float3 ShadeSH9Normal(float3 normalDirection) + { + return ShadeSH9(half4(normalDirection, 1.0)); + } + + half3 GetSHLength() + { + half3 x, x1; + x.r = length(unity_SHAr); + x.g = length(unity_SHAg); + x.b = length(unity_SHAb); + x1.r = length(unity_SHBr); + x1.g = length(unity_SHBg); + x1.b = length(unity_SHBb); + return x + x1; + } + + float FadeShadows(float attenuation, float3 worldPosition) + { + float viewZ = dot(_WorldSpaceCameraPos - worldPosition, UNITY_MATRIX_V[2].xyz); + float shadowFadeDistance = UnityComputeShadowFadeDistance(worldPosition, viewZ); + float shadowFade = UnityComputeShadowFade(shadowFadeDistance); + attenuation = saturate(attenuation + shadowFade); + return attenuation; + } + + float calculateAOMap(float AOMap, float AOStrength) + { + return lerp(1, AOMap, AOStrength); + } + + void calculateBasePassLighting(float3 normal, float2 uv) + { + poiLight.direction = _WorldSpaceLightPos0; + poiLight.nDotL = dot(normal, poiLight.direction); + float AOMap = 1; + #ifndef OUTLINE + AOMap = UNITY_SAMPLE_TEX2D_SAMPLER(_AOMap, _MainTex, TRANSFORM_TEX(uv, _AOMap)); + AOMap = calculateAOMap(AOMap, _AOStrength); + #endif + poiLight.finalLighting = saturate((GetSHLength() + poiLight.color) * AOMap); + } + + void calculateDNDLighting(v2f i) + { + #ifdef OUTLINE + _ShadowStrength = _OutlineShadowStrength; + #endif + UNITY_LIGHT_ATTENUATION(attenuation, i, i.worldPos.xyz) + poiLight.attenuation = FadeShadows(attenuation, i.worldPos.xyz); + poiLight.color = _LightColor0.rgb; + #ifdef FORWARD_BASE_PASS + calculateBasePassLighting(poiMesh.fragmentNormal, i.uv); + #else + #if defined(POINT) || defined(SPOT) + poiLight.position = _WorldSpaceLightPos0.xyz; + poiLight.direction = normalize(poiLight.position - i.worldPos); + poiLight.nDotL = dot(poiMesh.fragmentNormal, poiLight.direction); + poiLight.finalLighting = poiLight.color * poiLight.attenuation * smoothstep(.499, .5, .5 * poiLight.nDotL + .5); + #endif + #endif + } + + void applyDNDLighting(inout float4 finalColor) + { + finalColor.rgb *= poiLight.finalLighting; + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDragNDropLighting.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDragNDropLighting.cginc.meta new file mode 100644 index 00000000..18385131 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiDragNDropLighting.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b1c2ff5cc02c3dc428a5b629842d4d87 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiEmission.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiEmission.cginc new file mode 100644 index 00000000..c03f7a71 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiEmission.cginc @@ -0,0 +1,74 @@ +#ifndef POI_EMISSION + #define POI_EMISSION + + float4 _EmissionColor; + UNITY_DECLARE_TEX2D_NOSAMPLER(_EmissionMap); float4 _EmissionMap_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_EmissionMask); float4 _EmissionMask_ST; + float _EmissionStrength; + float _EnableEmission; + float4 _EmissiveScroll_Direction; + float4 _EmissionPan; + float _EmissiveScroll_Width; + float _EmissiveScroll_Velocity; + float _EmissiveScroll_Interval; + float _EmissiveBlink_Min; + float _EmissiveBlink_Max; + float _EmissiveBlink_Velocity; + float _ScrollingEmission; + float _EnableGITDEmission; + float _GITDEMinEmissionMultiplier; + float _GITDEMaxEmissionMultiplier; + float _GITDEMinLight; + float _GITDEMaxLight; + uint _GITDEWorldOrMesh; + uint _EmissionMapUV; + float4 emission = 0; + + void calculateEmission() + { + #ifdef POI_LIGHTING + UNITY_BRANCH + if (_EnableGITDEmission != 0) + { + float3 lightValue = _GITDEWorldOrMesh ? poiLight.finalLighting.rgb: poiLight.directLighting.rgb; + float gitdeAlpha = (clamp(poiMax(lightValue), _GITDEMinLight, _GITDEMaxLight) - _GITDEMinLight) / (_GITDEMaxLight - _GITDEMinLight); + _EmissionStrength *= lerp(_GITDEMinEmissionMultiplier, _GITDEMaxEmissionMultiplier, gitdeAlpha); + } + #endif + + float4 _Emissive_Tex_var = UNITY_SAMPLE_TEX2D_SAMPLER(_EmissionMap, _MainTex, TRANSFORM_TEX(poiMesh.uv[_EmissionMapUV], _EmissionMap) + _Time.y * _EmissionPan.xy); + emission = _Emissive_Tex_var * _EmissionColor * _EmissionStrength; + + // scrolling emission + if (_ScrollingEmission == 1) + { + float phase = dot(poiMesh.localPos, _EmissiveScroll_Direction); + phase -= _Time.y * _EmissiveScroll_Velocity; + phase /= _EmissiveScroll_Interval; + phase -= floor(phase); + float width = _EmissiveScroll_Width; + phase = (pow(phase, width) + pow(1 - phase, width * 4)) * 0.5; + emission *= phase; + } + + // blinking emission + float amplitude = (_EmissiveBlink_Max - _EmissiveBlink_Min) * 0.5f; + float base = _EmissiveBlink_Min + amplitude; + float emissiveBlink = sin(_Time.y * _EmissiveBlink_Velocity) * amplitude + base; + emission *= emissiveBlink; + + float _Emission_mask_var = UNITY_SAMPLE_TEX2D_SAMPLER(_EmissionMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[_EmissionMapUV], _EmissionMask) + _Time.x * _EmissionPan.zw); + + + + emission *= _Emission_mask_var; + } + void applyEmission(inout float4 finalColor) + { + #ifdef TRANSPARENT + finalColor.rgb += emission * albedo.a; + #else + finalColor.rgb += emission; + #endif + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiEmission.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiEmission.cginc.meta new file mode 100644 index 00000000..cb667c13 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiEmission.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3873d90815bcb9544bd9f7a82149bcb3 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFlipbook.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFlipbook.cginc new file mode 100644 index 00000000..763568dc --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFlipbook.cginc @@ -0,0 +1,70 @@ +#ifndef FLIPBOOK + #define FLIPBOOK + + UNITY_DECLARE_TEX2DARRAY(_FlipbookTexArray); float4 _FlipbookTexArray_ST; + float4 _FlipbookColor; + float _FlipbookFPS; + uint _FlipbookTotalFrames; + float4 _FlipbookScaleOffset; + float _FlipbookTiled; + int _FlipbookCurrentFrame; + float _FlipbookEmissionStrength; + float _FlipbookRotation; + float _EnableFlipbook; + uint _FlipbookUV; + // blending + float _FlipbookReplace; + float _FlipbookMultiply; + float _FlipbookAdd; + + // anim + uint _FlipbookMovementType; + float4 _FlipbookStartEndOffset; + float _FlipbookMovementSpeed; + + // Global + float4 flipBookPixel; + float4 flipBookPixelMultiply; + void calculateFlipbook() + { + _FlipbookScaleOffset.xy = 1 - _FlipbookScaleOffset.xy; + float2 uv = poiMesh.uv[_FlipbookUV]; + float theta = radians(_FlipbookRotation); + + float cs = cos(theta); + float sn = sin(theta); + float2 spriteCenter = _FlipbookScaleOffset.zw + .5; + uv = float2((uv.x - spriteCenter.x) * cs - (uv.y - spriteCenter.y) * sn + spriteCenter.x, (uv.x - spriteCenter.x) * sn + (uv.y - spriteCenter.y) * cs + spriteCenter.y); + + float2 newUV = remap(uv, float2(0, 0) + _FlipbookScaleOffset.xy / 2 + _FlipbookScaleOffset.zw, float2(1, 1) - _FlipbookScaleOffset.xy / 2 + _FlipbookScaleOffset.zw, float2(0, 0), float2(1, 1)); + + UNITY_BRANCH + if (_FlipbookTiled == 0) + { + if(max(newUV.x, newUV.y) > 1 || min(newUV.x, newUV.y) < 0) + { + flipBookPixel = 0; + flipBookPixelMultiply = 1; + return; + } + } + + uint currentFrame = floor(_FlipbookCurrentFrame) % _FlipbookTotalFrames; + if(_FlipbookCurrentFrame < 0) + { + currentFrame = (_Time.y / (1 / _FlipbookFPS)) % _FlipbookTotalFrames; + } + flipBookPixel = UNITY_SAMPLE_TEX2DARRAY(_FlipbookTexArray, float3(TRANSFORM_TEX(newUV, _FlipbookTexArray), currentFrame)); + flipBookPixelMultiply = flipBookPixel; + } + void applyFlipbook(inout float4 finalColor) + { + finalColor.rgb = lerp(finalColor, flipBookPixel.rgb * _FlipbookColor.rgb, flipBookPixel.a * _FlipbookColor.a * _FlipbookReplace); + finalColor.rgb = finalColor + flipBookPixel.rgb * _FlipbookColor.rgb * _FlipbookAdd; + finalColor.rgb = finalColor * lerp(1, flipBookPixelMultiply.rgb * _FlipbookColor.rgb, _FlipbookMultiply * flipBookPixelMultiply.a * _FlipbookColor.a); + } + void applyFlipbookEmission(inout float4 finalColor) + { + finalColor.rgb += lerp(0, flipBookPixel.rgb * _FlipbookColor.rgb * _FlipbookEmissionStrength, flipBookPixel.a * _FlipbookColor.a); + } +#endif diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFlipbook.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFlipbook.cginc.meta new file mode 100644 index 00000000..b2954626 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFlipbook.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc640e1037c35a549a2b3367efe4563e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFrag.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFrag.cginc new file mode 100644 index 00000000..02635c88 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFrag.cginc @@ -0,0 +1,196 @@ +#ifndef POIFRAG + #define POIFRAG + + float _ForceOpaque; + float4 _GlobalPanSpeed; + float _Clip; + float _MainEmissionStrength; + + float4 frag(v2f i, float facing: VFACE): SV_Target + { + + i.uv0 += _GlobalPanSpeed.xy * _Time.x; + //This has to be first because it modifies the UVs for the rest of the functions + + #ifdef POI_DATA + InitData(i); + #endif + + // This has to happen in init because it alters UV data globally + #ifdef POI_PARALLAX + calculateandApplyParallax(i); + #endif + + #ifdef POI_MAINTEXTURE + initTextureData(); + #endif + + #ifdef REFRACTION + calculateRefraction(i); + #endif + + #ifdef POI_LIGHTING + calculateLighting(); + #endif + + #if defined(POI_METAL) || defined(POI_CLEARCOAT) + CalculateReflectionData(); + #endif + + #ifdef POI_METAL + calculateReflections(); + #endif + + #ifdef POI_DATA + distanceFade(); + #endif + + #ifdef POI_RANDOM + albedo.a *= i.angleAlpha; + #endif + + clip(albedo.a - _Clip); + + #ifdef MATCAP + calculateMatcap(); + #endif + + #ifdef FLIPBOOK + calculateFlipbook(); + #endif + + #ifdef POI_LIGHTING + #ifdef SUBSURFACE + calculateSubsurfaceScattering(); + #endif + #endif + + #ifdef POI_RIM + calculateRimLighting(); + #endif + + #ifdef PANOSPHERE + calculatePanosphere(); + #endif + + #ifdef POI_EMISSION + calculateEmission(); + #endif + + finalColor = albedo; + + #ifdef REFRACTION + applyRefraction(finalColor); + #endif + + #ifdef POI_RIM + applyRimColor(finalColor); + #endif + + #ifdef MATCAP + applyMatcap(finalColor); + #endif + + #ifdef PANOSPHERE + applyPanosphereColor(finalColor); + #endif + + #ifdef FLIPBOOK + applyFlipbook(finalColor); + #endif + + float4 finalColorBeforeLighting = finalColor; + + #ifdef POI_LIGHTING + applyLighting(finalColor); + #endif + + #ifdef POI_RIM + applyEnviroRim(finalColor); + #endif + + #ifdef POI_METAL + applyReflections(finalColor, finalColorBeforeLighting); + #endif + + #ifdef POI_SPECULAR + calculateSpecular(finalColorBeforeLighting); + #endif + + #ifdef POI_PARALLAX + calculateAndApplyInternalParallax(); + #endif + + #ifdef FORWARD_BASE_PASS + #ifdef POI_LIGHTING + #ifdef POI_SPECULAR + //applyLightingToSpecular(); + applySpecular(finalColor); + #endif + #endif + + finalColor.rgb += albedo.rgb * _MainEmissionStrength * albedo.a; + + #ifdef PANOSPHERE + applyPanosphereEmission(finalColor); + #endif + + #ifdef POI_EMISSION + applyEmission(finalColor); + #endif + + #ifdef POI_DISSOLVE + applyDissolveEmission(finalColor); + #endif + + #ifdef POI_RIM + ApplyRimEmission(finalColor); + #endif + + #endif + + #ifdef POI_LIGHTING + #if (defined(POINT) || defined(SPOT)) + #ifdef POI_METAL + applyAdditiveReflectiveLighting(finalColor); + #endif + #ifdef TRANSPARENT + finalColor.rgb *= finalColor.a; + #endif + + #ifdef POI_SPECULAR + applySpecular(finalColor); + #endif + #endif + #endif + + #ifdef POI_LIGHTING + #ifdef SUBSURFACE + applySubsurfaceScattering(finalColor); + #endif + #endif + + #ifdef FLIPBOOK + applyFlipbookEmission(finalColor); + #endif + + #ifdef FORWARD_BASE_PASS + UNITY_APPLY_FOG(i.fogCoord, finalColor); + #endif + + + finalColor.a = max(_ForceOpaque, finalColor.a); + + #ifdef FORWARD_BASE_PASS + #ifdef POI_CLEARCOAT + calculateAndApplyClearCoat(finalColor); + #endif + #endif + + #ifdef POI_DEBUG + displayDebugInfo(finalColor); + #endif + + return finalColor; + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFrag.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFrag.cginc.meta new file mode 100644 index 00000000..07d6d922 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiFrag.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 275146360015da849b7d770865ece1f0 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiGeom.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiGeom.cginc new file mode 100644 index 00000000..a1d2e5d5 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiGeom.cginc @@ -0,0 +1,10 @@ +[maxvertexcount(3)] +void geom(triangle v2f IN[3], inout TriangleStream < v2f > tristream) +{ + for (int i = 0; i < 3; i ++) + { + IN[i].uv = uv; + tristream.Append(IN[i]); + } + tristream.RestartStrip(); +}
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiGeom.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiGeom.cginc.meta new file mode 100644 index 00000000..3afa1bc4 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiGeom.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ffd7b31944cb5d40bb4bb1d6373b4be +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiHelpers.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiHelpers.cginc new file mode 100644 index 00000000..ca97c16b --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiHelpers.cginc @@ -0,0 +1,166 @@ +// Normals + + +bool IsInMirror() +{ + return unity_CameraProjection[2][0] != 0.f || unity_CameraProjection[2][1] != 0.f; +} + +// Camera +float3 getCameraPosition() +{ + #ifdef USING_STEREO_MATRICES + return lerp(unity_StereoWorldSpaceCameraPos[0], unity_StereoWorldSpaceCameraPos[1], 0.5); + #endif + return _WorldSpaceCameraPos; +} + +float3 getCameraForward() +{ + #if UNITY_SINGLE_PASS_STEREO + float3 p1 = mul(unity_StereoCameraToWorld[0], float4(0, 0, 1, 1)); + float3 p2 = mul(unity_StereoCameraToWorld[0], float4(0, 0, 0, 1)); + #else + float3 p1 = mul(unity_CameraToWorld, float4(0, 0, 1, 1)); + float3 p2 = mul(unity_CameraToWorld, float4(0, 0, 0, 1)); + #endif + return normalize(p2 - p1); +} + +float3 grayscale_vector_node() +{ + return float3(0, 0.3823529, 0.01845836); +} + +float3 grayscale_for_light() +{ + return float3(0.298912, 0.586611, 0.114478); +} + +//Math Operators + +float remap(float x, float minOld, float maxOld, float minNew, float maxNew) +{ + return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); +} + +float2 remap(float2 x, float2 minOld, float2 maxOld, float2 minNew, float2 maxNew) +{ + return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); +} + +float3 remap(float3 x, float3 minOld, float3 maxOld, float3 minNew, float3 maxNew) +{ + return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); +} + +float4 remap(float4 x, float4 minOld, float4 maxOld, float4 minNew, float4 maxNew) +{ + return minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld); +} + +float remapClamped(float x, float minOld, float maxOld, float minNew, float maxNew) +{ + return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); +} + +float2 remapClamped(float2 x, float2 minOld, float2 maxOld, float2 minNew, float2 maxNew) +{ + return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); +} + +float3 remapClamped(float3 x, float3 minOld, float3 maxOld, float3 minNew, float3 maxNew) +{ + return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); +} + +float4 remapClamped(float4 x, float4 minOld, float4 maxOld, float4 minNew, float4 maxNew) +{ + return clamp(minNew + (x - minOld) * (maxNew - minNew) / (maxOld - minOld), minNew, maxNew); +} + +float poiMax(float2 i) +{ + return max(i.x, i.y); +} + +float poiMax(float3 i) +{ + return max(max(i.x, i.y), i.z); +} + +float poiMax(float4 i) +{ + return max(max(max(i.x, i.y), i.z), i.w); +} + +float4x4 poiAngleAxisRotationMatrix(float angle, float3 axis) +{ + axis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; + + return float4x4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, + oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, + oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, + 0.0, 0.0, 0.0, 1.0); +} + +float4x4 poiRotationMatrixFromAngles(float x, float y, float z) +{ + float angleX = radians(x); + float c = cos(angleX); + float s = sin(angleX); + float4x4 rotateXMatrix = float4x4(1, 0, 0, 0, + 0, c, -s, 0, + 0, s, c, 0, + 0, 0, 0, 1); + + float angleY = radians(y); + c = cos(angleY); + s = sin(angleY); + float4x4 rotateYMatrix = float4x4(c, 0, s, 0, + 0, 1, 0, 0, + - s, 0, c, 0, + 0, 0, 0, 1); + + float angleZ = radians(z); + c = cos(angleZ); + s = sin(angleZ); + float4x4 rotateZMatrix = float4x4(c, -s, 0, 0, + s, c, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + + return mul(mul(rotateXMatrix, rotateYMatrix), rotateZMatrix); +} + +float4x4 poiRotationMatrixFromAngles(float3 angles) +{ + float angleX = radians(angles.x); + float c = cos(angleX); + float s = sin(angleX); + float4x4 rotateXMatrix = float4x4(1, 0, 0, 0, + 0, c, -s, 0, + 0, s, c, 0, + 0, 0, 0, 1); + + float angleY = radians(angles.y); + c = cos(angleY); + s = sin(angleY); + float4x4 rotateYMatrix = float4x4(c, 0, s, 0, + 0, 1, 0, 0, + - s, 0, c, 0, + 0, 0, 0, 1); + + float angleZ = radians(angles.z); + c = cos(angleZ); + s = sin(angleZ); + float4x4 rotateZMatrix = float4x4(c, -s, 0, 0, + s, c, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1); + + return mul(mul(rotateXMatrix, rotateYMatrix), rotateZMatrix); +}
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiHelpers.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiHelpers.cginc.meta new file mode 100644 index 00000000..34241ad0 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiHelpers.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6bc22a9fb90a4c84f80445e301fff215 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiLighting.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiLighting.cginc new file mode 100644 index 00000000..d9a7f785 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiLighting.cginc @@ -0,0 +1,130 @@ + +#ifndef POI_LIGHTING + #define POI_LIGHTING + + int _LightingType; + sampler2D _ToonRamp; + float _AdditiveSoftness; + float _AdditiveOffset; + float _ForceLightDirection; + float _ShadowStrength; + float _OutlineShadowStrength; + float _ShadowOffset; + float3 _LightDirection; + float _ForceShadowStrength; + float _CastedShadowSmoothing; + float _IndirectContribution; + float _AttenuationMultiplier; + float _EnableLighting; + float _LightingControlledUseLightColor; + uint _LightingAOUV; + + UNITY_DECLARE_TEX2D_NOSAMPLER(_AOMap); float4 _AOMap_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_LightingShadowMask); float4 _LightingShadowMask_ST; + float _AOStrength; + + half PoiDiffuse(half NdotV, half NdotL, half LdotH) + { + half fd90 = 0.5 + 2 * LdotH * LdotH * SmoothnessToPerceptualRoughness(.5); + // Two schlick fresnel term + half lightScatter = (1 + (fd90 - 1) * Pow5(1 - NdotL)); + half viewScatter = (1 + (fd90 - 1) * Pow5(1 - NdotV)); + + return lightScatter * viewScatter; + } + + float3 ShadeSH9Indirect() + { + return ShadeSH9(half4(0.0, -1.0, 0.0, 1.0)); + } + + float3 ShadeSH9Direct() + { + return ShadeSH9(half4(0.0, 1.0, 0.0, 1.0)); + } + + float3 ShadeSH9Normal(float3 normalDirection) + { + return ShadeSH9(half4(normalDirection, 1.0)); + } + + half3 GetSHLength() + { + half3 x, x1; + x.r = length(unity_SHAr); + x.g = length(unity_SHAg); + x.b = length(unity_SHAb); + x1.r = length(unity_SHBr); + x1.g = length(unity_SHBg); + x1.b = length(unity_SHBb); + return x + x1; + } + + float calculateAOMap(float AOMap, float AOStrength) + { + return lerp(1, AOMap, AOStrength); + } + + void calculateBasePassLighting() + { + float AOMap = 1; + #ifndef OUTLINE + AOMap = UNITY_SAMPLE_TEX2D_SAMPLER(_AOMap, _MainTex, TRANSFORM_TEX(poiMesh.uv[_LightingAOUV], _AOMap)); + AOMap = calculateAOMap(AOMap, _AOStrength); + #endif + + float3 grayscale_vector = float3(.33333, .33333, .33333); + float3 ShadeSH9Plus = GetSHLength(); + float3 ShadeSH9Minus = ShadeSH9(float4(0, 0, 0, 1)); + + #ifndef OUTLINE + float ShadowStrengthMap = UNITY_SAMPLE_TEX2D_SAMPLER(_LightingShadowMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _LightingShadowMask)).r; + _ShadowStrength *= ShadowStrengthMap; + #endif + + float bw_lightColor = dot(poiLight.color, grayscale_vector); + float bw_directLighting = (((poiLight.nDotL * 0.5 + 0.5) * bw_lightColor * lerp(1, poiLight.attenuation, _AttenuationMultiplier)) + dot(ShadeSH9Normal(poiMesh.fragmentNormal), grayscale_vector)); + float bw_bottomIndirectLighting = dot(ShadeSH9Minus, grayscale_vector); + float bw_topIndirectLighting = dot(ShadeSH9Plus, grayscale_vector); + float lightDifference = ((bw_topIndirectLighting + bw_lightColor) - bw_bottomIndirectLighting); + poiLight.lightMap = smoothstep(0, lightDifference, bw_directLighting - bw_bottomIndirectLighting); + + poiLight.directLighting = saturate(lerp(ShadeSH9Plus, poiLight.color, .75)); + poiLight.indirectLighting = saturate(ShadeSH9Minus); + + poiLight.rampedLightMap = tex2D(_ToonRamp, poiLight.lightMap * AOMap + _ShadowOffset); + + if (_LightingType == 0) + { + poiLight.finalLighting = lerp((poiLight.indirectLighting), lerp(poiLight.directLighting, poiLight.indirectLighting, _IndirectContribution), lerp(1, poiLight.rampedLightMap, _ShadowStrength)) ; + } + else if(_LightingType == 1) + { + float3 ramp0 = tex2D(_ToonRamp, float2(1, 1)); + poiLight.finalLighting = lerp(ramp0, poiLight.rampedLightMap, _ShadowStrength) * poiLight.directLighting; + } + else if(_LightingType == 2) + { + float3 real = ShadeSH9(float4(poiMesh.fragmentNormal, 1)); + poiLight.finalLighting = saturate(_LightColor0.rgb * AOMap * lerp(1, poiLight.attenuation, _AttenuationMultiplier) * (poiLight.nDotL * 0.5 + 0.5) + real); + } + } + + void calculateLighting() + { + #ifdef OUTLINE + _ShadowStrength = _OutlineShadowStrength; + #endif + #ifdef FORWARD_BASE_PASS + calculateBasePassLighting(); + #else + #if defined(POINT) || defined(SPOT) + poiLight.finalLighting = poiLight.color * poiLight.attenuation * smoothstep(.5 - _AdditiveSoftness + _AdditiveOffset, .5 + _AdditiveSoftness + _AdditiveOffset, .5 * poiLight.nDotL + .5); + #endif + #endif + } + void applyLighting(inout float4 finalColor) + { + finalColor.rgb *= poiLight.finalLighting; + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiLighting.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiLighting.cginc.meta new file mode 100644 index 00000000..3d397bdc --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiLighting.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d15d9f6ca638f84f827dafa0d89ebdb +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMainTex.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMainTex.cginc new file mode 100644 index 00000000..e9a68293 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMainTex.cginc @@ -0,0 +1,111 @@ +#ifndef POI_MAINTEXTURE + #define POI_MAINTEXTURE + + UNITY_DECLARE_TEX2D_NOSAMPLER(_BumpMap); float4 _BumpMap_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_DetailNormalMap); float4 _DetailNormalMap_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_DetailMask); float4 _DetailMask_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_AlphaMask); float4 _AlphaMask_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_MainFadeTexture); float4 _MainFadeTexture_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_DetailTex); float4 _DetailTex_ST; + float4 _Color; + float _Saturation; + float _BumpScale; + float _DetailNormalMapScale; + float2 _MainNormalPan; + float2 _MainDetailNormalPan; + float2 _MainDistanceFade; + half _MainMinAlpha; + half _DetailTexIntensity; + half3 _DetailTint; + uint _DetailTexUV; + uint _DetailNormalUV; + float _DetailBrightness; + float2 _DetailTexturePan; + //globals + float alphaMask; + half3 diffColor; + + inline FragmentCommonData SpecularSetup(float4 i_tex) + { + half4 specGloss = 0; + half3 specColor = specGloss.rgb; + half smoothness = specGloss.a; + + half oneMinusReflectivity; + diffColor = EnergyConservationBetweenDiffuseAndSpecular(albedo, specColor, /*out*/ oneMinusReflectivity); + + FragmentCommonData o = (FragmentCommonData)0; + o.diffColor = diffColor; + o.specColor = specColor; + o.oneMinusReflectivity = oneMinusReflectivity; + o.smoothness = smoothness; + return o; + } + + inline FragmentCommonData FragmentSetup(float4 i_tex, half3 i_viewDirForParallax, float3 i_posWorld) + { + i_tex = i_tex; + + FragmentCommonData o = SpecularSetup(i_tex); + o.normalWorld = float4(0, 0, 0, 1); + o.eyeVec = poiCam.viewDir; + o.posWorld = i_posWorld; + + // NOTE: shader relies on pre-multiply alpha-blend (_SrcBlend = One, _DstBlend = OneMinusSrcAlpha) + o.diffColor = PreMultiplyAlpha(o.diffColor, 1, o.oneMinusReflectivity, /*out*/ o.alpha); + return o; + } + + void initTextureData() + { + mainTexture = UNITY_SAMPLE_TEX2D(_MainTex, TRANSFORM_TEX(poiMesh.uv[0], _MainTex)); + + #ifdef POI_MIRROR + applyMirrorTexture(); + #endif + + #ifdef _ALPHABLEND_ON + calculateDissolve(); + #endif + + #ifndef POISHADOW + alphaMask = UNITY_SAMPLE_TEX2D_SAMPLER(_AlphaMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _AlphaMask)); + albedo = float4(lerp(mainTexture.rgb, dot(mainTexture.rgb, float3(0.3, 0.59, 0.11)), -_Saturation) * _Color.rgb, mainTexture.a * _Color.a * alphaMask); + + float3 mainNormal = UnpackScaleNormal(UNITY_SAMPLE_TEX2D_SAMPLER(_BumpMap, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _BumpMap) + _Time.x * _MainNormalPan), _BumpScale); + float3 detailMask = UNITY_SAMPLE_TEX2D_SAMPLER(_DetailMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _DetailMask)); + float3 detailNormal = UnpackScaleNormal(UNITY_SAMPLE_TEX2D_SAMPLER(_DetailNormalMap, _MainTex, TRANSFORM_TEX(poiMesh.uv[_DetailNormalUV], _DetailNormalMap) + _Time.x * _MainDetailNormalPan), _DetailNormalMapScale * detailMask.g); + poiMesh.tangentSpaceNormal = BlendNormals(mainNormal, detailNormal); + + albedo.rgb *= lerp(1, UNITY_SAMPLE_TEX2D_SAMPLER(_DetailTex, _MainTex, TRANSFORM_TEX(poiMesh.uv[_DetailTexUV], _DetailTex) + _Time.x * _DetailTexturePan).rgb * _DetailBrightness * _DetailTint * unity_ColorSpaceDouble, detailMask.r * _DetailTexIntensity); + albedo.rgb = saturate(albedo.rgb); + poiMesh.fragmentNormal = normalize( + poiMesh.tangentSpaceNormal.x * poiMesh.tangent + + poiMesh.tangentSpaceNormal.y * poiMesh.bitangent + + poiMesh.tangentSpaceNormal.z * poiMesh.vertexNormal + ); + + poiLight.nDotV = dot(poiMesh.fragmentNormal, poiCam.viewDir); + poiLight.vNDotV = dot(poiMesh.vertexNormal, poiCam.viewDir); + poiLight.nDotL = dot(poiMesh.fragmentNormal, poiLight.direction); + poiLight.nDotH = dot(poiMesh.fragmentNormal, poiLight.halfDir); + poiLight.lDotv = dot(poiLight.direction, poiCam.viewDir); + poiLight.lDotH = dot(poiLight.direction, poiLight.halfDir); + + poiCam.viewDotNormal = abs(dot(poiCam.viewDir, poiMesh.fragmentNormal)); + + + s = FragmentSetup(float4(poiMesh.uv[0], 1, 1), poiCam.viewDir, poiMesh.worldPos); + #endif + } + + void distanceFade() + { + half fadeMap = UNITY_SAMPLE_TEX2D_SAMPLER(_MainFadeTexture, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _MainFadeTexture)); + if(fadeMap) + { + half fadeValue = max(smoothstep(_MainDistanceFade.x, _MainDistanceFade.y, poiCam.distanceToVert), _MainMinAlpha); + albedo.a *= fadeValue; + } + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMainTex.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMainTex.cginc.meta new file mode 100644 index 00000000..ec48a374 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMainTex.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3b00376224897b47b655455939a4ea3 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMatcap.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMatcap.cginc new file mode 100644 index 00000000..1a07fa7e --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMatcap.cginc @@ -0,0 +1,82 @@ +#ifndef MATCAP + #define MATCAP + + UNITY_DECLARE_TEX2D_NOSAMPLER(_Matcap); + UNITY_DECLARE_TEX2D_NOSAMPLER(_MatcapMask); float4 _MatcapMask_ST; + float _MatcapBorder; + float4 _MatcapColor; + float _MatcapIntensity; + float _MatcapReplace; + float _MatcapMultiply; + float _MatcapAdd; + float _MatcapEnable; + float _MatcapLightMask; + + UNITY_DECLARE_TEX2D_NOSAMPLER(_Matcap2); + UNITY_DECLARE_TEX2D_NOSAMPLER(_Matcap2Mask); float4 _Matcap2Mask_ST; + float _Matcap2Border; + float4 _Matcap2Color; + float _Matcap2Intensity; + float _Matcap2Replace; + float _Matcap2Multiply; + float _Matcap2Add; + float _Matcap2Enable; + float _Matcap2LightMask; + + float3 matcap; + float matcapMask; + float3 matcap2; + float matcap2Mask; + + + + void calculateMatcap() + { + // Both matcaps use the same coordinates + half3 worldViewUp = normalize(half3(0, 1, 0) - poiCam.viewDir * dot(poiCam.viewDir, half3(0, 1, 0))); + half3 worldViewRight = normalize(cross(poiCam.viewDir, worldViewUp)); + + // Matcap 1 + half2 matcapUV = half2(dot(worldViewRight, poiMesh.fragmentNormal), dot(worldViewUp, poiMesh.fragmentNormal)) * _MatcapBorder + 0.5; + matcap = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap, _MainTex, matcapUV) * _MatcapColor; + matcap.rgb *= _MatcapIntensity; + matcapMask = UNITY_SAMPLE_TEX2D_SAMPLER(_MatcapMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _MatcapMask)); + #ifdef POI_LIGHTING + if (_MatcapLightMask) + { + matcapMask *= lerp(1, poiLight.rampedLightMap, _MatcapLightMask); + } + #endif + + // Matcap 2 + UNITY_BRANCH + if (_Matcap2Enable) + { + half2 matcapUV2 = half2(dot(worldViewRight, poiMesh.fragmentNormal), dot(worldViewUp, poiMesh.fragmentNormal)) * _Matcap2Border + 0.5; + matcap2 = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2, _MainTex, matcapUV2) * _Matcap2Color; + matcap2 *= _Matcap2Intensity; + matcap2Mask = UNITY_SAMPLE_TEX2D_SAMPLER(_Matcap2Mask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _Matcap2Mask)); + #ifdef POI_LIGHTING + if(_Matcap2LightMask) + { + matcap2Mask *= lerp(1, poiLight.rampedLightMap, _Matcap2LightMask); + } + #endif + } + } + + void applyMatcap(inout float4 finalColor) + { + finalColor.rgb = lerp(finalColor, matcap, _MatcapReplace * matcapMask); + finalColor.rgb *= lerp(1, matcap, _MatcapMultiply * matcapMask); + finalColor.rgb += matcap * _MatcapAdd * matcapMask; + + UNITY_BRANCH + if(_Matcap2Enable) + { + finalColor.rgb = lerp(finalColor, matcap2, _Matcap2Replace * matcap2Mask); + finalColor.rgb *= lerp(1, matcap2, _Matcap2Multiply * matcap2Mask); + finalColor.rgb += matcap2 * _Matcap2Add * matcap2Mask; + } + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMatcap.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMatcap.cginc.meta new file mode 100644 index 00000000..9dbae768 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMatcap.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8474ec9ebe6a13f4194926910b94c501 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMetal.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMetal.cginc new file mode 100644 index 00000000..186211a7 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMetal.cginc @@ -0,0 +1,82 @@ +#ifndef POI_METAL + #define POI_METAL + + samplerCUBE _CubeMap; + float _SampleWorld; + sampler2D _MetallicMask; float4 _MetallicMask_ST; + float _Metallic; + sampler2D _SmoothnessMask; float4 _SmoothnessMask_ST; + float _InvertSmoothness; + float _Smoothness; + float _EnableMetallic; + float3 _MetalReflectionTint; + + float3 finalreflections; + float metalicMap; + float3 reflection; + float roughness; + float lighty_boy_uwu_var; + + void calculateReflections() + { + metalicMap = tex2D(_MetallicMask, TRANSFORM_TEX(poiMesh.uv[0], _MetallicMask)) * _Metallic; + float _Smoothness_map_var = (tex2D(_SmoothnessMask, TRANSFORM_TEX(poiMesh.uv[0], _SmoothnessMask))); + if (_InvertSmoothness == 1) + { + _Smoothness_map_var = 1 - _Smoothness_map_var; + } + _Smoothness_map_var *= _Smoothness; + roughness = 1 - _Smoothness_map_var; + roughness *= 1.7 - 0.7 * roughness; + float3 reflectedDir = poiCam.reflectionDir; + + float4 envSample = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + + float interpolator = unity_SpecCube0_BoxMin.w; + UNITY_BRANCH + if(interpolator < 0.99999) + { + //Probe 1 + float4 reflectionData0 = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + float3 reflectionColor0 = DecodeHDR(reflectionData0, unity_SpecCube0_HDR); + + //Probe 2 + float4 reflectionData1 = UNITY_SAMPLE_TEXCUBE_SAMPLER_LOD(unity_SpecCube1, unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + float3 reflectionColor1 = DecodeHDR(reflectionData1, unity_SpecCube1_HDR); + + reflection = lerp(reflectionColor1, reflectionColor0, interpolator); + } + else + { + float4 reflectionData = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS); + reflection = DecodeHDR(reflectionData, unity_SpecCube0_HDR); + } + + bool no_probe = unity_SpecCube0_HDR.a == 0 && envSample.a == 0; + lighty_boy_uwu_var = 0; + if (no_probe || _SampleWorld) + { + lighty_boy_uwu_var = 1; + reflection = texCUBElod(_CubeMap, float4(reflectedDir, roughness * UNITY_SPECCUBE_LOD_STEPS)); + } + } + + void applyReflections(inout float4 finalColor, float4 finalColorBeforeLighting) + { + #ifdef FORWARD_BASE_PASS + finalreflections = reflection.rgb * finalColorBeforeLighting.rgb * _MetalReflectionTint; + finalColor.rgb = finalColor.rgb * (1 - metalicMap); + #ifdef POI_LIGHTING + finalColor.rgb += (finalreflections * ((1 - roughness + metalicMap) / 2)) * lerp(1, poiLight.finalLighting, lighty_boy_uwu_var); + #else + finalColor.rgb += (finalreflections * ((1 - roughness + metalicMap) / 2)); + #endif + + #endif + } + + void applyAdditiveReflectiveLighting(inout float4 finalColor) + { + finalColor *= (1 - metalicMap); + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMetal.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMetal.cginc.meta new file mode 100644 index 00000000..d294cebe --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMetal.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8846817db36f515459b5bbb6a83b8fea +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMirror.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMirror.cginc new file mode 100644 index 00000000..40c86086 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMirror.cginc @@ -0,0 +1,77 @@ +#ifndef POI_MIRROR + #define POI_MIRROR + + int _Mirror; + float _EnableMirrorTexture; + UNITY_DECLARE_TEX2D_NOSAMPLER(_MirrorTexture); float4 _MirrorTexture_ST; + + + void applyMirrorRenderVert(inout float4 vertex) + { + UNITY_BRANCH + if (_Mirror != 0) + { + bool inMirror = IsInMirror(); + if(_Mirror == 1 && inMirror) + { + return; + } + if(_Mirror == 1 && !inMirror) + { + vertex = -1; + return; + } + if(_Mirror == 2 && inMirror) + { + vertex = -1; + return; + } + if(_Mirror == 2 && !inMirror) + { + return; + } + } + } + + void applyMirrorRenderFrag() + { + UNITY_BRANCH + if(_Mirror != 0) + { + bool inMirror = IsInMirror(); + if(_Mirror == 1 && inMirror) + { + return; + } + if(_Mirror == 1 && !inMirror) + { + clip(-1); + return; + } + if(_Mirror == 2 && inMirror) + { + clip(-1); + return; + } + if(_Mirror == 2 && !inMirror) + { + return; + } + } + } + + #if(defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS)) + void applyMirrorTexture() + { + UNITY_BRANCH + if(_EnableMirrorTexture) + { + if(IsInMirror()) + { + mainTexture = UNITY_SAMPLE_TEX2D_SAMPLER(_MirrorTexture, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _MirrorTexture)); + } + } + } + #endif + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMirror.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMirror.cginc.meta new file mode 100644 index 00000000..4db0bbc8 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiMirror.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 396d9bd19d1b5e04faf3ed13c4cb261e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineFrag.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineFrag.cginc new file mode 100644 index 00000000..48089cac --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineFrag.cginc @@ -0,0 +1,55 @@ +float _OutlineRimLightBlend; +float _Clip; +float4 frag(v2f i): COLOR +{ + + #ifdef POI_DATA + InitData(i); + #endif + + #ifdef POI_MAINTEXTURE + initTextureData(); + #endif + + fixed4 col = mainTexture; + float alphaMultiplier = smoothstep(_OutlineFadeDistance.x, _OutlineFadeDistance.y, distance(getCameraPosition(), i.worldPos)); + clip(_LineWidth - 0.001); + float _alphaMask_tex_var = UNITY_SAMPLE_TEX2D_SAMPLER(_AlphaMask, _MainTex, TRANSFORM_TEX(i.uv0, _AlphaMask)); + col = col * 0.00000000001 + tex2D(_OutlineTexture, TRANSFORM_TEX((i.uv0 + (_OutlineTexturePan.xy * _Time.g)), _OutlineTexture)); + col.a *= albedo.a; + col.a *= alphaMultiplier; + + #ifdef POI_RANDOM + col.a *= i.angleAlpha; + #endif + + clip(col.a * _alphaMask_tex_var - _Clip); + + UNITY_BRANCH + if (_OutlineMode == 1) + { + #ifdef POI_MIRROR + applyMirrorTexture(); + #endif + col.rgb = mainTexture.rgb; + } + else if(_OutlineMode == 2) + { + col.rgb = lerp(col.rgb, poiLight.color, _OutlineRimLightBlend); + } + col *= _LineColor; + + + #ifdef POI_LIGHTING + calculateLighting(); + #endif + + float4 finalColor = col; + + #ifdef POI_LIGHTING + applyLighting(finalColor); + #endif + + finalColor.rgb += (col.rgb * _OutlineEmission); + return finalColor; +}
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineFrag.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineFrag.cginc.meta new file mode 100644 index 00000000..72e1c8f7 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineFrag.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 72b7fa42c9f90df4f83dc6c3706edf33 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineVert.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineVert.cginc new file mode 100644 index 00000000..ba64f417 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineVert.cginc @@ -0,0 +1,72 @@ +#ifndef OutlineVert + #define OutlineVert + + uint _OutlineMode; + float4 _OutlinePersonaDirection; + float4 _OutlineDropShadowOffset; + float _OutlineUseVertexColors; + + sampler2D _OutlineMask; float4 _OutlineMask_ST; + v2f vert(appdata v) + { + UNITY_SETUP_INSTANCE_ID(v); + v2f o; + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + #ifdef POI_MIRROR + applyMirrorRenderVert(v.vertex); + #endif + + o.uv0 = v.uv0 + _OutlineGlobalPan.xy * _Time.y; + float outlineMask = poiMax(tex2Dlod(_OutlineMask, float4(TRANSFORM_TEX(o.uv0, _OutlineMask) + _Time.x * _OutlineTexturePan.zw, 0, 0)).rgb); + + UNITY_BRANCH + if (_OutlineUseVertexColors == 0) + { + o.normal = UnityObjectToWorldNormal(v.normal); + } + else + { + o.normal = UnityObjectToWorldNormal(v.color); + } + + + float3 offset = o.normal * (_LineWidth / 100) * outlineMask; + + half offsetMultiplier = 1; + UNITY_BRANCH + if(_OutlineMode == 2) + { + float3 lightDirection = poiLight.direction = normalize(_WorldSpaceLightPos0 + unity_SHAr.xyz + unity_SHAg.xyz + unity_SHAb.xyz); + offsetMultiplier = saturate(dot(lightDirection, o.normal)); + offset *= offsetMultiplier; + } + else if(_OutlineMode == 3) + { + half3 viewNormal = mul((float3x3)UNITY_MATRIX_V, o.normal); + offsetMultiplier = saturate(dot(viewNormal.xy, normalize(_OutlinePersonaDirection.xy))); + + offset *= offsetMultiplier; + } + else if(_OutlineMode == 4) + { + offset = mul((float3x3)transpose(UNITY_MATRIX_V), _OutlineDropShadowOffset); + } + + o.worldPos = mul(unity_ObjectToWorld, v.vertex) + float4(offset, 0); + o.modelPos = mul(unity_ObjectToWorld, float4(0, 0, 0, 1)); + o.pos = UnityWorldToClipPos(o.worldPos); + + o.angleAlpha = 1; + #ifdef POI_RANDOM + o.angleAlpha = ApplyAngleBasedRendering(o.modelPos); + #endif + + UNITY_TRANSFER_SHADOW(o, o.uv0); + UNITY_TRANSFER_FOG(o, o.pos); + return o; + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineVert.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineVert.cginc.meta new file mode 100644 index 00000000..85fbee5f --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiOutlineVert.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd3b68bfdcc9cb24aa10b4cc6b447572 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPanosphere.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPanosphere.cginc new file mode 100644 index 00000000..80156c6f --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPanosphere.cginc @@ -0,0 +1,55 @@ +#ifndef PANOSPHERE + #define PANOSPHERE + + sampler2D _PanosphereTexture; float4 _PanosphereTexture_ST; + sampler2D _PanoMapTexture; float4 _PanoMapTexture_ST; + float _PanoEmission; + float _PanoBlend; + float4 _PanosphereColor; + float3 _PanospherePan; + float _PanoToggle; + float _PanoCubeMapToggle; + samplerCUBE _PanoCubeMap; half4 _PanoCubeMap_HDR; + + float3 panoColor; + float panoMask; + + float2 projectIt(float3 coords) + { + float3 normalizedCoords = normalize(coords); + float latitude = acos(normalizedCoords.y); + float longitude = atan2(normalizedCoords.z, normalizedCoords.x); + float2 sphereCoords = float2(longitude + _Time.y * _PanospherePan.x, latitude + _Time.y * _PanospherePan.y) * float2(1.0 / UNITY_PI, 1.0 / UNITY_PI); + sphereCoords = float2(1.0, 1.0) - sphereCoords; + return(sphereCoords + float4(0, 1 - unity_StereoEyeIndex, 1, 1.0).xy) * float4(0, 1 - unity_StereoEyeIndex, 1, 1.0).zw; + } + + void calculatePanosphere() + { + panoMask = tex2D(_PanoMapTexture, TRANSFORM_TEX(poiMesh.uv[0], _PanoMapTexture)); + + UNITY_BRANCH + if (_PanoCubeMapToggle) + { + float3 cubeUV = mul(poiRotationMatrixFromAngles(_PanospherePan.xyz * _Time.y) ,float4(-poiCam.viewDir,1)); + half4 cubemap = texCUBE (_PanoCubeMap, cubeUV); + panoColor = DecodeHDR (cubemap, _PanoCubeMap_HDR); + } + else + { + float2 _StereoEnabled_var = projectIt(normalize(poiCam.worldPos.xyz - poiMesh.worldPos.xyz) * - 1); + panoColor = tex2D(_PanosphereTexture, TRANSFORM_TEX(_StereoEnabled_var, _PanosphereTexture)) * _PanosphereColor.rgb; + } + } + + void applyPanosphereColor(inout float4 finalColor) + { + finalColor.rgb = lerp(finalColor.rgb, panoColor, _PanoBlend * panoMask); + } + + void applyPanosphereEmission(inout float4 finalColor) + { + finalColor.rgb += panoColor * _PanoBlend * panoMask * _PanoEmission; + } + +#endif diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPanosphere.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPanosphere.cginc.meta new file mode 100644 index 00000000..17b64500 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPanosphere.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b4539cf5f665abd48abf34625dc7e7f2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParallax.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParallax.cginc new file mode 100644 index 00000000..ccad8d30 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParallax.cginc @@ -0,0 +1,121 @@ +#ifndef POI_PARALLAX + #define POI_PARALLAX + + sampler2D _ParallaxHeightMap; float4 _ParallaxHeightMap_ST; + float _ParallaxHeightIterations; + float _ParallaxStrength; + float _ParallaxBias; + float _ParallaxHeightMapEnabled; + + //Internal + float _ParallaxInternalMapEnabled; + sampler2D _ParallaxInternalMap; float4 _ParallaxInternalMap_ST; + float _ParallaxInternalIterations; + float _ParallaxInternalMinDepth; + float _ParallaxInternalMaxDepth; + float _ParallaxInternalMinFade; + float _ParallaxInternalMaxFade; + float4 _ParallaxInternalMinColor; + float4 _ParallaxInternalMaxColor; + float4 _ParallaxInternalPanSpeed; + float4 _ParallaxInternalPanDepthSpeed; + float _ParallaxInternalHeightmapMode; + float _ParallaxInternalHeightFromAlpha; + + float GetParallaxHeight(float2 uv) + { + return clamp(tex2D(_ParallaxHeightMap, TRANSFORM_TEX(uv, _ParallaxHeightMap)).g, 0, .99999); + } + /* + float2 ParallaxOffset(float2 viewDir) + { + float height = GetParallaxHeight(); + height -= 0.5; + height *= _ParallaxStrength; + return viewDir * height; + } + */ + float2 ParallaxRaymarching(float2 viewDir) + { + float2 uvOffset = 0; + float stepSize = 0.1; + float2 uvDelta = viewDir * (stepSize * _ParallaxStrength); + + float stepHeight = 1; + float surfaceHeight = GetParallaxHeight(poiMesh.uv[0]); + + float2 prevUVOffset = uvOffset; + float prevStepHeight = stepHeight; + float prevSurfaceHeight = surfaceHeight; + + for (int i = 1; i < _ParallaxHeightIterations && stepHeight > surfaceHeight; i ++) + { + prevUVOffset = uvOffset; + prevStepHeight = stepHeight; + prevSurfaceHeight = surfaceHeight; + + uvOffset -= uvDelta; + stepHeight -= stepSize; + surfaceHeight = GetParallaxHeight(poiMesh.uv[0] + uvOffset); + } + + float prevDifference = prevStepHeight - prevSurfaceHeight; + float difference = surfaceHeight - stepHeight; + float t = prevDifference / (prevDifference + difference); + uvOffset = prevUVOffset -uvDelta * t; + + return uvOffset; + } + + void calculateandApplyParallax(v2f i) + { + UNITY_BRANCH + if (_ParallaxHeightMapEnabled) + { + i.tangentViewDir = normalize(i.tangentViewDir); + i.tangentViewDir.xy /= (i.tangentViewDir.z + _ParallaxBias); + poiMesh.uv[0] += ParallaxRaymarching(i.tangentViewDir.xy); + } + } + + void calculateAndApplyInternalParallax() + { + #if defined(_PARALLAXMAP) + UNITY_BRANCH + if(_ParallaxInternalMapEnabled) + { + float3 parallax = 0; + for (int j = _ParallaxInternalIterations; j > 0; j --) + { + float ratio = (float)j / _ParallaxInternalIterations; + float2 parallaxOffset = _Time.y * (_ParallaxInternalPanSpeed + (1 - ratio) * _ParallaxInternalPanDepthSpeed); + float fade = lerp(_ParallaxInternalMinFade, _ParallaxInternalMaxFade, ratio); + float4 parallaxColor = tex2D(_ParallaxInternalMap, TRANSFORM_TEX(poiMesh.uv[0], _ParallaxInternalMap) + lerp(_ParallaxInternalMinDepth, _ParallaxInternalMaxDepth, ratio) * - poiCam.tangentViewDir.xy + parallaxOffset); + float3 parallaxTint = lerp(_ParallaxInternalMinColor, _ParallaxInternalMaxColor, ratio); + float parallaxHeight; + if(_ParallaxInternalHeightFromAlpha) + { + parallaxTint *= parallaxColor.rgb; + parallaxHeight = parallaxColor.a; + } + else + { + parallaxHeight = parallaxColor.r; + } + //float parallaxColor *= lerp(_ParallaxInternalMinColor, _ParallaxInternalMaxColor, 1 - ratio); + UNITY_BRANCH + if (_ParallaxInternalHeightmapMode == 1) + { + parallax = lerp(parallax, parallaxTint * fade, parallaxHeight >= 1 - ratio); + } + else + { + parallax += parallaxTint * parallaxHeight * fade; + } + } + //parallax /= _ParallaxInternalIterations; + finalColor.rgb += parallax; + } + #endif + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParallax.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParallax.cginc.meta new file mode 100644 index 00000000..8d77bb2e --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParallax.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 32a3c22a538f985479cb843e28d1f2a5 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParticlePass.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParticlePass.cginc new file mode 100644 index 00000000..5e85e1cf --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParticlePass.cginc @@ -0,0 +1,343 @@ +#pragma vertex vert +#pragma fragment frag +#pragma multi_compile_instancing +#include "UnityCG.cginc" +#include "Lighting.cginc" + +struct appdata +{ + float4 vertex: POSITION; + float4 color: COLOR; + float2 texcoord: TEXCOORD0; + uint id: SV_VertexID; + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct v2g +{ + float4 pos: SV_POSITION; + float2 uv: TEXCOORD0; + float4 worldPos: TEXCOORD1; + uint vid: TEXCOORD2; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO +}; + +struct g2f +{ + float4 pos: SV_POSITION; + float2 uv: TEXCOORD0; + uint TimeOffset: TEXCOORD2; + float4 DebugData: TEXCOORD3; + float Alpha: TEXCOORD4; + float4 screenUV: TEXCOORD5; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO +}; + +float random(float2 vids) +{ + return frac(sin(dot(vids, float2(12.9898, 78.2383))) * 43758.5453123); +} + +sampler2D _CameraDepthTexture; +sampler2D _ParticleMask; +float4 _ParticleColor; +uint _ParticleMovementMode; +float _ParticleScaleMin, _ParticleScaleMax; +float _ParticleSphericalMinSpeed, _ParticleSphericalMaxSpeed; +float _ParticleSphericalMinRadius, _ParticleSphericalMaxRadius; +float _ParticleRandomTimeOffset; +float _ParticlePerCMSquared; +float _ParticleMinRenderDistance; +float _ParticleRandomRotation; +float _ParticleRotation; +// Linear Movement +float3 _ParticleLinearEndOffsetMin; +float3 _ParticleLinearEndOffsetMax; +float _ParticleLinearSpeedMin; +float _ParticleLinearSpeedMax; +float _ParticleLinearStartAlpha ; +float _ParticleLinearEndAlpha; +float _ParticleLinearStartSizeMin; +float _ParticleLinearStartSizeMax; +float _ParticleLinearEndSizeMin; +float _ParticleLinearEndsizeMax; +float _ParticleLinearNormalRange; +float _ParticleFlipParticlesGoingInward; +v2g particleVert(appdata v) +{ + v2g o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + UNITY_TRANSFER_INSTANCE_ID(v, o); + o.pos = UnityObjectToClipPos(v.vertex); + o.worldPos = mul(unity_ObjectToWorld, v.vertex); + o.uv = v.texcoord.xy; + o.vid = v.id; + return o; +} + +void calculateParticleData(float4 startPos, float3 vid, float randomA, float randomB, float randomC, float randomD, +inout float4 offset, inout float scale, inout float opacity, inout float randomRotation, inout float loopAlpha) +{ + UNITY_BRANCH + if (_ParticleMovementMode == 0) //spherical + { + float3 vroom = float3(lerp(_ParticleSphericalMinSpeed, _ParticleSphericalMaxSpeed, randomA), lerp(_ParticleSphericalMinSpeed, _ParticleSphericalMaxSpeed, randomB), lerp(_ParticleSphericalMinSpeed, _ParticleSphericalMaxSpeed, randomC)); + scale = lerp(_ParticleScaleMin, _ParticleScaleMax, randomC); + offset.x = sin(_Time.x * vroom.x) * lerp(_ParticleSphericalMinRadius, _ParticleSphericalMaxRadius, randomA); + offset.y = sin(_Time.x * vroom.y) * lerp(_ParticleSphericalMinRadius, _ParticleSphericalMaxRadius, randomB); + offset.z = sin(_Time.x * vroom.z) * lerp(_ParticleSphericalMinRadius, _ParticleSphericalMaxRadius, randomC); + offset.w = 0; + } + else + { + float speed = lerp(_ParticleLinearSpeedMin, _ParticleLinearSpeedMax, randomD); + float alpha = (_Time.x + randomD) * speed; + float randomPerLoop = random(float2(ceil(alpha), ceil(alpha))); + randomRotation = (randomPerLoop) * 6.28318530718; + alpha = frac(alpha); + loopAlpha = alpha; + offset = float4(lerp(0, float3( + lerp(_ParticleLinearEndOffsetMin.x, _ParticleLinearEndOffsetMax.x, randomA), + lerp(_ParticleLinearEndOffsetMin.y, _ParticleLinearEndOffsetMax.y, randomB), + lerp(_ParticleLinearEndOffsetMin.z, _ParticleLinearEndOffsetMax.z, randomC) + ), alpha), 0); + float scaleStart = lerp(_ParticleLinearStartSizeMin, _ParticleLinearStartSizeMax, randomC); + float scaleEnd = lerp(_ParticleLinearEndSizeMin, _ParticleLinearEndsizeMax, randomD); + scale = lerp(scaleStart, scaleEnd, alpha); + opacity = saturate(lerp(_ParticleLinearStartAlpha, _ParticleLinearEndAlpha, alpha)); + } +} + +float ComputePolygonArea(float3 p1, float3 p2, float3 p3) +{ + return length(cross(p2 - p1, p3 - p1)) / 2; +} + +bool IsInMirror() +{ + return unity_CameraProjection[2][0] != 0.f || unity_CameraProjection[2][1] != 0.f; +} + +float4x4 poiAngleAxisRotationMatrix(float angle, float3 axis) +{ + axis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; + + return float4x4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, + oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, + oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, + 0.0, 0.0, 0.0, 1.0); +} + +[maxvertexcount(60)] +void particleGeom(triangle v2g IN[3], inout TriangleStream < g2f > tristream) +{ + float3 polySideA = IN[1].worldPos.xyz - IN[0].worldPos.xyz; + float3 polySideB = IN[2].worldPos.xyz - IN[0].worldPos.xyz; + float3 c = cross(polySideA, polySideB); + float3 outDir = normalize(c); + float4 center = (IN[0].worldPos + IN[1].worldPos + IN[2].worldPos) / 3; + + if (_ParticleMovementMode == 1) + { + float3 direction = normalize((center.xyz + lerp(_ParticleLinearEndOffsetMin, _ParticleLinearEndOffsetMax, .5).rgb) - center.xyz); + if(dot(outDir, direction) <= _ParticleLinearNormalRange) + { + return; + } + } + + g2f milk[4]; + + if(IsInMirror()) + { + milk[0].uv = float2(0, 1); + milk[1].uv = float2(0, 0); + milk[2].uv = float2(1, 0); + milk[3].uv = float2(1, 1); + } + else + { + milk[0].uv = float2(0, 0); + milk[1].uv = float2(0, 1); + milk[2].uv = float2(1, 1); + milk[3].uv = float2(1, 0); + } + + float areaOfPolygonCM = ComputePolygonArea(IN[0].worldPos, IN[1].worldPos, IN[2].worldPos) * 10000; // 100000 square cm in 1 square m + float randomlySpawnedParticle = 0; + if (areaOfPolygonCM < 1 / _ParticlePerCMSquared) + { + randomlySpawnedParticle = random(float2(IN[0].vid, IN[1].vid)) < areaOfPolygonCM / (1 / _ParticlePerCMSquared); + } + + float numberOfParticles = clamp(floor(areaOfPolygonCM * _ParticlePerCMSquared + .05) + randomlySpawnedParticle, 0, 10); + + numberOfParticles *= tex2Dlod(_ParticleMask, float4((IN[0].uv + IN[1].uv + IN[2].uv) / 3, 0, 0)).r; + + for (int index = 0; index < 4; index ++) + { + milk[index].DebugData = 0; + milk[index].DebugData.x = randomlySpawnedParticle; + milk[index].DebugData.y = randomlySpawnedParticle; + milk[index].DebugData.z = random(float2(IN[0].vid, IN[1].vid)); + milk[index].DebugData.w = randomlySpawnedParticle; + + milk[index].Alpha = 1; + } + + + for (int index = 0; index < numberOfParticles; index ++) + { + float randomValueA = random(float2(IN[0].vid + index * IN[2].vid, IN[2].vid + index * IN[0].vid)); + float randomValueB = random(float2(IN[1].vid + index * IN[2].vid, IN[1].vid + index * IN[0].vid)); + float randomValueC = random(float2(IN[2].vid + index * IN[2].vid, IN[0].vid + index * IN[0].vid)); + float randomValueD = random(float2(IN[1].vid + index * IN[2].vid, IN[0].vid + index * (IN[1].vid + IN[2].vid))); + float randomRotation = randomValueD * 6.28318530718; + float scale = 1; + float4 offset = 0; + float opacity = 1; + float loopAlpha = 0; + + calculateParticleData(center, float3(IN[0].vid, IN[1].vid, IN[2].vid), + randomValueA, randomValueB, randomValueC, randomValueD, offset, scale, opacity, randomRotation, loopAlpha); + + + milk[0].DebugData = float4(loopAlpha, randomValueB, randomValueC, randomValueD); + milk[1].DebugData = float4(loopAlpha, randomValueB, randomValueC, randomValueD); + milk[2].DebugData = float4(loopAlpha, randomValueB, randomValueC, randomValueD); + milk[3].DebugData = float4(loopAlpha, randomValueB, randomValueC, randomValueD); + + UNITY_BRANCH + if(_ParticleFlipParticlesGoingInward && _ParticleMovementMode == 1) + { + float3 offsetdirection = (center + offset).xyz - center.xyz; + if(dot(offsetdirection, outDir) <= 0) + { + offset *= -1; + } + } + + float4 forwardVector = float4(normalize((center + offset) - _WorldSpaceCameraPos), 0); + float4 rightVector = float4(-UNITY_MATRIX_V[0].xyz, 0); + rightVector.xyz = mul(poiAngleAxisRotationMatrix(_ParticleRandomRotation ? randomRotation: radians(_ParticleRotation), forwardVector), rightVector); + float4 upVector = float4(cross(forwardVector, rightVector), 0); + + milk[0].Alpha = opacity; + milk[1].Alpha = opacity; + milk[2].Alpha = opacity; + milk[3].Alpha = opacity; + + float timeOffset = _ParticleRandomTimeOffset ? lerp(0, 1000, randomValueA): 0; + + milk[0].TimeOffset = timeOffset; + milk[1].TimeOffset = timeOffset; + milk[2].TimeOffset = timeOffset; + milk[3].TimeOffset = timeOffset; + + if(randomValueA + randomValueB >= 1) + { + randomValueA = 1 - randomValueA; + randomValueB = 1 - randomValueB; + } + + float4 positionInPolygon = float4(IN[0].worldPos.xyz + (polySideA * randomValueA) + (polySideB * randomValueB), 1) + offset; + + milk[0].pos = UnityObjectToClipPos(mul(unity_WorldToObject, positionInPolygon + (rightVector + upVector) * scale)); + milk[1].pos = UnityObjectToClipPos(mul(unity_WorldToObject, positionInPolygon + (rightVector + - upVector) * scale)); + milk[2].pos = UnityObjectToClipPos(mul(unity_WorldToObject, positionInPolygon + (-rightVector + - upVector) * scale)); + milk[3].pos = UnityObjectToClipPos(mul(unity_WorldToObject, positionInPolygon + (-rightVector + upVector) * scale)); + + milk[0].screenUV = ComputeScreenPos(milk[0].pos); + milk[1].screenUV = ComputeScreenPos(milk[1].pos); + milk[2].screenUV = ComputeScreenPos(milk[2].pos); + milk[3].screenUV = ComputeScreenPos(milk[3].pos); + + if(distance(positionInPolygon, _WorldSpaceCameraPos) >= _ParticleMinRenderDistance) + { + tristream.Append(milk[0]); + tristream.Append(milk[1]); + tristream.Append(milk[2]); + tristream.RestartStrip(); + + tristream.Append(milk[2]); + tristream.Append(milk[3]); + tristream.Append(milk[0]); + tristream.RestartStrip(); + } + } +} + +sampler2D _ParticleTexture; float4 _ParticleTexture_ST; +sampler2D _ParticleStartColorGradient; float4 _ParticleStartColorGradient_ST; +UNITY_DECLARE_TEX2DARRAY(_ParticleFlipbookTexArray); float4 _ParticleFlipbookTexArray_ST; +float4 _ParticleFlipbookColor; +float _ParticleFlipbookFPS; +uint _ParticleFlipbookTotalFrames; +float _ParticleFlipbookTiled; +int _ParticleFlipbookCurrentFrame; +float _ParticleFlipbookEmissionStrength; +float _ParticleFlipbookRotation; +float _EnableParticleFlipbook; +float _ParticleAlphaCutoff; +float _ParticleIntersectionFadeDistance; +float _ParticleLit; +float _ColorOverLifetime; +float _ColorOverLifeSpeed; +// anim +uint _ParticleFlipbookMovementType; +float4 _ParticleFlipbookStartEndOffset; +float _ParticleFlipbookMovementSpeed; + +void getFlipbookColor(inout float4 finalColor, float2 uv, float timeOffset) +{ + UNITY_BRANCH + if (_EnableParticleFlipbook) + { + uint currentFrame = floor(_ParticleFlipbookCurrentFrame) % _ParticleFlipbookTotalFrames; + if(_ParticleFlipbookCurrentFrame < 0) + { + if(_ParticleFlipbookFPS < 1) + { + currentFrame = timeOffset % _ParticleFlipbookTotalFrames; + } + else + { + currentFrame = ((_Time.y + timeOffset) / (1 / max(_ParticleFlipbookFPS, 1))) % _ParticleFlipbookTotalFrames; + } + } + finalColor = UNITY_SAMPLE_TEX2DARRAY(_ParticleFlipbookTexArray, float3(TRANSFORM_TEX(uv, _ParticleFlipbookTexArray), currentFrame)); + } +} + +fixed4 particleFrag(g2f i): SV_Target +{ + UNITY_SETUP_INSTANCE_ID(i); + fixed4 finalColor; + float2 colorUV = i.DebugData.w; + + if(_ColorOverLifetime && _ParticleMovementMode == 0) + { + colorUV = frac(i.DebugData.w + _Time.x * _ColorOverLifeSpeed); + } + else if(_ColorOverLifetime && _ParticleMovementMode == 1) + { + colorUV = i.DebugData.x; + } + + float2 randomStartColor = i.DebugData.w + i.DebugData.x; + float3 randomColor = tex2D(_ParticleStartColorGradient, TRANSFORM_TEX(colorUV, _ParticleStartColorGradient)); + finalColor = tex2D(_ParticleTexture, TRANSFORM_TEX(i.uv, _ParticleTexture)); + getFlipbookColor(finalColor, i.uv, i.TimeOffset); + clip(finalColor.a - _ParticleAlphaCutoff); + finalColor.rgb *= _ParticleColor.rgb * randomColor.rgb; + finalColor.rgb *= _ParticleLit ? saturate(ShadeSH9(float4(0.0, 0.0, 0.0, 1.0))) + _LightColor0.rgb: 1; + finalColor.a *= i.Alpha * _ParticleColor.a; + return finalColor; +} + diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParticlePass.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParticlePass.cginc.meta new file mode 100644 index 00000000..25cbf641 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiParticlePass.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7178b86448a50944e97378d3e6f4ade2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPass.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPass.cginc new file mode 100644 index 00000000..901f149d --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPass.cginc @@ -0,0 +1,124 @@ +/* +_SPECGLOSSMAP +_PARALLAXMAP +_EMISSION +_REQUIRE_UV2 +_ALPHABLEND_ON +_DETAIL_MULX2 +_FADING_ON +_GLOSSYREFLECTIONS_OFF +_METALLICGLOSSMAP +_TERRAIN_NORMAL_MAP +_COLOROVERLAY_ON +_COLORADDSUBDIFF_ON +_NORMALMAP +_SUNDISK_NONE +_COLORCOLOR_ON + +_ALPHAMODULATE_ON +_ALPHAPREMULTIPLY_ON +_ALPHATEST_ON +_MAPPING_6_FRAMES_LAYOUT +_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A +_SPECULARHIGHLIGHTS_OFF +_SUNDISK_HIGH_QUALITY +_SUNDISK_SIMPLE +BILLBOARD_FACE_CAMERA_POS +EFFECT_BUMP +EFFECT_HUE_VARIATION +ETC1_EXTERNAL_ALPHA +GEOM_TYPE_BRANCH +EFFECT_BUMP +GEOM_TYPE_FROND +GEOM_TYPE_LEAF +GEOM_TYPE_MESH +LOD_FADE_CROSSFADE +PIXELSNAP_ON +SOFTPARTICLES_ON +STEREO_INSTANCING_ON +STEREO_MULTIVIEW_ON +UNITY_HDR_ON +UNITY_SINGLE_PASS_STEREO +UNITY_UI_ALPHACLIP +UNITY_UI_CLIP_RECT +*/ + + +#ifndef POI_PASS + #define POI_PASS + + #include "Poicludes.cginc" + #include "PoiHelpers.cginc" + + #ifdef _PARALLAXMAP + #include "PoiParallax.cginc" + #endif + + #ifdef _REQUIRE_UV2 + #include "PoiMirror.cginc" + #endif + + #include "PoiData.cginc" + + #ifdef _SUNDISK_NONE + #include "PoiRandom.cginc" + #endif + + #ifdef _ALPHABLEND_ON + #include "PoiDissolve.cginc" + #endif + + #include "PoiMainTex.cginc" + + #ifdef _DETAIL_MULX2 + #include "PoiPanosphere.cginc" + #endif + + #ifdef _NORMALMAP + #include "PoiLighting.cginc" + #endif + + #ifdef _FADING_ON + #include "PoiFlipbook.cginc" + #endif + + #ifdef _GLOSSYREFLECTIONS_OFF + #include "PoiRimlighting.cginc" + #endif + + #ifdef _METALLICGLOSSMAP + #include "PoiMetal.cginc" + #endif + + #ifdef _COLORADDSUBDIFF_ON + #include "PoiMatcap.cginc" + #endif + + #ifdef _SPECGLOSSMAP + #include "PoiSpecular.cginc" + #endif + + #ifdef _TERRAIN_NORMAL_MAP + #include "PoiSubsurfaceScattering.cginc" + #endif + + #ifdef REFRACTIVE + #include "PoiRefraction.cginc" + #endif + + #ifdef _EMISSION + #include "PoiEmission.cginc" + #endif + + #ifdef _COLORCOLOR_ON + #include "PoiClearCoat.cginc" + #endif + + #ifdef _COLOROVERLAY_ON + #include "PoiDebug.cginc" + #endif + + #include "PoiVert.cginc" + #include "PoiFrag.cginc" + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPass.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPass.cginc.meta new file mode 100644 index 00000000..7861c813 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPass.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 24c1e0662686fea48b07d7a8097d3e16 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassOutline.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassOutline.cginc new file mode 100644 index 00000000..389f5799 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassOutline.cginc @@ -0,0 +1,15 @@ +#ifndef POI_PASS_OUTLINE + #define POI_PASS_OUTLINE + #include "Poicludes.cginc" + #include "PoiHelpers.cginc" + #include "PoiDissolve.cginc" + #include "PoiMainTex.cginc" + #include "PoiData.cginc" + #ifdef _SUNDISK_NONE + #include "PoiRandom.cginc" + #endif + #include "poiMirror.cginc" + #include "PoiLighting.cginc" + #include "PoiOutlineVert.cginc" + #include "PoiOutlineFrag.cginc" +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassOutline.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassOutline.cginc.meta new file mode 100644 index 00000000..d57c1daf --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassOutline.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf5af5e3b880bc44c942f56187887dc5 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassShadow.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassShadow.cginc new file mode 100644 index 00000000..dc6b2c7a --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassShadow.cginc @@ -0,0 +1,17 @@ +#ifndef POI_PASS_SHADOW + #define POI_PASS_SHADOW + + #pragma multi_compile_shadowcaster + #include "UnityCG.cginc" + #include "UnityShaderVariables.cginc" + #include "PoiShadowIncludes.cginc" + #include "PoiHelpers.cginc" + #include "poiMirror.cginc" + #ifdef _SUNDISK_NONE + #include "PoiRandom.cginc" + #endif + #include "PoiDissolve.cginc" + #include "PoiShadowVert.cginc" + #include "PoiShadowFrag.cginc" + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassShadow.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassShadow.cginc.meta new file mode 100644 index 00000000..9e80d7ae --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiPassShadow.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b0ff2d1983dc4e540bbbe48386283bf2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRandom.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRandom.cginc new file mode 100644 index 00000000..6473b764 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRandom.cginc @@ -0,0 +1,39 @@ +#ifndef POI_RANDOM + #define POI_RANDOM + + float _EnableRandom; + float m_start_Angle; + uint _AngleType; + float3 _AngleForwardDirection; + float _CameraAngleMin, _CameraAngleMax; + float _ModelAngleMin, _ModelAngleMax; + float _AngleMinAlpha; + uint _AngleCompareTo; + + float ApplyAngleBasedRendering(float3 modelPos, float3 worldPos) + { + half cameraAngleMin = _CameraAngleMin / 180; + half cameraAngleMax = _CameraAngleMax / 180; + half modelAngleMin = _ModelAngleMin / 180; + half modelAngleMax = _ModelAngleMax / 180; + float3 pos = _AngleCompareTo == 0 ? modelPos : worldPos; + half3 cameraToModelDirection = normalize(pos - getCameraPosition()); + half3 modelForwardDirection = normalize(mul(unity_ObjectToWorld, normalize(_AngleForwardDirection))); + half cameraLookAtModel = remapClamped(.5 * dot(cameraToModelDirection, getCameraForward()) + .5, cameraAngleMax, cameraAngleMin, 0, 1); + half modelLookAtCamera = remapClamped(.5 * dot(-cameraToModelDirection, modelForwardDirection) + .5, modelAngleMax, modelAngleMin, 0, 1); + if (_AngleType == 0) + { + return max(cameraLookAtModel, _AngleMinAlpha); + } + else if(_AngleType == 1) + { + return max(modelLookAtCamera, _AngleMinAlpha); + } + else if(_AngleType == 2) + { + return max(cameraLookAtModel * modelLookAtCamera, _AngleMinAlpha); + } + return 1; + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRandom.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRandom.cginc.meta new file mode 100644 index 00000000..d7b42455 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRandom.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 428cdb5642de8b34982be94f8c522bbc +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRefraction.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRefraction.cginc new file mode 100644 index 00000000..d0b9fbed --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRefraction.cginc @@ -0,0 +1,50 @@ +#ifndef REFRACTION + #define REFRACTION + + sampler2D _PoiGrab; + float _RefractionIndex; + float _RefractionOpacity; + float _RefractionChromaticAberattion; + UNITY_DECLARE_TEX2D_NOSAMPLER(_RefractionOpacityMask); float4 _RefractionOpacityMask_ST; + + float3 refraction; + float refractionOpacityMask; + + inline float4 Refraction(v2f i, float indexOfRefraction, float chromaticAberration) + { + float4 screenPos = i.screenPos; + #if UNITY_UV_STARTS_AT_TOP + float scale = -1.0; + #else + float scale = 1.0; + #endif + float halfPosW = screenPos.w * 0.5; + screenPos.y = (screenPos.y - halfPosW) * _ProjectionParams.x * scale + halfPosW; + #if SHADER_API_D3D9 || SHADER_API_D3D11 + screenPos.w += 0.00000000001; + #endif + float2 projScreenPos = (screenPos / screenPos.w).xy; + float3 worldViewDir = normalize(UnityWorldSpaceViewDir(i.worldPos)); + float3 refractionOffset = ((((indexOfRefraction - 1.0) * mul(UNITY_MATRIX_V, float4(poiMesh.fragmentNormal, 0.0))) * (1.0 / (screenPos.z + 1.0))) * (1.0 - dot(poiMesh.fragmentNormal, worldViewDir))); + float2 cameraRefraction = float2(refractionOffset.x, - (refractionOffset.y * _ProjectionParams.x)); + //return tex2D(_PoiGrab, (projScreenPos + cameraRefraction)); + + float4 redAlpha = tex2D(_PoiGrab, (projScreenPos + cameraRefraction)); + float green = tex2D(_PoiGrab, (projScreenPos + (cameraRefraction * (1.0 - chromaticAberration)))).g; + float blue = tex2D(_PoiGrab, (projScreenPos + (cameraRefraction * (1.0 + chromaticAberration)))).b; + return float4(redAlpha.r, green, blue, redAlpha.a); + } + + void calculateRefraction(v2f i) + { + refraction = Refraction(i, _RefractionIndex, _RefractionChromaticAberattion).rgb; + refractionOpacityMask = UNITY_SAMPLE_TEX2D_SAMPLER(_RefractionOpacityMask, _MainTex, TRANSFORM_TEX(i.uv, _RefractionOpacityMask)); + } + + void applyRefraction(inout float4 finalColor) + { + finalColor.rgb = lerp(refraction * finalColor, finalColor, finalColor.a * alphaMask); + finalColor.a = 1; + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRefraction.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRefraction.cginc.meta new file mode 100644 index 00000000..8b63c980 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRefraction.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b9e2f8418313be440b5720a5380f463e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRimLighting.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRimLighting.cginc new file mode 100644 index 00000000..2f787bb4 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRimLighting.cginc @@ -0,0 +1,95 @@ +#ifndef POI_RIM + #define POI_RIM + + float4 _RimLightColor; + float _RimLightingInvert; + float _RimWidth; + float _RimStrength; + float _RimSharpness; + float _RimLightColorBias; + float4 _RimTexPanSpeed; + float _ShadowMix; + float _ShadowMixThreshold; + float _ShadowMixWidthMod; + float _EnableRimLighting; + float _RimBrighten; + + //enviro rim + float _EnableEnvironmentalRim; + UNITY_DECLARE_TEX2D_NOSAMPLER(_RimEnviroMask); float4 _RimEnviroMask_ST; + float _RimEnviroBlur; + float _RimEnviroMinBrightness; + float _RimEnviroWidth; + float _RimEnviroSharpness; + + UNITY_DECLARE_TEX2D_NOSAMPLER(_RimTex); float4 _RimTex_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_RimMask); float4 _RimMask_ST; + + UNITY_DECLARE_TEX2D_NOSAMPLER(_RimWidthNoiseTexture); float4 _RimWidthNoiseTexture_ST; + float _RimWidthNoiseStrength; + float4 _RimWidthNoisePan; + + float4 rimColor = float4(0, 0, 0, 0); + float rim = 0; + + void calculateRimLighting() + { + _RimWidthNoiseTexture_ST.zw += _Time.y * _RimWidthNoisePan.xy; + float rimNoise = UNITY_SAMPLE_TEX2D_SAMPLER(_RimWidthNoiseTexture, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _RimWidthNoiseTexture)); + rimNoise = (rimNoise - .5) * _RimWidthNoiseStrength; + UNITY_BRANCH + if (_RimLightingInvert) + { + poiCam.viewDotNormal = 1 - poiCam.viewDotNormal; + } + _RimWidth -= rimNoise; + float rimMask = UNITY_SAMPLE_TEX2D_SAMPLER(_RimMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _RimMask)); + rimColor = UNITY_SAMPLE_TEX2D_SAMPLER(_RimTex, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _RimTex) + _Time.y * _RimTexPanSpeed.xy) * _RimLightColor; + _RimWidth = lerp(_RimWidth, _RimWidth * lerp(0, 1, poiLight.lightMap - _ShadowMixThreshold) * _ShadowMixWidthMod, _ShadowMix); + rim = 1 - smoothstep(min(_RimSharpness, _RimWidth), _RimWidth, poiCam.viewDotNormal); + rim *= _RimLightColor.a * rimColor.a * rimMask; + } + + void applyRimColor(inout float4 finalColor) + { + finalColor.rgb = lerp(finalColor.rgb, lerp(finalColor.rgb, rimColor, _RimLightColorBias) + lerp(finalColor.rgb, rimColor, _RimLightColorBias) * _RimBrighten, rim); + } + void ApplyRimEmission(inout float4 finalColor) + { + finalColor.rgb += rim * lerp(finalColor.rgb, rimColor, _RimLightColorBias) * _RimStrength; + } + + void applyEnviroRim(inout float4 finalColor) + { + UNITY_BRANCH + if(_EnableEnvironmentalRim) + { + float enviroRimAlpha = saturate(1 - smoothstep(min(_RimEnviroSharpness, _RimEnviroWidth), _RimEnviroWidth, poiCam.viewDotNormal)); + _RimEnviroBlur *= 1.7 - 0.7 * _RimEnviroBlur; + + float3 enviroRimColor = 0; + float interpolator = unity_SpecCube0_BoxMin.w; + UNITY_BRANCH + if(interpolator < 0.99999) + { + //Probe 1 + float4 reflectionData0 = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, poiMesh.fragmentNormal, _RimEnviroBlur * UNITY_SPECCUBE_LOD_STEPS); + float3 reflectionColor0 = DecodeHDR(reflectionData0, unity_SpecCube0_HDR); + + //Probe 2 + float4 reflectionData1 = UNITY_SAMPLE_TEXCUBE_SAMPLER_LOD(unity_SpecCube1, unity_SpecCube0, poiMesh.fragmentNormal, _RimEnviroBlur * UNITY_SPECCUBE_LOD_STEPS); + float3 reflectionColor1 = DecodeHDR(reflectionData1, unity_SpecCube1_HDR); + + enviroRimColor = lerp(reflectionColor1, reflectionColor0, interpolator); + } + else + { + float4 reflectionData = UNITY_SAMPLE_TEXCUBE_LOD(unity_SpecCube0, poiMesh.fragmentNormal, _RimEnviroBlur * UNITY_SPECCUBE_LOD_STEPS); + enviroRimColor = DecodeHDR(reflectionData, unity_SpecCube0_HDR); + } + + half enviroMask = poiMax(UNITY_SAMPLE_TEX2D_SAMPLER(_RimEnviroMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _RimEnviroMask)).rgb); + finalColor.rgb += lerp(0, max(0, (enviroRimColor - _RimEnviroMinBrightness) * albedo.rgb), enviroRimAlpha).rgb * enviroMask; + } + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRimLighting.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRimLighting.cginc.meta new file mode 100644 index 00000000..beb87396 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiRimLighting.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d196cf8209464f499f85f52ebc89bb8 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowFrag.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowFrag.cginc new file mode 100644 index 00000000..7f504e4c --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowFrag.cginc @@ -0,0 +1,44 @@ +#ifndef SHADOW_FRAG + #define SHADOW_FRAG + + float2 _MainDistanceFade; + float _ForceOpaque; + half4 fragShadowCaster( + #if !defined(V2F_SHADOW_CASTER_NOPOS_IS_EMPTY) || defined(UNITY_STANDARD_USE_SHADOW_UVS) + VertexOutputShadowCaster i + #endif + ): SV_Target + { + #ifdef POI_MIRROR + applyMirrorRenderFrag(); + #endif + + #if defined(UNITY_STANDARD_USE_SHADOW_UVS) + half alpha = UNITY_SAMPLE_TEX2D(_MainTex, TRANSFORM_TEX(i.uv, _MainTex)).a; + alpha *= smoothstep(_MainDistanceFade.x, _MainDistanceFade.y, distance(i.modelPos, _WorldSpaceCameraPos)); + half alphaMask = tex2D(_AlphaMask, TRANSFORM_TEX(i.uv, _AlphaMask)); + + #ifdef POI_DISSOLVE + alpha *= calculateShadowDissolveAlpha(i.worldPos, i.localPos, i.uv); + #endif + + #ifdef POI_RANDOM + alpha *= i.angleAlpha; + #endif + + #ifdef CUTOUT + clip(alpha * alphaMask - _Clip); + UNITY_BRANCH + if (!_ForceOpaque) + { + clip(_Color.a - .75); + } + #endif + #ifdef TRANSPARENT + clip(alpha * alphaMask * _Color.a - 0.99); + #endif + #endif + SHADOW_CASTER_FRAGMENT(i) + } + + #endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowFrag.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowFrag.cginc.meta new file mode 100644 index 00000000..1db33353 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowFrag.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b00e388b635889144a85434f7d9747e4 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowIncludes.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowIncludes.cginc new file mode 100644 index 00000000..f2fdb268 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowIncludes.cginc @@ -0,0 +1,33 @@ +#ifndef SHADOW_INCLUDES + #define SHADOW_INCLUDES + + #define UNITY_STANDARD_USE_SHADOW_UVS 1 + + float4 _Color; + float _Clip; + UNITY_DECLARE_TEX2D(_MainTex); float4 _MainTex_ST; + float4 _GlobalPanSpeed; + sampler2D _AlphaMask; float4 _AlphaMask_ST; + + struct VertexInput + { + float4 vertex: POSITION; + float3 normal: NORMAL; + float2 uv0: TEXCOORD0; + }; + + #if !defined(V2F_SHADOW_CASTER_NOPOS_IS_EMPTY) || defined(UNITY_STANDARD_USE_SHADOW_UVS) + struct VertexOutputShadowCaster + { + V2F_SHADOW_CASTER_NOPOS + #if defined(UNITY_STANDARD_USE_SHADOW_UVS) + float2 uv: TEXCOORD1; + #endif + float3 modelPos: TEXCOORD2; + float3 worldPos: TEXCOORD3; + float3 localPos: TEXCOORD4; + float3 angleAlpha: TEXCOORD5; + }; + #endif + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowIncludes.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowIncludes.cginc.meta new file mode 100644 index 00000000..39a08379 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowIncludes.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2accc6aa74edc854ea1a4e9ae7e0d50c +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowVert.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowVert.cginc new file mode 100644 index 00000000..7c1530e0 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowVert.cginc @@ -0,0 +1,18 @@ +void vertShadowCaster(VertexInput v, +#if !defined(V2F_SHADOW_CASTER_NOPOS_IS_EMPTY) || defined(UNITY_STANDARD_USE_SHADOW_UVS) + out VertexOutputShadowCaster o, +#endif +out float4 opos: SV_POSITION) +{ + TRANSFER_SHADOW_CASTER_NOPOS(o, opos) + o.modelPos = mul(unity_ObjectToWorld, float4(0, 0, 0, 1)); + #if defined(UNITY_STANDARD_USE_SHADOW_UVS) + o.uv = TRANSFORM_TEX(v.uv0 + _GlobalPanSpeed.xy * float2(_Time.y, _Time.y), _MainTex); + #endif + o.localPos = v.vertex; + o.worldPos = mul(unity_ObjectToWorld, o.localPos); + o.angleAlpha = 1; + #ifdef POI_RANDOM + o.angleAlpha = ApplyAngleBasedRendering(o.modelPos, o.worldPos); + #endif +}
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowVert.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowVert.cginc.meta new file mode 100644 index 00000000..ad429ee3 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiShadowVert.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 47e9da9ff9584eb4cbdab7d953837bb6 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSpecular.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSpecular.cginc new file mode 100644 index 00000000..acf24f56 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSpecular.cginc @@ -0,0 +1,207 @@ +#ifndef POI_SPECULAR + #define POI_SPECULAR + int _SpecWhatTangent; + int _SpecularType; + int _SmoothnessFrom; + UNITY_DECLARE_TEX2D_NOSAMPLER(_SpecularMap); float4 _SpecularMap_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_ShiftTexture); float4 _ShiftTexture_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_AnisoTangentMap); float4 _AnisoTangentMap_ST; + UNITY_DECLARE_TEX2D_NOSAMPLER(_SpecularMask); float4 _SpecularMask_ST; + float4 _SpecularTint; + float _SpecularSmoothness; + float _Spec1Offset; + float _Spec1JitterStrength; + float _Spec2Smoothness; + float _Spec2Offset; + float _Spec2JitterStrength; + float _AnisoUseTangentMap; + float _AnisoSpec1Alpha; + float _AnisoSpec2Alpha; + float _SpecularInvertSmoothness; + half _SpecularMixAlbedoIntoTint; + // Toon + half4 _SpecularToonInnerOuter; + + // Globals + half3 finalSpecular; + float shiftTexture; + float3 tangentDirectionMap; + float4 specularMap; + UnityIndirect ZeroIndirect() + { + UnityIndirect ind; + ind.diffuse = 0; + ind.specular = 0; + return ind; + } + + // From unity just putting it here in case I want to mod it + half4 poiRealisticSpecular(half3 diffColor, half3 specColor, half oneMinusReflectivity, half smoothness, + float3 normal, + UnityLight light, UnityIndirect gi) + { + float perceptualRoughness = SmoothnessToPerceptualRoughness(smoothness); + #define UNITY_HANDLE_CORRECTLY_NEGATIVE_NDOTV 0 + + #if UNITY_HANDLE_CORRECTLY_NEGATIVE_NDOTV + half shiftAmount = dot(normal, poiCam.viewDir); + normal = shiftAmount < 0.0f ? normal + poiCam.viewDir * (-shiftAmount + 1e-5f): normal; + float nv = saturate(dot(normal, poiCam.viewDir)); + #else + half nv = abs(dot(normal, poiCam.viewDir)); + #endif + + float nl = saturate(dot(normal, light.dir)); + float nh = saturate(dot(normal, poiLight.halfDir)); + + half lv = saturate(dot(light.dir, poiCam.viewDir)); + half lh = saturate(dot(light.dir, poiLight.halfDir)); + + half diffuseTerm = DisneyDiffuse(nv, nl, lh, perceptualRoughness) * nl; + + float roughness = PerceptualRoughnessToRoughness(perceptualRoughness); + + roughness = max(roughness, 0.002); + float V = SmithJointGGXVisibilityTerm(nl, nv, roughness); + float D = GGXTerm(nh, roughness); + + float specularTerm = V * D * UNITY_PI; + + #ifdef UNITY_COLORSPACE_GAMMA + specularTerm = sqrt(max(1e-4h, specularTerm)); + #endif + + specularTerm = max(0, specularTerm * nl); + #if defined(_POI_SPECULARHIGHLIGHTS_OFF) + specularTerm = 0.0; + #endif + + half surfaceReduction; + #ifdef UNITY_COLORSPACE_GAMMA + surfaceReduction = 1.0 - 0.28 * roughness * perceptualRoughness; + #else + surfaceReduction = 1.0 / (roughness * roughness + 1.0); + #endif + + specularTerm *= any(specColor) ? 1.0: 0.0; + + half grazingTerm = saturate(smoothness + (1 - oneMinusReflectivity)); + half3 color = diffColor * (gi.diffuse + light.color * diffuseTerm) + + specularTerm * light.color * FresnelTerm(specColor, lh) + + surfaceReduction * gi.specular * FresnelLerp(specColor, grazingTerm, nv); + + return half4(color, 1); + } + + void calculateRealisticSpecular(float4 albedo, float2 uv) + { + + half oneMinusReflectivity; + + UnityLight unityLight; + unityLight.color = poiLight.color; + unityLight.dir = poiLight.direction; + unityLight.ndotl = poiLight.nDotL; + + UNITY_BRANCH + if (_SmoothnessFrom == 0) + { + half3 diffColor = EnergyConservationBetweenDiffuseAndSpecular(albedo, specularMap.rgb * _SpecularTint.rgb, /*out*/ oneMinusReflectivity); + finalSpecular = poiRealisticSpecular(diffColor, specularMap.rgb, oneMinusReflectivity, specularMap.a * _SpecularSmoothness * lerp(1,-1,_SpecularInvertSmoothness), poiMesh.fragmentNormal, unityLight, ZeroIndirect()); + } + else + { + half3 diffColor = EnergyConservationBetweenDiffuseAndSpecular(albedo, _SpecularTint.rgb, /*out*/ oneMinusReflectivity); + float smoothness = max(max(specularMap.r, specularMap.g), specularMap.b); + finalSpecular = poiRealisticSpecular(diffColor, 1, oneMinusReflectivity, smoothness * _SpecularSmoothness * lerp(1,-1,_SpecularInvertSmoothness), poiMesh.fragmentNormal, unityLight, ZeroIndirect()); + } + finalSpecular *= lerp(1, albedo.rgb, _SpecularMixAlbedoIntoTint); + } + + void calculateToonSpecular(float4 albedo, float2 uv) + { + /* + finalSpecular = 1; + calculateRealisticSpecular(albedo, uv); + float specIntensity = dot(finalSpecular.rgb, grayscale_for_light()); + finalSpecular.rgb = smoothstep(0.99, 1, specIntensity) * poiLight.color.rgb * poiLight.attenuation; + */ + finalSpecular = smoothstep(1 - _SpecularToonInnerOuter.y, 1 - _SpecularToonInnerOuter.x, dot(poiLight.halfDir, poiMesh.fragmentNormal) * poiLight.attenuation) * poiLight.color.rgb; + UNITY_BRANCH + if (_SmoothnessFrom == 0) + { + finalSpecular.rgb *= specularMap.rgb * lerp(1, albedo.rgb, _SpecularMixAlbedoIntoTint); + finalSpecular *= specularMap.a; + } + else + { + finalSpecular *= specularMap.r * lerp(1, albedo.rgb, _SpecularMixAlbedoIntoTint); + } + } + + float3 strandSpecular(float TdotL, float TdotV, float specPower) + { + float Specular = saturate(poiLight.nDotL) * pow(saturate(sqrt(1.0 - (TdotL * TdotL)) * sqrt(1.0 - (TdotV * TdotV)) - TdotL * TdotV), specPower); + half normalization = sqrt((specPower + 1) * ((specPower) + 1)) / (8 * pi);// + Specular *= normalization; + return Specular; + } + + void AnisotropicSpecular() + { + float3 tangentOrBitangent = _SpecWhatTangent ? poiMesh.tangent: poiMesh.bitangent; + + + float4 packedTangentMap = UNITY_SAMPLE_TEX2D_SAMPLER(_AnisoTangentMap, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _AnisoTangentMap)); + float3 normalLocalAniso = lerp(float3(0, 0, 1), UnpackNormal(packedTangentMap), _AnisoUseTangentMap); + normalLocalAniso = BlendNormals(normalLocalAniso, poiMesh.tangentSpaceNormal); + //float3 normalDirection = normalize(mul(poiMesh.fragmentNormal, poiTData.tangentTransform)); + float3 normalDirectionAniso = Unity_SafeNormalize(mul(normalLocalAniso, poiTData.tangentTransform)); + float3 tangentDirection = mul(poiTData.tangentTransform, tangentOrBitangent).xyz; + float3 viewReflectDirectionAniso = reflect(-poiCam.viewDir, normalDirectionAniso); // possible bad negation + tangentDirectionMap = mul(poiTData.tangentToWorld, float3(normalLocalAniso.rg, 0.0)).xyz; + tangentDirectionMap = normalize(lerp(tangentOrBitangent, tangentDirectionMap, _AnisoUseTangentMap)); + float TdotL = dot(poiLight.direction, tangentDirectionMap); + float TdotV = dot(poiCam.viewDir, tangentDirectionMap); + float TdotH = dot(poiLight.halfDir, tangentDirectionMap); + half specPower = RoughnessToSpecPower(1.0 - _SpecularSmoothness * specularMap.a); + half spec2Power = RoughnessToSpecPower(1.0 - _Spec2Smoothness * specularMap.a); + half Specular = 0; + + float3 spec = strandSpecular(TdotL, TdotV, specPower) * _AnisoSpec1Alpha; + float3 spec2 = strandSpecular(TdotL, TdotV, spec2Power) * _AnisoSpec2Alpha; + + finalSpecular = max(spec, spec2) * specularMap.rgb * _SpecularTint.a * poiLight.color * lerp(1, albedo.rgb, _SpecularMixAlbedoIntoTint); + } + + void calculateSpecular(float4 albedo) + { + specularMap = UNITY_SAMPLE_TEX2D_SAMPLER(_SpecularMap, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _SpecularMap)); + + UNITY_BRANCH + if (_SpecularType == 1) // Realistic + { + calculateRealisticSpecular(albedo, poiMesh.uv[0]); + finalSpecular *= poiLight.attenuation; + } + UNITY_BRANCH + if (_SpecularType == 2) // Toon + { + calculateToonSpecular(albedo, poiMesh.uv[0]); + } + UNITY_BRANCH + if (_SpecularType == 3) // anisotropic + { + AnisotropicSpecular(); + } + } + + void applySpecular(inout float4 finalColor) + { + half specularMask = UNITY_SAMPLE_TEX2D_SAMPLER(_SpecularMask, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _SpecularMask)).r; + finalSpecular *= _SpecularTint.a; + finalSpecular = finalSpecular.rgb * _SpecularTint.rgb * saturate(poiMax(poiLight.color.rgb)); + finalColor.rgb += finalSpecular * specularMask; + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSpecular.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSpecular.cginc.meta new file mode 100644 index 00000000..0b0570cb --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSpecular.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0fb2e921a4d806742a0096c3041686e2 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSubsurfaceScattering.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSubsurfaceScattering.cginc new file mode 100644 index 00000000..b290d7e3 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSubsurfaceScattering.cginc @@ -0,0 +1,35 @@ +#ifndef SUBSURFACE + #define SUBSURFACE + + float _SSSThicknessMod; + float _SSSStrength; + float _SSSPower; + float _SSSDistortion; + float4 _SSSColor; + float _EnableSSS; + + UNITY_DECLARE_TEX2D_NOSAMPLER(_SSSThicknessMap); float4 _SSSThicknessMap_ST; + + float3 finalSSS; + + void calculateSubsurfaceScattering() + { + float SSS = 1 - UNITY_SAMPLE_TEX2D_SAMPLER(_SSSThicknessMap, _MainTex, TRANSFORM_TEX(poiMesh.uv[0], _SSSThicknessMap)); + + half3 vLTLight = poiLight.direction + poiMesh.vertexNormal * _SSSDistortion; + half flTDot = pow(saturate(dot(poiCam.viewDir, -vLTLight)), _SSSPower) * _SSSStrength; + #ifdef FORWARD_BASE_PASS + half3 fLT = (flTDot) * saturate(SSS + - 1 * _SSSThicknessMod); + #else + half3 fLT = poiLight.attenuation * (flTDot) * saturate(SSS + - 1 * _SSSThicknessMod); + #endif + + finalSSS = fLT; + } + + void applySubsurfaceScattering(inout float4 finalColor) + { + finalColor.rgb += finalSSS * poiLight.color * albedo * _SSSColor; + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSubsurfaceScattering.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSubsurfaceScattering.cginc.meta new file mode 100644 index 00000000..da20e3d5 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiSubsurfaceScattering.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: df02917e60a4c134d854d059c784e6b9 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiTouch.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiTouch.cginc new file mode 100644 index 00000000..ada341f3 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiTouch.cginc @@ -0,0 +1,33 @@ +#ifndef POI_TOUCH + #define POI_TOUCH + + sampler2D _BulgeMask; + sampler2D _CameraDepthTexture; + float _BuldgeFadeLength; + float _BuldgeHeight; + + void bulgyWolgy(inout v2f o) + { + float depth = DecodeFloatRG(tex2Dlod(_CameraDepthTexture, float4(o.screenPos.xy / o.screenPos.w, 0, 0))); + float bulgeMask = tex2Dlod(_BulgeMask, float4(o.uv, 0, 0)); + depth = Linear01Depth(depth); + + float intersect = 0; + if (depth != 1) + { + float diff = distance(depth, Linear01Depth(o.pos.z / o.pos.w)); + if(diff > 0) + { + intersect = 1 - smoothstep(0, _ProjectionParams.w * _BuldgeFadeLength, diff); + } + } + float4 offset = intersect * _BuldgeHeight * float4(o.normal, 0); + + offset = IsInMirror() ? 0 : offset; + + o.worldPos = mul(unity_ObjectToWorld, o.localPos) + offset; + o.localPos = mul(unity_WorldToObject, o.worldPos); + o.pos = UnityObjectToClipPos(o.localPos); + } + +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiTouch.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiTouch.cginc.meta new file mode 100644 index 00000000..10b357eb --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiTouch.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 752ee284ed2a5f54893460881e53e619 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiVert.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiVert.cginc new file mode 100644 index 00000000..4af8633c --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiVert.cginc @@ -0,0 +1,63 @@ +#ifndef POI_VERT + #define POI_VERT + + void ComputeVertexLightColor(inout v2f i) + { + #if defined(VERTEXLIGHT_ON) + i.vertexLightColor = Shade4PointLights( + unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, + unity_LightColor[0].rgb, unity_LightColor[1].rgb, + unity_LightColor[2].rgb, unity_LightColor[3].rgb, + unity_4LightAtten0, i.worldPos, i.normal + ); + #endif + } + + v2f vert(appdata v) + { + UNITY_SETUP_INSTANCE_ID(v); + v2f o; + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + #ifdef POI_MIRROR + applyMirrorRenderVert(v.vertex); + #endif + + TANGENT_SPACE_ROTATION; + o.localPos = v.vertex; + o.pos = UnityObjectToClipPos(o.localPos); + o.screenPos = ComputeScreenPos(o.pos); + o.worldPos = mul(unity_ObjectToWorld, o.localPos); + o.uv0 = v.uv0.xy; + o.uv1 = v.uv1.xy; + o.uv2 = v.uv2.xy; + o.uv3 = v.uv3.xy; + o.normal = UnityObjectToWorldNormal(v.normal); + o.tangent = normalize(mul(unity_ObjectToWorld, float4(v.tangent.xyz, 0.0)).xyz); + o.bitangent = normalize(cross(o.normal, o.tangent) * v.tangent.w); + o.modelPos = mul(unity_ObjectToWorld, float4(0, 0, 0, 1)); + + #ifdef POI_TOUCH + bulgyWolgy(o); + #endif + + o.angleAlpha = 1; + #ifdef POI_RANDOM + o.angleAlpha = ApplyAngleBasedRendering(o.modelPos, o.worldPos); + #endif + + float3x3 objectToTangent = float3x3( + v.tangent.xyz, + cross(v.normal, v.tangent.xyz) * v.tangent.w, + v.normal + ); + o.tangentViewDir = mul(objectToTangent, ObjSpaceViewDir(v.vertex)); + + UNITY_TRANSFER_SHADOW(o, o.uv0); + UNITY_TRANSFER_FOG(o, o.pos); + ComputeVertexLightColor(o); + return o; + } +#endif
\ No newline at end of file diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiVert.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiVert.cginc.meta new file mode 100644 index 00000000..a13470ae --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/PoiVert.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8776894305708524da49f0d0841e51b8 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/Poicludes.cginc b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/Poicludes.cginc new file mode 100644 index 00000000..352a0533 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/Poicludes.cginc @@ -0,0 +1,147 @@ +#ifndef POICLUDES + #define POICLUDES + + #include "UnityCG.cginc" + #include "Lighting.cginc" + #include "UnityPBSLighting.cginc" + #include "AutoLight.cginc" + + UNITY_DECLARE_TEX2D(_MainTex); float4 _MainTex_ST; + + //Structs + struct appdata + { + float4 vertex: POSITION; + float3 normal: NORMAL; + float4 tangent: TANGENT; + float4 color: COLOR; + float2 uv0: TEXCOORD0; + float2 uv1: TEXCOORD1; + float2 uv2: TEXCOORD2; + float2 uv3: TEXCOORD3; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float4 pos: SV_POSITION; + float2 uv0: TEXCOORD0; + float2 uv1: TEXCOORD1; + float2 uv2: TEXCOORD2; + float2 uv3: TEXCOORD3; + float3 normal: TEXCOORD4; + float3 tangent: TEXCOORD5; + float3 bitangent: TEXCOORD6; + float4 worldPos: TEXCOORD7; + float4 localPos: TEXCOORD8; + float4 screenPos: TEXCOORD9; + float3 tangentViewDir: TEXCOORD10; + float3 modelPos: TEXCOORD11; + float angleAlpha: TEXCOORD12; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + UNITY_SHADOW_COORDS(13) + UNITY_FOG_COORDS(14) + #if defined(VERTEXLIGHT_ON) + float3 vertexLightColor: TEXCOORD15; + #endif + }; + + #ifdef OUTLINE + float _LineWidth; + float _OutlineEmission; + float4 _LineColor; + sampler2D _OutlineTexture; float4 _OutlineTexture_ST; + float4 _OutlineTexturePan; + + float4 _OutlineFadeDistance; + float4 _OutlineGlobalPan; + #endif + + struct PoiLighting + { + half3 direction; + half3 color; + half attenuation; + half3 directLighting; + half3 indirectLighting; + half lightMap; + half3 rampedLightMap; + half3 finalLighting; + half3 halfDir; + #if defined(VERTEXLIGHT_ON) + half3 vertexLightColor; + #endif + half nDotL; + half nDotH; + half lDotv; + half lDotH; + half nDotV; + half vNDotV; + half diffuseTerm; + }; + + struct PoiCamera + { + half3 viewDir; + half3 tangentViewDir; + half3 forwardDir; + half3 worldPos; + float viewDotNormal; + float distanceToModel; + float distanceToVert; + float3 reflectionDir; + float3 vertexReflectionDir; + }; + + struct PoiMesh + { + float3 vertexNormal; + float3 fragmentNormal; + float3 tangent; + float3 bitangent; + float3 localPos; + float3 worldPos; + float3 modelPos; + float3 tangentSpaceNormal; + float2 uv[4]; + }; + + struct PoiTangentData + { + float3x3 tangentTransform; + float3x3 tangentToWorld; + }; + + struct FragmentCommonData + { + half3 diffColor, specColor; + // Note: smoothness & oneMinusReflectivity for optimization purposes, mostly for DX9 SM2.0 level. + // Most of the math is being done on these (1-x) values, and that saves a few precious ALU slots. + half oneMinusReflectivity, smoothness; + float3 normalWorld; + float3 eyeVec; + half alpha; + float3 posWorld; + + #if UNITY_STANDARD_SIMPLE + half3 reflUVW; + #endif + + #if UNITY_STANDARD_SIMPLE + half3 tangentSpaceNormal; + #endif + }; + + static PoiLighting poiLight; + static PoiCamera poiCam; + static PoiMesh poiMesh; + static UnityGI gi; + static FragmentCommonData s; + static PoiTangentData poiTData; + float4 finalColor; + float4 mainTexture; + float4 albedo; + #define pi float(3.14159265359) + +#endif diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/Poicludes.cginc.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/Poicludes.cginc.meta new file mode 100644 index 00000000..594e0f3e --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Includes/Poicludes.cginc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e627afcc59d20744191e9c16f68157ae +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon.meta new file mode 100644 index 00000000..dea61ae0 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5cc6e5e463427654b9ac97911a0bb36a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonCutout.shader b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonCutout.shader new file mode 100644 index 00000000..a5bd70fa --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonCutout.shader @@ -0,0 +1,667 @@ +Shader ".poiyomi/Patreon/Particle2/Outline Cutout" +{ + Properties + { + [HideInInspector] shader_is_using_thry_editor ("", Float) = 0 + [HideInInspector] shader_master_label ("<color=#ff0000ff>❤</color> <color=#000000ff>Poiyomi Toon Shader V4.2</color> <color=#ff0000ff>❤</color>", Float) = 0 + [HideInInspector] shader_presets ("poiToonPresets", Float) = 0 + + + [HideInInspector] footer_youtube ("youtube footer button", Float) = 0 + [HideInInspector] footer_twitter ("twitter footer button", Float) = 0 + [HideInInspector] footer_patreon ("patreon footer button", Float) = 0 + [HideInInspector] footer_discord ("discord footer button", Float) = 0 + [HideInInspector] footer_github ("github footer button", Float) = 0 + + [HideInInspector] m_mainOptions ("Main", Float) = 0 + _Color ("Color & Alpha", Color) = (1, 1, 1, 1) + _Saturation ("Saturation", Range(-1, 1)) = 0 + _MainEmissionStrength ("Basic Emission", Range(0, 20)) = 0 + _MainTex ("Texture", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _MainTextureUV ("Tex UV#", Int) = 0 + [Normal]_BumpMap ("Normal Map", 2D) = "bump" { } + [Vector2]_MainNormalPan ("Normal Pan", Vector) = (0, 0, 0, 0) + _BumpScale ("Normal Intensity", Range(0, 10)) = 1 + _AlphaMask ("Alpha Mask", 2D) = "white" { } + _Clip ("Alpha Cuttoff", Range(0, 1.001)) = 0.5 + [ToggleUI]_ForceOpaque ("Force Opaque", Float) = 1 + [Vector2]_GlobalPanSpeed ("Global Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_start_DetailOptions ("Details", Float) = 0 + _DetailMask ("Detail Mask (R:Texture, G:Normal)", 2D) = "white" { } + _DetailTex ("Detail Texture", 2D) = "gray" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailTexUV ("Detail Tex UV#", Int) = 0 + _DetailTexIntensity ("Detail Tex Intensity", Range(0, 10)) = 1 + _DetailBrightness ("Detail Brightness:", Range(0, 2)) = 1 + [Vector2]_DetailTexturePan ("Detail Tex Pan", Vector) = (0, 0, 0, 0) + _DetailTint ("Detail Tint", Color) = (1, 1, 1) + [Normal]_DetailNormalMap ("Detail Normal", 2D) = "bump" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailNormalUV ("Detail Normal UV#", Int) = 0 + _DetailNormalMapScale ("Detail Normal Intensity", Range(0, 10)) = 1 + [Vector2]_MainDetailNormalPan ("Detail Normal Pan", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_DetailOptions ("Details", Float) = 0 + [HideInInspector] m_start_Fade ("Fade", Float) = 0 + _MainMinAlpha ("Minimum Alpha", Range(0, 1)) = 0 + _MainFadeTexture ("Fade Map", 2D) = "white" { } + [Vector2]_MainDistanceFade ("Distance Fade X to Y", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_Fade ("Fade", Float) = 0 + + // Particles Start + [HideInInspector] m_particleOptions ("Particles", Float) = 0 + [ToggleUI]_ParticleLit ("Basic Lighting", Float) = 0 + [HDR]_ParticleColor ("Color & Alpha", Color) = (1, 1, 1, 1) + _ParticleTexture ("Texture", 2D) = "white" { } + [ToggleUI]_ParticleRandomRotation ("Random Rotation", Float) = 0 + _ParticleRotation ("Rotation", Range(0, 360)) = 0 + _ParticlePerCMSquared ("Particle/cm^2", Float) = 1 + _ParticleAlphaCutoff ("Alpha Cutoff", Range(0, 1.001)) = 0 + _ParticleMinRenderDistance ("Min Render Distance", Float) = .2 + [Gradient]_ParticleStartColorGradient ("Color Range", 2D) = "white" { } + [ToggleUI]_ColorOverLifetime ("Color Over Lifetime?", Float) = 0 + _ParticleMask ("Particle Mask", 2D) = "white" { } + [Enum(Spherical, 0, Linear, 1)] _ParticleMovementMode ("Movement Mode", Int) = 0 + + [HideInInspector] m_start_sphericalMotion ("Spherical Motion", Float) = 0 + _ColorOverLifeSpeed ("Color/Life Speed", Float) = 1 + _ParticleScaleMin ("Scale min", float) = 0.01 + _ParticleScaleMax ("Scale max", float) = 0.02 + _ParticleSphericalMinSpeed ("Min Speed", Float) = -5 + _ParticleSphericalMaxSpeed ("Max Speed", Float) = 5 + _ParticleSphericalMinRadius ("Min Radius", Float) = 0 + _ParticleSphericalMaxRadius ("Max Radius", Float) = 0.2 + [HideInInspector] m_end_sphericalMotion ("Spherical Movement", Float) = 0 + + [HideInInspector] m_start_LinearMotion ("Linear Movement", Float) = 0 + _ParticleLinearEndOffsetMin ("End Offset Min", Vector) = (0.05, 0.05, 0.05, 0) + _ParticleLinearEndOffsetMax ("End Offset Max", Vector) = (-0.05, -0.05, -0.05, 0) + [ToggleUI]_ParticleFlipParticlesGoingInward ("Flip Particles Going Inward", Float) = 0 + _ParticleLinearSpeedMin ("Min Speed", Float) = 0.1 + _ParticleLinearSpeedMax ("Max Speed", Float) = 10 + _ParticleLinearStartAlpha ("Start Alpha", Float) = 1 + _ParticleLinearEndAlpha ("End Alpha", Float) = 1 + _ParticleLinearStartSizeMin ("Start min Size", Float) = .02 + _ParticleLinearStartSizeMax ("Start max Size", Float) = .02 + _ParticleLinearEndSizeMin ("End min Size", Float) = 0 + _ParticleLinearEndsizeMax ("End max Size", Float) = 0 + _ParticleLinearNormalRange ("Normal Spawn Range", Range(-1, 1)) = -1 + [HideInInspector] m_end_LinearMotion ("Linear Motion", Float) = 0 + + [HideInInspector] m_start_ParticleFlipbook ("Flipbook", Float) = 0 + [ToggleUI]_EnableParticleFlipbook ("Enable Flipbook", Float) = 0 + _ParticleFlipbookTexArray ("Texture Array", 2DArray) = "" { } + _ParticleFlipbookTotalFrames ("Total Frames", Int) = 1 + _ParticleFlipbookFPS ("FPS", Float) = 30.0 + [ToggleUI]_ParticleRandomTimeOffset ("Random Starting Frame?", Float) = 0 + [HideInInspector] m_start_manualParticleFlipbookControl ("Manual Control", Float) = 0 + _ParticleFlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualParticleFlipbookControl ("Manual Control", Float) = 0 + [HideInInspector] m_end_ParticleFlipbook ("Flipbook", Float) = 0 + // Particles End + + [HideInInspector] m_metallicOptions ("Metallic", Float) = 0 + [Toggle(_METALLICGLOSSMAP)]_EnableMetallic ("Enable Metallics", Float) = 0 + _CubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_SampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _MetalReflectionTint ("Reflection Tint", Color) = (1, 1, 1) + _MetallicMask ("Metallic Mask", 2D) = "white" { } + _Metallic ("Metallic", Range(0, 1)) = 0 + _SmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_InvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _Smoothness ("Smoothness", Range(0, 1)) = 0 + + [HideInInspector] m_start_clearCoat ("Clear Coat", Float) = 0 + [Toggle(_COLORCOLOR_ON)]_EnableClearCoat ("Enable Clear Coat", Float) = 0 + [Enum(Vertex, 0, Pixel, 1)] _ClearCoatNormalToUse ("What Normal?", Int) = 0 + _ClearCoatCubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_ClearCoatSampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _ClearCoatTint ("Reflection Tint", Color) = (1, 1, 1) + _ClearCoatMask ("Mask", 2D) = "white" { } + _ClearCoat ("Clear Coat", Range(0, 1)) = 1 + _ClearCoatSmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_ClearCoatInvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _ClearCoatSmoothness ("Smoothness", Range(0, 1)) = 0 + [HideInInspector] m_end_clearCoat ("Clear Coat", Float) = 0 + + [HideInInspector] m_matcapOptions ("Matcap / Sphere Textures", Float) = 0 + [Toggle(_COLORADDSUBDIFF_ON)]_MatcapEnable ("Enable Matcap", Float) = 0 + _MatcapColor ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap ("Matcap", 2D) = "white" { } + _MatcapBorder ("Border", Range(0, .5)) = 0.43 + _MatcapMask ("Mask", 2D) = "white" { } + _MatcapEmissionStrength ("Emission Strength", Range(0, 20)) = 0 + _MatcapIntensity ("Intensity", Range(0, 5)) = 1 + _MatcapLightMask ("Hide in Shadow", Range(0, 1)) = 0 + _MatcapReplace ("Replace With Matcap", Range(0, 1)) = 1 + _MatcapMultiply ("Multiply Matcap", Range(0, 1)) = 0 + _MatcapAdd ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_start_Matcap2 ("Matcap 2", Float) = 0 + [ToggleUI]_Matcap2Enable ("Enable Matcap 2", Float) = 0 + _Matcap2Color ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { } + _Matcap2Border ("Border", Range(0, .5)) = 0.43 + _Matcap2Mask ("Mask", 2D) = "white" { } + _Matcap2EmissionStrength ("Emission Strength", Range(0, 20)) = 0 + _Matcap2Intensity ("Intensity", Range(0, 5)) = 1 + _Matcap2LightMask ("Hide in Shadow", Range(0, 1)) = 0 + _Matcap2Replace ("Replace With Matcap", Range(0, 1)) = 0 + _Matcap2Multiply ("Multiply Matcap", Range(0, 1)) = 0 + _Matcap2Add ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_end_Matcap2 ("Matcap 2", Float) = 0 + + [HideInInspector] m_outlineOptions ("Outlines", Float) = 0 + [Enum(Basic, 0, Tint, 1, Rim Light, 2, Directional, 3, DropShadow, 4)]_OutlineMode ("Mode", Int) = 0 + [ToggleUI]_OutlineUseVertexColors ("V Color as Normal", Float) = 0 + _LineWidth ("Width", Float) = 0 + _LineColor ("Color", Color) = (1, 1, 1, 1) + _OutlineEmission ("Outline Emission", Float) = 0 + _OutlineTexture ("Outline Texture", 2D) = "white" { } + _OutlineMask ("Outline Mask", 2D) = "white" { } + _OutlineTexturePan ("Texture XY | Mask ZW Pan", Vector) = (0, 0, 0, 0) + _OutlineShadowStrength ("Shadow Strength", Range(0, 1)) = 1 + _OutlineRimLightBlend ("Rim Light Blend", Range(0, 1)) = 0 + _OutlinePersonaDirection ("directional Offset XY", Vector) = (1, 0, 0, 0) + _OutlineDropShadowOffset ("Drop Direction XY", Vector) = (1, 0, 0, 0) + [HideInInspector] m_start_outlineAdvanced ("Advanced", Float) = 0 + _OutlineFadeDistance ("Outline distance Fade", Vector) = (0, 0, 0, 0) + [Enum(UnityEngine.Rendering.CullMode)] _OutlineCull ("Cull", Float) = 1 + [HideInInspector] m_end_outlineAdvanced ("Advanced", Float) = 0 + + [HideInInspector] m_emissionOptions ("Emission / Glow", Float) = 0 + [Toggle(_EMISSION)]_EnableEmission ("Enable Emission", Float) = 0 + [ToggleUI]_EmissionReplace ("Replace Base Color", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _EmissionMapUV ("Emission UV#", Int) = 0 + [HDR]_EmissionColor ("Emission Color", Color) = (1, 1, 1, 1) + _EmissionMap ("Emission Map", 2D) = "white" { } + _EmissionMask ("Emission Mask", 2D) = "white" { } + _EmissionPan ("Map(XY) | Mask(ZW) Pan", Vector) = (0, 0, 0, 0) + _EmissionStrength ("Emission Strength", Range(0, 20)) = 0 + + [HideInInspector] m_start_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + [ToggleUI]_EnableGITDEmission ("Enable Glow In The Dark", Float) = 0 + [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh ("Lighting Type", Int) = 0 + _GITDEMinEmissionMultiplier ("Min Emission Multiplier", Range(0, 1)) = 1 + _GITDEMaxEmissionMultiplier ("Max Emission Multiplier", Range(0, 1)) = 0 + _GITDEMinLight ("Min Lighting", Range(0, 1)) = 0 + _GITDEMaxLight ("Max Lighting", Range(0, 1)) = 1 + [HideInInspector] m_end_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + + [HideInInspector] m_start_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + _EmissiveBlink_Min ("Emissive Blink Min", Float) = 1 + _EmissiveBlink_Max ("Emissive Blink Max", Float) = 1 + _EmissiveBlink_Velocity ("Emissive Blink Velocity", Float) = 4 + [HideInInspector] m_end_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + + [HideInInspector] m_start_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + [ToggleUI] _ScrollingEmission ("Enable Scrolling Emission", Float) = 0 + _EmissiveScroll_Direction ("Emissive Scroll Direction", Vector) = (0, -10, 0, 0) + _EmissiveScroll_Width ("Emissive Scroll Width", Float) = 10 + _EmissiveScroll_Velocity ("Emissive Scroll Velocity", Float) = 10 + _EmissiveScroll_Interval ("Emissive Scroll Interval", Float) = 20 + [HideInInspector] m_end_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + + [HideInInspector] m_fakeLightingOptions ("Light & Shadow", Float) = 0 + [Toggle(_NORMALMAP)]_EnableLighting ("Enable Lighting", Float) = 1 + [Enum(Natural, 0, Controlled, 1, Standardish, 2, Math, 3)] _LightingType ("Lighting Type", Int) = 1 + [Gradient]_ToonRamp ("Lighting Ramp", 2D) = "white" { } + _LightingShadowMask ("Shadow Mask (R)", 2D) = "white" { } + _ShadowStrength ("Shadow Strength", Range(0, 1)) = 1 + _ShadowOffset ("Shadow Offset", Range(-1, 1)) = 0 + _AOMap ("AO Map", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _LightingAOUV ("AO Map UV#", Int) = 0 + _AOStrength ("AO Strength", Range(0, 1)) = 1 + [HideInInspector] m_start_lightingAdvanced ("Advanced", Float) = 0 + _IndirectContribution ("Indirect Contribution", Range(0, 1)) = 0 + _AdditiveSoftness ("Additive Softness", Range(0, 0.5)) = 0.005 + _AdditiveOffset ("Additive Offset", Range(-0.5, 0.5)) = 0 + _AttenuationMultiplier ("Attenuation", Range(0, 1)) = 0 + [HideInInspector] m_end_lightingAdvanced ("Advanced", Float) = 0 + + [HideInInspector] m_specularHighlightsOptions ("Specular Highlights", Float) = 0 + [Toggle(_SPECGLOSSMAP)]_EnableSpecular ("Enable Specular", Float) = 0 + [Enum(Realistic, 1, Toon, 2, Anisotropic, 3)] _SpecularType ("Specular Type", Int) = 1 + _SpecularTint ("Specular Tint", Color) = (1, 1, 1, 1) + _SpecularMixAlbedoIntoTint ("Mix Material Color Into Tint", Range(0, 1)) = 0 + _SpecularSmoothness ("Smoothness", Range(0, 1)) = 1 + _SpecularMap ("Specular Map", 2D) = "white" { } + [ToggleUI]_SpecularInvertSmoothness ("Invert Smoothness", Float) = 0 + _SpecularMask ("Specular Mask", 2D) = "white" { } + [Enum(Alpha, 0, Grayscale, 1)] _SmoothnessFrom ("Smoothness From", Int) = 1 + [HideInInspector] m_start_SpecularToon ("Toon", Float) = 0 + [MultiSlider]_SpecularToonInnerOuter ("Inner/Outer Edge", Vector) = (0.25, 0.3, 0, 1) + [HideInInspector] m_end_SpecularToon ("Toon", Float) = 0 + [HideInInspector] m_start_Anisotropic ("Anisotropic", Float) = 0 + [Enum(Tangent, 0, Bitangent, 1)] _SpecWhatTangent ("(Bi)Tangent?", Int) = 0 + _AnisoSpec1Alpha ("Spec1 Alpha", Range(0, 1)) = 1 + _AnisoSpec2Alpha ("Spec2 Alpha", Range(0, 1)) = 1 + //_Spec1Offset ("Spec1 Offset", Float) = 0 + //_Spec1JitterStrength ("Spec1 Jitter Strength", Float) = 1.0 + _Spec2Smoothness ("Spec2 Smoothness", Range(0, 1)) = 0 + //_Spec2Offset ("Spec2 Offset", Float) = 0 + //_Spec2JitterStrength ("Spec2 Jitter Strength", Float) = 1.0 + [ToggleUI]_AnisoUseTangentMap ("Use Directional Map?", Float) = 0 + _AnisoTangentMap ("Anisotropic Directional Map", 2D) = "bump" { } + //_ShiftTexture ("Shift Texture", 2D) = "black" { } + [HideInInspector] m_end_Anisotropic ("Anisotropic", Float) = 0 + + [HideInInspector] m_ParallaxMap ("Parallax", Float) = 0 + [Toggle(_PARALLAXMAP)]_ParallaxMap ("Enable Parallax FX", Float) = 0 + [ToggleUI]_ParallaxHeightMapEnabled ("Enable Parallax Height", Float) = 0 + [ToggleUI]_ParallaxInternalMapEnabled ("Enable Parallax Internal", Float) = 0 + [HideInInspector] m_start_parallaxHeightmap ("Heightmap", Float) = 0 + _ParallaxHeightMap ("Height Map", 2D) = "black" { } + _ParallaxHeightIterations ("Parallax Height Iterations", Range(1, 10)) = 1 + _ParallaxStrength ("Parallax Strength", Range(0, 1)) = 0 + _ParallaxBias ("Parallax Bias (0.42)", Float) = 0.42 + [HideInInspector] m_end_parallaxHeightmap ("Heightmap", Float) = 0 + [HideInInspector] m_start_parallaxInternal ("Internal", Float) = 0 + [Enum(Basic, 0, HeightMap, 1)] _ParallaxInternalHeightmapMode ("Parallax Mode", Int) = 0 + [ToggleUI]_ParallaxInternalHeightFromAlpha ("HeightFromAlpha", Float) = 0 + _ParallaxInternalMap ("Internal Map", 2D) = "black" { } + _ParallaxInternalIterations ("Parallax Internal Iterations", Range(1, 50)) = 1 + _ParallaxInternalMinDepth ("Min Depth", Float) = 0 + _ParallaxInternalMaxDepth ("Max Depth", Float) = 1 + _ParallaxInternalMinFade ("Min Depth Brightness", Range(0, 5)) = 0 + _ParallaxInternalMaxFade ("Max Depth Brightness", Range(0, 5)) = 1 + _ParallaxInternalMinColor ("Min Depth Color", Color) = (1, 1, 1, 1) + _ParallaxInternalMaxColor ("Max Depth Color", Color) = (1, 1, 1, 1) + [Vector2]_ParallaxInternalPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + [Vector2]_ParallaxInternalPanDepthSpeed ("Per Level Speed Multiplier", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_parallaxInternal ("Internal", Float) = 0 + + [HideInInspector] m_subsurfaceOptions ("Subsurface Scattering", Float) = 0 + [Toggle(_TERRAIN_NORMAL_MAP)]_EnableSSS ("Enable Subsurface Scattering", Float) = 0 + _SSSColor ("Subsurface Color", Color) = (1, 1, 1, 1) + _SSSThicknessMap ("Thickness Map", 2D) = "black" { } + _SSSThicknessMod ("Thickness mod", Range(-1, 1)) = 0 + _SSSStrength ("Attenuation", Range(0, 1)) = 0 + _SSSPower ("Light Spread", Range(1, 100)) = 1 + _SSSDistortion ("Light Distortion", Range(0, 1)) = 0 + + [HideInInspector] m_rimLightOptions ("Rim Lighting", Float) = 0 + [Toggle(_GLOSSYREFLECTIONS_OFF)]_EnableRimLighting ("Enable Rim Lighting", Float) = 0 + [ToggleUI]_RimLightingInvert ("Invert Rim Lighting", Float) = 0 + _RimLightColor ("Rim Color", Color) = (1, 1, 1, 1) + _RimWidth ("Rim Width", Range(0, 1)) = 0.8 + _RimSharpness ("Rim Sharpness", Range(0, 1)) = .25 + _RimStrength ("Rim Emission", Range(0, 20)) = 0 + _RimBrighten ("Rim Color Brighten", Range(0, 3)) = 0 + _RimLightColorBias ("Rim Color Bias", Range(0, 1)) = 0 + _RimTex ("Rim Texture", 2D) = "white" { } + _RimMask ("Rim Mask", 2D) = "white" { } + [Vector2]_RimTexPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_start_reflectionRim ("Environmental Rim", Float) = 0 + [ToggleUI]_EnableEnvironmentalRim ("Enable Environmental Rim", Float) = 0 + _RimEnviroMask ("Mask", 2D) = "white" { } + _RimEnviroBlur ("Blur", Range(0, 1)) = 0.7 + _RimEnviroWidth ("Rim Width", Range(0, 1)) = 0.45 + _RimEnviroSharpness ("Rim Sharpness", Range(0, 1)) = 0 + _RimEnviroMinBrightness ("Min Brightness Threshold", Range(0, 2)) = 0 + [HideInInspector] m_end_reflectionRim ("Environmental Rim", Float) = 0 + [HideInInspector] m_start_rimWidthNoise ("Width Noise", Float) = 0 + _RimWidthNoiseTexture ("Rim Width Noise", 2D) = "black" { } + _RimWidthNoiseStrength ("Intensity", Range(0, 1)) = 0.1 + [Vector2]_RimWidthNoisePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_rimWidthNoise ("Width Noise", Float) = 0 + [HideInInspector] m_start_ShadowMix ("Shadow Mix", Float) = 0 + _ShadowMix ("Shadow Mix In", Range(0, 1)) = 0 + _ShadowMixThreshold ("Shadow Mix Threshold", Range(0, 1)) = .5 + _ShadowMixWidthMod ("Shadow Mix Width Mod", Range(0, 10)) = .5 + [HideInInspector] m_end_ShadowMix ("Shadow Mix", Float) = 0 + + [HideInInspector] m_flipBook ("Flipbook", Float) = 0 + [Toggle(_FADING_ON)]_EnableFlipbook ("Enable Flipbook", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _FlipbookUV ("Flipbook UV#", Int) = 0 + [TextureArray]_FlipbookTexArray ("Texture Array", 2DArray) = "" { } + [Vector2]_FlipbookTexturePan ("Texture Panning", Vector) = (0, 0, 0, 0) + [Vector2]_FlipbookMaskPan ("Mask Panning", Vector) = (0, 0, 0, 0) + _FlipbookColor ("Color & alpha", Color) = (1, 1, 1, 1) + _FlipbookTotalFrames ("Total Frames", Int) = 1 + _FlipbookFPS ("FPS", Float) = 30.0 + _FlipbookScaleOffset ("Scale | Offset", Vector) = (1, 1, 0, 0) + [ToggleUI]_FlipbookTiled ("Tiled?", Float) = 0 + _FlipbookEmissionStrength ("Emission Strength", Range(0, 20)) = 0 + _FlipbookRotation ("Rotation", Range(0, 360)) = 0 + _FlipbookRotationSpeed ("Rotation Speed", Float) = 0 + _FlipbookReplace ("Replace", Range(0, 1)) = 1 + _FlipbookMultiply ("Multiply", Range(0, 1)) = 0 + _FlipbookAdd ("Add", Range(0, 1)) = 0 + //[ToggleUI]_FlipbookControlsAlpha ("Flipbook Controls Alpha", Float) = 0 + /* + [HideInInspector] m_start_FlipbookOffsetLoop ("Offset Animation", Float) = 0 + [Enum(Off, 0, Loop, 1, Bounce, 2, Smooth Bounce, 3)]_FlipbookMovementType ("Movement Type", Int) = 1 + _FlipbookStartEndOffset ("Start & End Offset", Vector) = (0,0,0,0) + _FlipbookMovementSpeed ("Speed", Float) = 1.0 + [HideInInspector] m_end_FlipbookOffsetLoop ("Offset Animation", Float) = 0 + */ + [HideInInspector] m_start_manualFlipbookControl ("Manual Control", Float) = 0 + _FlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualFlipbookControl ("Manual Control", Float) = 0 + + [HideInInspector] m_dissolve ("Dissolve", Float) = 0 + [Toggle(_ALPHABLEND_ON)]_EnableDissolve ("Enable Dissolve", Float) = 0 + [Enum(Basic, 1, Point2Point, 2)] _DissolveType ("Dissolve Type", Int) = 1 + _DissolveEdgeWidth ("Edge Width", Range(0, .5)) = 0.025 + _DissolveEdgeHardness ("Edge Hardness", Range(0, 1)) = 0.5 + _DissolveEdgeColor ("Edge Color", Color) = (1, 1, 1, 1) + [Gradient]_DissolveEdgeGradient ("Edge Gradient", 2D) = "white" { } + _DissolveEdgeEmission ("Edge Emission", Range(0, 20)) = 0 + _DissolveTextureColor ("Dissolve to Color", Color) = (1, 1, 1, 1) + _DissolveToTexture ("Dissolve to Texture", 2D) = "white" { } + _DissolveToEmissionStrength ("Dissolve to Emission Strength", Range(0, 20)) = 0 + [Vector2]_DissolveToPanning ("Dissolve to Panning", Vector) = (0, 0, 0, 0) + _DissolveNoiseTexture ("Dissolve Noise", 2D) = "white" { } + [ToggleUI]_DissolveInvertNoise ("Invert Noise", Float) = 0 + _DissolveDetailNoise ("Dissolve Detail Noise", 2D) = "black" { } + [ToggleUI]_DissolveInvertDetailNoise ("Invert Detail Noise", Float) = 0 + _DissolveDetailStrength ("Dissolve Detail Strength", Range(0, 1)) = 0.1 + _DissolvePan ("Noise (XY) | Detail (ZW) Pan", Vector) = (0, 0, 0, 0) + _DissolveAlpha ("Dissolve Alpha", Range(0, 1)) = 0 + _DissolveMask ("Dissolve Mask", 2D) = "white" { } + _ContinuousDissolve ("Continuous Dissolve Speed", Float) = 0 + [HideInInspector] m_start_pointToPoint ("point to point", Float) = 0 + [Enum(Local, 0, World, 1)] _DissolveP2PWorldLocal ("World/Local", Int) = 0 + _DissolveP2PEdgeLength ("Edge Length", Float) = 0.1 + [Vector3]_DissolveStartPoint ("Start Point", Vector) = (0, -1, 0, 0) + [Vector3]_DissolveEndPoint ("End Point", Vector) = (0, 1, 0, 0) + [HideInInspector] m_end_pointToPoint ("Point To Point", Float) = 0 + + [HideInInspector] m_panosphereOptions ("Panosphere / Cubemaps", Float) = 0 + [Toggle(_DETAIL_MULX2)]_PanoToggle ("Enable Panosphere", Float) = 0 + _PanosphereColor ("Color", Color) = (1, 1, 1, 1) + _PanosphereTexture ("Texture", 2D) = "white" { } + _PanoMapTexture ("Mask", 2D) = "white" { } + _PanoEmission ("Emission Strength", Range(0, 10)) = 0 + _PanoBlend ("Alpha", Range(0, 1)) = 0 + [Vector3]_PanospherePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [ToggleUI]_PanoCubeMapToggle ("Use Cubemap", Float) = 0 + [TextureNoSO]_PanoCubeMap ("CubeMap", Cube) = "" { } + + + [HideInInspector] m_StencilPassOptions ("Stencil", Float) = 0 + [IntRange] _StencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + //[IntRange] _StencilReadMaskRef ("Stencil ReadMask Value", Range(0, 255)) = 0 + //[IntRange] _StencilWriteMaskRef ("Stencil WriteMask Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilCompareFunction ("Stencil Compare Function", Float) = 8 + + [HideInInspector] m_start_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + [IntRange] _ParticleStencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _ParticleStencilCompareFunction ("Stencil Compare Function", Float) = 8 + [HideInInspector] m_end_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + + [HideInInspector] m_start_OutlineStencil ("Outline Stencil", Float) = 0 + [IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + //[IntRange] _OutlineStencilReadMaskRef ("Stencil ReadMask Value", Range(0, 255)) = 0 + //[IntRange] _OutlineStencilWriteMaskRef ("Stencil WriteMask Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _OutlineStencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _OutlineStencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _OutlineStencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _OutlineStencilCompareFunction ("Stencil Compare Function", Float) = 8 + [HideInInspector] m_end_OutlineStencil ("Outline Stencil", Float) = 0 + + [HideInInspector] m_mirrorOptions ("Mirror", Float) = 0 + [Toggle(_REQUIRE_UV2)]_EnableMirrorOptions ("Enable Mirror Options", Float) = 0 + [Enum(ShowInBoth, 0, ShowOnlyInMirror, 1, DontShowInMirror, 2)] _Mirror ("Show in mirror", Int) = 0 + [ToggleUI]_EnableMirrorTexture ("Enable Mirror Texture", Float) = 0 + _MirrorTexture ("Mirror Tex", 2D) = "white" { } + + [HideInInspector] m_RandomOptions ("Random", Float) = 0 + [Toggle(_SUNDISK_NONE)]_EnableRandom ("Enable Random", Float) = 0 + [HideInInspector] m_start_Angle ("Angular Rendering", Float) = 0 + [Enum(Camera Face Model, 0, Model Face Camera, 1, Face Each Other, 2)] _AngleType ("Angle Type", Int) = 0 + [Enum(Model, 0, Vertex, 1)] _AngleCompareTo ("Model or Vert Positon", Int) = 0 + [Vector3]_AngleForwardDirection ("Forward Direction", Vector) = (0, 0, 1, 0) + _CameraAngleMin ("Camera Angle Min", Range(0, 180)) = 45 + _CameraAngleMax ("Camera Angle Max", Range(0, 180)) = 90 + _ModelAngleMin ("Model Angle Min", Range(0, 180)) = 45 + _ModelAngleMax ("Model Angle Max", Range(0, 180)) = 90 + _AngleMinAlpha ("Min Alpha", Range(0, 1)) = 0 + [HideInInspector] m_end_Angle ("Angular Rendering", Float) = 0 + + [HideInInspector] m_renderingOptions ("Rendering Options", Float) = 0 + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", Float) = 2 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + [Enum(UnityEngine.Rendering.BlendMode)] _SourceBlend ("Source Blend", Float) = 5 + [Enum(UnityEngine.Rendering.BlendMode)] _DestinationBlend ("Destination Blend", Float) = 10 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Int) = 1 + _ZBias ("ZBias", Float) = 0.0 + + [HideInInspector] m_debugOptions ("Debug", Float) = 0 + [Toggle(_COLOROVERLAY_ON)]_DebugDisplayDebug ("Display Debug Info", Float) = 0 + [Enum(Off, 0, Vertex Normal, 1, Pixel Normal, 2, Tangent, 3, Binormal, 4)] _DebugMeshData ("Mesh Data", Int) = 0 + [Enum(Off, 0, Attenuation, 1, Direct Lighting, 2, Indirect Lighting, 3, light Map, 4, Ramped Light Map, 5, Final Lighting, 6)] _DebugLightingData ("Lighting Data", Int) = 0 + [Enum(Off, 0, View Dir, 1, Tangent View Dir, 2, Forward Dir, 3, WorldPos, 4, View Dot Normal, 5)] _DebugCameraData ("Camera Data", Int) = 0 + } + + //originalEditorCustomEditor "PoiToon" + CustomEditor "Thry.ShaderEditor" + SubShader + { + Tags { "DisableBatching" = "True" "RenderType" = "Opaque" "Queue" = "Geometry" } + + Pass + { + Name "MainPass" + Tags { "LightMode" = "ForwardBase" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + AlphaToMask On + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define FORWARD_BASE_PASS + #pragma shader_feature _PARALLAXMAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // Lighting + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma shader_feature _EMISSION + // Clear Coat + #pragma shader_feature _COLORCOLOR_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + + Pass + { + Tags { "LightMode" = "ForwardAdd" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite Off + Blend One One + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define FORWARD_ADD_PASS + #pragma shader_feature _PARALLAX_MAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // Lighting + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdadd_fullshadows + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + + Pass + { + Name "Outline" + Tags { "LightMode" = "ForwardBase" } + Stencil + { + Ref [_OutlineStencilRef] + Comp [_OutlineStencilCompareFunction] + Pass [_OutlineStencilPassOp] + Fail [_OutlineStencilFailOp] + ZFail [_OutlineStencilZFailOp] + } + ZWrite [_ZWrite] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + Cull [_OutlineCull] + CGPROGRAM + + #pragma target 4.0 + #define FORWARD_BASE_PASS + #define OUTLINE + #pragma multi_compile_fwdbase + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Lighting + #pragma shader_feature _NORMALMAP + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPassOutline.cginc" + ENDCG + + } + + Pass + { + Name "ParticlePass" + Tags { "LightMode" = "ForwardBase" } + + Stencil + { + Ref [_ParticleStencilRef] + Comp [_ParticleStencilCompareFunction] + Pass [_ParticleStencilPassOp] + Fail [_ParticleStencilFailOp] + ZFail [_ParticleStencilZFailOp] + } + ZWrite On + Cull Back + AlphaToMask On + + CGPROGRAM + + #pragma target 4.0 + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex particleVert + #pragma geometry particleGeom + #pragma fragment particleFrag + #include "../Includes/PoiParticlePass.cginc" + ENDCG + + } + + Pass + { + Tags { "LightMode" = "ShadowCaster" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define CUTOUT + #define POISHADOW + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + #pragma multi_compile_instancing + #pragma vertex vertShadowCaster + #pragma fragment fragShadowCaster + #include "../Includes/PoiPassShadow.cginc" + ENDCG + + } + } + Fallback "Toon/Lit Cutout (Double)" +} diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonCutout.shader.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonCutout.shader.meta new file mode 100644 index 00000000..bd0c3222 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonCutout.shader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e230c350a15e81e4399c85e0281d79e4 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonTransparent.shader b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonTransparent.shader new file mode 100644 index 00000000..35a016b0 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonTransparent.shader @@ -0,0 +1,671 @@ +Shader ".poiyomi/Patreon/Particle2/Outline Transparent" +{ + Properties + { + [HideInInspector] shader_is_using_thry_editor ("", Float) = 0 + [HideInInspector] shader_master_label ("<color=#ff0000ff>❤</color> <color=#000000ff>Poiyomi Toon Shader V4.2</color> <color=#ff0000ff>❤</color>", Float) = 0 + [HideInInspector] shader_presets ("poiToonPresets", Float) = 0 + + + [HideInInspector] footer_youtube ("youtube footer button", Float) = 0 + [HideInInspector] footer_twitter ("twitter footer button", Float) = 0 + [HideInInspector] footer_patreon ("patreon footer button", Float) = 0 + [HideInInspector] footer_discord ("discord footer button", Float) = 0 + [HideInInspector] footer_github ("github footer button", Float) = 0 + + [HideInInspector] m_mainOptions ("Main", Float) = 0 + _Color ("Color & Alpha", Color) = (1, 1, 1, 1) + _Saturation ("Saturation", Range(-1, 1)) = 0 + _MainEmissionStrength ("Basic Emission", Range(0, 20)) = 0 + _MainTex ("Texture", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _MainTextureUV ("Tex UV#", Int) = 0 + [Normal]_BumpMap ("Normal Map", 2D) = "bump" { } + [Vector2]_MainNormalPan ("Normal Pan", Vector) = (0, 0, 0, 0) + _BumpScale ("Normal Intensity", Range(0, 10)) = 1 + _AlphaMask ("Alpha Mask", 2D) = "white" { } + _Clip ("Alpha Cuttoff", Range(0, 1.001)) = 0.5 + [Vector2]_GlobalPanSpeed ("Global Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_start_DetailOptions ("Details", Float) = 0 + _DetailMask ("Detail Mask (R:Texture, G:Normal)", 2D) = "white" { } + _DetailTex ("Detail Texture", 2D) = "gray" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailTexUV ("Detail Tex UV#", Int) = 0 + _DetailTexIntensity ("Detail Tex Intensity", Range(0, 10)) = 1 + _DetailBrightness ("Detail Brightness:", Range(0, 2)) = 1 + [Vector2]_DetailTexturePan ("Detail Tex Pan", Vector) = (0, 0, 0, 0) + _DetailTint ("Detail Tint", Color) = (1, 1, 1) + [Normal]_DetailNormalMap ("Detail Normal", 2D) = "bump" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailNormalUV ("Detail Normal UV#", Int) = 0 + _DetailNormalMapScale ("Detail Normal Intensity", Range(0, 10)) = 1 + [Vector2]_MainDetailNormalPan ("Detail Normal Pan", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_DetailOptions ("Details", Float) = 0 + [HideInInspector] m_start_Fade ("Fade", Float) = 0 + _MainMinAlpha ("Minimum Alpha", Range(0, 1)) = 0 + _MainFadeTexture ("Fade Map", 2D) = "white" { } + [Vector2]_MainDistanceFade ("Distance Fade X to Y", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_Fade ("Fade", Float) = 0 + + // Particles Start + [HideInInspector] m_particleOptions ("Particles", Float) = 0 + [ToggleUI]_ParticleLit ("Basic Lighting", Float) = 0 + [HDR]_ParticleColor ("Color & Alpha", Color) = (1, 1, 1, 1) + _ParticleTexture ("Texture", 2D) = "white" { } + [ToggleUI]_ParticleRandomRotation ("Random Rotation", Float) = 0 + _ParticleRotation ("Rotation", Range(0, 360)) = 0 + _ParticlePerCMSquared ("Particle/cm^2", Float) = 1 + _ParticleAlphaCutoff ("Alpha Cutoff", Range(0, 1.001)) = 0 + _ParticleMinRenderDistance ("Min Render Distance", Float) = .2 + [Gradient]_ParticleStartColorGradient ("Color Range", 2D) = "white" { } + [ToggleUI]_ColorOverLifetime ("Color Over Lifetime?", Float) = 0 + _ParticleMask ("Particle Mask", 2D) = "white" { } + [Enum(Spherical, 0, Linear, 1)] _ParticleMovementMode ("Movement Mode", Int) = 0 + + [HideInInspector] m_start_sphericalMotion ("Spherical Motion", Float) = 0 + _ColorOverLifeSpeed ("Color/Life Speed", Float) = 1 + _ParticleScaleMin ("Scale min", float) = 0.01 + _ParticleScaleMax ("Scale max", float) = 0.02 + _ParticleSphericalMinSpeed ("Min Speed", Float) = -5 + _ParticleSphericalMaxSpeed ("Max Speed", Float) = 5 + _ParticleSphericalMinRadius ("Min Radius", Float) = 0 + _ParticleSphericalMaxRadius ("Max Radius", Float) = 0.2 + [HideInInspector] m_end_sphericalMotion ("Spherical Movement", Float) = 0 + + [HideInInspector] m_start_LinearMotion ("Linear Movement", Float) = 0 + _ParticleLinearEndOffsetMin ("End Offset Min", Vector) = (0.05, 0.05, 0.05, 0) + _ParticleLinearEndOffsetMax ("End Offset Max", Vector) = (-0.05, -0.05, -0.05, 0) + [ToggleUI]_ParticleFlipParticlesGoingInward ("Flip Particles Going Inward", Float) = 0 + _ParticleLinearSpeedMin ("Min Speed", Float) = 0.1 + _ParticleLinearSpeedMax ("Max Speed", Float) = 10 + _ParticleLinearStartAlpha ("Start Alpha", Float) = 1 + _ParticleLinearEndAlpha ("End Alpha", Float) = 1 + _ParticleLinearStartSizeMin ("Start min Size", Float) = .02 + _ParticleLinearStartSizeMax ("Start max Size", Float) = .02 + _ParticleLinearEndSizeMin ("End min Size", Float) = 0 + _ParticleLinearEndsizeMax ("End max Size", Float) = 0 + _ParticleLinearNormalRange ("Normal Spawn Range", Range(-1, 1)) = -1 + [HideInInspector] m_end_LinearMotion ("Linear Motion", Float) = 0 + + [HideInInspector] m_start_ParticleFlipbook("Flipbook", Float) = 0 + [ToggleUI]_EnableParticleFlipbook("Enable Flipbook", Float) = 0 + _ParticleFlipbookTexArray ("Texture Array", 2DArray) = "" {} + _ParticleFlipbookTotalFrames ("Total Frames", Int) = 1 + _ParticleFlipbookFPS ("FPS", Float) = 30.0 + [ToggleUI]_ParticleRandomTimeOffset("Random Starting Frame?", Float) = 0 + [HideInInspector] m_start_manualParticleFlipbookControl ("Manual Control", Float) = 0 + _ParticleFlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualParticleFlipbookControl ("Manual Control", Float) = 0 + [HideInInspector] m_end_ParticleFlipbook ("Flipbook", Float) = 0 + // Particles End + + [HideInInspector] m_metallicOptions ("Metallic", Float) = 0 + [Toggle(_METALLICGLOSSMAP)]_EnableMetallic ("Enable Metallics", Float) = 0 + _CubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_SampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _MetalReflectionTint ("Reflection Tint", Color) = (1, 1, 1) + _MetallicMask ("Metallic Mask", 2D) = "white" { } + _Metallic ("Metallic", Range(0, 1)) = 0 + _SmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_InvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _Smoothness ("Smoothness", Range(0, 1)) = 0 + + [HideInInspector] m_start_clearCoat ("Clear Coat", Float) = 0 + [Toggle(_COLORCOLOR_ON)]_EnableClearCoat ("Enable Clear Coat", Float) = 0 + [Enum(Vertex, 0, Pixel, 1)] _ClearCoatNormalToUse ("What Normal?", Int) = 0 + _ClearCoatCubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_ClearCoatSampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _ClearCoatTint ("Reflection Tint", Color) = (1, 1, 1) + _ClearCoatMask ("Mask", 2D) = "white" { } + _ClearCoat ("Clear Coat", Range(0, 1)) = 1 + _ClearCoatSmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_ClearCoatInvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _ClearCoatSmoothness ("Smoothness", Range(0, 1)) = 0 + [HideInInspector] m_end_clearCoat ("Clear Coat", Float) = 0 + + [HideInInspector] m_matcapOptions ("Matcap / Sphere Textures", Float) = 0 + [Toggle(_COLORADDSUBDIFF_ON)]_MatcapEnable ("Enable Matcap", Float) = 0 + _MatcapColor ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap ("Matcap", 2D) = "white" { } + _MatcapBorder ("Border", Range(0, .5)) = 0.43 + _MatcapMask ("Mask", 2D) = "white" { } + _MatcapEmissionStrength ("Emission Strength", Range(0,20)) = 0 + _MatcapIntensity ("Intensity", Range(0, 5)) = 1 + _MatcapLightMask ("Hide in Shadow", Range(0, 1)) = 0 + _MatcapReplace ("Replace With Matcap", Range(0, 1)) = 1 + _MatcapMultiply ("Multiply Matcap", Range(0, 1)) = 0 + _MatcapAdd ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_start_Matcap2 ("Matcap 2", Float) = 0 + [ToggleUI]_Matcap2Enable ("Enable Matcap 2", Float) = 0 + _Matcap2Color ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { } + _Matcap2Border ("Border", Range(0, .5)) = 0.43 + _Matcap2Mask ("Mask", 2D) = "white" { } + _Matcap2EmissionStrength ("Emission Strength", Range(0,20)) = 0 + _Matcap2Intensity ("Intensity", Range(0, 5)) = 1 + _Matcap2LightMask ("Hide in Shadow", Range(0, 1)) = 0 + _Matcap2Replace ("Replace With Matcap", Range(0, 1)) = 0 + _Matcap2Multiply ("Multiply Matcap", Range(0, 1)) = 0 + _Matcap2Add ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_end_Matcap2 ("Matcap 2", Float) = 0 + + [HideInInspector] m_outlineOptions ("Outlines", Float) = 0 + [Enum(Basic, 0, Tint, 1, Rim Light, 2, Directional, 3, DropShadow, 4)]_OutlineMode ("Mode", Int) = 0 + [ToggleUI]_OutlineUseVertexColors ("V Color as Normal", Float) = 0 + _LineWidth ("Width", Float) = 0 + _LineColor ("Color", Color) = (1, 1, 1, 1) + _OutlineTintMix ("Tint Mix", Range(0,1)) = 1 + _OutlineEmission ("Outline Emission", Float) = 0 + _OutlineTexture ("Outline Texture", 2D) = "white" { } + _OutlineMask ("Outline Mask", 2D) = "white" { } + _OutlineTexturePan ("Outline Texture Pan", Vector) = (0, 0, 0, 0) + _OutlineShadowStrength ("Shadow Strength", Range(0, 1)) = 1 + _OutlineRimLightBlend ("Rim Light Blend", Range(0, 1)) = 0 + _OutlinePersonaDirection ("directional Offset XY", Vector) = (1, 0, 0, 0) + _OutlineDropShadowOffset ("Drop Direction XY", Vector) = (1, 0, 0, 0) + [HideInInspector] m_start_outlineAdvanced ("Advanced", Float) = 0 + _OutlineFadeDistance ("Outline distance Fade", Vector) = (0, 0, 0, 0) + + [Enum(UnityEngine.Rendering.CullMode)] _OutlineCull ("Cull", Float) = 1 + [HideInInspector] m_end_outlineAdvanced ("Advanced", Float) = 0 + + [HideInInspector] m_emissionOptions ("Emission / Glow", Float) = 0 + [Toggle(_EMISSION)]_EnableEmission ("Enable Emission", Float) = 0 + [ToggleUI]_EmissionReplace ("Replace Base Color", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _EmissionMapUV ("Emission UV#", Int) = 0 + [HDR]_EmissionColor ("Emission Color", Color) = (1, 1, 1, 1) + _EmissionMap ("Emission Map", 2D) = "white" { } + _EmissionMask ("Emission Mask", 2D) = "white" { } + _EmissionPan ("Map(XY) | Mask(ZW) Pan", Vector) = (0, 0, 0, 0) + _EmissionStrength ("Emission Strength", Range(0, 20)) = 0 + + [HideInInspector] m_start_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + [ToggleUI]_EnableGITDEmission ("Enable Glow In The Dark", Float) = 0 + [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh ("Lighting Type", Int) = 0 + _GITDEMinEmissionMultiplier ("Min Emission Multiplier", Range(0, 1)) = 1 + _GITDEMaxEmissionMultiplier ("Max Emission Multiplier", Range(0, 1)) = 0 + _GITDEMinLight ("Min Lighting", Range(0, 1)) = 0 + _GITDEMaxLight ("Max Lighting", Range(0, 1)) = 1 + [HideInInspector] m_end_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + + [HideInInspector] m_start_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + _EmissiveBlink_Min ("Emissive Blink Min", Float) = 1 + _EmissiveBlink_Max ("Emissive Blink Max", Float) = 1 + _EmissiveBlink_Velocity ("Emissive Blink Velocity", Float) = 4 + [HideInInspector] m_end_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + + [HideInInspector] m_start_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + [ToggleUI] _ScrollingEmission ("Enable Scrolling Emission", Float) = 0 + _EmissiveScroll_Direction ("Emissive Scroll Direction", Vector) = (0, -10, 0, 0) + _EmissiveScroll_Width ("Emissive Scroll Width", Float) = 10 + _EmissiveScroll_Velocity ("Emissive Scroll Velocity", Float) = 10 + _EmissiveScroll_Interval ("Emissive Scroll Interval", Float) = 20 + [HideInInspector] m_end_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + + [HideInInspector] m_fakeLightingOptions ("Light & Shadow", Float) = 0 + [Toggle(_NORMALMAP)]_EnableLighting ("Enable Lighting", Float) = 1 + [Enum(Natural, 0, Controlled, 1, Standardish, 2, Math, 3)] _LightingType ("Lighting Type", Int) = 1 + [Gradient]_ToonRamp ("Lighting Ramp", 2D) = "white" { } + _LightingShadowMask ("Shadow Mask (R)", 2D) = "white" { } + _ShadowStrength ("Shadow Strength", Range(0, 1)) = 1 + _ShadowOffset ("Shadow Offset", Range(-1, 1)) = 0 + _AOMap ("AO Map", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _LightingAOUV ("AO Map UV#", Int) = 0 + _AOStrength ("AO Strength", Range(0, 1)) = 1 + [HideInInspector] m_start_lightingAdvanced ("Advanced", Float) = 0 + _IndirectContribution ("Indirect Contribution", Range(0, 1)) = 0 + _AdditiveSoftness ("Additive Softness", Range(0, 0.5)) = 0.005 + _AdditiveOffset ("Additive Offset", Range(-0.5, 0.5)) = 0 + _AttenuationMultiplier ("Attenuation", Range(0, 1)) = 0 + [HideInInspector] m_end_lightingAdvanced ("Advanced", Float) = 0 + + [HideInInspector] m_specularHighlightsOptions ("Specular Highlights", Float) = 0 + [Toggle(_SPECGLOSSMAP)]_EnableSpecular ("Enable Specular", Float) = 0 + [Enum(Realistic, 1, Toon, 2, Anisotropic, 3)] _SpecularType ("Specular Type", Int) = 1 + _SpecularTint ("Specular Tint", Color) = (1, 1, 1, 1) + _SpecularMixAlbedoIntoTint ("Mix Material Color Into Tint", Range(0, 1)) = 0 + _SpecularSmoothness ("Smoothness", Range(0, 1)) = 1 + _SpecularMap ("Specular Map", 2D) = "white" { } + [ToggleUI]_SpecularInvertSmoothness ("Invert Smoothness", Float) = 0 + _SpecularMask ("Specular Mask", 2D) = "white" { } + [Enum(Alpha, 0, Grayscale, 1)] _SmoothnessFrom ("Smoothness From", Int) = 1 + [HideInInspector] m_start_SpecularToon ("Toon", Float) = 0 + [MultiSlider]_SpecularToonInnerOuter ("Inner/Outer Edge", Vector) = (0.25, 0.3, 0, 1) + [HideInInspector] m_end_SpecularToon ("Toon", Float) = 0 + [HideInInspector] m_start_Anisotropic ("Anisotropic", Float) = 0 + [Enum(Tangent, 0, Bitangent, 1)] _SpecWhatTangent ("(Bi)Tangent?", Int) = 0 + _AnisoSpec1Alpha ("Spec1 Alpha", Range(0, 1)) = 1 + _AnisoSpec2Alpha ("Spec2 Alpha", Range(0, 1)) = 1 + //_Spec1Offset ("Spec1 Offset", Float) = 0 + //_Spec1JitterStrength ("Spec1 Jitter Strength", Float) = 1.0 + _Spec2Smoothness ("Spec2 Smoothness", Range(0, 1)) = 0 + //_Spec2Offset ("Spec2 Offset", Float) = 0 + //_Spec2JitterStrength ("Spec2 Jitter Strength", Float) = 1.0 + [ToggleUI]_AnisoUseTangentMap ("Use Directional Map?", Float) = 0 + _AnisoTangentMap ("Anisotropic Directional Map", 2D) = "bump" { } + //_ShiftTexture ("Shift Texture", 2D) = "black" { } + [HideInInspector] m_end_Anisotropic ("Anisotropic", Float) = 0 + + [HideInInspector] m_ParallaxMap ("Parallax", Float) = 0 + [Toggle(_PARALLAXMAP)]_ParallaxMap ("Enable Parallax FX", Float) = 0 + [ToggleUI]_ParallaxHeightMapEnabled ("Enable Parallax Height", Float) = 0 + [ToggleUI]_ParallaxInternalMapEnabled ("Enable Parallax Internal", Float) = 0 + [HideInInspector] m_start_parallaxHeightmap ("Heightmap", Float) = 0 + _ParallaxHeightMap ("Height Map", 2D) = "black" { } + _ParallaxHeightIterations ("Parallax Height Iterations", Range(1, 10)) = 1 + _ParallaxStrength ("Parallax Strength", Range(0, 1)) = 0 + _ParallaxBias ("Parallax Bias (0.42)", Float) = 0.42 + [HideInInspector] m_end_parallaxHeightmap ("Heightmap", Float) = 0 + [HideInInspector] m_start_parallaxInternal ("Internal", Float) = 0 + [Enum(Basic, 0, HeightMap, 1)] _ParallaxInternalHeightmapMode ("Parallax Mode", Int) = 0 + [ToggleUI]_ParallaxInternalHeightFromAlpha ("HeightFromAlpha", Float) = 0 + _ParallaxInternalMap ("Internal Map", 2D) = "black" { } + _ParallaxInternalIterations ("Parallax Internal Iterations", Range(1, 50)) = 1 + _ParallaxInternalMinDepth ("Min Depth", Float) = 0 + _ParallaxInternalMaxDepth ("Max Depth", Float) = 1 + _ParallaxInternalMinFade ("Min Depth Brightness", Range(0, 5)) = 0 + _ParallaxInternalMaxFade ("Max Depth Brightness", Range(0, 5)) = 1 + _ParallaxInternalMinColor ("Min Depth Color", Color) = (1, 1, 1, 1) + _ParallaxInternalMaxColor ("Max Depth Color", Color) = (1, 1, 1, 1) + [Vector2]_ParallaxInternalPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + [Vector2]_ParallaxInternalPanDepthSpeed ("Per Level Speed Multiplier", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_parallaxInternal ("Internal", Float) = 0 + + [HideInInspector] m_subsurfaceOptions ("Subsurface Scattering", Float) = 0 + [Toggle(_TERRAIN_NORMAL_MAP)]_EnableSSS ("Enable Subsurface Scattering", Float) = 0 + _SSSColor ("Subsurface Color", Color) = (1, 1, 1, 1) + _SSSThicknessMap ("Thickness Map", 2D) = "black" { } + _SSSThicknessMod ("Thickness mod", Range(-1, 1)) = 0 + _SSSStrength ("Attenuation", Range(0, 1)) = 0 + _SSSPower ("Light Spread", Range(1, 100)) = 1 + _SSSDistortion ("Light Distortion", Range(0, 1)) = 0 + + [HideInInspector] m_rimLightOptions ("Rim Lighting", Float) = 0 + [Toggle(_GLOSSYREFLECTIONS_OFF)]_EnableRimLighting ("Enable Rim Lighting", Float) = 0 + [ToggleUI]_RimLightingInvert ("Invert Rim Lighting", Float) = 0 + _RimLightColor ("Rim Color", Color) = (1, 1, 1, 1) + _RimWidth ("Rim Width", Range(0, 1)) = 0.8 + _RimSharpness ("Rim Sharpness", Range(0, 1)) = .25 + _RimStrength ("Rim Emission", Range(0, 20)) = 0 + _RimBrighten ("Rim Color Brighten", Range(0, 3)) = 0 + _RimLightColorBias ("Rim Color Bias", Range(0, 1)) = 0 + _RimTex ("Rim Texture", 2D) = "white" { } + _RimMask ("Rim Mask", 2D) = "white" { } + [Vector2]_RimTexPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_start_reflectionRim ("Environmental Rim", Float) = 0 + [ToggleUI]_EnableEnvironmentalRim ("Enable Environmental Rim", Float) = 0 + _RimEnviroMask ("Mask", 2D) = "white" { } + _RimEnviroBlur ("Blur", Range(0, 1)) = 0.7 + _RimEnviroWidth ("Rim Width", Range(0, 1)) = 0.45 + _RimEnviroSharpness ("Rim Sharpness", Range(0, 1)) = 0 + _RimEnviroMinBrightness ("Min Brightness Threshold", Range(0, 2)) = 0 + [HideInInspector] m_end_reflectionRim ("Environmental Rim", Float) = 0 + [HideInInspector] m_start_rimWidthNoise ("Width Noise", Float) = 0 + _RimWidthNoiseTexture ("Rim Width Noise", 2D) = "black" { } + _RimWidthNoiseStrength ("Intensity", Range(0, 1)) = 0.1 + [Vector2]_RimWidthNoisePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_rimWidthNoise ("Width Noise", Float) = 0 + [HideInInspector] m_start_ShadowMix ("Shadow Mix", Float) = 0 + _ShadowMix ("Shadow Mix In", Range(0, 1)) = 0 + _ShadowMixThreshold ("Shadow Mix Threshold", Range(0, 1)) = .5 + _ShadowMixWidthMod ("Shadow Mix Width Mod", Range(0, 10)) = .5 + [HideInInspector] m_end_ShadowMix ("Shadow Mix", Float) = 0 + + [HideInInspector] m_flipBook ("Flipbook", Float) = 0 + [Toggle(_FADING_ON)]_EnableFlipbook ("Enable Flipbook", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _FlipbookUV ("Flipbook UV#", Int) = 0 + [TextureArray]_FlipbookTexArray ("Texture Array", 2DArray) = "" { } + [Vector2]_FlipbookTexturePan ("Texture Panning", Vector) = (0, 0, 0, 0) + [Vector2]_FlipbookMaskPan ("Mask Panning", Vector) = (0, 0, 0, 0) + _FlipbookColor ("Color & alpha", Color) = (1, 1, 1, 1) + _FlipbookTotalFrames ("Total Frames", Int) = 1 + _FlipbookFPS ("FPS", Float) = 30.0 + _FlipbookScaleOffset ("Scale | Offset", Vector) = (1, 1, 0, 0) + [ToggleUI]_FlipbookTiled ("Tiled?", Float) = 0 + _FlipbookEmissionStrength ("Emission Strength", Range(0, 20)) = 0 + _FlipbookRotation ("Rotation", Range(0, 360)) = 0 + _FlipbookRotationSpeed ("Rotation Speed", Float) = 0 + _FlipbookReplace ("Replace", Range(0, 1)) = 1 + _FlipbookMultiply ("Multiply", Range(0, 1)) = 0 + _FlipbookAdd ("Add", Range(0, 1)) = 0 + //[ToggleUI]_FlipbookControlsAlpha ("Flipbook Controls Alpha", Float) = 0 + /* + [HideInInspector] m_start_FlipbookOffsetLoop ("Offset Animation", Float) = 0 + [Enum(Off, 0, Loop, 1, Bounce, 2, Smooth Bounce, 3)]_FlipbookMovementType ("Movement Type", Int) = 1 + _FlipbookStartEndOffset ("Start & End Offset", Vector) = (0,0,0,0) + _FlipbookMovementSpeed ("Speed", Float) = 1.0 + [HideInInspector] m_end_FlipbookOffsetLoop ("Offset Animation", Float) = 0 + */ + [HideInInspector] m_start_manualFlipbookControl ("Manual Control", Float) = 0 + _FlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualFlipbookControl ("Manual Control", Float) = 0 + + [HideInInspector] m_dissolve ("Dissolve", Float) = 0 + [Toggle(_ALPHABLEND_ON)]_EnableDissolve ("Enable Dissolve", Float) = 0 + [Enum(Basic, 1, Point2Point, 2)] _DissolveType ("Dissolve Type", Int) = 1 + _DissolveEdgeWidth ("Edge Width", Range(0, .5)) = 0.025 + _DissolveEdgeHardness ("Edge Hardness", Range(0, 1)) = 0.5 + _DissolveEdgeColor ("Edge Color", Color) = (1, 1, 1, 1) + [Gradient]_DissolveEdgeGradient ("Edge Gradient", 2D) = "white" { } + _DissolveEdgeEmission ("Edge Emission", Range(0, 20)) = 0 + _DissolveTextureColor ("Dissolve to Color", Color) = (1, 1, 1, 1) + _DissolveToTexture ("Dissolve to Texture", 2D) = "white" { } + _DissolveToEmissionStrength ("Dissolve to Emission Strength", Range(0, 20)) = 0 + [Vector2]_DissolveToPanning ("Dissolve to Panning", Vector) = (0, 0, 0, 0) + _DissolveNoiseTexture ("Dissolve Noise", 2D) = "white" { } + [ToggleUI]_DissolveInvertNoise ("Invert Noise", Float) = 0 + _DissolveDetailNoise ("Dissolve Detail Noise", 2D) = "black" { } + [ToggleUI]_DissolveInvertDetailNoise ("Invert Detail Noise", Float) = 0 + _DissolveDetailStrength ("Dissolve Detail Strength", Range(0, 1)) = 0.1 + _DissolvePan ("Noise (XY) | Detail (ZW) Pan", Vector) = (0, 0, 0, 0) + _DissolveAlpha ("Dissolve Alpha", Range(0, 1)) = 0 + _DissolveMask ("Dissolve Mask", 2D) = "white" { } + _ContinuousDissolve ("Continuous Dissolve Speed", Float) = 0 + [HideInInspector] m_start_pointToPoint ("point to point", Float) = 0 + [Enum(Local, 0, World, 1)] _DissolveP2PWorldLocal ("World/Local", Int) = 0 + _DissolveP2PEdgeLength ("Edge Length", Float) = 0.1 + [Vector3]_DissolveStartPoint ("Start Point", Vector) = (0, -1, 0, 0) + [Vector3]_DissolveEndPoint ("End Point", Vector) = (0, 1, 0, 0) + [HideInInspector] m_end_pointToPoint ("Point To Point", Float) = 0 + + [HideInInspector] m_panosphereOptions ("Panosphere / Cubemaps", Float) = 0 + [Toggle(_DETAIL_MULX2)]_PanoToggle ("Enable Panosphere", Float) = 0 + _PanosphereColor ("Color", Color) = (1, 1, 1, 1) + _PanosphereTexture ("Texture", 2D) = "white" { } + _PanoMapTexture ("Mask", 2D) = "white" { } + _PanoEmission ("Emission Strength", Range(0, 10)) = 0 + _PanoBlend ("Alpha", Range(0, 1)) = 0 + [Vector3]_PanospherePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [ToggleUI]_PanoCubeMapToggle ("Use Cubemap", Float) = 0 + [TextureNoSO]_PanoCubeMap ("CubeMap", Cube) = "" { } + + + [HideInInspector] m_StencilPassOptions ("Stencil", Float) = 0 + [IntRange] _StencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + //[IntRange] _StencilReadMaskRef ("Stencil ReadMask Value", Range(0, 255)) = 0 + //[IntRange] _StencilWriteMaskRef ("Stencil WriteMask Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilCompareFunction ("Stencil Compare Function", Float) = 8 + + [HideInInspector] m_start_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + [IntRange] _ParticleStencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _ParticleStencilCompareFunction ("Stencil Compare Function", Float) = 8 + [HideInInspector] m_end_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + + [HideInInspector] m_start_OutlineStencil ("Outline Stencil", Float) = 0 + [IntRange] _OutlineStencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + //[IntRange] _OutlineStencilReadMaskRef ("Stencil ReadMask Value", Range(0, 255)) = 0 + //[IntRange] _OutlineStencilWriteMaskRef ("Stencil WriteMask Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _OutlineStencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _OutlineStencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _OutlineStencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _OutlineStencilCompareFunction ("Stencil Compare Function", Float) = 8 + [HideInInspector] m_end_OutlineStencil ("Outline Stencil", Float) = 0 + + [HideInInspector] m_mirrorOptions ("Mirror", Float) = 0 + [Toggle(_REQUIRE_UV2)]_EnableMirrorOptions ("Enable Mirror Options", Float) = 0 + [Enum(ShowInBoth, 0, ShowOnlyInMirror, 1, DontShowInMirror, 2)] _Mirror ("Show in mirror", Int) = 0 + [ToggleUI]_EnableMirrorTexture ("Enable Mirror Texture", Float) = 0 + _MirrorTexture ("Mirror Tex", 2D) = "white" { } + + [HideInInspector] m_RandomOptions ("Random", Float) = 0 + [Toggle(_SUNDISK_NONE)]_EnableRandom ("Enable Random", Float) = 0 + [HideInInspector] m_start_Angle ("Angular Rendering", Float) = 0 + [Enum(Camera Face Model, 0, Model Face Camera, 1, Face Each Other, 2)] _AngleType ("Angle Type", Int) = 0 + [Enum(Model, 0, Vertex, 1)] _AngleCompareTo ("Model or Vert Positon", Int) = 0 + [Vector3]_AngleForwardDirection ("Forward Direction", Vector) = (0, 0, 1, 0) + _CameraAngleMin ("Camera Angle Min", Range(0, 180)) = 45 + _CameraAngleMax ("Camera Angle Max", Range(0, 180)) = 90 + _ModelAngleMin ("Model Angle Min", Range(0, 180)) = 45 + _ModelAngleMax ("Model Angle Max", Range(0, 180)) = 90 + _AngleMinAlpha ("Min Alpha", Range(0, 1)) = 0 + [HideInInspector] m_end_Angle ("Angular Rendering", Float) = 0 + + [HideInInspector] m_renderingOptions ("Rendering Options", Float) = 0 + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", Float) = 2 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + [Enum(UnityEngine.Rendering.BlendMode)] _SourceBlend ("Source Blend", Float) = 5 + [Enum(UnityEngine.Rendering.BlendMode)] _DestinationBlend ("Destination Blend", Float) = 10 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Int) = 0 + _ZBias ("ZBias", Float) = 0.0 + + [HideInInspector] m_debugOptions ("Debug", Float) = 0 + [Toggle(_COLOROVERLAY_ON)]_DebugDisplayDebug ("Display Debug Info", Float) = 0 + [Enum(Off, 0, Vertex Normal, 1, Pixel Normal, 2, Tangent, 3, Binormal, 4)] _DebugMeshData ("Mesh Data", Int) = 0 + [Enum(Off, 0, Attenuation, 1, Direct Lighting, 2, Indirect Lighting, 3, light Map, 4, Ramped Light Map, 5, Final Lighting, 6)] _DebugLightingData ("Lighting Data", Int) = 0 + [Enum(Off, 0, View Dir, 1, Tangent View Dir, 2, Forward Dir, 3, WorldPos, 4, View Dot Normal, 5)] _DebugCameraData ("Camera Data", Int) = 0 + } + + //originalEditorCustomEditor "PoiToon" + CustomEditor "Thry.ShaderEditor" + SubShader + { + Tags { "DisableBatching" = "True" "Queue" = "Transparent" "RenderType" = "Transparent" } + //Blend SrcAlpha OneMinusSrcAlpha + Blend [_SourceBlend] [_DestinationBlend] + + Pass + { + Name "MainPass" + Tags { "LightMode" = "ForwardBase" } + + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define TRANSPARENT + #define FORWARD_BASE_PASS + #pragma shader_feature _PARALLAXMAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // Lighting + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma shader_feature _EMISSION + // Clear Coat + #pragma shader_feature _COLORCOLOR_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + + Pass + { + Tags { "LightMode" = "ForwardAdd" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite Off + Blend One One + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define FORWARD_ADD_PASS + #define TRANSPARENT + #pragma shader_feature _PARALLAX_MAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // POI_LIGHTING + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdadd_fullshadows + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + Pass + { + Name "Outline" + Tags { "LightMode" = "ForwardBase" } + Stencil + { + Ref [_OutlineStencilRef] + Comp [_OutlineStencilCompareFunction] + Pass [_OutlineStencilPassOp] + Fail [_OutlineStencilFailOp] + ZFail [_OutlineStencilZFailOp] + } + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + ZWrite [_ZWrite] + Cull [_OutlineCull] + CGPROGRAM + + #pragma target 4.0 + #define FORWARD_BASE_PASS + #define TRANSPARENT + #define OUTLINE + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Lighting + #pragma shader_feature _NORMALMAP + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPassOutline.cginc" + ENDCG + + } + + Pass + { + Name "ParticlePass" + Tags { "LightMode" = "ForwardBase" } + + Stencil + { + Ref [_ParticleStencilRef] + Comp [_ParticleStencilCompareFunction] + Pass [_ParticleStencilPassOp] + Fail [_ParticleStencilFailOp] + ZFail [_ParticleStencilZFailOp] + } + ZWrite Off + Cull Back + + CGPROGRAM + + #pragma target 4.0 + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex particleVert + #pragma geometry particleGeom + #pragma fragment particleFrag + #include "../Includes/PoiParticlePass.cginc" + ENDCG + + } + + Pass + { + Tags { "LightMode" = "ShadowCaster" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define TRANSPARENT + #define POISHADOW + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + #pragma multi_compile_instancing + #pragma vertex vertShadowCaster + #pragma fragment fragShadowCaster + #include "../Includes/PoiPassShadow.cginc" + ENDCG + + } + } +Fallback "Toon/Lit Cutout (Double)" +} diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonTransparent.shader.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonTransparent.shader.meta new file mode 100644 index 00000000..f7f8a6b2 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/OutlinesPoiyomiToonTransparent.shader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 743eed0e6bd7ebb4b95435c9609dd42f +ShaderImporter: + externalObjects: {} + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonCutout.shader b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonCutout.shader new file mode 100644 index 00000000..0f83706b --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonCutout.shader @@ -0,0 +1,596 @@ +Shader ".poiyomi/Patreon/Particle2/Cutout" +{ + Properties + { + [HideInInspector] shader_is_using_thry_editor ("", Float) = 0 + [HideInInspector] shader_master_label ("<color=#ff0000ff>❤</color> <color=#000000ff>Poiyomi Toon Shader V4.2</color> <color=#ff0000ff>❤</color>", Float) = 0 + [HideInInspector] shader_presets ("poiToonPresets", Float) = 0 + + + [HideInInspector] footer_youtube ("youtube footer button", Float) = 0 + [HideInInspector] footer_twitter ("twitter footer button", Float) = 0 + [HideInInspector] footer_patreon ("patreon footer button", Float) = 0 + [HideInInspector] footer_discord ("discord footer button", Float) = 0 + [HideInInspector] footer_github ("github footer button", Float) = 0 + + [HideInInspector] m_mainOptions ("Main", Float) = 0 + _Color ("Color & Alpha", Color) = (1, 1, 1, 1) + + _Saturation ("Saturation", Range(-1, 1)) = 0 + _MainEmissionStrength ("Basic Emission", Range(0, 20)) = 0 + _MainTex ("Texture", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _MainTextureUV ("Tex UV#", Int) = 0 + [Normal]_BumpMap ("Normal Map", 2D) = "bump" { } + [Vector2]_MainNormalPan ("Normal Pan", Vector) = (0, 0, 0, 0) + _BumpScale ("Normal Intensity", Range(0, 10)) = 1 + _AlphaMask ("Alpha Mask", 2D) = "white" { } + _Clip ("Alpha Cuttoff", Range(0, 1.001)) = 0.5 + [ToggleUI]_ForceOpaque ("Force Opaque", Float) = 1 + [Vector2]_GlobalPanSpeed ("Global Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_start_DetailOptions ("Details", Float) = 0 + _DetailMask ("Detail Mask (R:Texture, G:Normal)", 2D) = "white" { } + _DetailTex ("Detail Texture", 2D) = "gray" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailTexUV ("Detail Tex UV#", Int) = 0 + _DetailTexIntensity ("Detail Tex Intensity", Range(0, 10)) = 1 + _DetailBrightness ("Detail Brightness:", Range(0, 2)) = 1 + [Vector2]_DetailTexturePan ("Detail Tex Pan", Vector) = (0, 0, 0, 0) + _DetailTint ("Detail Tint", Color) = (1, 1, 1) + [Normal]_DetailNormalMap ("Detail Normal", 2D) = "bump" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailNormalUV ("Detail Normal UV#", Int) = 0 + _DetailNormalMapScale ("Detail Normal Intensity", Range(0, 10)) = 1 + [Vector2]_MainDetailNormalPan ("Detail Normal Pan", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_DetailOptions ("Details", Float) = 0 + [HideInInspector] m_start_Fade ("Fade", Float) = 0 + _MainMinAlpha ("Minimum Alpha", Range(0, 1)) = 0 + _MainFadeTexture ("Fade Map", 2D) = "white" { } + [Vector2]_MainDistanceFade ("Distance Fade X to Y", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_Fade ("Fade", Float) = 0 + + // Particles Start + [HideInInspector] m_particleOptions ("Particles", Float) = 0 + [ToggleUI]_ParticleLit("Basic Lighting", Float) = 0 + [HDR]_ParticleColor ("Color & Alpha", Color) = (1, 1, 1, 1) + _ParticleTexture ("Texture", 2D) = "white" { } + [ToggleUI]_ParticleRandomRotation("Random Rotation", Float) = 0 + _ParticleRotation("Rotation", Range(0, 360)) = 0 + _ParticlePerCMSquared ("Particle/cm^2", Float) = 1 + _ParticleAlphaCutoff ("Alpha Cutoff", Range(0,1.001)) = 0 + _ParticleMinRenderDistance ("Min Render Distance",Float) = .2 + [Gradient]_ParticleStartColorGradient ("Color Range", 2D) = "white" { } + [ToggleUI]_ColorOverLifetime("Color Over Lifetime?", Float) = 0 + _ParticleMask ("Particle Mask", 2D) = "white" { } + [Enum(Spherical, 0, Linear, 1)] _ParticleMovementMode("Movement Mode", Int) = 0 + + [HideInInspector] m_start_sphericalMotion ("Spherical Motion", Float) = 0 + _ColorOverLifeSpeed ("Color/Life Speed", Float) = 1 + _ParticleScaleMin ("Scale min", float) = 0.01 + _ParticleScaleMax ("Scale max", float) = 0.02 + _ParticleSphericalMinSpeed("Min Speed", Float) = -5 + _ParticleSphericalMaxSpeed("Max Speed", Float) = 5 + _ParticleSphericalMinRadius("Min Radius", Float) = 0 + _ParticleSphericalMaxRadius("Max Radius", Float) = 0.2 + [HideInInspector] m_end_sphericalMotion ("Spherical Movement", Float) = 0 + + [HideInInspector] m_start_LinearMotion ("Linear Movement", Float) = 0 + _ParticleLinearEndOffsetMin("End Offset Min", Vector) = (0.05,0.05,0.05,0) + _ParticleLinearEndOffsetMax("End Offset Max", Vector) = (-0.05,-0.05,-0.05,0) + [ToggleUI]_ParticleFlipParticlesGoingInward("Flip Particles Going Inward", Float) = 0 + _ParticleLinearSpeedMin ("Min Speed", Float) = 0.1 + _ParticleLinearSpeedMax ("Max Speed", Float) = 10 + _ParticleLinearStartAlpha ("Start Alpha", Float) = 1 + _ParticleLinearEndAlpha ("End Alpha", Float) = 1 + _ParticleLinearStartSizeMin ("Start min Size", Float) = .02 + _ParticleLinearStartSizeMax ("Start max Size", Float) = .02 + _ParticleLinearEndSizeMin ("End min Size", Float) = 0 + _ParticleLinearEndsizeMax ("End max Size", Float) = 0 + _ParticleLinearNormalRange ("Normal Spawn Range", Range(-1,1)) = -1 + [HideInInspector] m_end_LinearMotion ("Linear Motion", Float) = 0 + + [HideInInspector] m_start_ParticleFlipbook("Flipbook", Float) = 0 + [ToggleUI]_EnableParticleFlipbook("Enable Flipbook", Float) = 0 + _ParticleFlipbookTexArray ("Texture Array", 2DArray) = "" {} + _ParticleFlipbookTotalFrames ("Total Frames", Int) = 1 + _ParticleFlipbookFPS ("FPS", Float) = 30.0 + [ToggleUI]_ParticleRandomTimeOffset("Random Starting Frame?", Float) = 0 + [HideInInspector] m_start_manualParticleFlipbookControl ("Manual Control", Float) = 0 + _ParticleFlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualParticleFlipbookControl ("Manual Control", Float) = 0 + [HideInInspector] m_end_ParticleFlipbook ("Flipbook", Float) = 0 + // Particles End + + [HideInInspector] m_metallicOptions ("Metallic", Float) = 0 + [Toggle(_METALLICGLOSSMAP)]_EnableMetallic ("Enable Metallics", Float) = 0 + _CubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_SampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _MetalReflectionTint ("Reflection Tint", Color) = (1, 1, 1) + _MetallicMask ("Metallic Mask", 2D) = "white" { } + _Metallic ("Metallic", Range(0, 1)) = 0 + _SmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_InvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _Smoothness ("Smoothness", Range(0, 1)) = 0 + + [HideInInspector] m_start_clearCoat ("Clear Coat", Float) = 0 + [Toggle(_COLORCOLOR_ON)]_EnableClearCoat ("Enable Clear Coat", Float) = 0 + [Enum(Vertex, 0, Pixel, 1)] _ClearCoatNormalToUse ("What Normal?", Int) = 0 + _ClearCoatCubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_ClearCoatSampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _ClearCoatTint ("Reflection Tint", Color) = (1, 1, 1) + _ClearCoatMask ("Mask", 2D) = "white" { } + _ClearCoat ("Clear Coat", Range(0, 1)) = 1 + _ClearCoatSmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_ClearCoatInvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _ClearCoatSmoothness ("Smoothness", Range(0, 1)) = 0 + [HideInInspector] m_end_clearCoat ("Clear Coat", Float) = 0 + + [HideInInspector] m_matcapOptions ("Matcap / Sphere Textures", Float) = 0 + [Toggle(_COLORADDSUBDIFF_ON)]_MatcapEnable ("Enable Matcap", Float) = 0 + _MatcapColor ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap ("Matcap", 2D) = "white" { } + _MatcapBorder ("Border", Range(0, .5)) = 0.43 + _MatcapMask ("Mask", 2D) = "white" { } + _MatcapEmissionStrength ("Emission Strength", Range(0,20)) = 0 + _MatcapIntensity ("Intensity", Range(0, 5)) = 1 + _MatcapLightMask ("Hide in Shadow", Range(0, 1)) = 0 + _MatcapReplace ("Replace With Matcap", Range(0, 1)) = 1 + _MatcapMultiply ("Multiply Matcap", Range(0, 1)) = 0 + _MatcapAdd ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_start_Matcap2 ("Matcap 2", Float) = 0 + [ToggleUI]_Matcap2Enable ("Enable Matcap 2", Float) = 0 + _Matcap2Color ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { } + _Matcap2Border ("Border", Range(0, .5)) = 0.43 + _Matcap2Mask ("Mask", 2D) = "white" { } + _Matcap2EmissionStrength ("Emission Strength", Range(0,20)) = 0 + _Matcap2Intensity ("Intensity", Range(0, 5)) = 1 + _Matcap2LightMask ("Hide in Shadow", Range(0, 1)) = 0 + _Matcap2Replace ("Replace With Matcap", Range(0, 1)) = 0 + _Matcap2Multiply ("Multiply Matcap", Range(0, 1)) = 0 + _Matcap2Add ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_end_Matcap2 ("Matcap 2", Float) = 0 + + [HideInInspector] m_emissionOptions ("Emission / Glow", Float) = 0 + [Toggle(_EMISSION)]_EnableEmission ("Enable Emission", Float) = 0 + [ToggleUI]_EmissionReplace ("Replace Base Color", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _EmissionMapUV ("Emission UV#", Int) = 0 + [HDR]_EmissionColor ("Emission Color", Color) = (1, 1, 1, 1) + _EmissionMap ("Emission Map", 2D) = "white" { } + _EmissionMask ("Emission Mask", 2D) = "white" { } + _EmissionPan ("Map(XY) | Mask(ZW) Pan", Vector) = (0, 0, 0, 0) + _EmissionStrength ("Emission Strength", Range(0, 20)) = 0 + + [HideInInspector] m_start_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + [ToggleUI]_EnableGITDEmission ("Enable Glow In The Dark", Float) = 0 + [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh ("Lighting Type", Int) = 0 + _GITDEMinEmissionMultiplier ("Min Emission Multiplier", Range(0, 1)) = 1 + _GITDEMaxEmissionMultiplier ("Max Emission Multiplier", Range(0, 1)) = 0 + _GITDEMinLight ("Min Lighting", Range(0, 1)) = 0 + _GITDEMaxLight ("Max Lighting", Range(0, 1)) = 1 + [HideInInspector] m_end_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + + [HideInInspector] m_start_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + _EmissiveBlink_Min ("Emissive Blink Min", Float) = 1 + _EmissiveBlink_Max ("Emissive Blink Max", Float) = 1 + _EmissiveBlink_Velocity ("Emissive Blink Velocity", Float) = 4 + [HideInInspector] m_end_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + + [HideInInspector] m_start_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + [ToggleUI] _ScrollingEmission ("Enable Scrolling Emission", Float) = 0 + _EmissiveScroll_Direction ("Emissive Scroll Direction", Vector) = (0, -10, 0, 0) + _EmissiveScroll_Width ("Emissive Scroll Width", Float) = 10 + _EmissiveScroll_Velocity ("Emissive Scroll Velocity", Float) = 10 + _EmissiveScroll_Interval ("Emissive Scroll Interval", Float) = 20 + [HideInInspector] m_end_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + + [HideInInspector] m_fakeLightingOptions ("Light & Shadow", Float) = 0 + [Toggle(_NORMALMAP)]_EnableLighting ("Enable Lighting", Float) = 1 + [Enum(Natural, 0, Controlled, 1, Standardish, 2, Math, 3)] _LightingType ("Lighting Type", Int) = 1 + [Gradient]_ToonRamp ("Lighting Ramp", 2D) = "white" { } + _LightingShadowMask ("Shadow Mask (R)", 2D) = "white" { } + _ShadowStrength ("Shadow Strength", Range(0, 1)) = .2 + _ShadowOffset ("Shadow Offset", Range(-1, 1)) = 0 + _AOMap ("AO Map", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _LightingAOUV ("AO Map UV#", Int) = 0 + _AOStrength ("AO Strength", Range(0, 1)) = 1 + [HideInInspector] m_start_lightingAdvanced ("Advanced", Float) = 0 + _IndirectContribution ("Indirect Contribution", Range(0, 1)) = 0 + _AdditiveSoftness ("Additive Softness", Range(0, 0.5)) = 0.005 + _AdditiveOffset ("Additive Offset", Range(-0.5, 0.5)) = 0 + _AttenuationMultiplier ("Attenuation", Range(0, 1)) = 0 + [HideInInspector] m_end_lightingAdvanced ("Advanced", Float) = 0 + + [HideInInspector] m_specularHighlightsOptions ("Specular Highlights", Float) = 0 + [Toggle(_SPECGLOSSMAP)]_EnableSpecular ("Enable Specular", Float) = 0 + [Enum(Realistic, 1, Toon, 2, Anisotropic, 3)] _SpecularType ("Specular Type", Int) = 1 + _SpecularTint ("Specular Tint", Color) = (1, 1, 1, 1) + _SpecularMixAlbedoIntoTint ("Mix Material Color Into Tint", Range(0, 1)) = 0 + _SpecularSmoothness ("Smoothness", Range(0, 1)) = 1 + _SpecularMap ("Specular Map", 2D) = "white" { } + [ToggleUI]_SpecularInvertSmoothness ("Invert Smoothness", Float) = 0 + _SpecularMask ("Specular Mask", 2D) = "white" { } + [Enum(Alpha, 0, Grayscale, 1)] _SmoothnessFrom ("Smoothness From", Int) = 1 + [HideInInspector] m_start_SpecularToon ("Toon", Float) = 0 + [MultiSlider]_SpecularToonInnerOuter ("Inner/Outer Edge", Vector) = (0.25, 0.3, 0, 1) + [HideInInspector] m_end_SpecularToon ("Toon", Float) = 0 + [HideInInspector] m_start_Anisotropic ("Anisotropic", Float) = 0 + [Enum(Tangent, 0, Bitangent, 1)] _SpecWhatTangent ("(Bi)Tangent?", Int) = 0 + _AnisoSpec1Alpha ("Spec1 Alpha", Range(0, 1)) = 1 + _AnisoSpec2Alpha ("Spec2 Alpha", Range(0, 1)) = 1 + //_Spec1Offset ("Spec1 Offset", Float) = 0 + //_Spec1JitterStrength ("Spec1 Jitter Strength", Float) = 1.0 + _Spec2Smoothness ("Spec2 Smoothness", Range(0, 1)) = 0 + //_Spec2Offset ("Spec2 Offset", Float) = 0 + //_Spec2JitterStrength ("Spec2 Jitter Strength", Float) = 1.0 + [ToggleUI]_AnisoUseTangentMap ("Use Directional Map?", Float) = 0 + _AnisoTangentMap ("Anisotropic Directional Map", 2D) = "bump" { } + //_ShiftTexture ("Shift Texture", 2D) = "black" { } + [HideInInspector] m_end_Anisotropic ("Anisotropic", Float) = 0 + + [HideInInspector] m_ParallaxMap ("Parallax", Float) = 0 + [Toggle(_PARALLAXMAP)]_ParallaxMap ("Enable Parallax FX", Float) = 0 + [ToggleUI]_ParallaxHeightMapEnabled ("Enable Parallax Height", Float) = 0 + [ToggleUI]_ParallaxInternalMapEnabled ("Enable Parallax Internal", Float) = 0 + [HideInInspector] m_start_parallaxHeightmap ("Heightmap", Float) = 0 + _ParallaxHeightMap ("Height Map", 2D) = "black" { } + _ParallaxHeightIterations ("Parallax Height Iterations", Range(1, 10)) = 1 + _ParallaxStrength ("Parallax Strength", Range(0, 1)) = 0 + _ParallaxBias ("Parallax Bias (0.42)", Float) = 0.42 + [HideInInspector] m_end_parallaxHeightmap ("Heightmap", Float) = 0 + [HideInInspector] m_start_parallaxInternal ("Internal", Float) = 0 + [Enum(Basic, 0, HeightMap, 1)] _ParallaxInternalHeightmapMode ("Parallax Mode", Int) = 0 + [ToggleUI]_ParallaxInternalHeightFromAlpha ("HeightFromAlpha", Float) = 0 + _ParallaxInternalMap ("Internal Map", 2D) = "black" { } + _ParallaxInternalIterations ("Parallax Internal Iterations", Range(1, 50)) = 1 + _ParallaxInternalMinDepth ("Min Depth", Float) = 0 + _ParallaxInternalMaxDepth ("Max Depth", Float) = 1 + _ParallaxInternalMinFade ("Min Depth Brightness", Range(0, 5)) = 1 + _ParallaxInternalMaxFade ("Max Depth Brightness", Range(0, 5)) = 0 + _ParallaxInternalMinColor ("Min Depth Color", Color) = (1, 1, 1, 1) + _ParallaxInternalMaxColor ("Max Depth Color", Color) = (1, 1, 1, 1) + [Vector2]_ParallaxInternalPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + [Vector2]_ParallaxInternalPanDepthSpeed ("Per Level Speed Multiplier", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_parallaxInternal ("Internal", Float) = 0 + + [HideInInspector] m_subsurfaceOptions ("Subsurface Scattering", Float) = 0 + [Toggle(_TERRAIN_NORMAL_MAP)]_EnableSSS ("Enable Subsurface Scattering", Float) = 0 + _SSSColor ("Subsurface Color", Color) = (1, 1, 1, 1) + _SSSThicknessMap ("Thickness Map", 2D) = "black" { } + _SSSThicknessMod ("Thickness mod", Range(-1, 1)) = 0 + _SSSStrength ("Attenuation", Range(0, 1)) = 0 + _SSSPower ("Light Spread", Range(1, 100)) = 1 + _SSSDistortion ("Light Distortion", Range(0, 1)) = 0 + + [HideInInspector] m_rimLightOptions ("Rim Lighting", Float) = 0 + [Toggle(_GLOSSYREFLECTIONS_OFF)]_EnableRimLighting ("Enable Rim Lighting", Float) = 0 + [ToggleUI]_RimLightingInvert ("Invert Rim Lighting", Float) = 0 + _RimLightColor ("Rim Color", Color) = (1, 1, 1, 1) + _RimWidth ("Rim Width", Range(0, 1)) = 0.8 + _RimSharpness ("Rim Sharpness", Range(0, 1)) = .25 + _RimStrength ("Rim Emission", Range(0, 20)) = 0 + _RimBrighten ("Rim Color Brighten", Range(0, 3)) = 0 + _RimLightColorBias ("Rim Color Bias", Range(0, 1)) = 0 + _RimTex ("Rim Texture", 2D) = "white" { } + _RimMask ("Rim Mask", 2D) = "white" { } + [Vector2]_RimTexPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + + [HideInInspector] m_start_reflectionRim ("Environmental Rim", Float) = 0 + [ToggleUI]_EnableEnvironmentalRim ("Enable Environmental Rim", Float) = 0 + _RimEnviroMask ("Mask", 2D) = "white" { } + _RimEnviroBlur ("Blur", Range(0, 1)) = 0.7 + _RimEnviroWidth ("Rim Width", Range(0, 1)) = 0.45 + _RimEnviroSharpness ("Rim Sharpness", Range(0, 1)) = 0 + _RimEnviroMinBrightness ("Min Brightness Threshold", Range(0, 2)) = 0 + [HideInInspector] m_end_reflectionRim ("Environmental Rim", Float) = 0 + [HideInInspector] m_start_rimWidthNoise ("Width Noise", Float) = 0 + _RimWidthNoiseTexture ("Rim Width Noise", 2D) = "black" { } + _RimWidthNoiseStrength ("Intensity", Range(0, 1)) = 0.1 + [Vector2]_RimWidthNoisePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_rimWidthNoise ("Width Noise", Float) = 0 + [HideInInspector] m_start_ShadowMix ("Shadow Mix", Float) = 0 + _ShadowMix ("Shadow Mix In", Range(0, 1)) = 0 + _ShadowMixThreshold ("Shadow Mix Threshold", Range(0, 1)) = .5 + _ShadowMixWidthMod ("Shadow Mix Width Mod", Range(0, 10)) = .5 + [HideInInspector] m_end_ShadowMix ("Shadow Mix", Float) = 0 + + [HideInInspector] m_flipBook ("Flipbook", Float) = 0 + [Toggle(_FADING_ON)]_EnableFlipbook ("Enable Flipbook", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _FlipbookUV ("Flipbook UV#", Int) = 0 + [TextureArray]_FlipbookTexArray ("Texture Array", 2DArray) = "" { } + [Vector2]_FlipbookTexturePan ("Texture Panning", Vector) = (0, 0, 0, 0) + [Vector2]_FlipbookMaskPan ("Mask Panning", Vector) = (0, 0, 0, 0) + _FlipbookColor ("Color & alpha", Color) = (1, 1, 1, 1) + _FlipbookTotalFrames ("Total Frames", Int) = 1 + _FlipbookFPS ("FPS", Float) = 30.0 + _FlipbookScaleOffset ("Scale | Offset", Vector) = (1, 1, 0, 0) + [ToggleUI]_FlipbookTiled ("Tiled?", Float) = 0 + _FlipbookEmissionStrength ("Emission Strength", Range(0, 20)) = 0 + _FlipbookRotation ("Rotation", Range(0, 360)) = 0 + _FlipbookRotationSpeed ("Rotation Speed", Float) = 0 + _FlipbookReplace ("Replace", Range(0, 1)) = 1 + _FlipbookMultiply ("Multiply", Range(0, 1)) = 0 + _FlipbookAdd ("Add", Range(0, 1)) = 0 + //[ToggleUI]_FlipbookControlsAlpha ("Flipbook Controls Alpha", Float) = 0 + + [HideInInspector] m_start_manualFlipbookControl ("Manual Control", Float) = 0 + _FlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualFlipbookControl ("Manual Control", Float) = 0 + + [HideInInspector] m_dissolve ("Dissolve", Float) = 0 + [Toggle(_ALPHABLEND_ON)]_EnableDissolve ("Enable Dissolve", Float) = 0 + [Enum(Basic, 1, Point2Point, 2)] _DissolveType ("Dissolve Type", Int) = 1 + _DissolveEdgeWidth ("Edge Width", Range(0, .5)) = 0.025 + _DissolveEdgeHardness ("Edge Hardness", Range(0, 1)) = 0.5 + _DissolveEdgeColor ("Edge Color", Color) = (1, 1, 1, 1) + [Gradient]_DissolveEdgeGradient ("Edge Gradient", 2D) = "white" { } + _DissolveEdgeEmission ("Edge Emission", Range(0, 20)) = 0 + _DissolveTextureColor ("Dissolve to Color", Color) = (1, 1, 1, 1) + _DissolveToTexture ("Dissolve to Texture", 2D) = "white" { } + _DissolveToEmissionStrength ("Dissolve to Emission Strength", Range(0, 20)) = 0 + [Vector2]_DissolveToPanning ("Dissolve to Panning", Vector) = (0, 0, 0, 0) + _DissolveNoiseTexture ("Dissolve Noise", 2D) = "white" { } + [ToggleUI]_DissolveInvertNoise ("Invert Noise", Float) = 0 + _DissolveDetailNoise ("Dissolve Detail Noise", 2D) = "black" { } + [ToggleUI]_DissolveInvertDetailNoise ("Invert Detail Noise", Float) = 0 + _DissolveDetailStrength ("Dissolve Detail Strength", Range(0, 1)) = 0.1 + _DissolvePan ("Noise (XY) | Detail (ZW) Pan", Vector) = (0, 0, 0, 0) + _DissolveAlpha ("Dissolve Alpha", Range(0, 1)) = 0 + _DissolveMask ("Dissolve Mask", 2D) = "white" { } + _ContinuousDissolve ("Continuous Dissolve Speed", Float) = 0 + [HideInInspector] m_start_pointToPoint ("point to point", Float) = 0 + [Enum(Local, 0, World, 1)] _DissolveP2PWorldLocal ("World/Local", Int) = 0 + _DissolveP2PEdgeLength ("Edge Length", Float) = 0.1 + [Vector3]_DissolveStartPoint ("Start Point", Vector) = (0, -1, 0, 0) + [Vector3]_DissolveEndPoint ("End Point", Vector) = (0, 1, 0, 0) + [HideInInspector] m_end_pointToPoint ("Point To Point", Float) = 0 + + [HideInInspector] m_panosphereOptions ("Panosphere / Cubemaps", Float) = 0 + [Toggle(_DETAIL_MULX2)]_PanoToggle ("Enable Panosphere", Float) = 0 + _PanosphereColor ("Color", Color) = (1, 1, 1, 1) + _PanosphereTexture ("Texture", 2D) = "white" { } + _PanoMapTexture ("Mask", 2D) = "white" { } + _PanoEmission ("Emission Strength", Range(0, 10)) = 0 + _PanoBlend ("Alpha", Range(0, 1)) = 0 + [Vector3]_PanospherePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [ToggleUI]_PanoCubeMapToggle ("Use Cubemap", Float) = 0 + [TextureNoSO]_PanoCubeMap ("CubeMap", Cube) = "" { } + + [HideInInspector] m_StencilPassOptions ("Stencil", Float) = 0 + [IntRange] _StencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + //[IntRange] _StencilReadMaskRef ("Stencil ReadMask Value", Range(0, 255)) = 0 + //[IntRange] _StencilWriteMaskRef ("Stencil WriteMask Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilCompareFunction ("Stencil Compare Function", Float) = 8 + + [HideInInspector] m_start_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + [IntRange] _ParticleStencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _ParticleStencilCompareFunction ("Stencil Compare Function", Float) = 8 + [HideInInspector] m_end_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + + [HideInInspector] m_mirrorOptions ("Mirror", Float) = 0 + [Toggle(_REQUIRE_UV2)]_EnableMirrorOptions ("Enable Mirror Options", Float) = 0 + [Enum(ShowInBoth, 0, ShowOnlyInMirror, 1, DontShowInMirror, 2)] _Mirror ("Show in mirror", Int) = 0 + [ToggleUI]_EnableMirrorTexture ("Enable Mirror Texture", Float) = 0 + _MirrorTexture ("Mirror Tex", 2D) = "white" { } + + [HideInInspector] m_RandomOptions ("Random", Float) = 0 + [Toggle(_SUNDISK_NONE)]_EnableRandom ("Enable Random", Float) = 0 + [HideInInspector] m_start_Angle ("Angular Rendering", Float) = 0 + [Enum(Camera Face Model, 0, Model Face Camera, 1, Face Each Other, 2)] _AngleType ("Angle Type", Int) = 0 + [Enum(Model, 0, Vertex, 1)] _AngleCompareTo ("Model or Vert Positon", Int) = 0 + [Vector3]_AngleForwardDirection ("Forward Direction", Vector) = (0, 0, 1, 0) + _CameraAngleMin ("Camera Angle Min", Range(0, 180)) = 45 + _CameraAngleMax ("Camera Angle Max", Range(0, 180)) = 90 + _ModelAngleMin ("Model Angle Min", Range(0, 180)) = 45 + _ModelAngleMax ("Model Angle Max", Range(0, 180)) = 90 + _AngleMinAlpha ("Min Alpha", Range(0, 1)) = 0 + [HideInInspector] m_end_Angle ("Angular Rendering", Float) = 0 + + [HideInInspector] m_renderingOptions ("Rendering Options", Float) = 0 + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", Float) = 2 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + [Enum(UnityEngine.Rendering.BlendMode)] _SourceBlend ("Source Blend", Float) = 5 + [Enum(UnityEngine.Rendering.BlendMode)] _DestinationBlend ("Destination Blend", Float) = 10 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Int) = 1 + _ZBias ("ZBias", Float) = 0.0 + + [HideInInspector] m_debugOptions ("Debug", Float) = 0 + [Toggle(_COLOROVERLAY_ON)]_DebugDisplayDebug ("Display Debug Info", Float) = 0 + [Enum(Off, 0, Vertex Normal, 1, Pixel Normal, 2, Tangent, 3, Binormal, 4)] _DebugMeshData ("Mesh Data", Int) = 0 + [Enum(Off, 0, Attenuation, 1, Direct Lighting, 2, Indirect Lighting, 3, light Map, 4, Ramped Light Map, 5, Final Lighting, 6)] _DebugLightingData ("Lighting Data", Int) = 0 + [Enum(Off, 0, View Dir, 1, Tangent View Dir, 2, Forward Dir, 3, WorldPos, 4, View Dot Normal, 5)] _DebugCameraData ("Camera Data", Int) = 0 + } + + CustomEditor "Thry.ShaderEditor" + SubShader + { + Tags { "DisableBatching" = "True" "RenderType" = "TransparentCutout" "Queue" = "AlphaTest" } + + Pass + { + Name "MainPass" + Tags { "LightMode" = "ForwardBase" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + AlphaToMask On + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define FORWARD_BASE_PASS + #pragma shader_feature _PARALLAXMAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // Lighting + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma shader_feature _EMISSION + // Clear Coat + #pragma shader_feature _COLORCOLOR_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + + Pass + { + Name "ForwardAddPass" + Tags { "LightMode" = "ForwardAdd" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite Off + Blend One One + Cull [_Cull] + AlphaToMask On + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define FORWARD_ADD_PASS + #define BINORMAL_PER_FRAGMENT + #pragma shader_feature _PARALLAX_MAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // Lighting + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdadd_fullshadows + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + + Pass + { + Name "ParticlePass" + Tags { "LightMode" = "ForwardBase" } + + Stencil + { + Ref [_ParticleStencilRef] + Comp [_ParticleStencilCompareFunction] + Pass [_ParticleStencilPassOp] + Fail [_ParticleStencilFailOp] + ZFail [_ParticleStencilZFailOp] + } + ZWrite On + Cull Back + AlphaToMask On + + CGPROGRAM + #pragma target 4.0 + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex particleVert + #pragma geometry particleGeom + #pragma fragment particleFrag + #include "../Includes/PoiParticlePass.cginc" + ENDCG + + } + + Pass + { + Name "ShadowCasterPass" + Tags { "LightMode" = "ShadowCaster" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define CUTOUT + #define POISHADOW + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + #pragma multi_compile_instancing + #pragma vertex vertShadowCaster + #pragma fragment fragShadowCaster + #include "../Includes/PoiPassShadow.cginc" + ENDCG + + } + } +Fallback "Toon/Lit Cutout (Double)" +} diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonCutout.shader.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonCutout.shader.meta new file mode 100644 index 00000000..ff7f3557 --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonCutout.shader.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 19c3926362228c541bbece0b9045e4c5 +ShaderImporter: + externalObjects: {} + defaultTextures: + - _MainTex: {instanceID: 0} + - _BumpMap: {instanceID: 0} + - _AlphaMask: {instanceID: 0} + - _DetailNormalMap: {instanceID: 0} + - _DetailNormalMask: {instanceID: 0} + - _CubeMap: {fileID: 8900000, guid: a0fde614a95c2d44ca3dec1fba756a6f, type: 3} + - _MetallicMap: {instanceID: 0} + - _SmoothnessMap: {instanceID: 0} + - _Matcap: {instanceID: 0} + - _MatcapMap: {instanceID: 0} + - _EmissionMap: {instanceID: 0} + - _EmissionMask: {instanceID: 0} + - _ToonRamp: {fileID: 2800000, guid: 7744a2dff3641604fa8b6601a055824c, type: 3} + - _AOMap: {instanceID: 0} + - _SpecularMap: {instanceID: 0} + - _SpecularHighTexture: {instanceID: 0} + - _SSSThicknessMap: {instanceID: 0} + - _RimTex: {instanceID: 0} + - _RimMask: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonTransparent.shader b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonTransparent.shader new file mode 100644 index 00000000..810438ca --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonTransparent.shader @@ -0,0 +1,601 @@ +Shader ".poiyomi/Patreon/Particle2/Transparent" +{ + Properties + { + [HideInInspector] shader_is_using_thry_editor ("", Float) = 0 + [HideInInspector] shader_master_label ("<color=#ff0000ff>❤</color> <color=#000000ff>Poiyomi Toon Shader V4.2</color> <color=#ff0000ff>❤</color>", Float) = 0 + [HideInInspector] shader_properties_label_file ("7PlusLabels", Float) = 0 + [HideInInspector] footer_youtube ("youtube footer button", Float) = 0 + [HideInInspector] footer_twitter ("twitter footer button", Float) = 0 + [HideInInspector] footer_patreon ("patreon footer button", Float) = 0 + [HideInInspector] footer_discord ("discord footer button", Float) = 0 + [HideInInspector] footer_github ("github footer button", Float) = 0 + + [HideInInspector] m_mainOptions ("Main", Float) = 0 + _Color ("Color & Alpha", Color) = (1, 1, 1, 1) + _Saturation ("Saturation", Range(-1, 1)) = 0 + _MainEmissionStrength ("Basic Emission", Range(0, 20)) = 0 + _MainTex ("Texture", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _MainTextureUV ("Tex UV#", Int) = 0 + [Normal]_BumpMap ("Normal Map", 2D) = "bump" { } + [Vector2]_MainNormalPan ("Normal Pan", Vector) = (0, 0, 0, 0) + _BumpScale ("Normal Intensity", Range(0, 10)) = 1 + _AlphaMask ("Alpha Mask", 2D) = "white" { } + _Clip ("Alpha Cuttoff", Range(0, 1.001)) = 0.5 + [Vector2]_GlobalPanSpeed ("Global Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_start_DetailOptions ("Details", Float) = 0 + _DetailMask ("Detail Mask (R:Texture, G:Normal)", 2D) = "white" { } + _DetailTex ("Detail Texture", 2D) = "gray" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailTexUV ("Detail Tex UV#", Int) = 0 + _DetailTexIntensity ("Detail Tex Intensity", Range(0, 10)) = 1 + _DetailBrightness ("Detail Brightness:", Range(0, 2)) = 1 + [Vector2]_DetailTexturePan ("Detail Tex Pan", Vector) = (0, 0, 0, 0) + _DetailTint ("Detail Tint", Color) = (1, 1, 1) + [Normal]_DetailNormalMap ("Detail Normal", 2D) = "bump" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _DetailNormalUV ("Detail Normal UV#", Int) = 0 + _DetailNormalMapScale ("Detail Normal Intensity", Range(0, 10)) = 1 + [Vector2]_MainDetailNormalPan ("Detail Normal Pan", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_DetailOptions ("Details", Float) = 0 + [HideInInspector] m_start_Fade ("Fade", Float) = 0 + _MainMinAlpha ("Minimum Alpha", Range(0, 1)) = 0 + _MainFadeTexture ("Fade Map", 2D) = "white" { } + [Vector2]_MainDistanceFade ("Distance Fade X to Y", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_Fade ("Fade", Float) = 0 + + // Particles Start + [HideInInspector] m_particleOptions ("Particles", Float) = 0 + [ToggleUI]_ParticleLit ("Basic Lighting", Float) = 0 + [HDR]_ParticleColor ("Color & Alpha", Color) = (1, 1, 1, 1) + _ParticleTexture ("Texture", 2D) = "white" { } + [ToggleUI]_ParticleRandomRotation ("Random Rotation", Float) = 0 + _ParticleRotation ("Rotation", Range(0, 360)) = 0 + _ParticlePerCMSquared ("Particle/cm^2", Float) = 1 + _ParticleAlphaCutoff ("Alpha Cutoff", Range(0, 1.001)) = 0 + _ParticleMinRenderDistance ("Min Render Distance", Float) = .2 + [Gradient]_ParticleStartColorGradient ("Color Range", 2D) = "white" { } + [ToggleUI]_ColorOverLifetime ("Color Over Lifetime?", Float) = 0 + _ParticleMask ("Particle Mask", 2D) = "white" { } + [Enum(Spherical, 0, Linear, 1)] _ParticleMovementMode ("Movement Mode", Int) = 0 + + [HideInInspector] m_start_sphericalMotion ("Spherical Motion", Float) = 0 + _ColorOverLifeSpeed ("Color/Life Speed", Float) = 1 + _ParticleScaleMin ("Scale min", float) = 0.01 + _ParticleScaleMax ("Scale max", float) = 0.02 + _ParticleSphericalMinSpeed ("Min Speed", Float) = -5 + _ParticleSphericalMaxSpeed ("Max Speed", Float) = 5 + _ParticleSphericalMinRadius ("Min Radius", Float) = 0 + _ParticleSphericalMaxRadius ("Max Radius", Float) = 0.2 + [HideInInspector] m_end_sphericalMotion ("Spherical Movement", Float) = 0 + + [HideInInspector] m_start_LinearMotion ("Linear Movement", Float) = 0 + _ParticleLinearEndOffsetMin ("End Offset Min", Vector) = (0.05, 0.05, 0.05, 0) + _ParticleLinearEndOffsetMax ("End Offset Max", Vector) = (-0.05, -0.05, -0.05, 0) + [ToggleUI]_ParticleFlipParticlesGoingInward ("Flip Particles Going Inward", Float) = 0 + _ParticleLinearSpeedMin ("Min Speed", Float) = 0.1 + _ParticleLinearSpeedMax ("Max Speed", Float) = 10 + _ParticleLinearStartAlpha ("Start Alpha", Float) = 1 + _ParticleLinearEndAlpha ("End Alpha", Float) = 1 + _ParticleLinearStartSizeMin ("Start min Size", Float) = .02 + _ParticleLinearStartSizeMax ("Start max Size", Float) = .02 + _ParticleLinearEndSizeMin ("End min Size", Float) = 0 + _ParticleLinearEndsizeMax ("End max Size", Float) = 0 + _ParticleLinearNormalRange ("Normal Spawn Range", Range(-1, 1)) = -1 + [HideInInspector] m_end_LinearMotion ("Linear Motion", Float) = 0 + + [HideInInspector] m_start_ParticleFlipbook("Flipbook", Float) = 0 + [ToggleUI]_EnableParticleFlipbook("Enable Flipbook", Float) = 0 + _ParticleFlipbookTexArray ("Texture Array", 2DArray) = "" {} + _ParticleFlipbookTotalFrames ("Total Frames", Int) = 1 + _ParticleFlipbookFPS ("FPS", Float) = 30.0 + [ToggleUI]_ParticleRandomTimeOffset("Random Starting Frame?", Float) = 0 + [HideInInspector] m_start_manualParticleFlipbookControl ("Manual Control", Float) = 0 + _ParticleFlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualParticleFlipbookControl ("Manual Control", Float) = 0 + [HideInInspector] m_end_ParticleFlipbook ("Flipbook", Float) = 0 + // Particles End + + [HideInInspector] m_metallicOptions ("Metallic", Float) = 0 + [Toggle(_METALLICGLOSSMAP)]_EnableMetallic ("Enable Metallics", Float) = 0 + _CubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_SampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _MetalReflectionTint ("Reflection Tint", Color) = (1, 1, 1) + _MetallicMask ("Metallic Mask", 2D) = "white" { } + _Metallic ("Metallic", Range(0, 1)) = 0 + _SmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_InvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _Smoothness ("Smoothness", Range(0, 1)) = 0 + + [HideInInspector] m_start_clearCoat ("Clear Coat", Float) = 0 + [Toggle(_COLORCOLOR_ON)]_EnableClearCoat ("Enable Clear Coat", Float) = 0 + [Enum(Vertex, 0, Pixel, 1)] _ClearCoatNormalToUse ("What Normal?", Int) = 0 + _ClearCoatCubeMap ("Baked CubeMap", Cube) = "" { } + [ToggleUI]_ClearCoatSampleWorld ("Force Baked Cubemap", Range(0, 1)) = 0 + _ClearCoatTint ("Reflection Tint", Color) = (1, 1, 1) + _ClearCoatMask ("Mask", 2D) = "white" { } + _ClearCoat ("Clear Coat", Range(0, 1)) = 1 + _ClearCoatSmoothnessMask ("Smoothness Map", 2D) = "white" { } + [ToggleUI]_ClearCoatInvertSmoothness ("Invert Smoothness Map", Range(0, 1)) = 0 + _ClearCoatSmoothness ("Smoothness", Range(0, 1)) = 0 + [HideInInspector] m_end_clearCoat ("Clear Coat", Float) = 0 + + [HideInInspector] m_matcapOptions ("Matcap / Sphere Textures", Float) = 0 + [Toggle(_COLORADDSUBDIFF_ON)]_MatcapEnable ("Enable Matcap", Float) = 0 + _MatcapColor ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap ("Matcap", 2D) = "white" { } + _MatcapBorder ("Border", Range(0, .5)) = 0.43 + _MatcapMask ("Mask", 2D) = "white" { } + _MatcapEmissionStrength ("Emission Strength", Range(0,20)) = 0 + _MatcapIntensity ("Intensity", Range(0, 5)) = 1 + _MatcapLightMask ("Hide in Shadow", Range(0, 1)) = 0 + _MatcapReplace ("Replace With Matcap", Range(0, 1)) = 1 + _MatcapMultiply ("Multiply Matcap", Range(0, 1)) = 0 + _MatcapAdd ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_start_Matcap2 ("Matcap 2", Float) = 0 + [ToggleUI]_Matcap2Enable ("Enable Matcap 2", Float) = 0 + _Matcap2Color ("Color", Color) = (1, 1, 1, 1) + [TextureNoSO]_Matcap2 ("Matcap", 2D) = "white" { } + _Matcap2Border ("Border", Range(0, .5)) = 0.43 + _Matcap2Mask ("Mask", 2D) = "white" { } + _Matcap2EmissionStrength ("Emission Strength", Range(0,20)) = 0 + _Matcap2Intensity ("Intensity", Range(0, 5)) = 1 + _Matcap2LightMask ("Hide in Shadow", Range(0, 1)) = 0 + _Matcap2Replace ("Replace With Matcap", Range(0, 1)) = 0 + _Matcap2Multiply ("Multiply Matcap", Range(0, 1)) = 0 + _Matcap2Add ("Add Matcap", Range(0, 1)) = 0 + [HideInInspector] m_end_Matcap2 ("Matcap 2", Float) = 0 + + [HideInInspector] m_emissionOptions ("Emission / Glow", Float) = 0 + [Toggle(_EMISSION)]_EnableEmission ("Enable Emission", Float) = 0 + [ToggleUI]_EmissionReplace ("Replace Base Color", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _EmissionMapUV ("Emission UV#", Int) = 0 + [HDR]_EmissionColor ("Emission Color", Color) = (1, 1, 1, 1) + _EmissionMap ("Emission Map", 2D) = "white" { } + _EmissionMask ("Emission Mask", 2D) = "white" { } + _EmissionPan ("Map(XY) | Mask(ZW) Pan", Vector) = (0, 0, 0, 0) + _EmissionStrength ("Emission Strength", Range(0, 20)) = 0 + + [HideInInspector] m_start_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + [ToggleUI]_EnableGITDEmission ("Enable Glow In The Dark", Float) = 0 + [Enum(World, 0, Mesh, 1)] _GITDEWorldOrMesh ("Lighting Type", Int) = 0 + _GITDEMinEmissionMultiplier ("Min Emission Multiplier", Range(0, 1)) = 1 + _GITDEMaxEmissionMultiplier ("Max Emission Multiplier", Range(0, 1)) = 0 + _GITDEMinLight ("Min Lighting", Range(0, 1)) = 0 + _GITDEMaxLight ("Max Lighting", Range(0, 1)) = 1 + [HideInInspector] m_end_glowInDarkEmissionOptions ("Glow In The Dark Emission (Requires Lighting Enabled)", Float) = 0 + + [HideInInspector] m_start_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + _EmissiveBlink_Min ("Emissive Blink Min", Float) = 1 + _EmissiveBlink_Max ("Emissive Blink Max", Float) = 1 + _EmissiveBlink_Velocity ("Emissive Blink Velocity", Float) = 4 + [HideInInspector] m_end_blinkingEmissionOptions ("Blinking Emission", Float) = 0 + + [HideInInspector] m_start_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + [ToggleUI] _ScrollingEmission ("Enable Scrolling Emission", Float) = 0 + _EmissiveScroll_Direction ("Emissive Scroll Direction", Vector) = (0, -10, 0, 0) + _EmissiveScroll_Width ("Emissive Scroll Width", Float) = 10 + _EmissiveScroll_Velocity ("Emissive Scroll Velocity", Float) = 10 + _EmissiveScroll_Interval ("Emissive Scroll Interval", Float) = 20 + [HideInInspector] m_end_scrollingEmissionOptions ("Scrolling Emission", Float) = 0 + + [HideInInspector] m_fakeLightingOptions ("Light & Shadow", Float) = 0 + [Toggle(_NORMALMAP)]_EnableLighting ("Enable Lighting", Float) = 1 + [Enum(Natural, 0, Controlled, 1, Standardish, 2, Math, 3)] _LightingType ("Lighting Type", Int) = 1 + [Gradient]_ToonRamp ("Lighting Ramp", 2D) = "white" { } + _LightingShadowMask ("Shadow Mask (R)", 2D) = "white" { } + _ShadowStrength ("Shadow Strength", Range(0, 1)) = 1 + _ShadowOffset ("Shadow Offset", Range(-1, 1)) = 0 + _AOMap ("AO Map", 2D) = "white" { } + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _LightingAOUV ("AO Map UV#", Int) = 0 + _AOStrength ("AO Strength", Range(0, 1)) = 1 + [HideInInspector] m_start_lightingAdvanced ("Advanced", Float) = 0 + _IndirectContribution ("Indirect Contribution", Range(0, 1)) = 0 + _AdditiveSoftness ("Additive Softness", Range(0, 0.5)) = 0.005 + _AdditiveOffset ("Additive Offset", Range(-0.5, 0.5)) = 0 + _AttenuationMultiplier ("Attenuation", Range(0, 1)) = 0 + [HideInInspector] m_end_lightingAdvanced ("Advanced", Float) = 0 + + [HideInInspector] m_specularHighlightsOptions ("Specular Highlights", Float) = 0 + [Toggle(_SPECGLOSSMAP)]_EnableSpecular ("Enable Specular", Float) = 0 + [Enum(Realistic, 1, Toon, 2, Anisotropic, 3)] _SpecularType ("Specular Type", Int) = 1 + _SpecularTint ("Specular Tint", Color) = (1, 1, 1, 1) + _SpecularMixAlbedoIntoTint ("Mix Material Color Into Tint", Range(0, 1)) = 0 + _SpecularSmoothness ("Smoothness", Range(0, 1)) = 1 + _SpecularMap ("Specular Map", 2D) = "white" { } + [ToggleUI]_SpecularInvertSmoothness ("Invert Smoothness", Float) = 0 + _SpecularMask ("Specular Mask", 2D) = "white" { } + [Enum(Alpha, 0, Grayscale, 1)] _SmoothnessFrom ("Smoothness From", Int) = 1 + [HideInInspector] m_start_SpecularToon ("Toon", Float) = 0 + [MultiSlider]_SpecularToonInnerOuter ("Inner/Outer Edge", Vector) = (0.25, 0.3, 0, 1) + [HideInInspector] m_end_SpecularToon ("Toon", Float) = 0 + [HideInInspector] m_start_Anisotropic ("Anisotropic", Float) = 0 + [Enum(Tangent, 0, Bitangent, 1)] _SpecWhatTangent ("(Bi)Tangent?", Int) = 0 + _AnisoSpec1Alpha ("Spec1 Alpha", Range(0, 1)) = 1 + _AnisoSpec2Alpha ("Spec2 Alpha", Range(0, 1)) = 1 + //_Spec1Offset ("Spec1 Offset", Float) = 0 + //_Spec1JitterStrength ("Spec1 Jitter Strength", Float) = 1.0 + _Spec2Smoothness ("Spec2 Smoothness", Range(0, 1)) = 0 + //_Spec2Offset ("Spec2 Offset", Float) = 0 + //_Spec2JitterStrength ("Spec2 Jitter Strength", Float) = 1.0 + [ToggleUI]_AnisoUseTangentMap ("Use Directional Map?", Float) = 0 + _AnisoTangentMap ("Anisotropic Directional Map", 2D) = "bump" { } + //_ShiftTexture ("Shift Texture", 2D) = "black" { } + [HideInInspector] m_end_Anisotropic ("Anisotropic", Float) = 0 + + [HideInInspector] m_ParallaxMap ("Parallax", Float) = 0 + [Toggle(_PARALLAXMAP)]_ParallaxMap ("Enable Parallax FX", Float) = 0 + [ToggleUI]_ParallaxHeightMapEnabled ("Enable Parallax Height", Float) = 0 + [ToggleUI]_ParallaxInternalMapEnabled ("Enable Parallax Internal", Float) = 0 + [HideInInspector] m_start_parallaxHeightmap ("Heightmap", Float) = 0 + _ParallaxHeightMap ("Height Map", 2D) = "black" { } + _ParallaxHeightIterations ("Parallax Height Iterations", Range(1, 10)) = 1 + _ParallaxStrength ("Parallax Strength", Range(0, 1)) = 0 + _ParallaxBias ("Parallax Bias (0.42)", Float) = 0.42 + [HideInInspector] m_end_parallaxHeightmap ("Heightmap", Float) = 0 + [HideInInspector] m_start_parallaxInternal ("Internal", Float) = 0 + [Enum(Basic, 0, HeightMap, 1)] _ParallaxInternalHeightmapMode ("Parallax Mode", Int) = 0 + [ToggleUI]_ParallaxInternalHeightFromAlpha ("HeightFromAlpha", Float) = 0 + _ParallaxInternalMap ("Internal Map", 2D) = "black" { } + _ParallaxInternalIterations ("Parallax Internal Iterations", Range(1, 50)) = 1 + _ParallaxInternalMinDepth ("Min Depth", Float) = 0 + _ParallaxInternalMaxDepth ("Max Depth", Float) = 1 + _ParallaxInternalMinFade ("Min Depth Brightness", Range(0, 5)) = 0 + _ParallaxInternalMaxFade ("Max Depth Brightness", Range(0, 5)) = 1 + _ParallaxInternalMinColor ("Min Depth Color", Color) = (1, 1, 1, 1) + _ParallaxInternalMaxColor ("Max Depth Color", Color) = (1, 1, 1, 1) + [Vector2]_ParallaxInternalPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + [Vector2]_ParallaxInternalPanDepthSpeed ("Per Level Speed Multiplier", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_parallaxInternal ("Internal", Float) = 0 + + [HideInInspector] m_subsurfaceOptions ("Subsurface Scattering", Float) = 0 + [Toggle(_TERRAIN_NORMAL_MAP)]_EnableSSS ("Enable Subsurface Scattering", Float) = 0 + _SSSColor ("Subsurface Color", Color) = (1, 1, 1, 1) + _SSSThicknessMap ("Thickness Map", 2D) = "black" { } + _SSSThicknessMod ("Thickness mod", Range(-1, 1)) = 0 + _SSSStrength ("Attenuation", Range(0, 1)) = 0 + _SSSPower ("Light Spread", Range(1, 100)) = 1 + _SSSDistortion ("Light Distortion", Range(0, 1)) = 0 + + [HideInInspector] m_rimLightOptions ("Rim Lighting", Float) = 0 + [Toggle(_GLOSSYREFLECTIONS_OFF)]_EnableRimLighting ("Enable Rim Lighting", Float) = 0 + [ToggleUI]_RimLightingInvert ("Invert Rim Lighting", Float) = 0 + _RimLightColor ("Rim Color", Color) = (1, 1, 1, 1) + _RimWidth ("Rim Width", Range(0, 1)) = 0.8 + _RimSharpness ("Rim Sharpness", Range(0, 1)) = .25 + _RimStrength ("Rim Emission", Range(0, 20)) = 0 + _RimBrighten ("Rim Color Brighten", Range(0, 3)) = 0 + _RimLightColorBias ("Rim Color Bias", Range(0, 1)) = 0 + _RimTex ("Rim Texture", 2D) = "white" { } + _RimMask ("Rim Mask", 2D) = "white" { } + [Vector2]_RimTexPanSpeed ("Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_start_reflectionRim ("Environmental Rim", Float) = 0 + [ToggleUI]_EnableEnvironmentalRim ("Enable Environmental Rim", Float) = 0 + _RimEnviroMask ("Mask", 2D) = "white" { } + _RimEnviroBlur ("Blur", Range(0, 1)) = 0.7 + _RimEnviroWidth ("Rim Width", Range(0, 1)) = 0.45 + _RimEnviroSharpness ("Rim Sharpness", Range(0, 1)) = 0 + _RimEnviroMinBrightness ("Min Brightness Threshold", Range(0, 2)) = 0 + [HideInInspector] m_end_reflectionRim ("Environmental Rim", Float) = 0 + [HideInInspector] m_start_rimWidthNoise ("Width Noise", Float) = 0 + _RimWidthNoiseTexture ("Rim Width Noise", 2D) = "black" { } + _RimWidthNoiseStrength ("Intensity", Range(0, 1)) = 0.1 + [Vector2]_RimWidthNoisePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [HideInInspector] m_end_rimWidthNoise ("Width Noise", Float) = 0 + [HideInInspector] m_start_ShadowMix ("Shadow Mix", Float) = 0 + _ShadowMix ("Shadow Mix In", Range(0, 1)) = 0 + _ShadowMixThreshold ("Shadow Mix Threshold", Range(0, 1)) = .5 + _ShadowMixWidthMod ("Shadow Mix Width Mod", Range(0, 10)) = .5 + [HideInInspector] m_end_ShadowMix ("Shadow Mix", Float) = 0 + + [HideInInspector] m_flipBook ("Flipbook", Float) = 0 + [Toggle(_FADING_ON)]_EnableFlipbook ("Enable Flipbook", Float) = 0 + [Enum(UV0, 0, UV1, 1, UV2, 2, UV3, 3, DistortedUV1, 4)] _FlipbookUV ("Flipbook UV#", Int) = 0 + [TextureArray]_FlipbookTexArray ("Texture Array", 2DArray) = "" { } + [Vector2]_FlipbookTexturePan ("Texture Panning", Vector) = (0, 0, 0, 0) + [Vector2]_FlipbookMaskPan ("Mask Panning", Vector) = (0, 0, 0, 0) + _FlipbookColor ("Color & alpha", Color) = (1, 1, 1, 1) + _FlipbookTotalFrames ("Total Frames", Int) = 1 + _FlipbookFPS ("FPS", Float) = 30.0 + _FlipbookScaleOffset ("Scale | Offset", Vector) = (1, 1, 0, 0) + [ToggleUI]_FlipbookTiled ("Tiled?", Float) = 0 + _FlipbookEmissionStrength ("Emission Strength", Range(0, 20)) = 0 + _FlipbookRotation ("Rotation", Range(0, 360)) = 0 + _FlipbookRotationSpeed ("Rotation Speed", Float) = 0 + _FlipbookReplace ("Replace", Range(0, 1)) = 1 + _FlipbookMultiply ("Multiply", Range(0, 1)) = 0 + _FlipbookAdd ("Add", Range(0, 1)) = 0 + //[ToggleUI]_FlipbookControlsAlpha ("Flipbook Controls Alpha", Float) = 0 + /* + [HideInInspector] m_start_FlipbookOffsetLoop ("Offset Animation", Float) = 0w + [Enum(Off, 0, Loop, 1, Bounce, 2, Smooth Bounce, 3)]_FlipbookMovementType ("Movement Type", Int) = 1w + _FlipbookStartEndOffset ("Start & End Offset", Vector) = (0,0,0,0) + _FlipbookMovementSpeed ("Speed", Float) = 1.0 + [HideInInspector] m_end_FlipbookOffsetLoop ("Offset Animation", Float) = 0 + */ + [HideInInspector] m_start_manualFlipbookControl ("Manual Control", Float) = 0 + _FlipbookCurrentFrame ("Current Frame", Float) = -1 + [HideInInspector] m_end_manualFlipbookControl ("Manual Control", Float) = 0 + + [HideInInspector] m_dissolve ("Dissolve", Float) = 0 + [Toggle(_ALPHABLEND_ON)]_EnableDissolve ("Enable Dissolve", Float) = 0 + [Enum(Basic, 1, Point2Point, 2)] _DissolveType ("Dissolve Type", Int) = 1 + _DissolveEdgeWidth ("Edge Width", Range(0, .5)) = 0.025 + _DissolveEdgeHardness ("Edge Hardness", Range(0, 1)) = 0.5 + _DissolveEdgeColor ("Edge Color", Color) = (1, 1, 1, 1) + [Gradient]_DissolveEdgeGradient ("Edge Gradient", 2D) = "white" { } + _DissolveEdgeEmission ("Edge Emission", Range(0, 20)) = 0 + _DissolveTextureColor ("Dissolve to Color", Color) = (1, 1, 1, 1) + _DissolveToTexture ("Dissolve to Texture", 2D) = "white" { } + _DissolveToEmissionStrength ("Dissolve to Emission Strength", Range(0, 20)) = 0 + [Vector2]_DissolveToPanning ("Dissolve to Panning", Vector) = (0, 0, 0, 0) + _DissolveNoiseTexture ("Dissolve Noise", 2D) = "white" { } + [ToggleUI]_DissolveInvertNoise ("Invert Noise", Float) = 0 + _DissolveDetailNoise ("Dissolve Detail Noise", 2D) = "black" { } + [ToggleUI]_DissolveInvertDetailNoise ("Invert Detail Noise", Float) = 0 + _DissolveDetailStrength ("Dissolve Detail Strength", Range(0, 1)) = 0.1 + _DissolvePan ("Noise (XY) | Detail (ZW) Pan", Vector) = (0, 0, 0, 0) + _DissolveAlpha ("Dissolve Alpha", Range(0, 1)) = 0 + _DissolveMask ("Dissolve Mask", 2D) = "white" { } + _ContinuousDissolve ("Continuous Dissolve Speed", Float) = 0 + [HideInInspector] m_start_pointToPoint ("point to point", Float) = 0 + [Enum(Local, 0, World, 1)] _DissolveP2PWorldLocal ("World/Local", Int) = 0 + _DissolveP2PEdgeLength ("Edge Length", Float) = 0.1 + [Vector3]_DissolveStartPoint ("Start Point", Vector) = (0, -1, 0, 0) + [Vector3]_DissolveEndPoint ("End Point", Vector) = (0, 1, 0, 0) + [HideInInspector] m_end_pointToPoint ("Point To Point", Float) = 0 + + [HideInInspector] m_panosphereOptions ("Panosphere / Cubemaps", Float) = 0 + [Toggle(_DETAIL_MULX2)]_PanoToggle ("Enable Panosphere", Float) = 0 + _PanosphereColor ("Color", Color) = (1, 1, 1, 1) + _PanosphereTexture ("Texture", 2D) = "white" { } + _PanoMapTexture ("Mask", 2D) = "white" { } + _PanoEmission ("Emission Strength", Range(0, 10)) = 0 + _PanoBlend ("Alpha", Range(0, 1)) = 0 + [Vector3]_PanospherePan ("Pan Speed", Vector) = (0, 0, 0, 0) + [ToggleUI]_PanoCubeMapToggle ("Use Cubemap", Float) = 0 + [TextureNoSO]_PanoCubeMap ("CubeMap", Cube) = "" { } + + [HideInInspector] m_StencilPassOptions ("Stencil", Float) = 0 + [IntRange] _StencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + //[IntRange] _StencilReadMaskRef ("Stencil ReadMask Value", Range(0, 255)) = 0 + //[IntRange] _StencilWriteMaskRef ("Stencil WriteMask Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _StencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _StencilCompareFunction ("Stencil Compare Function", Float) = 8 + + [HideInInspector] m_start_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + [IntRange] _ParticleStencilRef ("Stencil Reference Value", Range(0, 255)) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilPassOp ("Stencil Pass Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilFailOp ("Stencil Fail Op", Float) = 0 + [Enum(UnityEngine.Rendering.StencilOp)] _ParticleStencilZFailOp ("Stencil ZFail Op", Float) = 0 + [Enum(UnityEngine.Rendering.CompareFunction)] _ParticleStencilCompareFunction ("Stencil Compare Function", Float) = 8 + [HideInInspector] m_end_ParticleStencilPassOptions ("Particle Stencil", Float) = 0 + + [HideInInspector] m_mirrorOptions ("Mirror", Float) = 0 + [Toggle(_REQUIRE_UV2)]_EnableMirrorOptions ("Enable Mirror Options", Float) = 0 + [Enum(ShowInBoth, 0, ShowOnlyInMirror, 1, DontShowInMirror, 2)] _Mirror ("Show in mirror", Int) = 0 + [ToggleUI]_EnableMirrorTexture ("Enable Mirror Texture", Float) = 0 + _MirrorTexture ("Mirror Tex", 2D) = "white" { } + + [HideInInspector] m_RandomOptions ("Random", Float) = 0 + [Toggle(_SUNDISK_NONE)]_EnableRandom ("Enable Random", Float) = 0 + [HideInInspector] m_start_Angle ("Angular Rendering", Float) = 0 + [Enum(Camera Face Model, 0, Model Face Camera, 1, Face Each Other, 2)] _AngleType ("Angle Type", Int) = 0 + [Enum(Model, 0, Vertex, 1)] _AngleCompareTo ("Model or Vert Positon", Int) = 0 + [Vector3]_AngleForwardDirection ("Forward Direction", Vector) = (0, 0, 1, 0) + _CameraAngleMin ("Camera Angle Min", Range(0, 180)) = 45 + _CameraAngleMax ("Camera Angle Max", Range(0, 180)) = 90 + _ModelAngleMin ("Model Angle Min", Range(0, 180)) = 45 + _ModelAngleMax ("Model Angle Max", Range(0, 180)) = 90 + _AngleMinAlpha ("Min Alpha", Range(0, 1)) = 0 + [HideInInspector] m_end_Angle ("Angular Rendering", Float) = 0 + + [HideInInspector] m_renderingOptions ("Rendering Options", Float) = 0 + [Enum(UnityEngine.Rendering.CullMode)] _Cull ("Cull", Float) = 2 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest ("ZTest", Float) = 4 + [Enum(UnityEngine.Rendering.BlendMode)] _SourceBlend ("Source Blend", Float) = 5 + [Enum(UnityEngine.Rendering.BlendMode)] _DestinationBlend ("Destination Blend", Float) = 10 + [Enum(Off, 0, On, 1)] _ZWrite ("ZWrite", Int) = 0 + _ZBias ("ZBias", Float) = 0.0 + + [HideInInspector] m_debugOptions ("Debug", Float) = 0 + [Toggle(_COLOROVERLAY_ON)]_DebugDisplayDebug ("Display Debug Info", Float) = 0 + [Enum(Off, 0, Vertex Normal, 1, Pixel Normal, 2, Tangent, 3, Binormal, 4)] _DebugMeshData ("Mesh Data", Int) = 0 + [Enum(Off, 0, Attenuation, 1, Direct Lighting, 2, Indirect Lighting, 3, light Map, 4, Ramped Light Map, 5, Final Lighting, 6)] _DebugLightingData ("Lighting Data", Int) = 0 + [Enum(Off, 0, View Dir, 1, Tangent View Dir, 2, Forward Dir, 3, WorldPos, 4, View Dot Normal, 5)] _DebugCameraData ("Camera Data", Int) = 0 + } + + //originalEditorCustomEditor "PoiToon" + CustomEditor "Thry.ShaderEditor" + SubShader + { + Tags { "DisableBatching" = "True" "Queue" = "Transparent" "RenderType" = "Transparent" } + //Blend SrcAlpha OneMinusSrcAlpha + Blend [_SourceBlend] [_DestinationBlend] + + Pass + { + Name "MainPass" + Tags { "LightMode" = "ForwardBase" } + + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + + CGPROGRAM + + #pragma target 4.0 + #define TRANSPARENT + #define FORWARD_BASE_PASS + #pragma shader_feature _PARALLAXMAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // Lighting + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma shader_feature _EMISSION + // Clear Coat + #pragma shader_feature _COLORCOLOR_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + + Pass + { + Name "ForwardAddPass" + Tags { "LightMode" = "ForwardAdd" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite Off + Blend One One + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define TRANSPARENT + #define FORWARD_ADD_PASS + #pragma shader_feature _PARALLAX_MAP + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + // Panosphere + #pragma shader_feature _DETAIL_MULX2 + // Lighting + #pragma shader_feature _NORMALMAP + // Flipbook + #pragma shader_feature _FADING_ON + // Rim Lighting + #pragma shader_feature _GLOSSYREFLECTIONS_OFF + // Metal + #pragma shader_feature _METALLICGLOSSMAP + // Matcap + #pragma shader_feature _COLORADDSUBDIFF_ON + // Specular + #pragma shader_feature _SPECGLOSSMAP + // SubSurface + #pragma shader_feature _TERRAIN_NORMAL_MAP + // Debug + #pragma shader_feature _COLOROVERLAY_ON + #pragma multi_compile_instancing + #pragma multi_compile_fwdadd_fullshadows + #pragma vertex vert + #pragma fragment frag + #include "../Includes/PoiPass.cginc" + ENDCG + + } + + Pass + { + Name "ParticlePass" + Tags { "LightMode" = "ForwardBase" } + + Stencil + { + Ref [_ParticleStencilRef] + Comp [_ParticleStencilCompareFunction] + Pass [_ParticleStencilPassOp] + Fail [_ParticleStencilFailOp] + ZFail [_ParticleStencilZFailOp] + } + ZWrite Off + Cull Back + + CGPROGRAM + + #pragma target 4.0 + #pragma multi_compile_instancing + #pragma multi_compile_fwdbase + #pragma fragmentoption ARB_precision_hint_fastest + #pragma multi_compile_fog + #pragma vertex particleVert + #pragma geometry particleGeom + #pragma fragment particleFrag + #include "../Includes/PoiParticlePass.cginc" + ENDCG + + } + + Pass + { + Name "ShadowCasterPass" + Tags { "LightMode" = "ShadowCaster" } + Stencil + { + Ref [_StencilRef] + Comp [_StencilCompareFunction] + Pass [_StencilPassOp] + Fail [_StencilFailOp] + ZFail [_StencilZFailOp] + } + ZWrite [_ZWrite] + Cull [_Cull] + ZTest [_ZTest] + Offset [_ZBias], [_ZBias] + CGPROGRAM + + #pragma target 4.0 + #define TRANSPARENT + #define POISHADOW + // Mirror + #pragma shader_feature _REQUIRE_UV2 + // Random + #pragma shader_feature _SUNDISK_NONE + // Dissolve + #pragma shader_feature _ALPHABLEND_ON + #pragma multi_compile_instancing + #pragma vertex vertShadowCaster + #pragma fragment fragShadowCaster + #include "../Includes/PoiPassShadow.cginc" + ENDCG + + } + } +Fallback "Toon/Lit Cutout (Double)" +} diff --git a/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonTransparent.shader.meta b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonTransparent.shader.meta new file mode 100644 index 00000000..fd6981ab --- /dev/null +++ b/VRCSDK3AvatarsLegacy/Assets/_PoiyomiShaders/Shaders/Patreon/LocalParticles/Shaders/Toon/PoiyomiToonTransparent.shader.meta @@ -0,0 +1,27 @@ +fileFormatVersion: 2 +guid: 3b42194eebbc4f849956916f885871ad +ShaderImporter: + externalObjects: {} + defaultTextures: + - _MainTex: {instanceID: 0} + - _BumpMap: {instanceID: 0} + - _AlphaMask: {instanceID: 0} + - _DetailNormalMap: {instanceID: 0} + - _DetailNormalMask: {instanceID: 0} + - _CubeMap: {fileID: 8900000, guid: a0fde614a95c2d44ca3dec1fba756a6f, type: 3} + - _MetallicMap: {instanceID: 0} + - _SmoothnessMap: {instanceID: 0} + - _Matcap: {instanceID: 0} + - _MatcapMap: {instanceID: 0} + - _EmissionMap: {instanceID: 0} + - _EmissionMask: {instanceID: 0} + - _ToonRamp: {fileID: 2800000, guid: 7744a2dff3641604fa8b6601a055824c, type: 3} + - _AOMap: {instanceID: 0} + - _SpecularMap: {instanceID: 0} + - _SpecularHighTexture: {instanceID: 0} + - _SSSThicknessMap: {instanceID: 0} + - _RimTex: {instanceID: 0} + - _RimMask: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |