Replacing the Pseudo-random Number Generator
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next timestamp
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu and Index Controls

a
w
s
d
h j k l


Esc Close menu / unfocus timestamp

Quotes and References Menus and Index

Enter Jump to timestamp

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:01Recap and set the stage for the day investigating the variance (flicker) in the lighting
🏃
0:01Recap and set the stage for the day investigating the variance (flicker) in the lighting
🏃
0:01Recap and set the stage for the day investigating the variance (flicker) in the lighting
🏃
4:15Read through and describe our usage of photons per second in the lighting code
📖
4:15Read through and describe our usage of photons per second in the lighting code
📖
4:15Read through and describe our usage of photons per second in the lighting code
📖
8:28Make ComputeLightPropagation() consider the approximate location of the moon (i.e. directly up in Z) when applying its colour
8:28Make ComputeLightPropagation() consider the approximate location of the moon (i.e. directly up in Z) when applying its colour
8:28Make ComputeLightPropagation() consider the approximate location of the moon (i.e. directly up in Z) when applying its colour
9:27Run the game to see that underside surfaces are black
🏃
9:27Run the game to see that underside surfaces are black
🏃
9:27Run the game to see that underside surfaces are black
🏃
10:10Temporarily increase the MoonColor brightness in ComputeLightPropagation()
10:10Temporarily increase the MoonColor brightness in ComputeLightPropagation()
10:10Temporarily increase the MoonColor brightness in ComputeLightPropagation()
10:19See that brighter moon and admire the character of the scene
🏃
10:19See that brighter moon and admire the character of the scene
🏃
10:19See that brighter moon and admire the character of the scene
🏃
12:42Remove the SkyColor, GroundColor and SunDirection from ComputeLightPropagation()
12:42Remove the SkyColor, GroundColor and SunDirection from ComputeLightPropagation()
12:42Remove the SkyColor, GroundColor and SunDirection from ComputeLightPropagation()
13:06Transferring light as photons per second
🖌
13:06Transferring light as photons per second
🖌
13:06Transferring light as photons per second
🖌
16:02Complete sample, if sampling every single photon hit by an infinite number of rays
🖌
16:02Complete sample, if sampling every single photon hit by an infinite number of rays
🖌
16:02Complete sample, if sampling every single photon hit by an infinite number of rays
🖌
19:39Our actual sample, casting 64 rays with temporal antialiasing filtering, and questions to consider
🖌
19:39Our actual sample, casting 64 rays with temporal antialiasing filtering, and questions to consider
🖌
19:39Our actual sample, casting 64 rays with temporal antialiasing filtering, and questions to consider
🖌
30:31Consider explicitly accumulating all lighting points and only averaging at the end
📖
30:31Consider explicitly accumulating all lighting points and only averaging at the end
📖
30:31Consider explicitly accumulating all lighting points and only averaging at the end
📖
33:12Rename Emit to LastPPS and Direction to LastDirection, and add SampleCount in lighting_point_state, to enable ComputeLightPropagation() to accumulate all lighting points directly without doing temporal blending?
33:12Rename Emit to LastPPS and Direction to LastDirection, and add SampleCount in lighting_point_state, to enable ComputeLightPropagation() to accumulate all lighting points directly without doing temporal blending?
33:12Rename Emit to LastPPS and Direction to LastDirection, and add SampleCount in lighting_point_state, to enable ComputeLightPropagation() to accumulate all lighting points directly without doing temporal blending?
39:02Run the game to see a totally stable lighting solution
🏃
39:02Run the game to see a totally stable lighting solution
🏃
39:02Run the game to see a totally stable lighting solution
🏃
40:42Introduce the notion of a fixed LIGHT_TEST_ACCUMULATION_COUNT, to make the light converge over this many iterations of the lighting routine
40:42Introduce the notion of a fixed LIGHT_TEST_ACCUMULATION_COUNT, to make the light converge over this many iterations of the lighting routine
40:42Introduce the notion of a fixed LIGHT_TEST_ACCUMULATION_COUNT, to make the light converge over this many iterations of the lighting routine
48:38Add a key to toggle the converging lighting accumulation in UpdateAndRenderWorld()
48:38Add a key to toggle the converging lighting accumulation in UpdateAndRenderWorld()
48:38Add a key to toggle the converging lighting accumulation in UpdateAndRenderWorld()
49:27Run the game and try toggling the lighting accumulation
🏃
49:27Run the game and try toggling the lighting accumulation
🏃
49:27Run the game and try toggling the lighting accumulation
🏃
49:45Enable LightingTest() to map the lighting points back
49:45Enable LightingTest() to map the lighting points back
49:45Enable LightingTest() to map the lighting points back
51:37Run the game to try toggling the lighting convergence
🏃
51:37Run the game to try toggling the lighting convergence
🏃
51:37Run the game to try toggling the lighting convergence
🏃
52:26Make LightingTest() cap the AccumulationCount
52:26Make LightingTest() cap the AccumulationCount
52:26Make LightingTest() cap the AccumulationCount
53:03Run the game to see our "converged" lighting getting brighter, and investigate why
🏃
53:03Run the game to see our "converged" lighting getting brighter, and investigate why
🏃
53:03Run the game to see our "converged" lighting getting brighter, and investigate why
🏃
55:23Correctly make LightingTest() cap the AccumulationCount
55:23Correctly make LightingTest() cap the AccumulationCount
55:23Correctly make LightingTest() cap the AccumulationCount
55:36Run the game and admire our converged lighting solution
🏃
55:36Run the game and admire our converged lighting solution
🏃
55:36Run the game and admire our converged lighting solution
🏃
56:37insobot 56 minutes into the main stream. 50 until Q&A. (based on NOTE)
🗪
56:37insobot 56 minutes into the main stream. 50 until Q&A. (based on NOTE)
🗪
56:37insobot 56 minutes into the main stream. 50 until Q&A. (based on NOTE)
🗪
56:42Toggle the lighting accumulation and consider how to address the oscillation
🏃
56:42Toggle the lighting accumulation and consider how to address the oscillation
🏃
56:42Toggle the lighting accumulation and consider how to address the oscillation
🏃
59:52Increase LIGHT_TEST_ACCUMULATION_COUNT from 256 to 1024
59:52Increase LIGHT_TEST_ACCUMULATION_COUNT from 256 to 1024
59:52Increase LIGHT_TEST_ACCUMULATION_COUNT from 256 to 1024
1:00:03Consider working on the hemisphere sampling
🏃
1:00:03Consider working on the hemisphere sampling
🏃
1:00:03Consider working on the hemisphere sampling
🏃
1:02:15Add debug visualisation of the rays in LightingTest()
1:02:15Add debug visualisation of the rays in LightingTest()
1:02:15Add debug visualisation of the rays in LightingTest()
1:06:43Run the game and check out the debug visualisation of our rays, to see that there is some clumping
🏃
1:06:43Run the game and check out the debug visualisation of our rays, to see that there is some clumping
🏃
1:06:43Run the game and check out the debug visualisation of our rays, to see that there is some clumping
🏃
1:07:42Determine to improve the random number generation1,2
📖
1:07:42Determine to improve the random number generation1,2
📖
1:07:42Determine to improve the random number generation1,2
📖
1:12:33Recommend Melissa O'Neill's3 PCG4
📖
1:12:33Recommend Melissa O'Neill's3 PCG4
📖
1:12:33Recommend Melissa O'Neill's3 PCG4
📖
1:16:59Consider the difficulty of performing PCG in SIMD, due to the absence of lane shifting until AVX-5125
📖
1:16:59Consider the difficulty of performing PCG in SIMD, due to the absence of lane shifting until AVX-5125
📖
1:16:59Consider the difficulty of performing PCG in SIMD, due to the absence of lane shifting until AVX-5125
📖
1:21:39Switch RandomNextUInt32() to perform xorshift
1:21:39Switch RandomNextUInt32() to perform xorshift
1:21:39Switch RandomNextUInt32() to perform xorshift
1:23:19Run the game to see an unexpected distribution
🏃
1:23:19Run the game to see an unexpected distribution
🏃
1:23:19Run the game to see an unexpected distribution
🏃
1:23:47Make RandomUnilateral() produce up to U32Max points of randomness
1:23:47Make RandomUnilateral() produce up to U32Max points of randomness
1:23:47Make RandomUnilateral() produce up to U32Max points of randomness
1:24:45Run the game to see a more expected, if still slightly clumpy, distribution
🏃
1:24:45Run the game to see a more expected, if still slightly clumpy, distribution
🏃
1:24:45Run the game to see a more expected, if still slightly clumpy, distribution
🏃
1:26:46Excise the old random number table in favour of xorshift
1:26:46Excise the old random number table in favour of xorshift
1:26:46Excise the old random number table in favour of xorshift
1:27:15Take another look at the random distribution
🏃
1:27:15Take another look at the random distribution
🏃
1:27:15Take another look at the random distribution
🏃
1:27:43LightingTest()
1:27:43LightingTest()
1:27:43LightingTest()
1:29:07Weighted sampling
🖌
1:29:07Weighted sampling
🖌
1:29:07Weighted sampling
🖌
1:30:36Start to make LightingTest() perform an inverse square-root mapping
1:30:36Start to make LightingTest() perform an inverse square-root mapping
1:30:36Start to make LightingTest() perform an inverse square-root mapping
1:31:39Run the game to see a more upward-facing distribution
🏃
1:31:39Run the game to see a more upward-facing distribution
🏃
1:31:39Run the game to see a more upward-facing distribution
🏃
1:31:59Continue to work on the upward-facing sampling equation in LightingTest()
1:31:59Continue to work on the upward-facing sampling equation in LightingTest()
1:31:59Continue to work on the upward-facing sampling equation in LightingTest()
1:33:58Upward-biased sampling equation
🖌
1:33:58Upward-biased sampling equation
🖌
1:33:58Upward-biased sampling equation
🖌
1:34:26Fix the sampling equation in LightingTest()
1:34:26Fix the sampling equation in LightingTest()
1:34:26Fix the sampling equation in LightingTest()
1:34:42Run the game to see a more fully distributed upward-facing distribution
🏃
1:34:42Run the game to see a more fully distributed upward-facing distribution
🏃
1:34:42Run the game to see a more fully distributed upward-facing distribution
🏃
1:35:39Enable the rays to be randomly cast over time
1:35:39Enable the rays to be randomly cast over time
1:35:39Enable the rays to be randomly cast over time
1:36:58Run the game to see our randomly cast rays
🏃
1:36:58Run the game to see our randomly cast rays
🏃
1:36:58Run the game to see our randomly cast rays
🏃
1:37:22Switch our random number generator to operate in SIMD by default, introducing f32_4x versions of << and >>
1:37:22Switch our random number generator to operate in SIMD by default, introducing f32_4x versions of << and >>
1:37:22Switch our random number generator to operate in SIMD by default, introducing f32_4x versions of << and >>
1:43:11Arithmetic vs logical shifting
🗩
1:43:11Arithmetic vs logical shifting
🗩
1:43:11Arithmetic vs logical shifting
🗩
1:45:43Introduce ShiftRight4X() and ShiftLeft4X() in lieu of f32_4x shift operators6
1:45:43Introduce ShiftRight4X() and ShiftLeft4X() in lieu of f32_4x shift operators6
1:45:43Introduce ShiftRight4X() and ShiftLeft4X() in lieu of f32_4x shift operators6
1:53:59Step through RandomNextU324X() to watch what it does
🏃
1:53:59Step through RandomNextU324X() to watch what it does
🏃
1:53:59Step through RandomNextU324X() to watch what it does
🏃
1:58:18Make RandomNextU324X() perform ShiftLeft4X() inline
1:58:18Make RandomNextU324X() perform ShiftLeft4X() inline
1:58:18Make RandomNextU324X() perform ShiftLeft4X() inline
2:00:07Step in to RandomNextU324X() and inspect its values
🏃
2:00:07Step in to RandomNextU324X() and inspect its values
🏃
2:00:07Step in to RandomNextU324X() and inspect its values
🏃
2:00:47Owl of Shame Moment: It wasn't doing a lane-based shift7
🦉
🗩
2:00:47Owl of Shame Moment: It wasn't doing a lane-based shift7
🦉
🗩
2:00:47Owl of Shame Moment: It wasn't doing a lane-based shift7
🦉
🗩
2:01:50Make ShiftRight4X() and ShiftLeft4X() use _mm_srli_epi32 and _mm_slli_epi32 respectively
🦉
🖮
2:01:50Make ShiftRight4X() and ShiftLeft4X() use _mm_srli_epi32 and _mm_slli_epi32 respectively
🦉
🖮
2:01:50Make ShiftRight4X() and ShiftLeft4X() use _mm_srli_epi32 and _mm_slli_epi32 respectively
🦉
🖮
2:02:37Step back through RandomNextU324X() to see that its values look reasonable
🏃
🦉
2:02:37Step back through RandomNextU324X() to see that its values look reasonable
🏃
🦉
2:02:37Step back through RandomNextU324X() to see that its values look reasonable
🏃
🦉
2:03:35Run the game to see our ray distribution, with unexpectedly flicker-free lighting
🏃
🦉
2:03:35Run the game to see our ray distribution, with unexpectedly flicker-free lighting
🏃
🦉
2:03:35Run the game to see our ray distribution, with unexpectedly flicker-free lighting
🏃
🦉
2:06:11Make U32_4x() pick the correct slice for RandomSeed()
🦉
🖮
2:06:11Make U32_4x() pick the correct slice for RandomSeed()
🦉
🖮
2:06:11Make U32_4x() pick the correct slice for RandomSeed()
🦉
🖮
2:07:11Run the game to see our flicker back
🏃
🦉
2:07:11Run the game to see our flicker back
🏃
🦉
2:07:11Run the game to see our flicker back
🏃
🦉
2:08:43Switch all our _mm_set*() calls to be _mm_setr*()
🦉
🖮
2:08:43Switch all our _mm_set*() calls to be _mm_setr*()
🦉
🖮
2:08:43Switch all our _mm_set*() calls to be _mm_setr*()
🦉
🖮
2:09:19Run the game and note the ordering of the _mm_set*() intrinsics8
🏃
🦉
📖
2:09:19Run the game and note the ordering of the _mm_set*() intrinsics8
🏃
🦉
📖
2:09:19Run the game and note the ordering of the _mm_set*() intrinsics8
🏃
🦉
📖
2:10:56Enable RandomBilateral_4x() to operate directly in SIMD, and introduce RandomUnilateral_4x() and U32ToF32()9
🦉
🖮
2:10:56Enable RandomBilateral_4x() to operate directly in SIMD, and introduce RandomUnilateral_4x() and U32ToF32()9
🦉
🖮
2:10:56Enable RandomBilateral_4x() to operate directly in SIMD, and introduce RandomUnilateral_4x() and U32ToF32()9
🦉
🖮
2:19:23Consider negative and positive numbers in twos complement
🦉
🗩
2:19:23Consider negative and positive numbers in twos complement
🦉
🗩
2:19:23Consider negative and positive numbers in twos complement
🦉
🗩
2:21:47Continue to implement RandomBilateral_4x()
🦉
🖮
2:21:47Continue to implement RandomBilateral_4x()
🦉
🖮
2:21:47Continue to implement RandomBilateral_4x()
🦉
🖮
2:22:46Run the game and consider stopping here for today
🏃
🦉
2:22:46Run the game and consider stopping here for today
🏃
🦉
2:22:46Run the game and consider stopping here for today
🏃
🦉
2:23:32Q&A
🗩
2:23:32Q&A
🗩
2:23:32Q&A
🗩
2:24:00vateferfout Q: Is there a drawback to implementing your f32_4x type as an union between __m18 and __m128i?
🗪
2:24:00vateferfout Q: Is there a drawback to implementing your f32_4x type as an union between __m18 and __m128i?
🗪
2:24:00vateferfout Q: Is there a drawback to implementing your f32_4x type as an union between __m18 and __m128i?
🗪
2:25:12vaualbus Q: There is not windows functions for random number generation?
🗪
2:25:12vaualbus Q: There is not windows functions for random number generation?
🗪
2:25:12vaualbus Q: There is not windows functions for random number generation?
🗪
2:25:51vkar2 Q: You can still try my idea, keep one subray fixed, make 3 random
🗪
2:25:51vkar2 Q: You can still try my idea, keep one subray fixed, make 3 random
🗪
2:25:51vkar2 Q: You can still try my idea, keep one subray fixed, make 3 random
🗪
2:26:12n30sh4d0w Q: So what does bilaterial vs. unilaterial mean?
🗪
2:26:12n30sh4d0w Q: So what does bilaterial vs. unilaterial mean?
🗪
2:26:12n30sh4d0w Q: So what does bilaterial vs. unilaterial mean?
🗪
2:26:32vateferfout Q: Doesn't relying on biased sampling instead of angular fall-off means that you could oversample if you use bilateral sampling?
🗪
2:26:32vateferfout Q: Doesn't relying on biased sampling instead of angular fall-off means that you could oversample if you use bilateral sampling?
🗪
2:26:32vateferfout Q: Doesn't relying on biased sampling instead of angular fall-off means that you could oversample if you use bilateral sampling?
🗪
2:26:54Sample distribution
🖌
2:26:54Sample distribution
🖌
2:26:54Sample distribution
🖌
2:28:58desuused Q: Would it be reasonable to seed your PRNG with RNG provided by OS?
🗪
2:28:58desuused Q: Would it be reasonable to seed your PRNG with RNG provided by OS?
🗪
2:28:58desuused Q: Would it be reasonable to seed your PRNG with RNG provided by OS?
🗪
2:29:44joshthebrawler handmade_hero I'm trying to start from the beginning of Handmade Hero including the Intro to C videos, but you use visual studio 2013 express in it. Is it okay to use visual studio 2017 express windows instead, or are there too many differences and I should use the 2013 version?
🗪
2:29:44joshthebrawler handmade_hero I'm trying to start from the beginning of Handmade Hero including the Intro to C videos, but you use visual studio 2013 express in it. Is it okay to use visual studio 2017 express windows instead, or are there too many differences and I should use the 2013 version?
🗪
2:29:44joshthebrawler handmade_hero I'm trying to start from the beginning of Handmade Hero including the Intro to C videos, but you use visual studio 2013 express in it. Is it okay to use visual studio 2017 express windows instead, or are there too many differences and I should use the 2013 version?
🗪
2:30:38ingenero Q: Can your current implementation of lighting turn a surface into a mirror? Are the sample points too sparse to do that effectively, or does it not really work like that at all? I'm trying to wrap my mind around how it all works
🗪
2:30:38ingenero Q: Can your current implementation of lighting turn a surface into a mirror? Are the sample points too sparse to do that effectively, or does it not really work like that at all? I'm trying to wrap my mind around how it all works
🗪
2:30:38ingenero Q: Can your current implementation of lighting turn a surface into a mirror? Are the sample points too sparse to do that effectively, or does it not really work like that at all? I'm trying to wrap my mind around how it all works
🗪
2:31:27Using the "eye" vector to estimate perceived reflectance of surfaces
🖌
2:31:27Using the "eye" vector to estimate perceived reflectance of surfaces
🖌
2:31:27Using the "eye" vector to estimate perceived reflectance of surfaces
🖌
2:36:21longboolean Q: You mentioned a few times that later on during world generation we will do a better job of adding sample points. Are theses sample points limited to static terrain or do you have ideas about how to handle terrain that can be in motion or altered in some other way?
🗪
2:36:21longboolean Q: You mentioned a few times that later on during world generation we will do a better job of adding sample points. Are theses sample points limited to static terrain or do you have ideas about how to handle terrain that can be in motion or altered in some other way?
🗪
2:36:21longboolean Q: You mentioned a few times that later on during world generation we will do a better job of adding sample points. Are theses sample points limited to static terrain or do you have ideas about how to handle terrain that can be in motion or altered in some other way?
🗪
2:37:17vateferfout Q: What I meant with the question is that if a surface B is nearly above surface A but perpendicular to it, there is a risk of a lot of rays originating from A could hit B and thus contribute a lot even though the angular falloff would prevent that
🗪
2:37:17vateferfout Q: What I meant with the question is that if a surface B is nearly above surface A but perpendicular to it, there is a risk of a lot of rays originating from A could hit B and thus contribute a lot even though the angular falloff would prevent that
🗪
2:37:17vateferfout Q: What I meant with the question is that if a surface B is nearly above surface A but perpendicular to it, there is a risk of a lot of rays originating from A could hit B and thus contribute a lot even though the angular falloff would prevent that
🗪
2:37:41Angular falloff
🖌
2:37:41Angular falloff
🖌
2:37:41Angular falloff
🖌
2:38:43vateferfout Q: I'm talking about bilateral sampling
🗪
2:38:43vateferfout Q: I'm talking about bilateral sampling
🗪
2:38:43vateferfout Q: I'm talking about bilateral sampling
🗪
2:39:43n30sh4d0w Actually you're not 100% true in terms of the diagram, but your concept is true. The geometric concept of rays actually breaks down for caves or any cone (it's the infinite reflection problem). Conceptually though you are right. Normal objects are not mirrors. You actually have to use nonlinear optics and a geometric diagram to fully describe the lightening going into a cave
🗪
2:39:43n30sh4d0w Actually you're not 100% true in terms of the diagram, but your concept is true. The geometric concept of rays actually breaks down for caves or any cone (it's the infinite reflection problem). Conceptually though you are right. Normal objects are not mirrors. You actually have to use nonlinear optics and a geometric diagram to fully describe the lightening going into a cave
🗪
2:39:43n30sh4d0w Actually you're not 100% true in terms of the diagram, but your concept is true. The geometric concept of rays actually breaks down for caves or any cone (it's the infinite reflection problem). Conceptually though you are right. Normal objects are not mirrors. You actually have to use nonlinear optics and a geometric diagram to fully describe the lightening going into a cave
🗪
2:40:58Computing reflected light sources around corners
🖌
2:40:58Computing reflected light sources around corners
🖌
2:40:58Computing reflected light sources around corners
🖌
2:43:16n30sh4d0w You can google The Illumination Problem - Numberphile for a full video on the topic
🗪
2:43:16n30sh4d0w You can google The Illumination Problem - Numberphile for a full video on the topic
🗪
2:43:16n30sh4d0w You can google The Illumination Problem - Numberphile for a full video on the topic
🗪
2:48:07We are good to go
🗩
2:48:07We are good to go
🗩
2:48:07We are good to go
🗩