• nGL - a fast (enough) 3D engine for the nspire 5 4
Currently:  

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

0 Members and 1 Guest are viewing this topic.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #330 on: June 05, 2014, 04:23:28 pm »
What is BLOCK_SIDE, and why does it consume 8 bits?

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 #331 on: June 05, 2014, 04:30:57 pm »
The BLOCK_WDATA type is used as block storage.
Each block can also have some additional data, e.g. the side a torch has been put on, the type of flower, orientation of a furnace, or in this case, the side a door has been put on. The 7th bit is now occupied by redstone (powering on/off).
BLOCK_SIDE is defined as
Code: [Select]
enum BLOCK_SIDE {
    BLOCK_FRONT=0,
    BLOCK_BACK,
    BLOCK_LEFT,
    BLOCK_RIGHT,
    BLOCK_TOP,
    BLOCK_BOTTOM
};

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #332 on: June 05, 2014, 05:44:12 pm »
You could half the number of bits needed by using a 3 bit number for the block side. So for doors (assuming that one bit is whether to door is open) you still have 3 bits free.

Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #333 on: June 05, 2014, 09:15:07 pm »
Couldn't you allocate 4 more bits for redstone state for each block? I don't think that would impact performance too badly.
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

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 #334 on: June 06, 2014, 02:10:58 am »
I could allocate some more, but I thought (e)ndless redstone would work better and is less annoying.
It wouldn't make it slower at all, but a second array redstone_state[SIZE][SIZE][SIZE] would make more sense and is also easier for backwards-compatibility.
But I need neither of them, the most parts are already implemented ;)

Edit: BLOCK_SIDE is 3 bits wide, but some blocks need some more bits and I'd like to have it as flexible as possible.
« Last Edit: June 06, 2014, 02:33:24 am by Vogtinator »

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 #335 on: June 06, 2014, 02:50:37 am »
For some reasons, Omnimaga search engine returns 0 results for OS 3.1 and 3.6 in this topic and I couldn't seem to figure out from the readme, so I'll ask the following question here: Will the latest version run on Ndless 3.1 or just 3.6?

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 #336 on: June 06, 2014, 03:05:23 am »
Both! Both tested, but 3.6 not regularily. The only ndless functions I use are hwtype(), isKeyPressed and fopen/fread/fwrite/fclose.

Edit: I just reseted the votes, removed lighting (doesn't work together with face-combining) and added minecarts (why not?)
« Last Edit: June 06, 2014, 06:04:24 am by Vogtinator »

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #337 on: June 06, 2014, 08:51:39 am »
Edit: I just reseted the votes, removed lighting (doesn't work together with face-combining) and added minecarts (why not?)

I thought face combining was a fast rendering mode approach only? The standard rendering method still exists and would support lighting, no?

I'll vote for caves, but my real vote is still for lighting. :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 #338 on: June 06, 2014, 08:59:23 am »
No, face-combining is always active, but I could make it optional (as well as lighting), but it's not really worth the hassle.
I mean, just for aesthethical purposes calculating multiple textures, giving each vertex a texture ptr, light computation etc. would be way to slow.
The startup time would approximately triple, if not more and the chunk geometry calculations would get slower as well, but they would cause a noticable slowdown in game, as each block change (door opened, block destroyed, redstone changed, water flows etc.) triggers a recalc of the chunk and possible the adjacent ones as well..

Offline bb010g

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 428
  • Rating: +22/-1
  • I do stuff
    • View Profile
    • elsewhere on the net
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #339 on: June 06, 2014, 10:14:37 am »
I could allocate some more, but I thought (e)ndless redstone would work better and is less annoying.
With normal redstone, though, we can port "real" redstone devices easier.
Arch Linux user
Haskell newbie | Warming up to Lua | Being dragged into C++
Calculators: HP 50g, HP 35s, Casio Prizm, TI-Nspire CX CAS, HP 28s, HP Prime, Mathematica 9 (if that counts)
π: 3.14...; l: 108; i: 105; e: 101; l+i+e: 314
THE CAKE IS A LIE IS A PIE

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 #340 on: June 06, 2014, 12:15:20 pm »
Both! Both tested, but 3.6 not regularily. The only ndless functions I use are hwtype(), isKeyPressed and fopen/fread/fwrite/fclose.

Edit: I just reseted the votes, removed lighting (doesn't work together with face-combining) and added minecarts (why not?)
ok cool to hear, because I didn't feel like upgrading to OS 3.6 yet. :P

Offline The_King

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 247
  • Rating: +6/-2
  • Ⓣⓗⓔ Ⓖⓐⓜⓔ ⓍⒹ
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #341 on: June 07, 2014, 12:50:53 am »
V.

Are u planning on adding mobs into the game at any point because that will make the game a bit more interesting

but good job
 
:D

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #342 on: June 07, 2014, 01:33:36 am »
Yeah he said mobs would be easy but they'll come later I guess.

Offline mdr1

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 303
  • Rating: +21/-2
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #343 on: June 07, 2014, 05:15:01 am »
ok cool to hear, because I didn't feel like upgrading to OS 3.6 yet. :P
Lol, you are not at all alone to do so. :p

Vogtinator, you probably forgot my question:

Why do you need bits for opened or closed doors? Can't you just make a block which is an opened door and an other one which is a closed one ?



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 #344 on: June 07, 2014, 06:14:52 am »
I could allocate some more, but I thought (e)ndless redstone would work better and is less annoying.
With normal redstone, though, we can port "real" redstone devices easier.
Just the comparator, nothing more. And I don't think you'd build really complex machinery on crafti..
Anyway, I'll post a "redstone manual" to show how it will work. If you're familiar with minecraft's redstone, this shouldn't be a problem,
the differences are small and most minecraft redstone stuff will work directly.

V.

Are u planning on adding mobs into the game at any point because that will make the game a bit more interesting

but good job
 
:D

I am, just vote for mobs in the poll at the top. But currently it seems you're lucky :)

Vogtinator, you probably forgot my question:

Why do you need bits for opened or closed doors? Can't you just make a block which is an opened door and an other one which is a closed one ?
I answered it, directly below. It wouldn't make any sense NOT to use the BLOCK_DATA bits as that's basically their purpose.
And it wouldn't solve the compatibility issues either.