Engine Blues...


So, I want this game to be 3D. Like real 3D, no faking.

I can do some of that with Racket's pict3d library. In a lot of ways, pict3d is really great! In one or two really critical ways... it's not. The one or two "must-haves"? Textures and materials.

I was even gritting my teeth to do without textures. I mean, really, if the game can't be expressed in solidly candy-coloured boxes, what good is it anyway? Except for one thing... Overlays. I need to show text, interface elements, scores, inventories and so on. To do overlays, I need textures because the standard way to put a graphical overlay over an OpenGL scene is to texture map it to a rectangle sitting at camera frustum. And nope. That's not a thing. I played around with rendering to a buffer and painting the buffer with h2dp/universe and yeah, maybe it could work, but it's slow, slow, slow! Devastatingly slow. I tried the 3D canvas with a conventional GUI with the idea that I could draw over the canvas dc after pict3d got done, but... nope! It's not that kind of canvas.

Textures may not be the lost cause that they appear to be on the surface. It's obvious that the author of pict3d spent some time getting texture loading (or at least transferring) working, but never actually wired any of that into the API. So maybe it could be exposed. Materials should be even easier than textures, but I worry they are deeply intertwingled into bits of the library that I don't want to visit -- like shader programs.

This is not necessarily pict3d's fault. It's intended more as a visualization tool, with a simplified lighting model (the material thing). The pict3d author indicates that he wants to have some kind of reasonable way to specify texture application in code -- he's obviously not considering the idea of using a separate program to create models that already have texture coordinates baked in.

What is there aside from pict3d? Well... Raw OpenGL is a possibility -- the "gems" game in the Racket Games package demonstrates it and of course, that's what's under pict3d. Another is to figure out how to use SDL. That would still require OpenGL stuff, but at least I'd have fast 2D stuff too.

I thiiiiink I'm going dig a bit into pict3d first. If I can use his nascent texture loader and turn on texture coordinates for poly's, that might be enough. I'd really like to take advantage of bigbang3d.

But I've got to be able to display text in the window with the game.

Get Steam+SPARK

Leave a comment

Log in with itch.io to leave a comment.