Yimec

  • il y a 16 jours
  • Inscrit 30 août 2023
  • Hi Again @Harald

    I'm glad it’s understood.
    Adjusting the offset on the relevant axis and in the scene helps up to a point, but it introduces other issues—for example, the distance between the sprite and its shadow.

    As for the shader, in the forward-lit pass I added an offset of -1, -1 (I don’t understand the units and can’t give more details because I did it with ChatGPT and this is all I managed to salvage).

    Pass
    {
        Name "ForwardLit"
        Tags { "LightMode"="UniversalForward" }
    
        Blend [_SrcBlend] [_DstBlend]
        Cull [_Cull]
    
        ZWrite On          // forces depth write
        Offset -1, -1      // pushes towards the camera

    Including these tags:

    Tags
    {
        "RenderPipeline"="UniversalPipeline"
        "Queue"="AlphaTest"                 //  = 2450
        "RenderType"="TransparentCutout"
        "IgnoreProjector"="True"
        "CanUseSpriteAtlas"="True"
    }

    And using the shader included in the URP Spine addon with this setup:

    Thank you again Harald

  • Hi @Harald ,

    I’ve tried what you suggested—modifying the shader by adding a couple of units’ offset to the Z—but I haven’t noticed any difference.

    I’m sending you a screenshot of the Spine object (with a “broken” material, since the NDA keeps me from showing the character), and you can clearly see that the large rectangle on the right (a Spine VFX) gets clipped horizontally right where it meets the ground—and that’s exactly the part I need to render on top.

    The camera sits at a 30-degree angle relative to the ground, and the 2-D objects (quads) always face the camera. It’s using an orthographic projection.

    Sorry I can’t share more images—NDAs make that tricky, haha.

    I hope the screenshot helps illustrate what I’m trying to solve.

    Thanks a ton!!

    • Hi everyone. I realise this is partly a Unity-specific problem, but after a lot of searching I haven’t found a solution, so I’m asking here.

      I’m making a 2.5-D game. The player, enemies and some other elements are Spine skeletons, while many props and decorations are simple quads with sprite textures so they can sit in 3-D space and cast/receive shadows.

      Here’s the issue: the main character’s skeleton is positioned so that Spine’s origin (0, 0) is at the feet, resting exactly on the Unity ground plane. When the character attacks toward the camera (facing “down” on screen), the sword-wielding arm dips below Spine’s 0, 0 because of the perspective tilt. In Unity this means the lower part of the sprite clips into the ground mesh and appears “cut off”.

      What I need is a way to have the Spine character render just a little after the ground plane so the weapon and arm aren’t clipped, but still allow the character to go behind ground pieces that are actually higher than the feet (e.g. slopes, steps, raised platforms).

      Thank you for your help, I hope you can help me finding a solution to this problem which is driving me crazy haha.

    • Hello @Harald,
      it works perfectly!

      Thank you for your quick update and follow up!!

      • Hello @Harald! Thank you for your follow up.

        I've checked the problem and the issue seems to be related to URP 17.1.0 (which I'm using).

        With ChatGPT's help I found out that changin this part in the Spine-Common-URP.hlsl:

        uint GetMeshRenderingLayerBackwardsCompatible()
        {
            #if IS_URP_14_OR_NEWER
            return GetMeshRenderingLayer();
            #elif IS_URP_12_OR_NEWER
            return GetMeshRenderingLightLayer();
            #else
            return 0;
            #endif
        }

        with

        uint GetMeshRenderingLayerBackwardsCompatible()
        {
            #if IS_URP_14_OR_NEWER
                // Compatible con URP 14+ incluyendo URP 17
                return GetMeshRenderingLayer();
            #else
                // Para URP 12 y anteriores, GetMeshRenderingLightLayer ya no se usa
                return 0;
            #endif
        }

        as long as URP 17.1.0 no longer uses GetMeshRenderingLightLayer().

        I don't know if this is a workaround or is an useful fix, but now I can get my character receive shadows! (Until next package update, which will overwrite my changes haha)

        • Harald Thank you for your response @Harald

          Any idea or roadmap to know when this will be compatible?

          Thank you!

        • After keeping my test I found out that "Skeleton Lit" from the URP shaders is in the section "failed to compile" with this error:

          Shader error in 'Universal Render Pipeline/Spine/Skeleton Lit': undeclared identifier 'GetMeshRenderingLightLayer' at /LostBook/Library/PackageCache/com.esotericsoftware.spine.urp-shaders@954ead4ca6c9/Shaders/Include/Spine-Common-URP.hlsl(45) (on d3d11)
          
          Compiling Subshader: 0, Pass: ForwardLit, Fragment program with _ADAPTIVE_PROBE_VOLUMES_PER_PIXEL _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _LIGHT_LAYERS _MAIN_LIGHT_SHADOWS_CASCADE _RECEIVE_SHADOWS_OFF _SHADOWS_SOFT
          Platform defines: SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_ENABLE_DETAIL_NORMALMAP UNITY_ENABLE_REFLECTION_BUFFERS UNITY_LIGHTMAP_RGBM_ENCODING UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_PBS_USE_BRDF1 UNITY_PLATFORM_SUPPORTS_DEPTH_FETCH UNITY_SPECCUBE_BLENDING UNITY_SPECCUBE_BOX_PROJECTION UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS
          Disabled keywords: FOG_EXP FOG_EXP2 FOG_LINEAR INSTANCING_ON PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 SHADER_API_GLES30 UNITY_ASTC_NORMALMAP_ENCODING UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_FULL_HDR UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_DXT5nm UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_UNIFIED_SHADER_PRECISION_MODEL UNITY_VIRTUAL_TEXTURING _ADDITIONAL_LIGHTS_VERTEX _DOUBLE_SIDED_LIGHTING _FORWARD_PLUS _LIGHT_AFFECTS_ADDITIVE _LIGHT_COOKIES _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_SCREEN _MIXED_LIGHTING_SUBTRACTIVE _RECEIVE_SHADOWS _STRAIGHT_ALPHA_INPUT _TINT_BLACK_ON _WRITE_RENDERING_LAYERS

          For your information, I'm using Unity 6000.1.4f1, Spine-Unity Runtime 4.2.106, Spine-csharp 4.3.2 and Spine URP 4.2.43

          I hope this helps you helping me!

        • I'm testing all URP UPM shaders but no one works for me, am I doing something wrong or missing something?

        • Hello Everyone!

          I have a project in which everything takes place in a 3D scene. All the 3D objects cast shadows, and so does my Spine character—but the character doesn’t receive shadows. The project is set up in Unity using URP, and the only material that works (everything else shows Unity’s dramatic magenta “missing shader” color) is Spine/Skeleton. If I switch the character to the URP Lit material, its 2-D animated shadow stops being cast altogether (I’ve attached this gif screenshot to illustrate).

          What I’d really love is for the Spine character to receive shadows from those 3D objects (or from sprites that cast them). Is that possible with a particular material or Unity setting?

          Thanks in advance!

          Hi there @Misaki !

          In the end, using the example you sent me—plus a bit of my own logic, which might not be perfect but did the trick—I managed it with transform constraints. I put a bone on each corner of the box and used them as “anchors” for other bones that depend on them, each with its own transform constraint. I may have over-complicated things, but for what I needed, it worked!

          Thanks so much for your reply, and sorry it took me a while to answer. I’d been researching as much as I could to sort this out; it should have been something simple, but it definitely wasn’t!

            Misaki I only want some perspective deformation. Here is a gif of what I achieved so far (which is enough for what I want):

            I hope this is helpful.

            Thank you @Misaki !

              Hi forum,

              I've been trying to rig a cube to give a 3D-like effect by following the tips on the Spine website, but while I’ve managed to get a convincing deformation of the "base," I can't seem to transfer that deformation to the overlapping parts of the design I want to animate.

              For example, this is the base of the box, and it deforms the way I want:

              But the final composition with all the parts of the box looks like this:

              And I want parts like the light panels or the corner decorations to properly follow the corners when the box is deformed. I'm doing everything with a single bone to control the perspective (the edge closest to the "camera" is fixed to one bone, and all other vertices have gradually shared weights between that fixed bone and the controller).

              I've managed to get the upper corner elements to follow the correct positions during deformation using transform constraints, but the elements on the cube’s surfaces (like the light panels, the book icon, or the bottom-left protrusion) don’t deform or move properly, neither with direct weighting nor with transform constraints.

              Can anyone help me with this rig? I have no experience with vertex weighting on hard-surface meshes—it’s so much easier to deform characters than boxes!

              Thanks in advance!

                Sure! I'm entering right now!

                Thank you!

                Hello everyone,

                My name is Chema Esteo,
                I wanted to take this opportunity to announce that our game, Bubble Ghost Remake, will be released this Thursday, the 27th, on Switch, PC, and PS5. As the animator and art director of the studio, I can't thank you enough for the support we've received from everyone at Esoteric.

                I had to learn how to use Spine in a rush because the game wasn't meeting performance requirements on Switch. Although I had previous experience as an animator, I had never worked with Spine before. That’s why the help from everyone in this forum has been absolutely crucial during the development process, and I want to personally thank you all.

                I also want to express my gratitude for the amazing tool you’ve developed, which has made the process of animating for video games so much easier — not only in terms of optimization but also because of the sheer number of tools the application offers, not to mention the constant updates.

                As a token of our appreciation, we’ve included the Esoteric team in the game’s credits. Without you, this game wouldn’t have been possible (or at least, my learning process wouldn’t!). Once again, thank you so much. I’m leaving the game’s trailer here, where you can catch a glimpse of the gameplay. If anyone’s interested, remember it’s available digitally on the platforms I mentioned earlier.

                I can’t wait to show you the next projects I’ll be working on with Spine!

                  Hi Harald,

                  My experience with shaders is limited unless using Shader Graph. Are there any specific considerations I should keep in mind when working with Shader Graph and Spine?

                  I really like the RGB mask solution (using different channels for masking), and having three customizable elements is more than enough for my needs. I've used this approach in other contexts but never in combination with Spine.

                  Additionally, could you provide more information about the CLI texture packer?

                  Thanks a lot!

                    Hello everyone!

                    I'm working on a project where you can customize your character in different ways, and we're considering giving players the option to modify different color zones so they can choose the colors they prefer.

                    I know that in Spine you can change the color of a slot, but would this mean having to modify the color of all slots separately?

                    Speaking of a specific example, the character I'm attaching: we've proposed allowing players to change the orange fur and the white fur, giving each part a custom color. Is there a way to do this without having to divide, for example, the tail, into separate parts?

                    Maybe some kind of RGB channel masking or something like that?

                    Thanks a lot for your time!

                  • Hello everyone!

                    This is my first contact with Spine Physics (that works AMAZING and love the results, btw).

                    However I'm wondering about some issues related to Unity interaction:

                    I have this Piñata rigged to move as desired:

                    My intention is to achieve this movement without moving the rope's origin in unity, only the piñata itself (as a hanging piñata should behave while tied to some point at the ceiling). This is, the rope being fixed both the "ceiling" and the piñata itself. Additionaly, it should move (swing) when something collides with the piñata.

                    Could anyone help me setting this up? Is there something I'm missing out?

                    thank you all in advance!

                  • Thank you @Misaki! importing the samples (and using the sample URP setup) made it!

                    I have no words to thank you enough!

                  • I have checked that even the spine examples materials are broken as in the scene "Sprite Shaders", where everything appears to be pink (missing material).

                    I have uninstalled everything from git and installed the package from https://es.esotericsoftware.com/files/runtimes/unity/spine-unity-4.2-2024-09-23.unitypackage
                    (as is the only way I know to access spine examples).

                    I'm starting to suspect that there is something missing in the spine installation but I'm not sure at all.

                    Any help is really welcome.
                    Thank you!

                    • Hello everyone!

                      I have a project where I have installed everything necessary for Spine (through Git), and everything related to Spine itself works perfectly. However, when I try to change the default material, I encounter issues.

                      Using /Spine/Skeleton-lit, I see the sprite as "pink" (as if "something is missing").

                      If I use /Universal Render Pipeline/Spine/Skeleton-lit (or any other material from this folder), the sprite is simply invisible.

                      I've tried adjusting Unity settings, the cameras, and different scenes (it's a project I picked up halfway, so I don't have control over everything that's been done so far, and maybe I'm overlooking something).

                      The thing is, I would like to change my Spine animations so that they are affected by the lighting.

                      Thank you for your responses, Best regards!