Using noise in shaders (texture blending)

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 16

  • @BarneyCodes
    @BarneyCodes  10 месяцев назад +5

    If you'd like to see what else I'm working on, it would be great if you could wishlist my game Star Mining Co. on Steam! s.team/a/2584800/
    What shader effect would you like to see next?

    • @theman7050
      @theman7050 10 месяцев назад +1

      Is there a way to contact you man?

    • @BarneyCodes
      @BarneyCodes  10 месяцев назад +1

      My username is barneycodes on discord, feel free to reach out there! Otherwise you can email me at barney@barneycodes.com

    • @Tritoon710
      @Tritoon710 9 месяцев назад +1

      Facing Ratio & Dot Product
      Thanks

    • @BarneyCodes
      @BarneyCodes  9 месяцев назад +2

      I'm planning on looking at some basic lighting in an upcoming video so should cover this then! Thanks for the comment!

  • @theman7050
    @theman7050 10 месяцев назад +2

    Barney at it again!!! 🎉
    Wow I used to think generating noise in code is more efficient. But using a texture for it comes as a surprise man. Thanks :)

    • @BarneyCodes
      @BarneyCodes  10 месяцев назад +1

      It's probably slightly more nuanced then "it's always better to use a texture", but things like Perlin and Worley noise can be a bit expensive to calculate every frame.
      On the other hand, white noise can be really quick because you can just take a hash of the position vector to get a "random" value.
      Thanks for your comment!

  • @DeniseNepraunig
    @DeniseNepraunig 9 месяцев назад +1

    Really great explanation. I love the way you go through this, showing all the code changes and variants! Top notch editing. Thanks man!

    • @BarneyCodes
      @BarneyCodes  9 месяцев назад +1

      Thank you so much! Glad you liked it!

  • @openlink9958
    @openlink9958 7 месяцев назад +3

    0:08 it looks like a shader that replicates how cells look like. Every "cell" (circle) is separated from adjacent circles but all of them are together, on a similar way how skin cells would be (or any kind of large cell structure really)

    • @BarneyCodes
      @BarneyCodes  7 месяцев назад +1

      That's voronoi noise! It pops up in nature quite a lot which is really cool! The basic idea behind it is that each pixel is coloured based on the distance to the nearest "seed" point, which is why you get those shaded blob regions!

  • @tepiku
    @tepiku 9 месяцев назад +1

    Thanks for the video. Really well explained.
    3:38 The thing with p5.js is that the coordinates 0,0 are located in the top left corner instead of the bottom left.

    • @BarneyCodes
      @BarneyCodes  8 месяцев назад

      Thanks! I sort of assumed that the underlying image data wouldn't be affected by that but I guess I was wrong!

  • @number3boo
    @number3boo 10 месяцев назад +6

    So that's how they do it

  • @literallyaperson7125
    @literallyaperson7125 10 месяцев назад +4

    nice