#Polychrome Shader

1 messages · Page 1 of 1 (latest)

robust urchin
#

I've gotten.... close, but there's clearly some translation error, as there's a clear moire pattern in the game that I haven't managed to recreate.

  • Fig 1: from game with moire lines indicated
  • Fig 2: exact translation (effect appears uniform)
  • Fig 3: altered translation (effect appears linear)
    The difference between 2 and 3 is using the code in the game that passes the card's "juice" and tilt to the shader (functionally fixed values across the whole quad, just changes over time), vs. using the texture UV coordinates.
    This tells me that something in the fragment shader was translated incorrectly, but I can't figure out how or why. The only real difference between the two is how the UV coordinates are handled (Balatro has to calculate them from image file parameters, I can directly access them).
robust urchin
#

Figured it out, had everything to do with the floored_uv value: uv was being multiplied by the sprite dimensions, floored, then divided by the sprite dimensions again. Having had trouble figuring out what texture_details actually was, I had mistranslated that line

#

Some math experimentation later and I can now expose an intensity value which controls the size of the pattern without making it look pixelized.