5 ms·
Slightly off topic but you can unofficially program these in C/C++ and make things like this Minecraft clone I’ve been working on: https://media.discordapp.net/
by circuit10 3y ago
Slightly off topic but you can unofficially program these in C/C++ and make things like this Minecraft clone I’ve been working on: https://media.discordapp.net/attachments/1135251023435415633/1147668810493591632/break.mp4 https://media.discordapp.net/attachments/1135251023435415633...
- KeplerBoy 3y agonice, this is super cool. Does it run as fast on the real calculator?
- circuit10 3y agoThanks, it runs at 14-20fps depending on the scene but you can overclock the calculator to get it to a solid 20fps like in the video (or more but that makes you move too fast)
- Vogtinator 3y agoI also made a Minecraft clone for a graphical calculator (https://github.com/Vogtinator/crafti https://github.com/Vogtinator/crafti), but the TI nspire has more resources available (esp. RAM) than the CG50. I'm wondering how you do rendering: Usual rasterization per scanline per triangle or some other technique (s buffers)? Depth sorting or Z buffer? Any other tricks?
- circuit10 3y agoHello, I've seen Crafti, it looks a lot more complete than mine. The rendering is based on the triangle renderer in https://gitea.planet-casio.com/Lephenixnoir/Azur https://gitea.planet-casio.com/Lephenixnoir/Azur which renders in fragments to the fast on chip memory so it isn't bottlenecked by the slow main RAM, but I customised it to add textures etc. It's using barycentric coordinates over a bounding box which is probably not as fast as scanline rendering but I can try to make it use scanlines at some point.I'm also using parts of https://codeberg.org/drummyfish/small3dlib https://codeberg.org/drummyfish/small3dlib. It's using depth sorting which works fine for a simple voxel world like this but if I add things like entities and non-full blocks that might complicate things. Also, to speed things up it uses affine texture mapping (which I think yours uses too?) but splits the triangles when they get close to reduce the distortion. The splitting is causing the seams in the video, I can probably improve it by having sub-pixel precision in the triangle rendering or something
- Vogtinator 3y ago> The rendering is based on the triangle renderer in https://gitea.planet-casio.com/Lephenixnoir/Azur https://gitea.planet-casio.com/Lephenixnoir/Azur which renders in fragments to the fast on chip memory so it isn't bottlenecked by the slow main RAM, but I customised it to add textures etc. It's using barycentric coordinates over a bounding box which is probably not as fast as scanline rendering but I can try to make it use scanlines at some point. Ok, interesting. Does it use barycentric coordinates for texturing only or also for single color triangles? I see that the tree is not textured and I wonder whether that's to save texture memory or to use scanline rendering. > It's using depth sorting which works fine for a simple voxel world like this but if I add things like entities and non-full blocks that might complicate things. It might, but it should still work fine as long as there's no unusual geometry, like overlapping itself. Depending on how you sort everything, freely moving entities might be complex but I don't think non-full blocks are much of an issue. > Also, to speed things up it uses affine texture mapping (which I think yours uses too?) but splits the triangles when they get close to reduce the distortion. Yep. I didn't bother with splitting up triangles (or even using partial Z based interpolation like Quake), as I don't think it's that bad of an issue.
- circuit10 3y agoInitially I planned for the game to be flat shaded and added textures as an experiment, then realised the performance wasn't as horrible as I expected, so it's mostly just a leftover from that. I did end up writing a scanline renderer for the flat shaded triangles, I think for those the bottleneck was transforming the vertices though. Maybe I can deal with z-sorting entities by splitting them on voxel boundaries, and I guess dividing them again at any boundaries within non-full blocks (is this similar to https://en.wikipedia.org/wiki/Binary_space_partitioning https://en.wikipedia.org/wiki/Binary_space_partitioning?) For the affine texture splitting, as far as I can tell your game is more focused on creative mode/building whereas I might also want to add a survival mode so for that you're more likely to be up close to the blocks (e.g. in thin underground tunnels) and then the artifacts get much worse so I guess it matters more for me. The code is at https://github.com/Heath123/minecraft-casio https://github.com/Heath123/minecraft-casio if you want to look at it (textures are in a branch) but it is quite messy