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 2 Guests are viewing this topic.

catastropher

Quote from: DJ Omnimaga on August 24, 2015, 05:41:39 pm
Yeah the idea might not be the best solution, else people will wonder why sometimes placing portals doesn't work.

True... I may proved a few different options and let the client choose which to use.

Quote from: DJ Omnimaga on August 24, 2015, 05:41:39 pm
And I see about 2D stuff. Sorry to hear

Well hopefully I can come up with a solution. I just haven't put too much thought into it yet. Several times I'll think that something is infeasible until I come up with a clever way to do it ;)
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

DJ Omnimaga

Lol ok. But yeah don't worry too much about it if you can't implement 2D stuff. :)

catastropher

Over the past few days I did more work on the physics engine. New features include:

       
  • Gravity

  •    
  • Friction

  •    
  • Proper sliding along walls and ramps

  •    
  • Proper collision resolution

  •    
  • Two default modes of collision handling: bounce and slide

  •        
  • Two types of bounding volumes for collision: sphere and capsule (for the player)

  •        
  • Jumping


Here is a screenshot of it in action. Note: for some reason it's running at a faster speed than on the real calculator, so no, it's not bouncing thaaat quickly:

X3D Physics: ShowHide
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

DJ Omnimaga

Looks cool. :D After how many bouncing blocks does the calculator starts slowing down considerably (by more than half the frame rate) by the way? I am curious about how slow it would get if you made a :walrii: with the outline made out of cubes bounce around far enough to be fully visible? :P

catastropher

Hi guys, it's been forever since I've given an update, so here we go. I've been working on X3D almost constantly (if you check my github, you'll see I work on it almost everyday). I finally implemented my new clipping algorithm, which means it now draws a single room in 2/256 seconds (i.e. 128 FPS!). This is because the engine spent most of its time in the clipper, and I found a way to reduce the problem from O(n^4) to O(n^3). In theory, if we had 10 rooms to draw, the new algorithm will take 1/10 the time of the old one.

But then, a few weeks ago, I got talking with Jason. Because the algorithm is so much faster, we probably could get away with polygon filling i.e. filled walls (black or white). Then it occurred to us that honestly, grayscale wouldn't be that much more expensive. So, X3D will now render in grayscale.

X3D Grayscale: ShowHide


However, this image is being rendered with the old clipper. I have devised a clipping algorithm that clips and renders in a single pass (by clipping the scanlines). Because it's so simple and barely uses any division or multiplication, it may actually be nearly as fast to draw filled polygons as clipped lines  O.O I'll be implementing it over the next few days and I'll keep you posted of my progress! Also, I'm happy to announce that Jason is back to working on the project with me! :)
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

DJ Omnimaga

Heya, nice to see you again, I hope things are going well :)

I am shocked at how good this looks like. It reminds me a bit of the Space Dementia II style, but I haven't gotten the chance to play that game since it didn't seem to work. I am curious about how smooth your engine will be on a real calculator. I wish 68K calcs had an emulator with slowdowns so we could take screenshots while emulation is slowed down then speed them up with a video/GIF editor.

Good job so far on this engine. Will it still be possible to use wireframe/lines with no filling? That might be better for certain color calculator models if you ported the engine.

matrefeytontias

Wow that looks amazing. I've always been fond of 3D stuff, as many know, so this really speaks to me :P
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

utz

Holy ****, that looks amazing indeed! Congrats on the great progress.

catastropher

Quote from: DJ Omnimaga on October 28, 2015, 05:00:57 pm
Heya, nice to see you again, I hope things are going well :)

Thanks! Things have been going pretty well, I've just been crazy busy with work and school! I'll try to post my progress more frequently though!

Quote from: DJ Omnimaga on October 28, 2015, 05:00:57 pm
I am shocked at how good this looks like. It reminds me a bit of the Space Dementia II style, but I haven't gotten the chance to play that game since it didn't seem to work. I am curious about how smooth your engine will be on a real calculator. I wish 68K calcs had an emulator with slowdowns so we could take screenshots while emulation is slowed down then speed them up with a video/GIF editor.

I too am curious how smooth it will be! haha This is actually the 4th clipping algorithm that I've tried. The first two were very very slow (used for the light bridge version). Then, over the summer, I created a new algorithm (which is hinted at in the first post of this thread). I finally got it implemented a few weeks ago... only to come up with a better algorithm a few days later that is several times better :P I'm currently implementing this now, actually, and will add some animated screenshots when its done! :)

Quote from: DJ Omnimaga on October 28, 2015, 05:00:57 pm
Good job so far on this engine. Will it still be possible to use wireframe/lines with no filling? That might be better for certain color calculator models if you ported the engine.

Thanks again! And yes, I plan to still allow outlined walls instead of filled :)

Quote from: matrefeytontias on October 28, 2015, 09:48:27 pm
Wow that looks amazing. I've always been fond of 3D stuff, as many know, so this really speaks to me :P

Hey thanks! I also am really fond of 3D stuff, especially when it means pushing the hardware of the calculator to its limits! There are many many more things in store though! I just need to get this clipping algorithm up and running first! :)

Quote from: utz on October 28, 2015, 11:38:54 pm
Holy ****, that looks amazing indeed! Congrats on the great progress.

Thank you as well! I have plans for lots more stuff, so hopefully I can keep impressing you guys!
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

DJ Omnimaga

That reminds me, would this engine be suitable for actual 3D models as well or is it mainly for maps?

catastropher

Quote from: DJ Omnimaga on November 02, 2015, 07:19:53 am
That reminds me, would this engine be suitable for actual 3D models as well or is it mainly for maps?

My goal is to support simple 3D models, in addition to facing sprites. Sorry for the delayed response!

As promised, here is a screenshot of grayscale in action! Note that the graphical glitches are due to the emulator not responding well to grayscale; these glitches are not present on the actual device. Currently you can't actually enter the room because it needs to do clipping against the near view-frustum plane. This will be in the works soon though!

Animated X3D Grayscale: ShowHide
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

DJ Omnimaga

That looks really nice, plus I like how the 3D environment can change in real time with animations and stuff. :)

catastropher

Quote from: DJ Omnimaga on November 09, 2015, 05:46:09 pm
That looks really nice, plus I like how the 3D environment can change in real time with animations and stuff. :)

Thanks! I think going to grayscale was a good decision. The only tricky part will be getting it fast enough!
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

DJ Omnimaga

Can you get extra speed by reducing the resolution to 80x100 or 40x100, then scale it back up to 160x100 when time comes to display the result? From experience, details loss in 3D when lowering horizontal resolution are quite bearable, but it depends if your routine speed is dependent on screen size and if displaying something at 4 times its original resolution is slow or not.

catastropher

Quote from: DJ Omnimaga on November 10, 2015, 06:52:21 am
Can you get extra speed by reducing the resolution to 80x100 or 40x100, then scale it back up to 160x100 when time comes to display the result? From experience, details loss in 3D when lowering horizontal resolution are quite bearable, but it depends if your routine speed is dependent on screen size and if displaying something at 4 times its original resolution is slow or not.

Well one of the neat things about the monochrome calculators is that you can cram 8 pixels in a single byte. This means, if you're drawing a horizontal line/scanline you can set multiple pixels at once. Unfortunately, scaling is much more complicated because you're pretty much forced to read/set each pixel individually. Right now, the source of slowness comes about from my unoptimized polygon filler/clipper. However, I know some really good ways to improve it! :) I'd just like to say, many thanks to Lionel Debroux for extgraph and GCC4TI! X3D wouldn't be possible without them!
Creator of X3D, a 3D portal rendering game engine for Nspire, 68k, and PC

Powered by EzPortal