• Runtimes
  • Custom shaders/filters for spine-pixi-v8

Hi Spine,

Is there any documentation for setting custom shaders or filters for the Spine meshes? I have a need in my pixie game to set a custom Depth (Z) value. I can't see any documentation or tutorials regarding this. I tried setting the filter on the entire sprite itself, but it doesnt work, i think i need to set the filter on the individual meshes (WebGL, WebGPU) Themselves, thanks

  • Davide ha risposto a questo messaggio
    Related Discussions
    ...

    For setting custom shaders or filters for Spine meshes in a pixi-spine environment, you would typically need to work with the WebGL or WebGPU context directly. Unfortunately, there isn't specific documentation from Esoteric Software for pixi-spine as it is maintained by a third party. However, you can apply custom shaders by modifying the shader code used by the Spine runtime. You might need to delve into the pixi-spine source code to understand how it handles shaders and then apply your custom shader logic accordingly. If you are looking to set a custom Depth (Z) value, you would likely need to modify the vertex shader to adjust the Z position of the vertices.

    For more detailed guidance, you might want to explore the pixi-spine GitHub repository or reach out to the community there for specific examples and support.

    benjaminhon

    Hello! Pixi filters work with spine-pixi-v8.

    See the basic examples with an AsciiFilter.

    I haven't tried yet to create a custom filter, but mimicking the existing filters, I guess you can achieve your desired result.

    Ah yes it works, i think i was setting the uniforms wrong

    Hmmm I managed to get the filter working for the entire Spine container, however how do we handle the case for custom shaders for individual parts?

    For instance:

    • Normal maps, lighting

    For this we would need to be able to set the shaders for the individual meshes instead of the whole container

    • Davide ha risposto a questo messaggio
      6 giorni dopo

      benjaminhon

      Apologies for the delayed response; I've been away these past few days.
      Currently, it’s not possible to modify the shader of individual attachments directly.

      However, with a bit more effort, you can achieve the same effect by using a slot object, as demonstrated in the following example:

      To do this, you can extract the individual texture and replace the corresponding attachment with a slot object. Since slot objects are standard Pixi elements, you can then easily apply a filter to them.

        15 giorni dopo

        Davide I see, thanks.