demofox,
@demofox@mastodon.gamedev.place avatar

For folks that know me as "the blue noise guy", I've put together a 50 minute video that talks about many of the things I've learned in my ~decade long dive into noise and related topics - up to and including our latest paper published days ago at I3D.
I hope you enjoy it!
https://www.youtube.com/watch?v=tethAU66xaA

A slide showing how random numbers which are positively correlated on the screen give correlated resulting renders, uncorrelated random numbers give uncorrelated renders, and negative correlation random numbers give negatively correlated renders. Negatively correlated renders have the best perceptual quality, despite all three having the same actual error.

dougmerritt,
@dougmerritt@mathstodon.xyz avatar

@demofox
I know you know what you're doing, but the left side image about "irrational" and "random" reminds me of the famous John Von Neumann quote that I really love:

"Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin."

demofox,
@demofox@mastodon.gamedev.place avatar

@dougmerritt that's a great quote, I'm going to log that one to memory. Quantum seems to be the last bastion for non determinism and we'll see if that even holds up over time. 💯

mbr,
@mbr@mastodon.gamedev.place avatar

@dougmerritt @demofox Nod. But "real" random isn't any fun.

demofox,
@demofox@mastodon.gamedev.place avatar

@mbr @dougmerritt so true hehe

mbr,
@mbr@mastodon.gamedev.place avatar

@demofox @dougmerritt To expand. With pseudo-random (or LDS) you have a set of known properties. And the fact you can repeat exactly the same sequences (or subset thereof) is of great value. Real random is a niche thing that's only has limited usefulness in "security" IMHO.

demofox,
@demofox@mastodon.gamedev.place avatar

@mbr @dougmerritt yeah. Having a deterministic mode is so great to verify you haven't broken anything as you change things :)

dougmerritt,
@dougmerritt@mathstodon.xyz avatar

@mbr @demofox
Yes, correct, repeatability is extremely handy, and pseudo-random number generators are often a great thing to use -- except that your phrasing might give someone the idea that there's never any point in using true hardware randomness collection -- yet although niche, that sort of thing is very important in some niches.

(I just collected some hardware randomness within the last week, although really that's neither here nor there)

Randomness is a deep subject that very few technical people really understand. (Present company presumably excepted out of respect and politeness)

Anyway I hope it was clear that I wasn't criticizing, it was just an opportunity to share a quote that I really like.

demofox,
@demofox@mastodon.gamedev.place avatar

@dougmerritt @mbr definitely clear. It's a great quote :)

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Just getting to this and continued fractions just blew my mind. I had no idea you could analyze irrationals like this and that the golden ratio is the "most irrational" b/c of it's pessimal approximability is super neat!

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig Yeah isn't that neat?
I thought sqrt(2) was globally 2nd place to golden ratio because it is an infinite string of 2's.
A couple days ago i saw that sqrt(3) is an infinite string of "12121212..." which i think makes it be better than sqrt(2).
Someone should make some kind of irrational number table sorted from most to least so we have a place to go and grab em when we need em :)

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Oh that's interesting! Makes me wonder if there's "1111211112" hiding out there or in the extreme case "1111...(arbitrary?)...1112" ? Like is there some theoretical reason that the run of 1s couldn't be arbitrarily long?

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig something to also consider here... lets say you wanted to do 2 shuffles and you wanted to make sure they didn't interact with each other (same irrational would make them be the same shuffle but offset), you could pick a 2nd good irrational number, but that irrational number may be somewhat similar to the first irrational number. So it's like you want it to be irrational with respect to integers, but also golden ratio. "Co-irrational" numbers need to come into math's existance :)

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Oh neat. Is this conceptually similar to "multi-class" blue noise you alluded to with the chicken's eye? Two layers, different within, different across. (I'm only at 23:52 in your video; taking lots of notes haha)

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig a bit yeah. It seems like it could help us come up with an irrational value for the x axis, and another for the y axis, that combined would make nice 2D point sets. Right now we have heuristics for doing that, but nothing solid.
IMO state of the art is "R2"
https://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig and haha... welcome to the blue noise / golden ratio club.

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Great survey talk btw!
Here's what I think I've taken away (a lot of these concepts are first time for me):

LDS means single index with unknown upper limit produces even distribution
LDS: great for when you want even distribution w/ unknown length
Golden ratio: pretty much ideal LDS for 1D, but for higher dimensions maybe see R2
BN: better than LDS if you want the properties or feel of randomness

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig LDS is deterministic. It can be a set (must use all points for it to work well) or a sequence (can use any points from 0 to N and it works well).
LDS wins over BN at numerical integration and similar "do a thing with RNG and calculate error" situations.
BN is randomized and is high frequency noise.
There is 2 kinds of BN. BN points and BN textures.
BN points can be sets or sequences too.
At dimensions > 2 Owen Scrambled Sobol seems to be the winner.
BN textures are for perceptual error.

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox

BN: can help you trade quality for speed by sampling w/ small probability tables (beware the cache)
BN: a lot easier to denoise than WN, in fact your visual system might naturally be denoising
BN: ideal for small sample counts were you don't have the luxury of convergence
many small filters add up to gaussian; gaussian removes high frequencies
WN: has clumps and voids, might be what you want for e.g. perlin noise

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig yeah for sure and 1d LDS can give you benefits in probabilities.
For rendering, LDS has problems with aliasing, Blue noise does not.

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox

Fast noise: u can design noise around the filter for better BN-like properties in the output domain(?)

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig yeah, FAST is optimized so that if you know you are going to render, then apply a specific spatial filter, then a specific temporal filter, it minimizes the POST FILTERING error.
If you optimize noise for a gaussian filter spatially, that gives you blue noise, which is also how you optimize for perceptual error.
But you can optimize for box spatially which is what we usually use!
Check out "D" on this page for something interesting/unsolved about perceptual error.
https://github.com/electronicarts/fastnoise/blob/main/FastNoiseDesign.md

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig and FAST lets you have whatever per pixel value type you want. scalars, vectors, importance sampled vectors, etc. It's best to use noise textures with what you want in them, vs take scalar values and turn it into a vector, because that warping hurts the frequencies.

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Ah thank you! These are really helpful clarifications. Gives me a lot to chew on.

This is a very interesting space. The approach of reducing samples to increase speed but choosing your samples carefully to minimize perceptual loss seems very general.

Now I need to look at everywhere where I'm doing box filtering and consider if I can make better use of my resources..

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig yeah so true! and box filtering is the same as averaging so if you ever find yourself averaging, or shuffling, or using random numbers etc etc, you have something to try. It's crazy how wide open this is. Like, a person could just start writing all sorts of computer science research papers and improving things IMO :P

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox If only there were a "blue noise" guy to fill that niche :P

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Thinking through some non-rendering use cases in my engine, maybe:

enemy aiming: making hit vs miss more fair w/ LDS

evenly spaced colors: Like Martin's approach, but use a more perceptual color space, like OkLab, and use LDS with A & B and with fixed-ish L

network queue: When there's more objects to be synced over the network than capacity, assign priority weights and than using an LDS to reduce starvation of lower priority items instead of just top-priority first.

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig drool those are great usage cases IMO. For that last one, you might be interested in this post if you don't want to have a go at tackling it yourself. Or maybe you can improve this method or find a better one!
"Weighted Round Robin (Weighted Random Integers) Using The Golden Ratio Low Discrepancy Sequence"
https://blog.demofox.org/2020/06/23/weighted-round-robin-using-the-golden-ratio-low-discrepancy-sequence/

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Ha because of course you would have a blog post on this topic. Neat! I'm definitely saving that link. :)

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox I'm going to make this my "blue noise epiphanies" thread:

I'm wondering it'd be reasonable to use 1d blue noise or golden ratio shuffle to select indices into some resource pool. E.g. say I've got a particle pool that's full and I want to spawn a new particle but I don't want to track lifetimes or keep a free list, I could just claim indices using the golden ratio and you wouldn't see old particles disappearing in a pattern.

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig I agree with you and think that could work great, yeah. Only problem with this type of solution is it takes huge strides across the memory and is cache unfriendly!
Unsure what to do about that in general, but i have something cooking for this problem when it's in screenspace for rendering :P

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox Oh hmm. Say I wanted to spawn 20 new particles in a burst. Instead of picking these indices across the whole buffer, I could pick them within some subset range that is more likely to be cache friendly. And that process of which range to pick could itself be blue noise!

But maybe this is way too complicated and should instead use some other alloc scheme haha

demofox,
@demofox@mastodon.gamedev.place avatar

@sprig i wonder if you could do some hierarchical thing, like it would work in small windows at a time, but work in a way such that the statistics of how long something will live on average before being stomped is the same? not sure of the details but it seems probable

sprig,
@sprig@mastodon.gamedev.place avatar

@demofox That seems ideal. Say you've got some address with higher-oder (HO) and lower-order (LO) bits. You advance your HO index using an LDS every once every max value of your LO bits, and the LO index is advanced using some LDS.

I think this evenly samples the whole address space over time? But if your LO size is about some cache size maybe it'll be cache friendly?

longbool,
@longbool@mastodon.gamedev.place avatar

@demofox Alan this is an amazing and approachable talk, thank you 🙂

demofox,
@demofox@mastodon.gamedev.place avatar

@longbool thanks a lot :)

baggers, (edited )
@baggers@mastodon.gamedev.place avatar

@demofox
It's well known that if someone says "blue noise" three times in a mirror, you appear.

Stoked for this video though, thanks for making it!

apoorvaj,
@apoorvaj@mastodon.gamedev.place avatar

@demofox This was a great talk. Thanks! I hope you do more of these. :)

demofox,
@demofox@mastodon.gamedev.place avatar

@apoorvaj Thanks a lot, i really appreciate you saying that :)

mamoniem,
@mamoniem@mastodon.gamedev.place avatar

@demofox i always knew, if there is a love letter talk to blue noise like that comes one day, it will be from you, and only you! Good job!

demofox,
@demofox@mastodon.gamedev.place avatar

@mamoniem not enough people know about 1d blue noise textures, let alone spatiotemporal, and now the generalization to arbitrary spatial and temporal filters.
More people need to hop on the train :)
I think there is still a lot of work to do in the area too. Lots of useful discoveries left to be made.

mamoniem,
@mamoniem@mastodon.gamedev.place avatar

@demofox i personally was not familiarized with the term till i saw you on twitter sharing about it frequently, hence it caught my attention 🤩 (results speaks to be fair) and i started building knowledge about it (integrating slowly into my personal work).
also, this is why i was expecting that at some point a deep talk about it wouldn't come from anyone but you😅

Az,
@Az@mastodon.gamedev.place avatar

@demofox Youtube really hated your 8 colors dithered slide ah! Thanks for the talk, I picked up most of it following you here during the last couple years but it's still interesting to see it all put together in a presentation.

demofox,
@demofox@mastodon.gamedev.place avatar

@Az it's unfortunate that dithering helps reduce how many colors & bits you use, but makes it a lot harder to compress 😂

romulo,
@romulo@mastodon.gamedev.place avatar

@demofox Thanks for the video, I'll watch it ASAP :)

demofox,
@demofox@mastodon.gamedev.place avatar

@romulo awesome, I hope you like it!

demofox,
@demofox@mastodon.gamedev.place avatar

note the projective geometric algebra poster in the background @EricLengyel haha

EricLengyel,
@EricLengyel@mastodon.gamedev.place avatar

@demofox Cool! I'll have to send you the current version!

EricLengyel,
@EricLengyel@mastodon.gamedev.place avatar

@demofox Just checking that you received the posters.

demofox,
@demofox@mastodon.gamedev.place avatar

@EricLengyel I found the tube in my wife's office. My goodness, I have some new things to try and absorb now. Thanks Eric :)
I'll move them to the other side of the camera next time I record a video 😂

EricLengyel,
@EricLengyel@mastodon.gamedev.place avatar

@demofox Heh, glad you found them! Was the tube damaged? It looks like the posters have gone through the wringer.

demofox,
@demofox@mastodon.gamedev.place avatar

@EricLengyel no it was fine and the posters are good. I may have been eager to get them out hehe. They are great though, thanks a lot.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • InstantRegret
  • osvaldo12
  • magazineikmin
  • thenastyranch
  • rosin
  • Youngstown
  • mdbf
  • slotface
  • ngwrru68w68
  • tester
  • kavyap
  • everett
  • Durango
  • JUstTest
  • ethstaker
  • cubers
  • modclub
  • GTA5RPClips
  • tacticalgear
  • Leos
  • khanakhh
  • normalnudes
  • provamag3
  • cisconetworking
  • anitta
  • megavids
  • lostlight
  • All magazines