[video output=day102 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Transforming Normals Properly" vod_platform=youtube id=73u0sR4DU9E annotator=Miblo annotator=dspecht]
[0:31][Yesterday we had a little bit of a problem]
[1:25][Blackboard: Imagining the Normals for a house]
[3:51][Blackboard: Recap how to get the perpendicular of a vector]
[5:20][Blackboard: Constructing this Normal with rotation and uniform scale]
[8:27][Blackboard: What happens if we do non-uniform scale?]
[13:30][Blackboard: How can we work around this incorrect calculation?]
[17:41][Open up emacs and take a look at what's currently going on in-game]
[18:15][Rotate normals based on X/Y axis]
[20:04][Introduce NxAxis and NyAxis]
[21:54][Give our v4s the ability to assign just to xy, yz or zw]
[22:36][Check it out in-game]
[22:50][Moment of realisation: We can't just normalise afterwards without having touched the Z size]
[23:22][Compensate for the size changes of X and Y]
[24:42][Check it out in-game]
[25:47][Blackboard: Explaining NzScale]
[29:19][RIP Das Keyboard 4]
[30:11][Consider NzScale]
[31:10][Resume working on sampling from the maps correctly]
[35:09][Document SampleEnvironmentMap a little]
[39:01][Pass DistanceFromMapInZ to SampleEnvironmentMap]
[40:13][Blackboard: Think about the weird nature of lighting in 2D games]
[41:54][Flip DistanceFromMapInZ]
[42:23][Ensure we're still where we were in-game and continue to verify SampleEnvironmentMap]
[45:17][Blackboard: Figure out which direction Z should be sampling in the map]
[47:01][Push BounceDirection.z up to the head end and negate it there]
[47:45][View it in-game, try flipping it back and investigate what is happening]
[58:39][Leave that as the puzzler and go to the Q&A]
[59:04][@grumpygiant256][Draw the sampling vector as RGB=XYZ*0.5+0.5 to visualize it]
[1:06:50][@miblo][Is the map being clipped on either the top or bottom edge? (Don't know if that makes sense.)]
[1:07:23][@robotchocolatedino][Could we calculate a value for the NzScale from the Normal.x and Normal.y so that the Normal.z is unchanged after normalization?]
[1:11:53][@thesizik][Only flip the BounceDirection.z when you use the top map]
[1:18:08][Identify that we're almost puncturing through, or inverting, the map]
[1:20:33][@nicstop][Maybe you can try to write code to show points on the textures from which it is doing sampling?]
[1:20:50][@flaturated][How would the anomaly shift if the sphere were to move up and down instead of left and right?]
[1:22:40][@grumpygiant256][Wondering if it shouldn't maybe be " / fabs(SampleDirection.y)"?]
[1:26:04][@stelar7][Show the sampling on the texture?]
[1:28:40][The stream's over][:speech]
[/video]
