Using noise in shaders (texture blending)

  Рет қаралды 9,285

Barney Codes

Barney Codes

Күн бұрын

0:00 Intro
0:30 What is noise?
1:48 Setup
3:23 Vertex Shader
3:50 Reading textures
4:27 Blending with mix
5:01 Reading noise values
5:39 Controlling the noise
7:07 Scaling the noise
7:58 Conclusion
Code from this video:
editor.p5js.org/BarneyCodes/s...
Introduction to shaders: • Introduction to shader...
Examples used:
“Base warp fBM” by trinketMage: www.shadertoy.com/view/tdG3Rd
“contour noise” by DeltaT: www.shadertoy.com/view/dsGfRz
"Cloud perturbations" by felipetovarhenao: www.shadertoy.com/view/mdcBDl
More resources on noise:
Procedural shader noise: thebookofshaders.com/11/
Some different noise algos: lodev.org/cgtutor/randomnoise...
Perlin noise wiki article: en.wikipedia.org/wiki/Perlin_...
Textures used in this video:
Dirt texture: opengameart.org/content/simpl...
Grass texture: opengameart.org/content/10-se...
Noise textures give programmers a way to introduce random and organic elements into their effects. In this video I'll show you how you can use noise textures in a shader to create a simple texture blending effect.
There are so many ways that you can use noise to create awesome looking visuals, so hopefully you find this video useful and pick up a few tricks!
Follow me:
Twitter: / barneycodes
Reddit: / barneycodes
Support the channel: www.youtube.com/@BarneyCodes/...
#glsl #p5js #shaders

Пікірлер: 16
@BarneyCodes
@BarneyCodes 9 ай бұрын
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 8 ай бұрын
Is there a way to contact you man?
@BarneyCodes
@BarneyCodes 8 ай бұрын
My username is barneycodes on discord, feel free to reach out there! Otherwise you can email me at barney@barneycodes.com
@Tritoon710
@Tritoon710 7 ай бұрын
Facing Ratio & Dot Product Thanks
@BarneyCodes
@BarneyCodes 7 ай бұрын
I'm planning on looking at some basic lighting in an upcoming video so should cover this then! Thanks for the comment!
@DeniseNepraunig
@DeniseNepraunig 8 ай бұрын
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 8 ай бұрын
Thank you so much! Glad you liked it!
@theman7050
@theman7050 8 ай бұрын
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 8 ай бұрын
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!
@number3boo
@number3boo 9 ай бұрын
So that's how they do it
@literallyaperson7125
@literallyaperson7125 9 ай бұрын
nice
@BarneyCodes
@BarneyCodes 9 ай бұрын
Thanks!
@openlink9958
@openlink9958 5 ай бұрын
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 5 ай бұрын
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 7 ай бұрын
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 7 ай бұрын
Thanks! I sort of assumed that the underlying image data wouldn't be affected by that but I guess I was wrong!
Fixing the REALTIME terrain shadows using YOUR suggestions!
8:40
Barney Codes
Рет қаралды 70 М.
Introduction to shaders: Learn the basics!
34:50
Barney Codes
Рет қаралды 305 М.
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 28 МЛН
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 16 МЛН
One moment can change your life ✨🔄
00:32
A4
Рет қаралды 34 МЛН
The ONE Texture Every Game NEEDS
9:00
SimonDev
Рет қаралды 248 М.
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 945 М.
I spent 30 days learning shaders to avoid drawing pixel art
7:49
Easy Perlin Noise Flow Fields
10:22
Barney Codes
Рет қаралды 33 М.
C++: Perlin Noise Tutorial
8:52
Zipped
Рет қаралды 11 М.
The coolest shader effect that nobody uses
8:03
Nitro-Gen Studios
Рет қаралды 78 М.
What is Perlin Noise?
7:49
Suboptimal Engineer
Рет қаралды 12 М.
Your Images DESERVE These Effects
4:46
Juxtopposed
Рет қаралды 38 М.
Simulating the Evolution of Rock, Paper, Scissors
15:00
Primer
Рет қаралды 1,1 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 28 МЛН