okay gamedev challenge reportback
a bit early, because i got tired of rust + hit on a new idea that's really grabbed my attention.
so, rust. the first thing: rust's library ecosystem is very much not robust. there are some fairly comprehensive geometry/math libs (
at first i looked at
(one of my demands here was "i am not going to use any graphics library that expects me to manually serialize texture byte data", which i don't think is an unreasonable demand at all but apparently several graphics library authors disagree with me)
they had a function that gave you a
anyway then somebody else recommended
three-rs basically worked decently? or rather: the version on cargo is version 0.2.0 and has basically no documentation at all, and also has a
i forget how exactly i figured it out (looking directly at the github source, probably?) but eventually i realized the version hosted on github, which is where the examples linked to, while also called version 0.2.0, was radically different and much further along in development. after cloning the repo and building it locally i also discovered that it had a bunch of actual documentation written. so after that giant hurdle it was decent.
(btw the newer version has default shaders, hence the lack of that arg for
generally most of the time was spent struggling with the library itself as opposed to the language, which, given how fiddly and how little a grasp i have on rust-the-language, wasn't really encouraging either. in like a week of use i found one library panic bug and one place where the library just kinda threw away uv data because apparently literally nobody had ever used this library to draw textures before, which is like... yeah the rust library ecosystem is not robust.
there was still the issue of there not really being explanations for what anything does -- one of the issues i was having was that textures appeared to be loaded automatically using linear interpolation, which looked like absolute garbage for my lo-fi textures. so i was like, well, what in the world sets that, because it's not mentioned anywhere. i searched for "blend" or "linear" or something like that, and that got me some types (
i eventually got a super basic demo that draws some textured hexagons and also has a billboarded sprite drawn that switches its sprite index as you rotate the camera around. nothing really worth showing off.
i guess i might return to rust at some point later? but really because my only other options are haskell (not good at realtime anything) or java (terrible libraries, requires a giant IDE to do anything, requires oodles of boilerplate code everywhere), or like, learning c++ (no). plus it's a language that's doing something interesting, so i feel like i kinda have an obligation to support it over the waves of "let's just write everything in javascript" that are kinda consuming the code scene these days. but so far, uh, not really liking the language or any of its libraries all that much.
a bit early, because i got tired of rust + hit on a new idea that's really grabbed my attention.
so, rust. the first thing: rust's library ecosystem is very much not robust. there are some fairly comprehensive geometry/math libs (
cgmath
, mint
), but after that, in terms of "3d rendering engines", it's... very slim pickings.at first i looked at
piston
, which was a gigantic mess of half-finished code and leaky abstractions that was immensely frustrating to try to use. specifically i was like "okay now let's load a texture and place it on a polygon", and they only have examples for loading raw texture bytes.(one of my demands here was "i am not going to use any graphics library that expects me to manually serialize texture byte data", which i don't think is an unreasonable demand at all but apparently several graphics library authors disagree with me)
they had a function that gave you a
Texture
object from a filename, but it was a texture object that was completely distinct from some other texture object that seemed to be the one that was actually used, and there was a bunch of lower-level gfx
code that wasn't really restructured at all, so it seemed like they were expecting you to sometimes use a piston abstraction but sometimes you'd have to talk to the gfx code directly and it was a huge mess. and none of it was really documented, so all of that is basically just guesses i made from looking at the rust doc and trying to line up types, with no real clue if i was looking down the right path. so that alone was nearly enough to get me to just give up there.anyway then somebody else recommended
three-rs
, which was comparably way less busted.three-rs basically worked decently? or rather: the version on cargo is version 0.2.0 and has basically no documentation at all, and also has a
Window::new
function, which you need to get the general assortment of three-rs rendering objects, that expects "a shader path". that's really weird because 1. you need at least two shaders (vertex and fragment) to do anything, so a single shader is useless and 2. they mention precisely nowhere what the shader should actually do (input uniforms, etc). so i looked at the code examples, only to see them using a one-arg version of Window::new
that did not appear to actually exist.i forget how exactly i figured it out (looking directly at the github source, probably?) but eventually i realized the version hosted on github, which is where the examples linked to, while also called version 0.2.0, was radically different and much further along in development. after cloning the repo and building it locally i also discovered that it had a bunch of actual documentation written. so after that giant hurdle it was decent.
(btw the newer version has default shaders, hence the lack of that arg for
Window
, but it still talks about having "a shader" whenever you need to provide one, and it's only through guesswork and asking other people that i discovered that what it wants is a name like "foo" that it will automagically rewrite to "foo_vs.glsl" and "foo_ps.glsl" and load those as the vertex and fragment shaders. this isn't even mentioned anywhere in the docs, they just say "a shader" or "a shader name" as if that's clear.)generally most of the time was spent struggling with the library itself as opposed to the language, which, given how fiddly and how little a grasp i have on rust-the-language, wasn't really encouraging either. in like a week of use i found one library panic bug and one place where the library just kinda threw away uv data because apparently literally nobody had ever used this library to draw textures before, which is like... yeah the rust library ecosystem is not robust.
there was still the issue of there not really being explanations for what anything does -- one of the issues i was having was that textures appeared to be loaded automatically using linear interpolation, which looked like absolute garbage for my lo-fi textures. so i was like, well, what in the world sets that, because it's not mentioned anywhere. i searched for "blend" or "linear" or something like that, and that got me some types (
Sampler
s) that seemed to be talking about texture interpolation functionality, except... the load_texture
function didn't take that as an argument, and always forced you to use the 'default' one. there was a separate load_texture_from_memory
function that did, but, it didn't take a filename; it required you to manually construct texture bytes. so i griped at somebody to do something about that, and they did, and that turned out to be the thing that fixed it, but until that patch had landed i still wasn't actually certain that the Sampler
arg actually did interpolation. it certainly seemed to be the thing in code that did that, but there wasn't any documentation about it anywhere, aside from in data declarations and type signatures.i eventually got a super basic demo that draws some textured hexagons and also has a billboarded sprite drawn that switches its sprite index as you rotate the camera around. nothing really worth showing off.
i guess i might return to rust at some point later? but really because my only other options are haskell (not good at realtime anything) or java (terrible libraries, requires a giant IDE to do anything, requires oodles of boilerplate code everywhere), or like, learning c++ (no). plus it's a language that's doing something interesting, so i feel like i kinda have an obligation to support it over the waves of "let's just write everything in javascript" that are kinda consuming the code scene these days. but so far, uh, not really liking the language or any of its libraries all that much.