Cheshirecrow

  • 3 juin
  • Inscrit 4 août 2024
  • @Cheshirecrow One thing which might perhaps be helpful is the RenderExistingMesh component which allows you to re-render the same skeleton mesh with a different material. This is used e.g. to render a skeleton again with an outline-only shader, which might be somewhat related to your 2d rim light use-case.

  • Use a Directional Light: In the 3D URP pipeline, you can use a directional light to simulate the rim light effect. Position the light in such a way that it highlights the edges of your 2D objects.

    @Cheshirecrow In additiona to what Spinebot said above, you could set the normals in the skeleton's normalmap to point 90 degrees sideways at the edge, so that an almost forward-facing light used as rim light would illuminate the perimeter slightly (or you can use two lights). You could also modify a shader and your normal-maps so that the blue channel values [0..255] don't map to [0..1] forward but instead include backward mapping to [-1..1].

    • @Cheshirecrow Glad it helped, sorry that there isn't a simple straightforward solution.

      Cheshirecrow Sadly there isn't any solution to animate it directly inside Spine but I guess it is what it is.

      I assume the by "animate it" you mean animating the red emissive parts. Of course you could also just use a Slot with Blend Mode Additive and then create an animation which changes the slot color. Sorry if I missed that you want to do that, I was mostly focussing on a solution for the rim light (which is the harder problem to solve properly for the rotating ball.)

      • @Cheshirecrow An easier solution would be to have the rim mask cover the whole area of your ball, and to have Spotlight rim lights illuminate the top part brighter than the bottom.

        You can actually see a similar setup in the example scene URP 2D Shaders, at the Spine GameObject (stretchyman) objects, there you can have a look at the material setup.