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

48 lines
4.9 KiB
Plaintext
Raw Permalink Normal View History

[video output=day479 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Large Texture Support" vod_platform=youtube id=wzDx--c5uUo annotator=Miblo]
2018-10-21 18:09:22 +00:00
[0:00][Recap and set the stage for the day][:rendering :speech]
[2:11][Plug Meow Hash[ref
site="Molly Rocket"
page="Meow Hash"
url=https://mollyrocket.com/meowhash]][:research]
[3:59][Try to :run the game but crash in OpenGLManageTextures()][:hardware :rendering]
[4:57][][quote 631]
[5:09][Investigate the crash in OpenGLManageTextures(), to find that a fresh rebuild does not crash][:hardware :rendering :run]
[10:48][:Run the Renderer Test noting that we have adequate throughput][:rendering]
[12:18][:Run the game and note our new absence of support for large textures in our texture array][:"asset system" :rendering]
[14:25][Approaching the problem of handling large textures now that we have a fixed-size texture array][:"asset system" :speech]
[17:03][Consider mipmapping our sprites][:"asset system" :rendering :speech]
[19:33][:Run the Renderer Test and try to see scaling artifacts that could be fixed by mipmaps][:"asset system" :rendering]
[23:21][Set out our strategy for handling large textures][:"asset system"][quote 632]
[26:49][Add a renderer_texture array to render_entry_textured_quads to special-case our :rendering of large textures][:"asset system"]
[35:38][Enable GetCurrentQuads() to handle large textures, adding a stretchy renderer_texture *QuadTextures buffer to game_render_commands, introducing IsSpecialTexture() and stubbing out GetSpecialTextureHandleFor()][:"asset system" :rendering]
[54:29][:Run the Renderer Test and the game successfully][:"asset system" :rendering]
[55:15][Enable LoadBitmap() to handle special large textures, introducing DimensionsRequireSpecialTexture() and SpecialTextureIndexFrom()][:"asset system"]
[1:05:01][Add SpecialTextureHandleCount and NextSpecialTextureHandle to game_assets and enable AllocateGameAssets() to handle special large textures][:"asset system" :memory]
[1:09:18][Enable OpenGLAllocateTexture() to handle special large textures, introducing TextureIndexFrom()][:"asset system" :hardware :memory]
[1:12:37][XOR vs AND NOT][:mathematics][quote 633]
[1:16:02][A few words on demythologising programming and the truth of making mistakes][:experience]
[1:19:30][Continue to enable OpenGLAllocateTexture(), Win32InitOpenGL() and OpenGLBeginFrame() to handle special large textures][:"asset system" :hardware :memory :"platform layer"]
[1:42:54][:Run the game and crash in OpenGLInit()][:"asset system" :hardware :rendering]
[1:44:08][Fix Win32InitOpenGL() to allocate the asset and texture handle arrays before calling OpenGLInit()][:"asset system" :hardware :memory]
[1:44:41][:Run the game nominally correctly, before switching to the cutscene and crashing in OpenGLAllocateTexture()][:"asset system" :hardware :memory]
[1:45:53][Step through LoadBitmap() to see what happens with the large textures][:"asset system" :run]
[1:49:01][Fix DimensionsRequireSpecialTexture() to correctly handle textures that are larger than standard on either axis (rather than both)][:"asset system"]
[1:49:17][:Run the game, switch to the cutscene and hit our Assert(TextureIndex == Texture.Index) in PushQuad()][:"asset system" :rendering]
[1:50:33][Fix PushQuad() to peel off the handle from the texture in stages, first as a u32, then cast down to a u16][:"asset system" :rendering]
[1:51:12][:Run the game and crash in OpenGLEndFrame()][:"asset system" :hardware :rendering]
[1:53:43][Fix GetCurrentQuads() to set the IndexArrayOffset, and change OpenGLEndFrame() to use this offset accordingly][:"asset system" :hardware]
[1:57:44][:Run the game without crashing, but see no cutscene textures][:"asset system" :hardware :rendering]
[2:00:43][Step in to OpenGLEndFrame() and inspect the Texture][:"asset system" :hardware :rendering :run]
[2:01:01][Fix PushQuad() to actually push on special textures][:"asset system"]
[2:02:30][:Run the game, see that the Texture at this point in OpenGLEndFrame() looks a lot better, but that we don't see the cutscene textures in-game][:"asset system"]
[2:03:46][Q&A][:speech]
[2:04:16][@rooctag][Q: Commands-> should be Entry-> on the line where it breaks. Commands was leftover and not updated to Entry]
[2:04:47][Fix OpenGLEndFrame() to set the special Texture from the Entry, rather than from the Commands][:"asset system"]
[2:04:55][:Run the game and still see no cutscene textures][:"asset system"]
[2:06:37][@etisdew][Q: How do you handle attributes and varyings for your GLSL?][:hardware :rendering]
[2:07:54][A few words on the need for a :language that offers the ability to read in material written in another language (e.g. GLSL), and use the types defined in that material directly, noting that [@naysayer88 Jon Blow]'s JAI has this ability][:speech]
[2:09:58][][quote 634]
[2:10:12][@caseyismyhero1337][Q: Casey my man, what are the stats on your glasses?][:trivia]
[2:11:13][Wrap it up][:speech]
[/video]