Scratcher effect shader - Learning shaders in Godot episode 2

Поділитися
Вставка
  • Опубліковано 2 жов 2024

КОМЕНТАРІ • 6

  • @beedeo3664
    @beedeo3664 Рік тому +2

    Hi, I loved your video tutorial. Step by step and very clear. I am new to godot and am trying to make a scratch off. I followed your example and it worked for me but I have a question:
    How do I know the percentage of the scratched surface? I would like that when 50% of the surface is scratched, the rest of the surface is automatically scratched.
    Thank you very much! ❤

    • @mrelipteach
      @mrelipteach  Рік тому

      Thanks, glad you liked it.
      Honestly I'm not completely sure. The most obvious way to me is to count how many pixels have been changed in the mask texture (the black and white texture on which we draw), but I'm afraid it's going to be quite slow because you have to do it in GDScript.

  • @melpeslier
    @melpeslier 11 місяців тому

    I think we can just use a transparent drawing color ?

  • @RenatoMeyer
    @RenatoMeyer Рік тому

    Hey! Awesome tutorial! Can this be aplied to a moving sprite? Like, if I have the sprite of a cow, could I erase the head and then move the cow with a missing head around?

    • @mrelipteach
      @mrelipteach  Рік тому +1

      You have to make a shader on the texture and not a screen shader. So yes it can be done with some tweaking

    • @RenatoMeyer
      @RenatoMeyer Рік тому

      @@mrelipteach That's cool! Would you say it's similar to what you do here and I could use this tutorial? Or do you think it's too different