[unity] New separate LWRP shaders UPM package content added to repository. Cleanup and restructuring / adaptations of existing shaders. Added and improved warnings in case of problematic texture and material settings. See #1255.

This commit is contained in:
Harald Csaszar 2019-07-14 22:53:18 +02:00
parent eac42ae50a
commit 195ae91db1
75 changed files with 9142 additions and 152 deletions

View File

@ -299,6 +299,11 @@ namespace Spine.Unity.Editor {
if (!valid)
return;
string errorMessage = null;
if (MaterialChecks.IsMaterialSetupProblematic((SkeletonRenderer)this.target, ref errorMessage)) {
EditorGUILayout.HelpBox(errorMessage, MessageType.Error, true);
}
// More Render Options...
using (new SpineInspectorUtility.BoxScope()) {

View File

@ -175,9 +175,7 @@ namespace Spine.Unity.Editor {
public static string editorPath = "";
public static string editorGUIPath = "";
public static bool initialized;
static int STRAIGHT_ALPHA_PARAM_ID = Shader.PropertyToID("_StraightAlphaInput");
#if NEW_PREFERENCES_SETTINGS_PROVIDER
static class SpineSettingsProviderRegistration
{
@ -314,21 +312,15 @@ namespace Spine.Unity.Editor {
int extensionPos = texturePath.LastIndexOf('.');
string materialPath = texturePath.Substring(0, extensionPos) + "_Material.mat";
Material material = AssetDatabase.LoadAssetAtPath<Material>(materialPath);
if (material == null || !material.HasProperty(STRAIGHT_ALPHA_PARAM_ID)) {
return true; // non-Spine shader used on material
}
// 'sRGBTexture = true' generates incorrectly weighted mipmaps at PMA textures,
// causing white borders due to undesired custom weighting.
if (texImporter.sRGBTexture && texImporter.mipmapEnabled && PlayerSettings.colorSpace == ColorSpace.Gamma) {
Debug.LogWarningFormat("`{0}` : Problematic Texture Settings found: When enabling `Generate Mip Maps` in Gamma color space, it is recommended to disable `sRGB (Color Texture)`. Otherwise you will receive white border artifacts on an atlas exported with default `Premultiply alpha` settings.\n(You can disable this warning in `Edit - Preferences - Spine`)", texturePath);
}
if (texImporter.alphaIsTransparency) {
int straightAlphaValue = material.GetInt(STRAIGHT_ALPHA_PARAM_ID);
if (straightAlphaValue == 0) {
string materialName = System.IO.Path.GetFileName(materialPath);
Debug.LogWarningFormat("`{0}` and material `{1}` : Incorrect Texture / Material Settings found: It is strongly recommended to disable `Alpha Is Transparency` on `Premultiply alpha` textures.\nAssuming `Premultiply alpha` texture because `Straight Alpha Texture` is disabled at material). (You can disable this warning in `Edit - Preferences - Spine`)", texturePath, materialName);
}
if (material == null)
return true;
string errorMessage = null;
if (MaterialChecks.IsTextureSetupProblematic(material, PlayerSettings.colorSpace,
texImporter. sRGBTexture, texImporter. mipmapEnabled, texImporter. alphaIsTransparency,
texturePath, materialPath, ref errorMessage)) {
Debug.LogWarning(errorMessage);
}
return true;
}
@ -860,6 +852,8 @@ namespace Spine.Unity.Editor {
// Import atlases first.
var atlases = new List<AtlasAssetBase>();
foreach (string ap in atlasPaths) {
if (ap.StartsWith("Packages"))
continue;
TextAsset atlasText = AssetDatabase.LoadAssetAtPath<TextAsset>(ap);
AtlasAssetBase atlas = IngestSpineAtlas(atlasText);
atlases.Add(atlas);
@ -868,6 +862,8 @@ namespace Spine.Unity.Editor {
// Import skeletons and match them with atlases.
bool abortSkeletonImport = false;
foreach (string skeletonPath in skeletonPaths) {
if (skeletonPath.StartsWith("Packages"))
continue;
if (!reimport && CheckForValidSkeletonData(skeletonPath)) {
ReloadSkeletonData(skeletonPath);
continue;

View File

@ -29,6 +29,7 @@
using UnityEngine;
using UnityEditor;
using Spine.Unity;
using SpineInspectorUtility = Spine.Unity.Editor.SpineInspectorUtility;
@ -36,6 +37,7 @@ public class SpineSpriteShaderGUI : ShaderGUI {
static readonly string kShaderVertexLit = "Spine/Sprite/Vertex Lit";
static readonly string kShaderPixelLit = "Spine/Sprite/Pixel Lit";
static readonly string kShaderUnlit = "Spine/Sprite/Unlit";
static readonly string kShaderLitLW = "Lightweight Render Pipeline/Spine/Sprite";
static readonly int kSolidQueue = 2000;
static readonly int kAlphaTestQueue = 2450;
static readonly int kTransparentQueue = 3000;
@ -54,6 +56,7 @@ public class SpineSpriteShaderGUI : ShaderGUI {
VertexLit,
PixelLit,
Unlit,
LitLightweight
};
private enum eCulling {
@ -120,6 +123,7 @@ public class SpineSpriteShaderGUI : ShaderGUI {
static GUIContent _depthText = new GUIContent("Write to Depth", "Write to Depth Buffer by clipping alpha.");
static GUIContent _depthAlphaCutoffText = new GUIContent("Depth Alpha Cutoff", "Threshold for depth write alpha cutoff");
static GUIContent _shadowAlphaCutoffText = new GUIContent("Shadow Alpha Cutoff", "Threshold for shadow alpha cutoff");
static GUIContent _receiveShadowsText = new GUIContent("Receive Shadows", "When enabled, other GameObjects can cast shadows onto this GameObject. 'Write to Depth' has to be enabled in Lightweight RP.");
static GUIContent _fixedNormalText = new GUIContent("Fixed Normals", "If this is ticked instead of requiring mesh normals a Fixed Normal will be used instead (it's quicker and can result in better looking lighting effects on 2d objects).");
static GUIContent _fixedNormalDirectionText = new GUIContent("Fixed Normal Direction", "Should normally be (0,0,1) if in view-space or (0,0,-1) if in model-space.");
static GUIContent _adjustBackfaceTangentText = new GUIContent("Adjust Back-face Tangents", "Tick only if you are going to rotate the sprite to face away from the camera, the tangents will be flipped when this is the case to make lighting correct.");
@ -128,7 +132,8 @@ public class SpineSpriteShaderGUI : ShaderGUI {
static GUIContent[] _lightingModeOptions = {
new GUIContent("Vertex Lit"),
new GUIContent("Pixel Lit"),
new GUIContent("Unlit")
new GUIContent("Unlit"),
new GUIContent("Lit Lightweight")
};
static GUIContent _blendModeText = new GUIContent("Blend Mode", "Blend Mode");
static GUIContent[] _blendModeOptions = {
@ -160,7 +165,7 @@ public class SpineSpriteShaderGUI : ShaderGUI {
static GUIContent _meshRequiresTangentsText = new GUIContent("Note: Material requires a mesh with tangents.");
static GUIContent _meshRequiresNormalsText = new GUIContent("Note: Material requires a mesh with normals.");
static GUIContent _meshRequiresNormalsAndTangentsText = new GUIContent("Note: Material requires a mesh with Normals and Tangents.");
const string _primaryMapsText = "Main Maps";
const string _depthLabelText = "Depth";
const string _shadowsText = "Shadows";
@ -324,6 +329,10 @@ public class SpineSpriteShaderGUI : ShaderGUI {
if (material.shader.name != kShaderUnlit)
_materialEditor.SetShader(Shader.Find(kShaderUnlit), false);
break;
case eLightMode.LitLightweight:
if (material.shader.name != kShaderLitLW)
_materialEditor.SetShader(Shader.Find(kShaderLitLW), false);
break;
}
}
@ -351,6 +360,11 @@ public class SpineSpriteShaderGUI : ShaderGUI {
dataChanged = true;
}
if (QualitySettings.activeColorSpace == ColorSpace.Linear &&
!EditorGUI.showMixedValue && blendMode == eBlendMode.PreMultipliedAlpha) {
EditorGUILayout.HelpBox(MaterialChecks.kPMANotSupportedLinearMessage, MessageType.Error, true);
}
}
// GUILayout.Label(Styles.advancedText, EditorStyles.boldLabel);
@ -554,12 +568,44 @@ public class SpineSpriteShaderGUI : ShaderGUI {
}
protected virtual bool RenderShadowsProperties () {
bool dataChanged = false;
EditorGUI.BeginChangeCheck();
_materialEditor.RangeProperty(_shadowAlphaCutoff, _shadowAlphaCutoffText.text);
return EditorGUI.EndChangeCheck();
dataChanged = EditorGUI.EndChangeCheck();
bool areMixedShaders = false;
bool hasReceiveShadowsParameter = IsLWRPShader(_materialEditor, out areMixedShaders);
if (hasReceiveShadowsParameter) {
bool forceDisableReceiveShadows = !_writeToDepth.hasMixedValue && _writeToDepth.floatValue == 0;
EditorGUI.BeginDisabledGroup(forceDisableReceiveShadows);
EditorGUI.BeginChangeCheck();
bool mixedValue;
bool enableReceive = !IsKeywordEnabled(_materialEditor, "_RECEIVE_SHADOWS_OFF", out mixedValue);
EditorGUI.showMixedValue = mixedValue;
enableReceive = EditorGUILayout.Toggle(_receiveShadowsText, enableReceive);
EditorGUI.showMixedValue = false;
if (EditorGUI.EndChangeCheck() || forceDisableReceiveShadows) {
SetKeyword(_materialEditor, "_RECEIVE_SHADOWS_OFF", !enableReceive || forceDisableReceiveShadows);
dataChanged = true;
}
EditorGUI.EndDisabledGroup(); // forceDisableReceiveShadows
}
return dataChanged;
}
protected virtual bool RenderSphericalHarmonicsProperties () {
bool areMixedShaders = false;
bool isLWRPShader = IsLWRPShader(_materialEditor, out areMixedShaders);
bool hasSHParameter = areMixedShaders || !isLWRPShader;
if (!hasSHParameter)
return false;
EditorGUI.BeginChangeCheck();
bool mixedValue;
bool enabled = IsKeywordEnabled(_materialEditor, "_SPHERICAL_HARMONICS", out mixedValue);
@ -828,6 +874,21 @@ public class SpineSpriteShaderGUI : ShaderGUI {
m.DisableKeyword(keyword);
}
static bool IsLWRPShader (MaterialEditor editor, out bool mixedValue) {
mixedValue = false;
bool isAnyLWRPShader = false;
foreach (Material material in editor.targets) {
if (material.shader.name == kShaderLitLW) {
isAnyLWRPShader = true;
}
else if (isAnyLWRPShader) {
mixedValue = true;
}
}
return isAnyLWRPShader;
}
static bool IsKeywordEnabled (MaterialEditor editor, string keyword, out bool mixedValue) {
bool keywordEnabled = ((Material)editor.target).IsKeywordEnabled(keyword);
mixedValue = false;
@ -845,13 +906,18 @@ public class SpineSpriteShaderGUI : ShaderGUI {
static eLightMode GetMaterialLightMode (Material material) {
if (material.shader.name == kShaderPixelLit) {
return eLightMode.PixelLit;
} else if (material.shader.name == kShaderUnlit) {
}
else if (material.shader.name == kShaderUnlit) {
return eLightMode.Unlit;
} else {
}
else if (material.shader.name == kShaderLitLW) {
return eLightMode.LitLightweight;
}
else { // if (material.shader.name == kShaderVertexLit)
return eLightMode.VertexLit;
}
}
static eBlendMode GetMaterialBlendMode (Material material) {
if (material.IsKeywordEnabled("_ALPHABLEND_ON"))
return eBlendMode.StandardAlpha;

View File

@ -306,6 +306,14 @@ namespace Spine.Unity {
if (OnRebuild != null)
OnRebuild(this);
#if UNITY_EDITOR
if (!Application.isPlaying) {
string errorMessage = null;
if (MaterialChecks.IsMaterialSetupProblematic(this, ref errorMessage))
Debug.LogWarningFormat("Problematic material setup at {0}: {1}", this.name, errorMessage);
}
#endif
}
/// <summary>

View File

@ -64,14 +64,14 @@ Shader "Spine/Skeleton Lit" {
#pragma multi_compile __ POINT SPOT
half3 computeLighting (int idx, half3 dirToLight, half3 eyeNormal, half3 viewDir, half4 diffuseColor, half atten) {
half3 computeLighting (int idx, half3 dirToLight, half3 eyeNormal, half4 diffuseColor, half atten) {
half NdotL = max(dot(eyeNormal, dirToLight), 0.0);
// diffuse
half3 color = NdotL * diffuseColor.rgb * unity_LightColor[idx].rgb;
return color * atten;
}
half3 computeOneLight (int idx, float3 eyePosition, half3 eyeNormal, half3 viewDir, half4 diffuseColor) {
half3 computeOneLight (int idx, float3 eyePosition, half3 eyeNormal, half4 diffuseColor) {
float3 dirToLight = unity_LightPosition[idx].xyz;
half att = 1.0;
@ -94,7 +94,7 @@ Shader "Spine/Skeleton Lit" {
#endif
att *= 0.5; // passed in light colors are 2x brighter than what used to be in FFP
return min (computeLighting (idx, dirToLight, eyeNormal, viewDir, diffuseColor, att), 1.0);
return min (computeLighting (idx, dirToLight, eyeNormal, diffuseColor, att), 1.0);
}
int4 unity_VertexLightParams; // x: light count, y: zero, z: one (y/z needed by d3d9 vs loop instruction)
@ -103,7 +103,7 @@ Shader "Spine/Skeleton Lit" {
float3 pos : POSITION;
float3 normal : NORMAL;
half4 color : COLOR;
float3 uv0 : TEXCOORD0;
float2 uv0 : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
@ -124,12 +124,11 @@ Shader "Spine/Skeleton Lit" {
half3 fixedNormal = half3(0,0,-1);
half3 eyeNormal = normalize(mul((float3x3)UNITY_MATRIX_IT_MV, fixedNormal));
//half3 eyeNormal = half3(0,0,1);
half3 viewDir = 0.0;
// Lights
half3 lcolor = half4(0,0,0,1).rgb + color.rgb * glstate_lightmodel_ambient.rgb;
for (int il = 0; il < LIGHT_LOOP_LIMIT; ++il) {
lcolor += computeOneLight(il, eyePos, eyeNormal, viewDir, color);
lcolor += computeOneLight(il, eyePos, eyeNormal, color);
}
color.rgb = lcolor.rgb;

View File

@ -1,7 +1,11 @@
#ifndef SHADER_MATHS_INCLUDED
#define SHADER_MATHS_INCLUDED
#if defined(USE_LWRP)
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#else
#include "UnityCG.cginc"
#endif
////////////////////////////////////////
// Maths functions

View File

@ -1,7 +1,13 @@
// Upgrade NOTE: upgraded instancing buffer 'PerDrawSprite' to new syntax.
#ifndef SHADER_SHARED_INCLUDED
#define SHADER_SHARED_INCLUDED
#if defined(USE_LWRP)
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#else
#include "UnityCG.cginc"
#endif
#ifdef UNITY_INSTANCING_ENABLED
@ -34,14 +40,37 @@ inline float4 calculateWorldPos(float4 vertex)
return mul(unity_ObjectToWorld, vertex);
}
#if defined(USE_LWRP)
// snaps post-transformed position to screen pixels
inline float4 UnityPixelSnap(float4 pos)
{
float2 hpc = _ScreenParams.xy * 0.5f;
#if SHADER_API_PSSL
// sdk 4.5 splits round into v_floor_f32(x+0.5) ... sdk 5.0 uses v_rndne_f32, for compatabilty we use the 4.5 version
float2 temp = ((pos.xy / pos.w) * hpc) + float2(0.5f, 0.5f);
float2 pixelPos = float2(__v_floor_f32(temp.x), __v_floor_f32(temp.y));
#else
float2 pixelPos = round((pos.xy / pos.w) * hpc);
#endif
pos.xy = pixelPos / hpc * pos.w;
return pos;
}
#endif
inline float4 calculateLocalPos(float4 vertex)
{
#if !defined(USE_LWRP)
#ifdef UNITY_INSTANCING_ENABLED
vertex.xy *= _Flip.xy;
#endif
#endif
#if defined(USE_LWRP)
float4 pos = TransformObjectToHClip(vertex.xyz);
#else
float4 pos = UnityObjectToClipPos(vertex);
#endif
#ifdef PIXELSNAP_ON
pos = UnityPixelSnap(pos);
#endif
@ -51,7 +80,11 @@ inline float4 calculateLocalPos(float4 vertex)
inline half3 calculateWorldNormal(float3 normal)
{
#if defined(USE_LWRP)
return TransformObjectToWorldNormal(normal);
#else
return UnityObjectToWorldNormal(normal);
#endif
}
////////////////////////////////////////
@ -70,7 +103,8 @@ half3 UnpackScaleNormal(half4 packednormal, half bumpScale)
#else
half3 normal;
normal.xy = (packednormal.wy * 2 - 1);
#if (SHADER_TARGET >= 30)
// Note: we allow scaled normals in LWRP since we might be using fewer instructions.
#if (SHADER_TARGET >= 30) || defined(USE_LWRP)
// SM2.0: instruction count limitation
// SM2.0: normal scaler is not supported
normal.xy *= bumpScale;
@ -83,7 +117,11 @@ half3 UnpackScaleNormal(half4 packednormal, half bumpScale)
inline half3 calculateWorldTangent(float4 tangent)
{
#if defined(USE_LWRP)
return TransformObjectToWorldDir(tangent.xyz);
#else
return UnityObjectToWorldDir(tangent);
#endif
}
inline half3 calculateWorldBinormal(half3 normalWorld, half3 tangentWorld, float tangentSign)
@ -109,82 +147,46 @@ inline half3 calculateNormalFromBumpMap(float2 texUV, half3 tangentWorld, half3
// Blending functions
//
inline fixed4 calculateLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target
inline fixed4 prepareLitPixelForOutput(fixed4 finalPixel, fixed4 color) : SV_Target
{
fixed4 finalPixel;
#if defined(_ALPHABLEND_ON)
//Normal Alpha
finalPixel.a = texureColor.a * color.a;
finalPixel.rgb = texureColor.rgb * color.rgb * (lighting * finalPixel.a);
finalPixel.rgb *= finalPixel.a;
#elif defined(_ALPHAPREMULTIPLY_ON)
//Pre multiplied alpha
finalPixel = texureColor * color;
finalPixel.rgb *= lighting * color.a;
finalPixel.rgb *= color.a;
#elif defined(_MULTIPLYBLEND)
//Multiply
finalPixel = texureColor * color;
finalPixel.rgb *= lighting;
finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a);
#elif defined(_MULTIPLYBLEND_X2)
//Multiply x2
finalPixel.rgb = texureColor.rgb * color.rgb * lighting * 2.0f;
finalPixel.a = color.a * texureColor.a;
finalPixel.rgb *= 2.0f;
finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a);
#elif defined(_ADDITIVEBLEND)
//Additive
finalPixel = texureColor * 2.0f * color;
finalPixel.rgb *= lighting * color.a;
finalPixel *= 2.0f;
finalPixel.rgb *= color.a;
#elif defined(_ADDITIVEBLEND_SOFT)
//Additive soft
finalPixel = texureColor * color;
finalPixel.rgb *= lighting * finalPixel.a;
finalPixel.rgb *= finalPixel.a;
#else
//Opaque
finalPixel.a = 1;
finalPixel.rgb = texureColor.rgb * color.rgb * lighting;
#endif
return finalPixel;
}
inline fixed4 calculateLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target
{
fixed4 finalPixel = texureColor * color * fixed4(lighting, 1);
finalPixel = prepareLitPixelForOutput(finalPixel, color);
return finalPixel;
}
inline fixed4 calculateLitPixel(fixed4 texureColor, fixed3 lighting) : SV_Target
{
fixed4 finalPixel;
#if defined(_ALPHABLEND_ON)
//Normal Alpha
finalPixel.a = texureColor.a;
finalPixel.rgb = texureColor.rgb * (lighting * finalPixel.a);
#elif defined(_ALPHAPREMULTIPLY_ON)
//Pre multiplied alpha
finalPixel = texureColor;
finalPixel.rgb *= lighting;
#elif defined(_MULTIPLYBLEND)
//Multiply
finalPixel = texureColor;
finalPixel.rgb *= lighting;
finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a);
#elif defined(_MULTIPLYBLEND_X2)
//Multiply x2
finalPixel.rgb = texureColor.rgb * lighting * 2.0f;
finalPixel.a = texureColor.a;
finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a);
#elif defined(_ADDITIVEBLEND)
//Additive
finalPixel = texureColor * 2.0f;
finalPixel.rgb *= lighting;
#elif defined(_ADDITIVEBLEND_SOFT)
//Additive soft
finalPixel = texureColor;
finalPixel.rgb *= lighting * finalPixel.a;
#else
//Opaque
finalPixel.a = 1;
finalPixel.rgb = texureColor.rgb * lighting;
#endif
return finalPixel;
// note: we let the optimizer work, removed duplicate code.
return calculateLitPixel(texureColor, fixed4(1, 1, 1, 1), lighting);
}
inline fixed4 calculateAdditiveLitPixel(fixed4 texureColor, fixed4 color, fixed3 lighting) : SV_Target
@ -227,75 +229,14 @@ inline fixed4 calculateAdditiveLitPixel(fixed4 texureColor, fixed3 lighting) : S
inline fixed4 calculatePixel(fixed4 texureColor, fixed4 color) : SV_Target
{
fixed4 finalPixel;
#if defined(_ALPHABLEND_ON)
//Normal Alpha
finalPixel.a = texureColor.a * color.a;
finalPixel.rgb = (texureColor.rgb * color.rgb) * finalPixel.a;
#elif defined(_ALPHAPREMULTIPLY_ON)
//Pre multiplied alpha
finalPixel = texureColor * color;
finalPixel.rgb *= color.a;
#elif defined(_MULTIPLYBLEND)
//Multiply
finalPixel = color * texureColor;
finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a);
#elif defined(_MULTIPLYBLEND_X2)
//Multiply x2
finalPixel.rgb = texureColor.rgb * color.rgb * 2.0f;
finalPixel.a = color.a * texureColor.a;
finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a);
#elif defined(_ADDITIVEBLEND)
//Additive
finalPixel = texureColor * 2.0f * color;
#elif defined(_ADDITIVEBLEND_SOFT)
//Additive soft
finalPixel = color * texureColor;
finalPixel.rgb *= finalPixel.a;
#else
//Opaque
finalPixel.a = 1;
finalPixel.rgb = texureColor.rgb * color.rgb;
#endif
return finalPixel;
// note: we let the optimizer work, removed duplicate code.
return calculateLitPixel(texureColor, color, fixed3(1, 1, 1));
}
inline fixed4 calculatePixel(fixed4 texureColor) : SV_Target
{
fixed4 finalPixel;
#if defined(_ALPHABLEND_ON)
//Normal Alpha
finalPixel.a = texureColor.a;
finalPixel.rgb = texureColor.rgb * finalPixel.a;
#elif defined(_ALPHAPREMULTIPLY_ON)
//Pre multiplied alpha
finalPixel = texureColor;
#elif defined(_MULTIPLYBLEND)
//Multiply
finalPixel = texureColor;
finalPixel = lerp(fixed4(1,1,1,1), finalPixel, finalPixel.a);
#elif defined(_MULTIPLYBLEND_X2)
//Multiply x2
finalPixel.rgb = texureColor.rgb * 2.0f;
finalPixel.a = texureColor.a;
finalPixel = lerp(fixed4(0.5f,0.5f,0.5f,0.5f), finalPixel, finalPixel.a);
#elif defined(_ADDITIVEBLEND)
//Additive
finalPixel = texureColor * 2.0f;
#elif defined(_ADDITIVEBLEND_SOFT)
//Additive soft
finalPixel = texureColor;
finalPixel.rgb *= finalPixel.a;
#else
//Opaque
finalPixel.a = 1;
finalPixel.rgb = texureColor.rgb;
#endif
return finalPixel;
// note: we let the optimizer work, removed duplicate code.
return calculateLitPixel(texureColor, fixed4(1, 1, 1, 1), fixed3(1, 1, 1));
}
////////////////////////////////////////
@ -380,7 +321,7 @@ inline fixed4 adjustColor(fixed4 color)
#if defined(_FOG) && (defined(FOG_LINEAR) || defined(FOG_EXP) || defined(FOG_EXP2))
inline fixed4 applyFog(fixed4 pixel, float1 fogCoord)
inline fixed4 applyFog(fixed4 pixel, float fogCoordOrFactorAtLWRP)
{
#if defined(_ADDITIVEBLEND) || defined(_ADDITIVEBLEND_SOFT)
//In additive mode blend from clear to black based on luminance
@ -400,14 +341,19 @@ inline fixed4 applyFog(fixed4 pixel, float1 fogCoord)
#else
//In opaque mode just return fog color;
fixed4 fogColor = unity_FogColor;
#endif
#endif
UNITY_APPLY_FOG_COLOR(fogCoord, pixel, fogColor);
#if defined(USE_LWRP)
pixel.rgb = MixFogColor(pixel.rgb, fogColor.rgb, fogCoordOrFactorAtLWRP);
#else
UNITY_APPLY_FOG_COLOR(fogCoordOrFactorAtLWRP, pixel, fogColor);
#endif
return pixel;
}
#define APPLY_FOG(pixel, input) pixel = applyFog(pixel, input.fogCoord);
#define APPLY_FOG_LWRP(pixel, fogFactor) pixel = applyFog(pixel, fogFactor);
#define APPLY_FOG_ADDITIVE(pixel, input) \
UNITY_APPLY_FOG_COLOR(input.fogCoord, pixel.rgb, fixed4(0,0,0,0)); // fog towards black in additive pass
@ -415,6 +361,7 @@ inline fixed4 applyFog(fixed4 pixel, float1 fogCoord)
#else
#define APPLY_FOG(pixel, input)
#define APPLY_FOG_LWRP(pixel, fogFactor)
#define APPLY_FOG_ADDITIVE(pixel, input)
#endif

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 52627c17e6dd4bf4dad4bdfc490ce823
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,114 @@
/******************************************************************************
* Spine Runtimes License Agreement
* Last updated May 1, 2019. Replaces all prior versions.
*
* Copyright (c) 2013-2019, Esoteric Software LLC
*
* Integration of the Spine Runtimes into software or otherwise creating
* derivative works of the Spine Runtimes is permitted under the terms and
* conditions of Section 2 of the Spine Editor License Agreement:
* http://esotericsoftware.com/spine-editor-license
*
* Otherwise, it is permitted to integrate the Spine Runtimes into software
* or otherwise create derivative works of the Spine Runtimes (collectively,
* "Products"), provided that each user of the Products must obtain their own
* Spine Editor license and redistribution of the Products in any form must
* include this license and copyright notice.
*
* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS
* INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
namespace Spine.Unity {
/// <summary>Utility class providing methods to check material settings for incorrect combinations.</summary>
public class MaterialChecks {
static readonly int STRAIGHT_ALPHA_PARAM_ID = Shader.PropertyToID("_StraightAlphaInput");
static readonly string ALPHAPREMULTIPLY_ON_KEYWORD = "_ALPHAPREMULTIPLY_ON";
public static readonly string kPMANotSupportedLinearMessage =
"Warning: Premultiply-alpha atlas textures not supported in Linear color space!\n\nPlease\n"
+ "a) re-export atlas as straight alpha texture with 'premultiply alpha' unchecked or\n"
+ "b) switch to Gamma color space via\nProject Settings - Player - Other Settings - Color Space.\n";
public static bool IsMaterialSetupProblematic (SkeletonRenderer renderer, ref string errorMessage) {
var materials = renderer.GetComponent<Renderer>().sharedMaterials;
bool isProblematic = false;
foreach (var mat in materials) {
isProblematic |= MaterialChecks.IsMaterialSetupProblematic(mat, ref errorMessage);
}
return isProblematic;
}
public static bool IsMaterialSetupProblematic(Material material, ref string errorMessage) {
return !IsColorSpaceSupported(material, ref errorMessage);
}
public static bool IsColorSpaceSupported (Material material, ref string errorMessage) {
if (QualitySettings.activeColorSpace == ColorSpace.Linear) {
if (IsPMAMaterial(material)) {
errorMessage += kPMANotSupportedLinearMessage;
return false;
}
}
return true;
}
public static bool UsesSpineShader (Material material) {
return material.shader.name.Contains("Spine/");
}
public static bool IsTextureSetupProblematic (Material material, ColorSpace colorSpace,
bool sRGBTexture, bool mipmapEnabled, bool alphaIsTransparency,
string texturePath, string materialPath,
ref string errorMessage) {
if (material == null || !UsesSpineShader(material)) {
return false;
}
bool isProblematic = false;
if (IsPMAMaterial(material)) {
// 'sRGBTexture = true' generates incorrectly weighted mipmaps at PMA textures,
// causing white borders due to undesired custom weighting.
if (sRGBTexture && mipmapEnabled && colorSpace == ColorSpace.Gamma) {
errorMessage += string.Format("`{0}` : Problematic Texture Settings found: When enabling `Generate Mip Maps` in Gamma color space, it is recommended to disable `sRGB (Color Texture)` on `Premultiply alpha` textures. Otherwise you will receive white border artifacts on an atlas exported with default `Premultiply alpha` settings.\n(You can disable this warning in `Edit - Preferences - Spine`)\n", texturePath);
isProblematic = true;
}
if (alphaIsTransparency) {
string materialName = System.IO.Path.GetFileName(materialPath);
errorMessage += string.Format("`{0}` and material `{1}` : Problematic Texture / Material Settings found: It is recommended to disable `Alpha Is Transparency` on `Premultiply alpha` textures.\nAssuming `Premultiply alpha` texture because `Straight Alpha Texture` is disabled at material). (You can disable this warning in `Edit - Preferences - Spine`)\n", texturePath, materialName);
isProblematic = true;
}
}
else { // straight alpha texture
if (!alphaIsTransparency) {
string materialName = System.IO.Path.GetFileName(materialPath);
errorMessage += string.Format("`{0}` and material `{1}` : Incorrect Texture / Material Settings found: It is strongly recommended to enable `Alpha Is Transparency` on `Straight alpha` textures.\nAssuming `Straight alpha` texture because `Straight Alpha Texture` is enabled at material). (You can disable this warning in `Edit - Preferences - Spine`)\n", texturePath, materialName);
isProblematic = true;
}
}
return isProblematic;
}
static bool IsPMAMaterial (Material material) {
return (material.HasProperty(STRAIGHT_ALPHA_PARAM_ID) && material.GetInt(STRAIGHT_ALPHA_PARAM_ID) == 0) ||
material.IsKeywordEnabled(ALPHAPREMULTIPLY_ON_KEYWORD);
}
}
}
#endif // UNITY_EDITOR

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e68fa8db689084946adce454b83e6d4a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a32432c0568946f429800254981e7c02
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c1c5be7b33880734d9675fdca40ac5d0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 03948dede49bd084c80f13cfb8f5c5c1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7bb1acf275841dd4d85e39c168d08cdf
timeCreated: 1479531945
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
# Spine Runtimes License Agreement
Last updated May 1, 2019. Replaces all prior versions.
Copyright (c) 2013-2019, Esoteric Software LLC
Integration of the Spine Runtimes into software or otherwise creating
derivative works of the Spine Runtimes is permitted under the terms and
conditions of Section 2 of the Spine Editor License Agreement:
http://esotericsoftware.com/spine-editor-license
Otherwise, it is permitted to integrate the Spine Runtimes into software
or otherwise create derivative works of the Spine Runtimes (collectively,
"Products"), provided that each user of the Products must obtain their own
Spine Editor license and redistribution of the Products in any form must
include this license and copyright notice.
THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS
INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 09eeff36e2b574446a04336904abbe04
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: da24c0c782c02ef4d9b3ae62e6c7891d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bb2ec1d147af7ed41a90761d9fa2866c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,37 @@
#ifndef COMMON_SHADOW_CASTER_PASS_LW_INCLUDED
#define COMMON_SHADOW_CASTER_PASS_LW_INCLUDED
#include "SpineCoreShaders/ShaderShared.cginc"
struct AttributesSpine
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 vertexColor : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VaryingsSpine
{
float4 positionCS : SV_POSITION;
float4 texcoordAndAlpha: TEXCOORD0;
};
float4 GetShadowPositionHClip(AttributesSpine input)
{
float3 positionWS = TransformObjectToWorld(input.positionOS.xyz);
float3 normalWS = TransformObjectToWorldNormal(input.normalOS);
float4 positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, _LightDirection));
#if UNITY_REVERSED_Z
positionCS.z = min(positionCS.z, positionCS.w * UNITY_NEAR_CLIP_VALUE);
#else
positionCS.z = max(positionCS.z, positionCS.w * UNITY_NEAR_CLIP_VALUE);
#endif
return positionCS;
}
#endif

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6fcd9fbd32d3cc9479ee4efcb876bd98
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,42 @@
#ifndef SPRITES_DEPTH_ONLY_PASS_LW_INCLUDED
#define SPRITES_DEPTH_ONLY_PASS_LW_INCLUDED
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "SpineCoreShaders/ShaderShared.cginc"
struct AttributesSprite
{
float4 positionOS : POSITION;
float4 vertexColor : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VaryingsSprite
{
float4 positionCS : SV_POSITION;
float4 texcoordAndAlpha: TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
VaryingsSprite DepthOnlyVertexSprite(AttributesSprite input)
{
VaryingsSprite output = (VaryingsSprite)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
output.texcoordAndAlpha.xyz = float3(TRANSFORM_TEX(input.texcoord, _MainTex).xy, 0);
output.texcoordAndAlpha.a = input.vertexColor.a * _Color.a;
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
return output;
}
half4 DepthOnlyFragmentSprite(VaryingsSprite input) : SV_TARGET
{
fixed4 texureColor = calculateTexturePixel(input.texcoordAndAlpha.xy);
clip(texureColor.a * input.texcoordAndAlpha.a - _Cutoff);
return 0;
}
#endif

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 62f5598eb40b49f44b4394d675da8472
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,48 @@
#ifndef LIGHTWEIGHT_LIT_INPUT_INCLUDED
#define LIGHTWEIGHT_LIT_INPUT_INCLUDED
////////////////////////////////////////
// Defines
//
#undef LIGHTMAP_ON
#if defined(_SPECULAR) || defined(_SPECULAR_GLOSSMAP)
#define SPECULAR
#endif
//Have to process lighting per pixel if using normal maps or a diffuse ramp or rim lighting or specular
#if defined(_NORMALMAP) || defined(_DIFFUSE_RAMP) || defined(_RIM_LIGHTING) || defined(SPECULAR)
#define PER_PIXEL_LIGHTING
#endif
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "SpineCoreShaders/ShaderShared.cginc"
#if defined(SPECULAR)
CBUFFER_START(UnityPerMaterial)
half _Metallic;
half _Glossiness;
half _GlossMapScale;
CBUFFER_END
sampler2D _MetallicGlossMap;
inline half2 getMetallicGloss(float2 uv)
{
half2 mg;
#ifdef _SPECULAR_GLOSSMAP
mg = tex2D(_MetallicGlossMap, uv).ra;
mg.g *= _GlossMapScale;
#else
mg.r = _Metallic;
mg.g = _Glossiness;
#endif
return mg;
}
#endif
#endif // LIGHTWEIGHT_INPUT_SURFACE_PBR_INCLUDED

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f4e2f096b2fbf094097454382c73c816
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,76 @@
#ifndef SKELETONLIT_FORWARD_PASS_LW_INCLUDED
#define SKELETONLIT_FORWARD_PASS_LW_INCLUDED
struct appdata {
float3 pos : POSITION;
float3 normal : NORMAL;
half4 color : COLOR;
float2 uv0 : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput {
half4 color : COLOR0;
float2 uv0 : TEXCOORD0;
float4 pos : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
};
half3 LightweightLightVertexSimplified(float3 positionWS, half3 normalWS) {
Light mainLight = GetMainLight();
half3 attenuatedLightColor = mainLight.color * (mainLight.distanceAttenuation * mainLight.shadowAttenuation);
half3 diffuseLightColor = LightingLambert(attenuatedLightColor, mainLight.direction, normalWS);
// Note: we don't add any lighting in the fragment shader, thus we include both variants below
#if defined(_ADDITIONAL_LIGHTS) || defined(_ADDITIONAL_LIGHTS_VERTEX)
for (int i = 0; i < GetAdditionalLightsCount(); ++i)
{
Light light = GetAdditionalLight(i, positionWS);
half3 attenuatedLightColor = light.color * (light.distanceAttenuation * light.shadowAttenuation);
diffuseLightColor += LightingLambert(attenuatedLightColor, light.direction, normalWS);
}
#endif
return diffuseLightColor;
}
VertexOutput vert(appdata v) {
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
half4 color = v.color;
float3 positionWS = TransformObjectToWorld(v.pos);
half3 fixedNormal = half3(0, 0, -1);
half3 normalWS = normalize(mul((float3x3)unity_ObjectToWorld, fixedNormal));
color.rgb = LightweightLightVertexSimplified(positionWS, normalWS);
// Note: ambient light is also handled via SH.
half3 vertexSH;
OUTPUT_SH(normalWS.xyz, vertexSH);
color.rgb += SAMPLE_GI(input.lightmapUV, vertexSH, normalWS);
o.color = color;
o.uv0 = v.uv0;
o.pos = TransformWorldToHClip(positionWS);
return o;
}
sampler2D _MainTex;
half4 frag(VertexOutput i) : SV_Target{
half4 tex = tex2D(_MainTex, i.uv0);
half4 col;
#if defined(_STRAIGHT_ALPHA_INPUT)
col.rgb = tex.rgb * i.color.rgb * tex.a;
#else
col.rgb = tex.rgb * i.color.rgb;
#endif
col.a = tex.a * i.color.a;
return col;
}
#endif

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 60e3412410cd14646a1dfd86d9775cb4
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
#ifndef SKELETONLIT_SHADOW_CASTER_PASS_LW_INCLUDED
#define SKELETONLIT_SHADOW_CASTER_PASS_LW_INCLUDED
#include "Spine-Common-ShadowCasterPass-LW.hlsl"
VaryingsSpine ShadowPassVertexSkeletonLit(AttributesSpine input)
{
VaryingsSpine output;
UNITY_SETUP_INSTANCE_ID(input);
output.texcoordAndAlpha.xyz = float3(TRANSFORM_TEX(input.texcoord, _MainTex).xy, 0);
output.positionCS = GetShadowPositionHClip(input);
output.texcoordAndAlpha.a = input.vertexColor.a;
return output;
}
half4 ShadowPassFragmentSkeletonLit(VaryingsSpine input) : SV_TARGET
{
fixed4 texureColor = calculateTexturePixel(input.texcoordAndAlpha.xy);
clip(texureColor.a * input.texcoordAndAlpha.a - _Cutoff);
return 0;
}
#endif

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 73bd9b77edd0d794ca8fde763e80a145
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,267 @@
#ifndef VERTEX_LIT_FORWARD_PASS_LW_INCLUDED
#define VERTEX_LIT_FORWARD_PASS_LW_INCLUDED
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Lighting.hlsl"
#include "SpineCoreShaders/SpriteLighting.cginc"
////////////////////////////////////////
// Vertex output struct
//
struct VertexOutputLWRP
{
float4 pos : SV_POSITION;
fixed4 vertexColor : COLOR;
float3 texcoord : TEXCOORD0;
half4 fogFactorAndVertexLight : TEXCOORD1;
half3 viewDirectionWS : TEXCOORD2;
DECLARE_LIGHTMAP_OR_SH(lightmapUV, vertexSH, 3);
#if defined(_NORMALMAP)
half4 normalWorld : TEXCOORD4;
half4 tangentWorld : TEXCOORD5;
half4 binormalWorld : TEXCOORD6;
#else
half3 normalWorld : TEXCOORD4;
#endif
#if defined(_MAIN_LIGHT_SHADOWS) && !defined(_RECEIVE_SHADOWS_OFF)
float4 shadowCoord : TEXCOORD7;
#endif
#if defined(_RIM_LIGHTING) || defined(_ADDITIONAL_LIGHTS)
float4 positionWS : TEXCOORD8;
#endif
UNITY_VERTEX_OUTPUT_STEREO
};
///////////////////////////////////////////////////////////////////////////////
// Vertex and Fragment functions //
///////////////////////////////////////////////////////////////////////////////
half3 LightweightLightVertexSimplified(float3 positionWS, half3 normalWS) {
#ifdef _MAIN_LIGHT_VERTEX
Light mainLight = GetMainLight();
half3 attenuatedLightColor = mainLight.color * (mainLight.distanceAttenuation * mainLight.shadowAttenuation);
half3 diffuseLightColor = LightingLambert(attenuatedLightColor, mainLight.direction, normalWS);
#else
half3 diffuseLightColor = half3(0, 0, 0);
#endif
#ifdef _ADDITIONAL_LIGHTS_VERTEX
int pixelLightCount = GetAdditionalLightsCount();
for (int i = 0; i < pixelLightCount; ++i)
{
Light light = GetAdditionalLight(i, positionWS);
half3 attenuatedLightColor = light.color * (light.distanceAttenuation * light.shadowAttenuation);
diffuseLightColor += LightingLambert(attenuatedLightColor, light.direction, normalWS);
}
#endif // _ADDITIONAL_LIGHTS_VERTEX
return diffuseLightColor;
}
#ifdef _DIFFUSE_RAMP
half3 LightingLambertRamped(half3 lightColor, float attenuation, half3 lightDir, half3 normal)
{
half angleDot = max(0, dot(lightDir, normal));
return calculateRampedDiffuse(lightColor, attenuation, angleDot);
}
#endif
#if defined(SPECULAR)
half4 LightweightFragmentPBRSimplified(InputData inputData, half4 texAlbedoAlpha, half metallic, half3 specular,
half smoothness, half3 emission, half4 vertexColor)
{
half4 albedo = texAlbedoAlpha * vertexColor;
BRDFData brdfData;
half ignoredAlpha = 1; // ignore alpha, otherwise
InitializeBRDFData(albedo.rgb, metallic, specular, smoothness, ignoredAlpha, brdfData);
brdfData.specular *= albedo.a;
#ifndef _MAIN_LIGHT_VERTEX
#if defined(_MAIN_LIGHT_SHADOWS) && !defined(_RECEIVE_SHADOWS_OFF)
Light mainLight = GetMainLight(inputData.shadowCoord);
#else
Light mainLight = GetMainLight();
#endif
half3 finalColor = inputData.bakedGI;
finalColor += LightingPhysicallyBased(brdfData, mainLight, inputData.normalWS, inputData.viewDirectionWS);
#else // _MAIN_LIGHT_VERTEX
half3 finalColor = inputData.bakedGI;
#endif // _MAIN_LIGHT_VERTEX
#ifdef _ADDITIONAL_LIGHTS
int pixelLightCount = GetAdditionalLightsCount();
for (int i = 0; i < pixelLightCount; ++i)
{
Light light = GetAdditionalLight(i, inputData.positionWS);
finalColor += LightingPhysicallyBased(brdfData, light, inputData.normalWS, inputData.viewDirectionWS);
}
#endif
#ifdef _ADDITIONAL_LIGHTS_VERTEX
finalColor += inputData.vertexLighting * brdfData.diffuse;
#endif
finalColor += emission;
return prepareLitPixelForOutput(half4(finalColor, texAlbedoAlpha.a), vertexColor);
}
#else // !SPECULAR
half4 LightweightFragmentBlinnPhongSimplified(InputData inputData, half4 texDiffuseAlpha, half3 emission, half4 vertexColor)
{
half4 diffuse = texDiffuseAlpha * vertexColor;
#ifndef _MAIN_LIGHT_VERTEX
#if defined(_MAIN_LIGHT_SHADOWS) && !defined(_RECEIVE_SHADOWS_OFF)
Light mainLight = GetMainLight(inputData.shadowCoord);
#else
Light mainLight = GetMainLight();
#endif
half3 diffuseLighting = inputData.bakedGI;
half3 attenuation = mainLight.distanceAttenuation * mainLight.shadowAttenuation;
half3 attenuatedLightColor = mainLight.color * attenuation;
#ifndef _DIFFUSE_RAMP
diffuseLighting += LightingLambert(attenuatedLightColor, mainLight.direction, inputData.normalWS);
#else
diffuseLighting += LightingLambertRamped(mainLight.color, attenuation, mainLight.direction, inputData.normalWS);
#endif
#else // _MAIN_LIGHT_VERTEX
half3 diffuseLighting = inputData.bakedGI;
#endif // _MAIN_LIGHT_VERTEX
#ifdef _ADDITIONAL_LIGHTS
int pixelLightCount = GetAdditionalLightsCount();
for (int i = 0; i < pixelLightCount; ++i)
{
Light light = GetAdditionalLight(i, inputData.positionWS);
half3 attenuatedLightColor = light.color * (light.distanceAttenuation * light.shadowAttenuation);
diffuseLighting += LightingLambert(attenuatedLightColor, light.direction, inputData.normalWS);
}
#endif
#ifdef _ADDITIONAL_LIGHTS_VERTEX
diffuseLighting += inputData.vertexLighting;
#endif
diffuseLighting += emission;
//half3 finalColor = diffuseLighting * diffuse + emission;
half3 finalColor = diffuseLighting * diffuse.rgb;
return prepareLitPixelForOutput(half4(finalColor, texDiffuseAlpha.a), vertexColor);
}
#endif // SPECULAR
VertexOutputLWRP ForwardPassVertexSprite(VertexInput input)
{
VertexOutputLWRP output = (VertexOutputLWRP)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
output.pos = calculateLocalPos(input.vertex);
output.vertexColor = calculateVertexColor(input.color);
output.texcoord = float3(calculateTextureCoord(input.texcoord), 0);
float3 positionWS = TransformObjectToWorld(input.vertex.xyz);
float backFaceSign = 1;
#if defined(FIXED_NORMALS_BACKFACE_RENDERING)
backFaceSign = calculateBackfacingSign(positionWS.xyz);
#endif
output.viewDirectionWS = GetCameraPositionWS() - positionWS;
#if defined(PER_PIXEL_LIGHTING)
#if defined(_RIM_LIGHTING) || defined(_ADDITIONAL_LIGHTS)
output.positionWS = float4(positionWS, 1);
#endif
half3 normalWS = calculateSpriteWorldNormal(input, -backFaceSign);
output.normalWorld.xyz = normalWS;
#if defined(_NORMALMAP)
output.tangentWorld.xyz = calculateWorldTangent(input.tangent);
output.binormalWorld.xyz = calculateSpriteWorldBinormal(input, output.normalWorld.xyz, output.tangentWorld.xyz, backFaceSign);
#endif
#else // !PER_PIXEL_LIGHTING
half3 fixedNormal = half3(0, 0, -1);
half3 normalWS = normalize(mul((float3x3)unity_ObjectToWorld, fixedNormal));
#endif // !PER_PIXEL_LIGHTING
output.fogFactorAndVertexLight.yzw = LightweightLightVertexSimplified(positionWS, normalWS);
#if defined(_MAIN_LIGHT_SHADOWS) && !defined(_RECEIVE_SHADOWS_OFF)
VertexPositionInputs vertexInput;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = output.pos;
output.shadowCoord = GetShadowCoord(vertexInput);
#endif
#if defined(_FOG)
half fogFactor = ComputeFogFactor(output.pos.z);
output.fogFactorAndVertexLight.x = fogFactor;
#endif
OUTPUT_SH(normalWS.xyz, output.vertexSH);
return output;
}
half4 ForwardPassFragmentSprite(VertexOutputLWRP input) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
fixed4 texureColor = calculateTexturePixel(input.texcoord.xy);
ALPHA_CLIP(texureColor, input.vertexColor)
// fill out InputData struct
InputData inputData;
#if defined(_MAIN_LIGHT_SHADOWS) && !defined(_RECEIVE_SHADOWS_OFF)
inputData.shadowCoord = input.shadowCoord;
#endif
inputData.viewDirectionWS = input.viewDirectionWS;
inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
#if defined(PER_PIXEL_LIGHTING)
#if defined(_NORMALMAP)
half3 normalWS = calculateNormalFromBumpMap(input.texcoord.xy, input.tangentWorld.xyz, input.binormalWorld.xyz, input.normalWorld.xyz);
#else
half3 normalWS = input.normalWorld.xyz;
#endif
#else // !PER_PIXEL_LIGHTING
half3 fixedNormal = half3(0, 0, -1);
half3 normalWS = normalize(mul((float3x3)unity_ObjectToWorld, fixedNormal));
#endif // !PER_PIXEL_LIGHTING
inputData.normalWS = normalWS;
inputData.bakedGI = SAMPLE_GI(input.lightmapUV, input.vertexSH, inputData.normalWS);
#if defined(_RIM_LIGHTING) || defined(_ADDITIONAL_LIGHTS)
inputData.positionWS = input.positionWS.rgb;
#endif
#if defined(SPECULAR)
half2 metallicGloss = getMetallicGloss(input.texcoord.xy);
half metallic = metallicGloss.x;
half smoothness = metallicGloss.y; // this is 1 minus the square root of real roughness m.
half3 specular = half3(0, 0, 0);
half4 emission = half4(0, 0, 0, 1);
APPLY_EMISSION_SPECULAR(emission, input.texcoord.xy)
half4 pixel = LightweightFragmentPBRSimplified(inputData, texureColor, metallic, specular, smoothness, emission.rgb, input.vertexColor);
#else
half3 emission = half3(0, 0, 0);
APPLY_EMISSION(emission, input.texcoord.xy)
half4 pixel = LightweightFragmentBlinnPhongSimplified(inputData, texureColor, emission, input.vertexColor);
#endif
#if defined(_RIM_LIGHTING)
pixel.rgb = applyRimLighting(input.positionWS.xyz, normalWS, pixel);
#endif
COLORISE(pixel)
APPLY_FOG_LWRP(pixel, input.fogFactorAndVertexLight.x)
return pixel;
}
#endif

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ddd0ba95f6acb1c47829c9a19237b684
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
#ifndef SPRITES_SHADOW_CASTER_PASS_LW_INCLUDED
#define SPRITES_SHADOW_CASTER_PASS_LW_INCLUDED
#include "Spine-Common-ShadowCasterPass-LW.hlsl"
uniform fixed _ShadowAlphaCutoff;
VaryingsSpine ShadowPassVertexSprite(AttributesSpine input)
{
VaryingsSpine output;
UNITY_SETUP_INSTANCE_ID(input);
output.texcoordAndAlpha.xyz = float3(TRANSFORM_TEX(input.texcoord, _MainTex).xy, 0);
output.positionCS = GetShadowPositionHClip(input);
output.texcoordAndAlpha.a = input.vertexColor.a * _Color.a;
return output;
}
half4 ShadowPassFragmentSprite(VaryingsSpine input) : SV_TARGET
{
fixed4 texureColor = calculateTexturePixel(input.texcoordAndAlpha.xy);
clip(texureColor.a * input.texcoordAndAlpha.a - _ShadowAlphaCutoff);
return 0;
}
#endif

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8330f220bb6d1f6409adc375e7ed71c1
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0461a69371982a14eb98743d0cc25031
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,2 @@
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
#include "Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc"

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 665a6ae9755aded42a8316c0bdfebee6
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,2 @@
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
#include "Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc"

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 31f462b6ddedf4342b4a46b28ffdf90b
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,161 @@
// - forwardPass(Lightweight Vertex Lit) + ShadowCaster + DepthOnly
// - Premultiplied Alpha Blending (Optional straight alpha input)
// - Double-sided, no depth
Shader "Lightweight Render Pipeline/Spine/Skeleton Lit" {
Properties {
_Cutoff ("Shadow alpha cutoff", Range(0,1)) = 0.1
[NoScaleOffset] _MainTex ("Main Texture", 2D) = "black" {}
[Toggle(_STRAIGHT_ALPHA_INPUT)] _StraightAlphaInput("Straight Alpha Texture", Int) = 0
[HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
[Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Compare", Float) = 0.0 // Disabled stencil test by default
}
SubShader {
// Lightweight Pipeline tag is required. If Lightweight render pipeline is not set in the graphics settings
// this Subshader will fail.
Tags { "RenderPipeline" = "LightweightPipeline" "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
LOD 100
Cull Off
ZWrite Off
Blend One OneMinusSrcAlpha
Stencil {
Ref[_StencilRef]
Comp[_StencilComp]
Pass Keep
}
Pass {
Name "ForwardLit"
Tags{"LightMode" = "LightweightForward"}
ZWrite Off
Cull Off
Blend One OneMinusSrcAlpha
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
// -------------------------------------
// Lightweight Pipeline keywords
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile _ _SHADOWS_SOFT
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
// -------------------------------------
// Unity defined keywords
#pragma multi_compile_fog
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
//--------------------------------------
// Spine related keywords
#pragma shader_feature _ _STRAIGHT_ALPHA_INPUT
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0
#undef LIGHTMAP_ON
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Lighting.hlsl"
#define USE_LWRP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "CGIncludes/Spine-SkeletonLit-ForwardPass-LW.hlsl"
ENDHLSL
}
Pass
{
Name "ShadowCaster"
Tags{"LightMode" = "ShadowCaster"}
ZWrite On
ZTest LEqual
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
// -------------------------------------
// Material Keywords
#pragma shader_feature _ALPHATEST_ON
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma vertex ShadowPassVertexSkeletonLit
#pragma fragment ShadowPassFragmentSkeletonLit
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/ShadowCasterPass.hlsl"
#define USE_LWRP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "CGIncludes/Spine-Input-LW.hlsl"
#include "CGIncludes/Spine-SkeletonLit-ShadowCasterPass-LW.hlsl"
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags{"LightMode" = "DepthOnly"}
ZWrite On
ColorMask 0
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
#pragma vertex DepthOnlyVertexSprite
#pragma fragment DepthOnlyFragmentSprite
// -------------------------------------
// Material Keywords
#pragma shader_feature _ALPHATEST_ON
#pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/DepthOnlyPass.hlsl"
#define USE_LWRP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "CGIncludes/Spine-Input-LW.hlsl"
#include "CGIncludes/Spine-DepthOnlyPass-LW.hlsl"
ENDHLSL
}
}
FallBack "Hidden/InternalErrorShader"
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 01105625afd026d4e989a24c4d70b8d6
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,222 @@
Shader "Lightweight Render Pipeline/Spine/Sprite"
{
Properties
{
_MainTex("Main Texture", 2D) = "white" {}
_Color("Color", Color) = (1,1,1,1)
_BumpScale("Scale", Float) = 1.0
_BumpMap("Normal Map", 2D) = "bump" {}
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0
[PerRendererData] _AlphaTex("External Alpha", 2D) = "white" {}
[PerRendererData] _EnableExternalAlpha("Enable External Alpha", Float) = 0
_EmissionColor("Color", Color) = (0,0,0,0)
_EmissionMap("Emission", 2D) = "white" {}
_EmissionPower("Emission Power", Float) = 2.0
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
_MetallicGlossMap("Metallic", 2D) = "white" {}
_DiffuseRamp("Diffuse Ramp Texture", 2D) = "gray" {}
_FixedNormal("Fixed Normal", Vector) = (0,0,1,1)
_ZWrite("Depth Write", Float) = 0.0
_Cutoff("Depth alpha cutoff", Range(0,1)) = 0.0
_ShadowAlphaCutoff("Shadow alpha cutoff", Range(0,1)) = 0.1
_CustomRenderQueue("Custom Render Queue", Float) = 0.0
_OverlayColor("Overlay Color", Color) = (0,0,0,0)
_Hue("Hue", Range(-0.5,0.5)) = 0.0
_Saturation("Saturation", Range(0,2)) = 1.0
_Brightness("Brightness", Range(0,2)) = 1.0
_RimPower("Rim Power", Float) = 2.0
_RimColor("Rim Color", Color) = (1,1,1,1)
_BlendTex("Blend Texture", 2D) = "white" {}
_BlendAmount("Blend", Range(0,1)) = 0.0
[HideInInspector] _SrcBlend("__src", Float) = 1.0
[HideInInspector] _DstBlend("__dst", Float) = 0.0
[HideInInspector] _RenderQueue("__queue", Float) = 0.0
[HideInInspector] _Cull("__cull", Float) = 0.0
[HideInInspector] _StencilRef("Stencil Reference", Float) = 1.0
[Enum(UnityEngine.Rendering.CompareFunction)] _StencilComp("Stencil Compare", Float) = 0.0 // Disabled stencil test by default
}
SubShader
{
// Lightweight Pipeline tag is required. If Lightweight render pipeline is not set in the graphics settings
// this Subshader will fail.
Tags { "RenderPipeline"="LightweightPipeline" "Queue"="Transparent" "RenderType"="Sprite" "AlphaDepth"="False" "CanUseSpriteAtlas"="True" "IgnoreProjector"="True" }
LOD 150
Stencil {
Ref[_StencilRef]
Comp[_StencilComp]
Pass Keep
}
// ------------------------------------------------------------------
// Forward pass.
Pass
{
// Lightmode matches the ShaderPassName set in LightweightRenderPipeline.cs. SRPDefaultUnlit and passes with
// no LightMode tag are also rendered by Lightweight Render Pipeline
Name "ForwardLit"
Tags{"LightMode" = "LightweightForward"}
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
Cull[_Cull]
HLSLPROGRAM
// Required to compile gles 2.0 with standard SRP library
// All shaders must be compiled with HLSLcc and currently only gles is not using HLSLcc by default
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
// -------------------------------------
// Material Keywords
#pragma shader_feature _ _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ADDITIVEBLEND _ADDITIVEBLEND_SOFT _MULTIPLYBLEND _MULTIPLYBLEND_X2
#pragma shader_feature _ _FIXED_NORMALS_VIEWSPACE _FIXED_NORMALS_VIEWSPACE_BACKFACE _FIXED_NORMALS_MODELSPACE _FIXED_NORMALS_MODELSPACE_BACKFACE
#pragma shader_feature _ _SPECULAR _SPECULAR_GLOSSMAP
#pragma shader_feature _NORMALMAP
#pragma shader_feature _ALPHA_CLIP
#pragma shader_feature _EMISSION
#pragma shader_feature _DIFFUSE_RAMP
#pragma shader_feature _COLOR_ADJUST
#pragma shader_feature _RIM_LIGHTING
#pragma shader_feature _TEXTURE_BLEND
#pragma shader_feature _FOG
#pragma shader_feature _RECEIVE_SHADOWS_OFF
#pragma fragmentoption ARB_precision_hint_fastest
#pragma multi_compile_fog
#pragma multi_compile _ PIXELSNAP_ON
#pragma multi_compile _ ETC1_EXTERNAL_ALPHA
// -------------------------------------
// Lightweight Pipeline keywords
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile _ _SHADOWS_SOFT
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile_fog
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
//--------------------------------------
// Spine related keywords
#pragma shader_feature _ _STRAIGHT_ALPHA_INPUT
#pragma vertex ForwardPassVertexSprite
#pragma fragment ForwardPassFragmentSprite
#define USE_LWRP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "CGIncludes/Spine-Input-LW.hlsl"
#include "CGIncludes/Spine-Sprite-ForwardPass-LW.hlsl"
ENDHLSL
}
Pass
{
Name "ShadowCaster"
Tags{"LightMode" = "ShadowCaster"}
ZWrite On
ZTest LEqual
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
// -------------------------------------
// Material Keywords
#pragma shader_feature _ALPHATEST_ON
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma vertex ShadowPassVertexSprite
#pragma fragment ShadowPassFragmentSprite
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/ShadowCasterPass.hlsl"
#define USE_LWRP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "CGIncludes/Spine-Input-LW.hlsl"
#include "CGIncludes/Spine-Sprite-ShadowCasterPass-LW.hlsl"
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags{"LightMode" = "DepthOnly"}
ZWrite On
ColorMask 0
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
#pragma vertex DepthOnlyVertexSprite
#pragma fragment DepthOnlyFragmentSprite
// -------------------------------------
// Material Keywords
#pragma shader_feature _ALPHATEST_ON
#pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.lightweight/Shaders/DepthOnlyPass.hlsl"
#define USE_LWRP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "CGIncludes/Spine-Input-LW.hlsl"
#include "CGIncludes/Spine-DepthOnlyPass-LW.hlsl"
ENDHLSL
}
}
FallBack "Hidden/InternalErrorShader"
CustomEditor "SpineSpriteShaderGUI"
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 199639b6b2859f44bb4dfaaa032efefc
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e574027a4d03954469c95b03a443bd4b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7eb43a94f5f18fe4ca91d5422ec9613c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 782a38db158bbe54abe5f23c974f3478
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f1b3b4b945939a54ea0b23d3396115fb, type: 3}
m_Name: raptor-pro_SkeletonData
m_EditorClassIdentifier:
atlasAssets:
- {fileID: 11400000, guid: 399f83b8511d02a49bea993c1fb51e88, type: 2}
scale: 0.01
skeletonJSON: {fileID: 4900000, guid: 782a38db158bbe54abe5f23c974f3478, type: 3}
skeletonDataModifiers: []
fromAnimation: []
toAnimation: []
duration: []
defaultMix: 0.2
controller: {fileID: 0}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 83b868dae6d9ae34397e35d6f29e926b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,272 @@
raptor.png
size: 1024,512
format: RGBA8888
filter: Linear,Linear
repeat: none
back-arm
rotate: false
xy: 895, 295
size: 46, 25
orig: 46, 25
offset: 0, 0
index: -1
back-bracer
rotate: true
xy: 992, 216
size: 39, 28
orig: 39, 28
offset: 0, 0
index: -1
back-hand
rotate: false
xy: 594, 58
size: 36, 34
orig: 36, 34
offset: 0, 0
index: -1
back-knee
rotate: true
xy: 729, 86
size: 49, 67
orig: 49, 67
offset: 0, 0
index: -1
back-thigh
rotate: false
xy: 379, 2
size: 39, 24
orig: 39, 24
offset: 0, 0
index: -1
eyes-open
rotate: true
xy: 902, 194
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front-arm
rotate: false
xy: 945, 306
size: 48, 26
orig: 48, 26
offset: 0, 0
index: -1
front-bracer
rotate: false
xy: 949, 197
size: 41, 29
orig: 41, 29
offset: 0, 0
index: -1
front-hand
rotate: false
xy: 949, 266
size: 41, 38
orig: 41, 38
offset: 0, 0
index: -1
front-open-hand
rotate: false
xy: 875, 148
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front-thigh
rotate: true
xy: 793, 171
size: 57, 29
orig: 57, 29
offset: 0, 0
index: -1
gun
rotate: true
xy: 379, 28
size: 107, 103
orig: 107, 103
offset: 0, 0
index: -1
gun-nohand
rotate: false
xy: 487, 87
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 807, 361
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
lower-leg
rotate: false
xy: 827, 195
size: 73, 98
orig: 73, 98
offset: 0, 0
index: -1
mouth-grind
rotate: true
xy: 920, 145
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
mouth-smile
rotate: true
xy: 992, 257
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
neck
rotate: false
xy: 359, 114
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
raptor-back-arm
rotate: false
xy: 653, 142
size: 82, 86
orig: 82, 86
offset: 0, 0
index: -1
raptor-body
rotate: false
xy: 2, 277
size: 632, 233
orig: 632, 233
offset: 0, 0
index: -1
raptor-front-arm
rotate: true
xy: 484, 4
size: 81, 102
orig: 81, 102
offset: 0, 0
index: -1
raptor-front-leg
rotate: false
xy: 2, 18
size: 191, 257
orig: 191, 257
offset: 0, 0
index: -1
raptor-hindleg-back
rotate: false
xy: 636, 295
size: 169, 215
orig: 169, 215
offset: 0, 0
index: -1
raptor-horn
rotate: false
xy: 195, 22
size: 182, 80
orig: 182, 80
offset: 0, 0
index: -1
raptor-horn-back
rotate: true
xy: 945, 334
size: 176, 77
orig: 176, 77
offset: 0, 0
index: -1
raptor-jaw
rotate: false
xy: 359, 137
size: 126, 138
orig: 126, 138
offset: 0, 0
index: -1
raptor-jaw-tooth
rotate: true
xy: 895, 322
size: 37, 48
orig: 37, 48
offset: 0, 0
index: -1
raptor-mouth-inside
rotate: true
xy: 949, 228
size: 36, 41
orig: 36, 41
offset: 0, 0
index: -1
raptor-saddle-strap-back
rotate: true
xy: 653, 86
size: 54, 74
orig: 54, 74
offset: 0, 0
index: -1
raptor-saddle-strap-front
rotate: false
xy: 594, 94
size: 57, 95
orig: 57, 95
offset: 0, 0
index: -1
raptor-saddle-w-shadow
rotate: false
xy: 195, 104
size: 162, 171
orig: 162, 171
offset: 0, 0
index: -1
raptor-tail-shadow
rotate: false
xy: 636, 230
size: 189, 63
orig: 189, 63
offset: 0, 0
index: -1
raptor-tongue
rotate: false
xy: 807, 295
size: 86, 64
orig: 86, 64
offset: 0, 0
index: -1
stirrup-back
rotate: true
xy: 952, 151
size: 44, 35
orig: 44, 35
offset: 0, 0
index: -1
stirrup-front
rotate: false
xy: 902, 243
size: 45, 50
orig: 45, 50
offset: 0, 0
index: -1
stirrup-strap
rotate: false
xy: 824, 147
size: 49, 46
orig: 49, 46
offset: 0, 0
index: -1
torso
rotate: false
xy: 737, 137
size: 54, 91
orig: 54, 91
offset: 0, 0
index: -1
visor
rotate: false
xy: 487, 191
size: 131, 84
orig: 131, 84
offset: 0, 0
index: -1

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b219eece9997ce34681f630958223068
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 KiB

View File

@ -0,0 +1,145 @@
fileFormatVersion: 2
guid: 4c61e8d64ed9c3b4c9f0c834b7f9bd2b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 2
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Nintendo Switch
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a6b194f808b1af6499c93410e504af42, type: 3}
m_Name: raptor_Atlas
m_EditorClassIdentifier:
atlasFile: {fileID: 4900000, guid: b219eece9997ce34681f630958223068, type: 3}
materials:
- {fileID: 2100000, guid: 501778ed9798a664b909ce819e493a6f, type: 2}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 399f83b8511d02a49bea993c1fb51e88
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,81 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: raptor_Material
m_Shader: {fileID: 4800000, guid: 01105625afd026d4e989a24c4d70b8d6, type: 3}
m_ShaderKeywords: _ALPHABLEND_ON _RECEIVE_SHADOWS_OFF _STRAIGHT_ALPHA_INPUT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
AlphaDepth: true
IGNOREPROJECTOR: true
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BlendTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DiffuseRamp:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 4c61e8d64ed9c3b4c9f0c834b7f9bd2b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- PixelSnap: 0
- _BlendAmount: 0
- _Brightness: 1
- _BumpScale: 1
- _Cull: 0
- _CustomRenderQueue: 0
- _Cutoff: 0.1
- _DstBlend: 10
- _EmissionPower: 2
- _EnableExternalAlpha: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _Hue: 0
- _Metallic: 0
- _RenderQueue: 0
- _RimPower: 2
- _Saturation: 1
- _ShadowAlphaCutoff: 0.1
- _SrcBlend: 1
- _StencilComp: 8
- _StencilRef: 1
- _StraightAlphaInput: 1
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
- _FixedNormal: {r: 0, g: 0, b: 1, a: 1}
- _OverlayColor: {r: 0, g: 0, b: 0, a: 0}
- _RimColor: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 501778ed9798a664b909ce819e493a6f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 23c56cb648bf0ca40919a0eb1c3791f2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,145 @@
fileFormatVersion: 2
guid: f1892711e91b98c4cbb121c5c2081896
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 2
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Nintendo Switch
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,145 @@
fileFormatVersion: 2
guid: 54afe9be49fd5db49a11b9741d32edec
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 16
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Nintendo Switch
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,41 @@
stretchyman.png
size: 1024,256
format: RGBA8888
filter: Linear,Linear
repeat: none
back-arm
rotate: true
xy: 679, 173
size: 72, 202
orig: 72, 202
offset: 0, 0
index: -1
back-leg
rotate: true
xy: 2, 2
size: 100, 318
orig: 100, 318
offset: 0, 0
index: -1
body
rotate: true
xy: 2, 104
size: 141, 452
orig: 141, 452
offset: 0, 0
index: -1
front-arm
rotate: true
xy: 456, 100
size: 145, 221
orig: 145, 221
offset: 0, 0
index: -1
head
rotate: true
xy: 322, 15
size: 87, 102
orig: 87, 102
offset: 0, 0
index: -1

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0ed395381a661d0458f54665867273c0
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b5e06730b3f0c0249b5eb650ab949253
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

View File

@ -0,0 +1,145 @@
fileFormatVersion: 2
guid: 02664619cf3c92645ac9790566129b50
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: 2
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: iPhone
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Windows Store Apps
maxTextureSize: 8192
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Nintendo Switch
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a6b194f808b1af6499c93410e504af42, type: 3}
m_Name: stretchyman_Atlas
m_EditorClassIdentifier:
atlasFile: {fileID: 4900000, guid: 0ed395381a661d0458f54665867273c0, type: 3}
materials:
- {fileID: 2100000, guid: 7ee25f95c3010c741aa55289d41e9b7d, type: 2}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fe648824e1e7ef2459f5f1087d7ad6ef
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,82 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: stretchyman_Material
m_Shader: {fileID: 4800000, guid: 199639b6b2859f44bb4dfaaa032efefc, type: 3}
m_ShaderKeywords: _ALPHABLEND_ON _EMISSION _FIXED_NORMALS_VIEWSPACE _NORMALMAP _RECEIVE_SHADOWS_OFF
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
AlphaDepth: true
IGNOREPROJECTOR: true
RenderType: Transparent
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BlendTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 54afe9be49fd5db49a11b9741d32edec, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DiffuseRamp:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 2800000, guid: f1892711e91b98c4cbb121c5c2081896, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 02664619cf3c92645ac9790566129b50, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- PixelSnap: 0
- _BlendAmount: 0
- _Brightness: 1
- _BumpScale: 1
- _Cull: 0
- _CustomRenderQueue: 0
- _Cutoff: 0
- _DstBlend: 10
- _EmissionPower: 2
- _EnableExternalAlpha: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _Hue: 0
- _Metallic: 0
- _RenderQueue: 0
- _RimPower: 2
- _Saturation: 1
- _ShadowAlphaCutoff: 0.1
- _SrcBlend: 1
- _StencilComp: 8
- _StencilRef: 1
- _StraightAlphaInput: 0
- _ZWrite: 0
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 1, g: 1, b: 1, a: 0}
- _FixedNormal: {r: 0, g: 0, b: 1, a: 1}
- _OverlayColor: {r: 0, g: 0, b: 0, a: 0}
- _RimColor: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7ee25f95c3010c741aa55289d41e9b7d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f1b3b4b945939a54ea0b23d3396115fb, type: 3}
m_Name: stretchyman_SkeletonData
m_EditorClassIdentifier:
atlasAssets:
- {fileID: 11400000, guid: fe648824e1e7ef2459f5f1087d7ad6ef, type: 2}
scale: 0.01
skeletonJSON: {fileID: 4900000, guid: b5e06730b3f0c0249b5eb650ab949253, type: 3}
skeletonDataModifiers: []
fromAnimation: []
toAnimation: []
duration: []
defaultMix: 0.2
controller: {fileID: 0}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4e2ecc2a9b955f343964c702e58dcb53
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,22 @@
{
"name": "com.esotericsoftware.spine.lwrp-shaders",
"displayName": "Spine Lightweight RP Shaders",
"description": "This plugin provides lightweight render pipeline (LWRP) shaders for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 3.8.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
"version": "3.8.0",
"unity": "2018.3",
"author": {
"name": "Esoteric Software",
"email": "contact@esotericsoftware.com",
"url": "http://esotericsoftware.com/"
},
"dependencies": {
"com.unity.render-pipelines.lightweight": "5.7.2"
},
"keywords": [
"spine",
"lwrp",
"lightweight",
"render pipeline",
"shaders"
]
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 6c38da08742642a4d9a65f2fde2d13b6
PackageManifestImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: