Author Topic: nGL - a fast (enough) 3D engine for the nspire  (Read 265277 times)

0 Members and 1 Guest are viewing this topic.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #45 on: January 16, 2014, 03:16:47 pm »
Oh Go-Armok, that's incredible! :o

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #46 on: January 21, 2014, 03:40:11 pm »
Seriously though, "we all" want MineCraft, you have an engine that could support it, you are looking for an idea.

So, I mean, why not MineCraft ?

Of course, you probably won't make the whole game in one week, but nothing prevents you from first making a world editor where the player would be flying and would dispose of infinite blocks (kind of like the Creative mode) to place anywhere. This would already be enough for people to have fun, see how they shared their creations even if there was no goal in nCraft. And then, if you feel like it, you could add player gravity. Then if you still feel like it, you could add mobs. Etc.

Of course, I don't want to tell you what to do, but once again, people want MineCraft, you have an engine that could support it and you are looking for an idea :P
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #47 on: January 21, 2014, 03:49:12 pm »
crafti has the fundamental things (chunks, block properties etc.) already built-in, so it shouldn't be too hard to make a game out of it.
There are still some problems in nGL, though, the missing z-clipping causes some weird glitches in some situations.
When I have some time (or want to procrastinate  ;) ) I'll fix those issues (and remove buggy keypad IRQs again) and implement some block modifying stuff.
Should I go the ray-box intersection route or the color coding route?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #48 on: January 21, 2014, 03:56:50 pm »
Ray-box would be the best IMO ; since everything in Minecraft can be leveled down to a single bounding box without losing precision, it could be good to have specific code for that.
« Last Edit: January 21, 2014, 03:57:37 pm by Matrefeytontias »

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #49 on: January 21, 2014, 04:23:28 pm »
Definitely raycasting. Since everything is cubes, digital differential analysis will be perfect.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #50 on: January 21, 2014, 04:27:46 pm »
This is too specific to be in nGL ... and Minecraft with raycasting ? -___-

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #51 on: January 21, 2014, 04:46:04 pm »
Minecraft with raycasting would probably be way to slow. It would require a ray for every pixel on the screen, which would be slow. IIRC Minecraft 4K uses a technique similar to raycasting to render it's world, and it is very limited (world size of 64x64x64) and runs at a decreased resolution (856x480 pixels, but at half resolution) on a computer.
You can always try, but as polygon-based graphics and not voxel-based graphics are the current standard for 3D computer graphics, I don't think a raycasting-based voxel renderer would be feasable.

You may be able to 'cheat' a bit with polygons tough, as when rendering blocks all the faces are parallel.
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #52 on: January 21, 2014, 07:32:10 pm »
Sorry, I meant raycasting for block picking. Not for rendering. :P

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #53 on: February 15, 2014, 02:53:27 pm »
It's weekend so I had a little bit time for some improvements:
crafti 0.2 with nGL 0.4.
New features: Basic light system in crafti and z-clipping in nGL


In the screenshot it renders 80 fps at the beginning and ~100 at the end when only the 9 dirt blocks are visible.
Lighting is only supported if textures are disabled, as it would require 3 multiplications per pixel.

I guess I'll have to implement something like minecraft now ;D

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #54 on: February 15, 2014, 08:33:10 pm »
Wow, a Minecraft clone using this engine would rule! O.O How does it handle a 512x512x64 map?

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #55 on: February 15, 2014, 09:23:48 pm »
O_o just now saw this... So friggin awesome  O.O

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #56 on: February 16, 2014, 12:53:02 am »
I noticed the edges of the polygons were shimmering. Is that because you are using integer coordinates for drawing?

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #57 on: February 16, 2014, 08:25:07 am »
I'm using fixed-point (1/256 accuracy) so it could be.
But I assume the things you saw were caused by a mixture of my .gif recorder and normal aliasing.

Edit:
Quote
Wow, a Minecraft clone using this engine would rule!  How does it handle a 512x512x64 map?
Not at all, I tried it. 16*16 chunks of 16*16*16 blocks = 1 FPS...

4*4 chunks is the maximum usable size (~8fps), too many triangles
« Last Edit: February 16, 2014, 08:33:54 am by Vogtinator »

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #58 on: February 16, 2014, 10:14:46 am »
I'm using fixed-point (1/256 accuracy) so it could be.
But I assume the things you saw were caused by a mixture of my .gif recorder and normal aliasing.

Edit:
Quote
Wow, a Minecraft clone using this engine would rule!  How does it handle a 512x512x64 map?
Not at all, I tried it. 16*16 chunks of 16*16*16 blocks = 1 FPS...

4*4 chunks is the maximum usable size (~8fps), too many triangles
How do you render them? If you render every block individually, you waste a lot of time drawing invisible parts. Even a computer can't handle this. You need to generate meshes which contain only the sides of the block  that are exposed to air (or to any non-solid block if you include any). Then you should notice a huge performance increase. (The real minecraft does this)
If you already do this, then you may want to look into other ways of hidden surface removal. I think you mentionned earlier that you use a Z-buffer? For a world made out of blocks, this isn't really nessicary, as they are very easy to Z-order. If you plan on including mobs as well, it gets a little  bit harder, but it should be possible as well. This should also increase the performance because it cuts down on per-pixel operations. (The real minecraft doesn't do this, but on a computer, you have graphics hardware that is designed to do per-pixel calculations efficiently, which the nspire doesn't have)
If you already do both of them, then I'm out of ideas to increase the performance.
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #59 on: February 16, 2014, 10:52:48 am »
Aw too bad it runs much slower with 16x16x16. Does it mean a Minecraft clone using this would actually be slower than nCraft?