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

61 lines
4.2 KiB
Plaintext
Raw Normal View History

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Textured Quadrilaterals" vod_platform=youtube id=k5wzQeWRokA annotator=Miblo annotator=dspecht]
[0:44][Recap and push forwards]
[2:46][Expand the notion of CoordinateSystem to allow passing a Texture]
[4:36][Review how our Edge equations work]
[6:05][Blackboard: Working through a problem from first principals]
[7:26][Blackboard: Texture mapping]
[9:22][Blackboard: Standard nomenclature]
[12:16][Blackboard: How do we produce some u and v values that tell us where in the texture we are at any given time?]
[15:06][Blackboard: Take a look at what's going to happen here]
[17:38][Blackboard: Does this equation give us what we want?]
[19:30][Blackboard: Looking at the problem from another angle]
[21:21][Blackboard: The equation we'd like to implement]
[22:16][Implement that equation, starting by distributing the negative in the Edge tests]
[22:49][Introduce d]
[23:16][Compute u and v]
[24:59][Lookup the u and v inside the Texture]
[27:48][Compile and see what's happening in-game]
[27:55][Assert that X and Y are >=0 and < Texture dimensions]
[28:20][Do that lookup of the u and v]
[29:36][Check out our texture mapping in-game][quote 52]
[30:24][Add in the Alpha]
[31:56][See the alpha composite happening in-game]
[32:23][Slow down the fanciness]
[32:53][Hit an assertion and postpone clamping U and V until we're doing SIMD]
[33:42][Resume slowing down that fanciness]
[34:24][Notice the flickering and mention subpixel accuracy]
[35:26][Make the Tree bigger and put it in the centre of the screen]
[36:17][Move the Tree horizontally and keep its angle constant]
[37:39][Observe the nature of rendering without subpixel accuracy]
[38:56][Blackboard: The number of pixels and texels isn't dividing out evenly]
[41:36][Start tackling these problems]
[41:57][Notice that DrawRectangleSlowly is ignoring the floating point accuracy that was passed to it]
[43:28][Why do we still look like that, though?]
[43:58][Blackboard: Doing a better job of figuring out where we are in the texture map]
[47:18][Linearly blend (Lerp) the colours]
[48:55][Pretend our Texture is smaller than it actually is]
[49:39][Blend these guys together, but not before lofting out the Color values]
[53:01][Manufacture a v4 for Lerping between two Lerps and ones for doing scalar multiplications]
[54:47][View our properly blurry rendering in-game]
[56:55][Switch between the old and new ways, for comparison]
[59:13][Q&A, after getting the tree spinning again]
[1:00:53][@miblo][Will the Wall trees be subpixel accurate now?]
[1:01:37][@andsz][the top of the tree seems to be cut short]
[1:03:50][@powerc9k][Is tree spinning going to be in the DLC?]
[1:04:14][@zuurr_][does it rotate with subpixel accuracy?]
[1:05:18][@trevnewt][What's the most major / fundamental thing left to do on the renderer?]
[1:06:09][TODO(casey): SSE clamping]
[1:06:27][@@garlandobloom][Q: how would you do smooth subpixel rendering for something like pixel art graphics, that doesn't blur but still moves smoothly]
[1:06:59][Blackboard: Doing smooth subpixel rendering for pixel art graphics]
[1:12:09][@ttbjm][couldn't you use the rounding +0.5 and truncate to not sample outside the edges of the texture?]
[1:13:31][@allaizn][why are you still adding 0.5f to tX and tY?]
[1:13:48][@pseudonym73][Is it any faster if you just test the domain of (u,v) instead of testing edges?]
[1:15:57][@ssx1][Is rendering on the cpu different in comparison to rendering on a gpu codewise?]
[1:17:19][@digitaldomovoi][Are there performance benefits for using a quad as primitive over triangles in a software renderer like this?]
[1:18:59][@cubercaleb][why do the edges of the tree look like they are feathered?]
[1:19:54][@guit4rfreak][Will the different renderers be in the platform layer?]
[1:20:19][@log_2][I saw a great video on youtube called 'Computer Color is Broken' from minutephysics that talks about how blending colours is usually incorrectly done. Without relying on 3rd party libraries, you have an opportunity to do it correctly.]
[1:22:21][@miblo][Remember when you introduced RenderGroup the other week? Is this subpixel rendering lerp one of the things that will go in the RenderGroup?]
[1:23:16][Call it for today with a recap and a glimpse into the future]
[/video]