updated shader math
okay two-week project reportback
i rewrote the shader! this involved making a bunch of fiddly changes to the shader equations and what vertex data was stored and a bunch of other stuff like that.
the three main changes i made were:
so that's neat!
after that i drew some bigger 64x32 textures, which i think might be the size i standardize on for all the future stuff -- big enough to have some detail, but still small enough to effectively be pixel art. something to do in the future is to put together some more complex connected textures code so i can repeat textures in less repetitive ways, or have overlay textures for adjacent tiles, that kind of thing. i think that would make a huge difference in terms of making a landscape that looks good.
also i got a little bit of the way through reimplementing hex slopes, but since i've done that a few times before i wasn't really super enthused to be doing it again. one of the big goals this year is to actually make progress on stuff instead of constantly retreading old ground, so it kind of sucks to have to (well, 'have to') recode old stuff to use the new buffer allocation code. i also did a little bit of work sketching out data structures for world data / buffer data that should work for stuffing arbitrary information into later on -- since the ultimate goal is to have much more complex landscapes than just a barren heightmap, i'm going to need game data structures that can actually store all that information in a reasonably structured and efficient way, and i think i have some pretty decent starting points.
that being said i'm so sick of render code, so the next 2-wk project is gonna be all about graph grammars. like, now that i have a world data structure and some stuff rendering, it's actually time to start thinking about worldgen, and, specifically, finally bridging the gap between the world data and all those svg hex dungeons i've been working on for ages.
so the next two weeks are gonna be graph expansion bugfixing + trying to work out some actual expansion decks that generate an interesting space. that's an entirely different kind of problem, so, we'll see how i do at it.
i rewrote the shader! this involved making a bunch of fiddly changes to the shader equations and what vertex data was stored and a bunch of other stuff like that.
the three main changes i made were:
- the shader itself now does the lighting calculations, rather than me having to precompute them in the vertex color data. this means i can now have moving lights (well, a moving light) and opens the way to having a diffuse/specular material system, which would be kind of neat.
- atlased textures can now be wrapped. opengl has built-in support for wrapping a single texture around to repeat it, but you can only wrap the entire texture. once all the landscape textures have been atlased into a single big texture, in order to 'wrap around' it would have to wrap literally across all the other unrelated textures in the atlas before repeating itself. that's definitely not what i wanted. so now the vertices store some texture dimension data and i can wrap an individual texture as much as i want
- this is the big one and the reason i started doing the shader rewrite in the first place: the uv mapping of textures has been changed to be way less distorted. i posted a comparison image on monsterpit: first the hex textures and then the wall quad textures.
so that's neat!
after that i drew some bigger 64x32 textures, which i think might be the size i standardize on for all the future stuff -- big enough to have some detail, but still small enough to effectively be pixel art. something to do in the future is to put together some more complex connected textures code so i can repeat textures in less repetitive ways, or have overlay textures for adjacent tiles, that kind of thing. i think that would make a huge difference in terms of making a landscape that looks good.
also i got a little bit of the way through reimplementing hex slopes, but since i've done that a few times before i wasn't really super enthused to be doing it again. one of the big goals this year is to actually make progress on stuff instead of constantly retreading old ground, so it kind of sucks to have to (well, 'have to') recode old stuff to use the new buffer allocation code. i also did a little bit of work sketching out data structures for world data / buffer data that should work for stuffing arbitrary information into later on -- since the ultimate goal is to have much more complex landscapes than just a barren heightmap, i'm going to need game data structures that can actually store all that information in a reasonably structured and efficient way, and i think i have some pretty decent starting points.
that being said i'm so sick of render code, so the next 2-wk project is gonna be all about graph grammars. like, now that i have a world data structure and some stuff rendering, it's actually time to start thinking about worldgen, and, specifically, finally bridging the gap between the world data and all those svg hex dungeons i've been working on for ages.
so the next two weeks are gonna be graph expansion bugfixing + trying to work out some actual expansion decks that generate an interesting space. that's an entirely different kind of problem, so, we'll see how i do at it.