mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
Merge branch '4.0' into 4.1-beta
This commit is contained in:
commit
ca9274b86d
@ -7,7 +7,7 @@ up into multiple modules:
|
||||
1. `spine-webgl/`, a self-contained WebGL backend, built on the core classes.
|
||||
1. `spine-canvas/`, a self-contained Canvas backend, built on the core classes.
|
||||
1. `spine-threejs/`, a self-contained THREE.JS backend, built on the core classes.
|
||||
1. `spine-player/`, a self-contained player to easily display Spine animations on your website, built on core the classes and WebGL backend.
|
||||
1. `spine-player/`, a self-contained player to easily display Spine animations on your website, built on the core classes and WebGL backend.
|
||||
|
||||
In most cases, the `spine-player` module is best suited for your needs. Please refer to the [Spine Web Player documentation](https://esotericsoftware.com/spine-player) for more information.
|
||||
|
||||
@ -104,6 +104,7 @@ spine-ts is developed with TypeScript, we thus recommend the following developme
|
||||
3. Open a terminal and execute
|
||||
```
|
||||
git clone https://github.com/esotericsoftware/spine-runtimes
|
||||
cd spine-runtimes/spine-ts
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
@ -51,16 +51,15 @@ half4 NormalsRenderingFragment(Varyings i) : SV_Target
|
||||
half4 mainTex = i.color * tex2D(_MainTex, i.uv);
|
||||
|
||||
#if defined(_NORMALMAP)
|
||||
half3 normalWS = calculateNormalFromBumpMap(i.uv.xy, i.tangentWS.xyz, i.bitangentWS.xyz, i.normalWS.xyz);
|
||||
half3 normalTS = normalize(UnpackScaleNormal(tex2D(_BumpMap, i.uv.xy), _BumpScale));
|
||||
return NormalsRenderingShared(mainTex, normalTS, i.tangentWS.xyz, i.bitangentWS.xyz, i.normalWS.xyz);
|
||||
#else
|
||||
half3 normalTS = half3(0, 0, 1);
|
||||
half3 tangentWS = half3(0, 0, 0);
|
||||
half3 bitangentWS = half3(0, 0, 0);
|
||||
half3 normalWS = i.normalWS.xyz;
|
||||
return NormalsRenderingShared(mainTex, normalTS, tangentWS, bitangentWS, normalWS);
|
||||
#endif
|
||||
|
||||
half3 normalVS = TransformWorldToViewDir(normalWS);
|
||||
float4 normalColor;
|
||||
normalColor.rgb = 0.5 * ((normalVS) + 1);
|
||||
normalColor.a = mainTex.a;
|
||||
return normalColor;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -92,7 +92,18 @@ half4 CombinedShapeLightFragment(VertexOutputSpriteURP2D input) : SV_Target
|
||||
half4 main = texureColor * input.vertexColor;
|
||||
|
||||
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, input.texcoord.xy);
|
||||
#if UNITY_VERSION < 202120
|
||||
half4 pixel = half4(CombinedShapeLightShared(half4(main.rgb, 1), mask, input.lightingUV).rgb, main.a);
|
||||
#else
|
||||
SurfaceData2D surfaceData;
|
||||
InputData2D inputData;
|
||||
surfaceData.albedo = main.rgb;
|
||||
surfaceData.alpha = 1;
|
||||
surfaceData.mask = mask;
|
||||
inputData.uv = input.texcoord;
|
||||
inputData.lightingUV = input.lightingUV;
|
||||
half4 pixel = half4(CombinedShapeLightShared(surfaceData, inputData).rgb, main.a);
|
||||
#endif
|
||||
|
||||
#if defined(_RIM_LIGHTING)
|
||||
#if defined(_NORMALMAP)
|
||||
|
||||
@ -153,7 +153,7 @@
|
||||
float4 positionCS : SV_POSITION;
|
||||
float4 color : COLOR;
|
||||
float2 uv : TEXCOORD0;
|
||||
float3 normalVS : TEXCOORD1;
|
||||
float3 normalWS : TEXCOORD1;
|
||||
};
|
||||
|
||||
TEXTURE2D(_MainTex);
|
||||
@ -166,8 +166,7 @@
|
||||
o.positionCS = TransformObjectToHClip(attributes.positionOS);
|
||||
o.uv = attributes.uv;
|
||||
o.color = attributes.color;
|
||||
float3 normalWS = TransformObjectToWorldDir(float3(0, 0, -1));
|
||||
o.normalVS = TransformWorldToViewDir(normalWS);
|
||||
o.normalWS = TransformObjectToWorldDir(float3(0, 0, -1));
|
||||
return o;
|
||||
}
|
||||
|
||||
@ -176,11 +175,10 @@
|
||||
float4 NormalsRenderingFragment(Varyings i) : SV_Target
|
||||
{
|
||||
float4 mainTex = i.color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
|
||||
|
||||
float4 normalColor;
|
||||
normalColor.rgb = 0.5 * ((i.normalVS)+1);
|
||||
normalColor.a = mainTex.a;
|
||||
return normalColor;
|
||||
half3 normalTS = half3(0, 0, 1);
|
||||
half3 tangentWS = half3(0, 0, 0);
|
||||
half3 bitangentWS = half3(0, 0, 0);
|
||||
return NormalsRenderingShared(mainTex, normalTS, tangentWS, bitangentWS, i.normalWS);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "com.esotericsoftware.spine.urp-shaders",
|
||||
"displayName": "Spine Universal RP Shaders",
|
||||
"description": "This plugin provides universal render pipeline (URP) shaders for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
|
||||
"version": "4.1.0",
|
||||
"version": "4.1.1",
|
||||
"unity": "2019.3",
|
||||
"author": {
|
||||
"name": "Esoteric Software",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user