The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

X3D - A 3D engine for TI68k & Nspire Calculators

Started by catastropher, June 27, 2015, 02:37:43 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

catastropher

So today I got a very basic version of solid mode working. It's crappy, sluggish, and glitchy but it's a start :P The number at the top of the screen shows how many ticks it took to render the scene (1 tick = 1/350th of a second). Most of the time is spent in the polygon clipper, which will be replaced soon with a better algorithm I came up with. My apologies for the erratic screenshot!

Spoiler: ShowHide


Things that really need to be worked on:

  • The level editor controls are very difficult to use as is (you can see me struggling in the image :P)

  • It's using the old clipping algorithm as I'm getting the new one working - this adds an O(n^2) algorithm to each face with a segment on the other side :(

  • You currently can't move between rooms

  • Some lines are unnecessarily being drawn twice, which is why some of them look extra thick

  • For some reason the engine keeps freezing every once in a while, also noticeable in the image


Anyway, just thought I'd get something out here to show that progress is being made :)
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

CKH4

Wow that level editor is impressive, you may want to add a toggle for the solid fill.


catastropher

Thanks! The project has come a long way since I restarted it a few months ago :) I will indeed add a toggle, thanks for the suggestion! The funny thing is, the engine actually runs faster in solid mode because it can discard entire parts of the level if they're not visible. In wireframe mode, you unfortunately have no choice but to practically draw everything :(
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

CKH4

That's an interesting upside to the solid mode. I'm really glad to see the progress. What calculators does this run on, I might try to find one that can run this because of how great it is.


catastropher

Quote from: CKH4 on July 13, 2015, 10:26:49 pm
That's an interesting upside to the solid mode. I'm really glad to see the progress. What calculators does this run on, I might try to find one that can run this because of how great it is.

Aww thanks! Currently it only runs on the 68k calculators (TI92+, Voyage 200, and the TI89), but I'll eventually be providing ports for the NSpire and PC. Really, it can run on anything that GCC can target for and is powerful enough to run it :)

Btw, the source is code is here: https://github.com/catastropher/X3D-68k (most development is currently being done in the segment branch). If you give me a few days to iron out some of the bugs, I'd be happy to upload some binaries (which can be run with TIEmu if you don't have a physical calc) :D
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

CKH4

Oooh, sounds great. Does the ti 89 category contain titanium as well? (I'm not too familiar with 68k)

Also I'll take a look at the source. I might learn something.


catastropher

Quote from: CKH4 on July 13, 2015, 10:45:17 pm
Oooh, sounds great. Does the ti 89 category contain titanium as well? (I'm not too familiar with 68k)


It does indeed! The only thing is, the TI89 family tends to be more expensive. Though the TI92+ was discontinued a long time ago, it has a 240x128 screen and you can buy them online pretty cheap (I got mine a few months ago for 35 USD). The TI89 on the other hand has twice as much flash and a 16 MHz CPU (compared to the 12 MHz TI92+) but it only has a 160x100 display. X3D runs on them both though! Actually, it will run faster on the TI89 because of the faster clock speed.

Quote from: CKH4 on July 13, 2015, 10:45:17 pm
Also I'll take a look at the source. I might learn something.

Sweet! Don't hesitate to ask me any questions you have (the source code is currenly just a bit messy since I've been quickly doing several things. Most of it is documented using Doxygen though!) Also, feel free to contribute if you'd like. It's completely open source so anyone can take part! :D
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

Lionel Debroux

QuoteThe number at the top of the screen shows how many ticks it took to render the scene (1 tick = 1/350th of a second).

350 Hz sounds like you used AUTO_INT_1 for timing, which is a good idea on HW2+ calculators from 1999 onwards - but in such a case, the rate is 256 Hz :)
Only HW1 calculators "feature" that inaccurate and varying AUTO_INT_1 rate, usually said to be 350-395 Hz (depending on battery strength, the phase of the moon, etc.).

Quote(which can be run with TIEmu if you don't have a physical calc)

Or https://tiplanet.org/pad_ti68k_emu/v12.html , started by Patrick Davidson and largely improved by myself. It aims at being an install-less, portable, "good enough" emulator. It's unfinished - it lacks a debugger, to begin with - and it was started before Emscripten became a usable option, but it works for most purposes.

QuoteThe TI89 on the other hand has twice as much flash and a 16 MHz CPU (compared to the 12 MHz TI92+) but it only has a 160x100 display. X3D runs on them both though! Actually, it will run faster on the TI89 because of the faster clock speed.

The CPU frequency of the 89 and 92+ is the same, actually.
Now, the frequency of the 89T's CPU was at first thought to be ~16 MHz, but it was a benchmarking issue stemming from comparing an empty 89T to a loaded 89, which had consequences on the memory allocation and VAT subsystems. Pure assembly benchmarks didn't show such a significant speed difference.

From the dependencies on Github:
* you're linking to the obsolete and unmaintained TIGCC, but not to the newer, improved and less buggy GCC4TI - how sad ;)
* copying third-party headers / libraries to the GCC4TI environment can certainly cause issues with some projects and end up referencing files from the environment when one would like to reference other files, so I'm not keen on anyone copying ExtGraph (or any widely used third-party library, again) there.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

catastropher

Quote from: Lionel Debroux on July 14, 2015, 05:59:19 am
350 Hz sounds like you used AUTO_INT_1 for timing, which is a good idea on HW2+ calculators from 1999 onwards - but in such a case, the rate is 256 Hz :)
Only HW1 calculators "feature" that inaccurate and varying AUTO_INT_1 rate, usually said to be 350-395 Hz (depending on battery strength, the phase of the moon, etc.).


Ah ok, thanks. The documentation on https://debrouxl.github.io/gcc4ti/intr.html#SetIntVec still says 350 with without mentioning this is only for HW1. Is there someway we could update this?

Quote from: Lionel Debroux on July 14, 2015, 05:59:19 am
Or https://tiplanet.org/pad_ti68k_emu/v12.html , started by Patrick Davidson and largely improved by myself. It aims at being an install-less, portable, "good enough" emulator. It's unfinished - it lacks a debugger, to begin with - and it was started before Emscripten became a usable option, but it works for most purposes.


Oh, I didn't realize there were other emulators! I will have to give this a try :)

Quote from: Lionel Debroux on July 14, 2015, 05:59:19 am
The CPU frequency of the 89 and 92+ is the same, actually.
Now, the frequency of the 89T's CPU was at first thought to be ~16 MHz, but it was a benchmarking issue stemming from comparing an empty 89T to a loaded 89, which had consequences on the memory allocation and VAT subsystems. Pure assembly benchmarks didn't show such a significant speed difference.


This is what I get for trusting the information from Wikipedia (incorrect box on the right still shows 16 MHz https://en.wikipedia.org/wiki/TI-89_series#TI-89_Titanium) :P

Quote from: Lionel Debroux on July 14, 2015, 05:59:19 am
* you're linking to the obsolete and unmaintained TIGCC, but not to the newer, improved and less buggy GCC4TI - how sad ;)


Oops, sorry about that! I wrote that readme in a hurry and forgot to link to both. I'll get that corrected as soon as I can!

Quote from: Lionel Debroux on July 14, 2015, 05:59:19 am
* copying third-party headers / libraries to the GCC4TI environment can certainly cause issues with some projects and end up referencing files from the environment when one would like to reference other files, so I'm not keen on anyone copying ExtGraph (or any widely used third-party library, again) there.


Oh alright, I wasn't aware of this problem. Should I just include the extgraph header in my repository in X3D-68k/src/headers?

Thanks for correcting me, I certainly don't want to be propagating misinformation (apologies if I already have)!
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

Lionel Debroux

QuoteThe documentation on https://debrouxl.github.io/gcc4ti/intr.html#SetIntVec still says 350 with without mentioning this is only for HW1. Is there someway we could update this?

Just did it locally :)
Given that this is not the only piece of inaccurate/outdated information in the trunk/tigcc/doc/System/Include/intr.h/SetIntVec.hsf file (for instance, on HW3/4, AUTO_INT_3 no longer is a 1 Hz timer, it's used for USB), a more involved pass on this page and several of its siblings is warranted. It's just another proof that most of the GCC4TI documentation was written in the late 1990s and early 2000s, before the V200 (2002) and 89T (2004) became available for purchase. Documentation and library work largely stagnated after 2002-2003 for multiple reasons outside of the scope of this topic, such work only resumed with GCC4TI.

The authoritative resource for documentation on the TI-68k series' hardware (for HW1 and HW2, that is) is known as "J89hw.txt", mainly written by Johan Eilert, and improved later based on newer work by e.g. ExtendeD (port 70001F, for instance).
The most recent version of that file is in the TIEmu repository, and mirrored at http://tict.ticalc.org/docs/J89hw.txt . IOW, I'm supposed to be the maintainer of both the file and the mirror. ExtendeD's newest work on HW3/4 I/O ports (710000-7100FF) was never reformatted for inclusion into that file, and no emulator emulates most of those ports.

QuoteOh, I didn't realize there were other emulators!

This one is intentionally not widely advertised, because it's unfinished, and probably will stay that way, as performance and accuracy are already good (i.e. the "good enough" goal for pure consumers has already been largely achieved), and there are barely any TI-68k native code developers left - you're one of the few exceptions, precisely :)
Nowadays, the proper way to write a TI-68k emulator would be to rewrite a pure C/C++ code base, starting from the TIEmu code base, and use Emscripten to target asm.js and soon WebAssembly.

QuoteShould I just include the extgraph header in my repository in X3D-68k/src/headers?

You can copy or link the files from ExtGraph to that location on your computer, but please do not add them to the repository: there are already too many outdated versions of ExtGraph being shipped around :)
It's likely that even some TICT software, i.e. myself, is guilty.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

catastropher

July 14, 2015, 01:59:30 pm #55 Last Edit: July 14, 2015, 10:52:15 pm by catastropher
Quote from: Lionel Debroux on July 14, 2015, 11:54:14 am
Just did it locally :)
Given that this is not the only piece of inaccurate/outdated information in the trunk/tigcc/doc/System/Include/intr.h/SetIntVec.hsf file (for instance, on HW3/4, AUTO_INT_3 no longer is a 1 Hz timer, it's used for USB), a more involved pass on this page and several of its siblings is warranted. It's just another proof that most of the GCC4TI documentation was written in the late 1990s and early 2000s, before the V200 (2002) and 89T (2004) became available for purchase. Documentation and library work largely stagnated after 2002-2003 for multiple reasons outside of the scope of this topic, such work only resumed with GCC4TI.

Great thanks! Let me know if there's anything I can do to help! I want to do as much as I can to help breath life into the platform :)

Quote from: Lionel Debroux on July 14, 2015, 11:54:14 am
The authoritative resource for documentation on the TI-68k series' hardware (for HW1 and HW2, that is) is known as "J89hw.txt", mainly written by Johan Eilert, and improved later based on newer work by e.g. ExtendeD (port 70001F, for instance).
The most recent version of that file is in the TIEmu repository, and mirrored at http://tict.ticalc.org/docs/J89hw.txt . IOW, I'm supposed to be the maintainer of both the file and the mirror. ExtendeD's newest work on HW3/4 I/O ports (710000-7100FF) was never reformatted for inclusion into that file, and no emulator emulates most of those ports.

Thanks for the resource! Sorry again for being misinformed :P

Quote from: Lionel Debroux on July 14, 2015, 11:54:14 am
You can copy or link the files from ExtGraph to that location on your computer, but please do not add them to the repository: there are already too many outdated versions of ExtGraph being shipped around :)
It's likely that even some TICT software, i.e. myself, is guilty.

Awesome, I'll update the readme and includes when I get the chance :D

Edit: I updated the readme with a link to GCC4TI instead of TIGCC :) I will update the code to expect extgraph in a different folder soon, after which I will update the readme again.
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

DJ Omnimaga

IIRC, the last update in TIGCC was adding Windows Vista support in 2007 or 2009 O.O . I'M glad that someone took over  to maintain it. I can't wait for X3D updates to see more of this program into action :)

By the way, are there 68K emulators that allows you to slow down emulation, like with Nspire_emu and WabbitEmu? That can be handy during screen capture with Camstudio and such software, because then you can speed the video back up and you get much smoother screenshots that do the program's justice and it would be nice for people without 68K calcs to see an animated screenshot showing the full speed potential of this engine. :)

Lionel Debroux

July 20, 2015, 05:53:46 am #57 Last Edit: July 20, 2015, 05:55:30 am by Lionel Debroux
Yes, the JS TI-68k emulator can slow emulation down. However, it does not support producing animated screenshots by itself, unlike jsTIfied.

Full Vista+ (UAC) support was actually added after TIGCC became unmaintained for practical purposes, as part of GCC4TI.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

DJ Omnimaga

That's good. I normally use a third-party video capture software then I convert the AVI into GIF, and I produced particularly smooth (although sometimes very large) animated GIFs or AVI files of TI-Nspire programs before. Most old 68K screenshots flickers and/or lags a lot.

catastropher

Hello guys! I would like to apologize for my extended absence. X3D is still being very actively developed though! However, we've had difficulty getting the project organized. Worse, X3D was originally developed as a static library, but we've found that the size is just too big. Thus, the project is now going be a DLL (for the core) and a static library (for extra features). So... the entire project is going to be written (for what, the 5th time now? :P) If anyone is interested in joining the project, now would be the perfect time because there's a lot to do and many opportunities to contribute! There's not much code currently, but check out https://github.com/catastropher/X3D-68k/wiki/Building-For-68k-Calculators for how to build it!
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

Powered by EzPortal