Skip Navigation

FooBarrington

@foobarrington.lemmy.world.ap.tdpl.io

25 Posts30 Comments0 Memberships

Joined August 2026

  • godot [Discussion] How do you (unit-)test your shaders?

    The code snippet, or what exactly? Everything comes from my brain.

    Yeah, that's what I tried to express with the snippet. But even if a driver update every now and then invalidates your snapshots - so what? You can either manually verify them, or just regenerate them from the last known working commit and keep going.

    I've now written ~60 tests for ~10 shader functions, and it's been an enormous help. Can't recommend it enough!

    0 0
  • godot [Discussion] How do you (unit-)test your shaders?

    My current plan is to write unit tests using Sub-Viewports that each have a small wrapper shader to draw the result of the tested functions to e.g. 256x256px textures, which I can then compare against snapshots. Depending on the effects of different hardware/driver environments, it might be necessary to check that for some threshold t:

     
    vec3 res = abs(result - snapshot);  // residuals
    max(res.r, res.g, res.b) < t

    This could technically also allow for assertion functions (one condition per pixel), but getting any kind of usable error messages would mean a ton of work, so I don't think that it'd be worth it - though I am tempted :) ——— Edit: turns out Godot has native support for comparing two images, even better! https://docs.godotengine.org/en/stable/classes/class_image.html#class-image-method-compute-image-metrics

    2 0
  • 😰

    1 1
  • comicstrips The lookup table

    It's not really possible to give a concrete answer without a concrete definition of "understanding". But unless you assume supernatural explanations, either systems must be able to "understand", or humans are also incapable of "understanding", since we ourselves are physical systems too.

    For instance I feel that a gravity coin sorter is made with understanding but does not have understanding

    I get the example and agree that such a coin sorter does not meaningfully have an understanding of gravity. But IMO it does have a (minimal) understanding of the different coins you're sorting, since it contains a mechanism for differentiating between their sizes. Imagine we replaced the gravity mechanism with a bunch of actuators controlled by organic neurons, which are connected to something like an eye. The neurons fire and cause the actuators to sort the coins. Now, if say the neurons just react to brightness levels it'd be hard to argue there's an understanding. But if the neurons are part of a real human brain, they can definitely understand the coins etc. and sort based on their understanding. As you take away more parts of said brain, when does it lose the understanding?

    0 0
  • comicstrips The lookup table

    No, you're still a necessary part of the system, since otherwise there is no interaction possible. And yes, I don't think understanding relies on consciousness.

    Where is the semantic difference?

    0 1
  • comicstrips The lookup table

    I'd like to add a rebuttal I tend to agree with: You're only a component of a larger system, and the whole system (you + the room + your list of instructions) does encode some understanding, otherwise a chinese speaker wouldn't be able to interact with the room in any meaningful way. In almost any system, you can look at a specific part and argue that part doesn't fulfill a property that the entire system taken as one does.

    4 2
  • comicstrips Poor guy

    Palpatine secretly controlled the whole trade blockade around Naboo as well as directing Count Dooku, Darth Maul and General Grievous among many other shenanigans.

    To compare it to German history: Palpatine didn't just light the metaphorical Reichstag on fire, my Geschwisty. He used an armada of tanks assembled into a Voltron-style robot that shoots Flammenwerfer capable of turning air into fuel.

    6 2