cinera_handmade.network/cmuratori/hero/code/code100.hmml

50 lines
3.1 KiB
Plaintext
Raw Permalink Normal View History

[video output=day100 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Reflection Vectors" vod_platform=youtube id=PHz3ulc_mFk annotator=Miblo annotator=dspecht]
[1:06][Recap where we left off yesterday]
[2:20][Blackboard: Surface reflectance]
[5:12][Blackboard: Straight reflection model and Collision detection]
[11:05][Look at the code]
[12:25][Blackboard: Orthographic projection]
[15:31][Make the Z-axis our EyeVector]
[15:51][Blackboard: A "premature optimisation"]
[18:43][Compute the bounce on the assumption that the eye vector is always \[0, 0, 1\]]
[21:18][Compile and see what happens]
[22:03][Blackboard: Fudge factor][quote 64]
[24:22][Blackboard: Sampling from the environment map]
[29:44][Assume that the BounceDirection is always going in the direction of the map that it's trying to sample from]
[31:15][Negate the BounceDirection for the Bottom map]
[33:05][Start setting up SampleDirection]
[34:05][Compute the offset from the fudge factor and the coefficient]
[35:36][Compute tX and tY and (erroneously) clamp them]
[37:20][Figure out what the UV is]
[39:41][Check it out in-game and introduce some motion]
[43:40][Blackboard: The way that we're encoding things]
[44:12][Change that default Normal in MakeSphereNormalMap]
[45:01][Take a look in-game]
[45:50][Step into the debugger][quote 62]
[47:00][Blackboard: We still need some degree of tilt to the mirror]
[47:50][It was really just Casey being kind of blunt][quote 61]
[47:53][Tweak the Normal]
[49:01][Check out the reflective sphere in-game]
[49:56][Consider investigating what's going wrong with the Top map]
[51:46][Q&A][:speech]
[52:50][@thesizik][You could try creating a normal map with a more predictable reflection, rather than a sphere]
[53:53][@andsz_][Is the Y-axis correctly set in the normal map?]
[54:58][@pseudonym73][A pyramid was suggested by a couple of people]
[56:00][Blackboard: Pyramid]
[57:05][Make a pyramid]
[58:12][Blackboard: Figuring out a pyramid]
[59:05][Set that pyramid]
[1:00:30][Give it a shot]
2017-12-24 00:16:27 +00:00
[1:01:10][@garlandobloom][Q: So it would need to be flipped on both directions?]
[1:01:26][@garlandobloom][Q: I think the lower reflection also needs to flip the Y there because it's the incoming vector, right?]
[1:02:06][@ttbjm][you said you might have to make the sky texture larger than the ground so it wouldn't miss it. Could you instead sample from adjacent sky maps (assuming they're not occluded)?]
[1:03:01][@grumpygiant256][The edge attenuation is correct, given that a reflected vector right on the edge will have a smaller Y value than ones reflected from nearer the center]
2017-12-24 00:16:27 +00:00
[1:04:35][@chronaldragon][Q: Would it be possible to rotate the "incoming" sampling from the environment map so that it looks like the sphere is spinning?]
[1:05:17][@blueravengt][Cylinders might be useful]
[1:08:26][@gasto5][Are you using a left-handed coordinate system or a right-handed coordinate system?]
[1:08:54][@ttbjm][Would inverted versions of the normal maps be useful? (inverted sphere)]
2017-12-24 00:16:27 +00:00
[1:09:17][@abnercoimbre][That's disturbing]
[1:09:35][TODO(casey): Rotate normals based on X/Y axis!]
2017-12-24 00:16:27 +00:00
[1:12:29][@abnercoimbre][Q: That's a wrap!]
[/video]