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

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

0 Members and 1 Guest are viewing this topic.

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 #270 on: May 10, 2014, 06:10:07 pm »
A solution would be to make nGL support true monochrome rendering and convert textures to monochrome before needing them.

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 #271 on: May 10, 2014, 06:13:35 pm »
nGL doesn't care about colors or such things, it just sets every COLOR on screen to a COLOR in a TEXTURE.
4-bit doesn't work in C and if I use 16 bit I wouldn't even have to change the definition of COLOR as uint16_t.

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 #272 on: May 10, 2014, 06:17:18 pm »
Oh OK thanks for the info.

Offline GinDiamond

  • LV3 Member (Next: 100)
  • ***
  • Posts: 71
  • Rating: +2/-2
  • I dont always fail at life, but when I do, I dont
    • View Profile
Re: nGL - a fast (enough) 3D engine for the nspire
« Reply #273 on: May 11, 2014, 01:30:18 pm »
How close would redstone/related stuff be?

Or even lighting?

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 #274 on: May 11, 2014, 01:32:54 pm »
If you mean progress: I didn't even begin. I will when I have time, motivation and some other projects finished.

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 #275 on: May 13, 2014, 01:39:26 pm »
Just a quick question: How much could I increase startup time?
In v1.0 I'll implement some more optimizations, but it'll result in a slower start.

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 #276 on: May 13, 2014, 01:44:08 pm »
A slow start doesn't bother me since it'll improve the game overall.

What about being able to interrupt startup and emergency quit ?

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 #277 on: May 13, 2014, 01:45:55 pm »
That'd be possible by either writing some asynchronous worker functions, which is a total mess or keyboard interrupts which I never got to work.

So, not until I find a solution for keyboard IRQs.

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 #278 on: May 13, 2014, 02:17:48 pm »
I was more thinking of putting key detects in the loops that precompute datas - the ones that occur when we see the "Crafti" title screen, that way you can detect emergency-quit.

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 #279 on: May 13, 2014, 02:20:25 pm »
Most of the time it's doing a fread call, so hardly interruptible. But I'll insert a isKeyPressed(KEY_NSPIRE_ESC) in the middle somewhere.
Probably when "Loading" is shown first.

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 #280 on: May 13, 2014, 02:25:51 pm »
Voginator, you should do coroutines based calculations. FOr HBE for instance all subroutines give the hand to another routine, even if they didn't reached their goal.

For your case, you could do something like this

Code: [Select]
LOOP
  Calculate a batch of things
  Draw
  Key update (the order of the actions doen't mind)
ENDLOOP
for the batch calculations, you could track the index or the loop counter.

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 #281 on: May 13, 2014, 02:58:20 pm »
That's called game/render-loop and I'm using that already, combined with a state-machine.
But for cleanup, for instance, I'd need to return some value to inform the whole call stack up to main that the user requested a termination.
(I dislike atexit and there may be some problems with bFLT..).
Also, most are some calls to drawTexture, newTexture, loadTexture, resizeTexture and I don't want to just throw some if(!isKeyPressed) in there. Also the key press detection itself would take longer than the rest of the loop body.
A interrupt would be the most clean solution, but I'll not implement anything more than some additional isKeyPressed in between until I found a solution for keypad interrupt handler crashing occasionally.

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 #282 on: May 17, 2014, 06:21:26 am »
Wow ! Those are good improvements! :o

Nonetheless, the game... laggs. Why does it lagg more with water and lava?

Feature requests:
  • Be able to open the menu or quit the game even when there is the "loading" label.
  • Move on the items selector menu with the touchpad.

I think the priority is the speed up all the "loading" during the game.

Quote
Just a quick question: How much could I increase startup time?
In v1.0 I'll implement some more optimizations, but it'll result in a slower start.

I think the speed during the game is much more important than the startup time. I think you can grow it up to 40 seconds (currently 22 seconds) if you add a loading bar.

Thanks for your work! Do you mind if I upload it on tiplanet?



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 #283 on: May 17, 2014, 07:15:36 am »
Wow ! Those are good improvements! :o

Nonetheless, the game... laggs. Why does it lagg more with water and lava?
That's a bug I found yesterday by accident and I already fixed it ;) (Water was spreading to blocks even if there's already water)
And it will always be somewhat slower if water and lava are visible as blocks under water or lava still have to be drawn as you can dive.
(I COULD rerender the world if you're submerged, but that'd take some seconds, which would be very annoying if you're swimming just beneath the surface)
That's also the reason why I retained from natual water sources such as seas, oceans or underground lava.

Quote
Feature requests:
  • Be able to open the menu or quit the game even when there is the "loading" label.
I can insert a if(keyPressed(KEY_NSPIRE_ESC)) somewhere in the middle of the splash screen, that shouldn't be too bad.

Quote
  • Move on the items selector menu with the touchpad.
Ok, will do.

Quote
I think the priority is the speed up all the "loading" during the game.
That's terrain generation and it will probably not get much faster.. :( Unless I can find a better way to generate terrain.

Quote
Quote
Just a quick question: How much could I increase startup time?
In v1.0 I'll implement some more optimizations, but it'll result in a slower start.

I think the speed during the game is much more important than the startup time. I think you can grow it up to 40 seconds (currently 22 seconds) if you add a loading bar.
I hope I don't reach 40 seconds, but it's likely the framerate will increase by ~20-100% in some cases!

Quote
Thanks for your work! Do you mind if I upload it on tiplanet?
Not at all, if you put a link to the github release page or this thread, just so that everybody can find the latest release and source code.

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 #284 on: May 17, 2014, 07:21:39 am »
I think the priority is the speed up all the "loading" during the game.
That's terrain generation and it will probably not get much faster.. :( Unless I can find a better way to generate terrain.
Wait, that means that if I stay on a "region" where everything is already generated, I don't have that loading anymore ?
Maybe you could add an option or something to waste 1 minute of time generating a "huge" map to save time later by not generating anything anymore ?
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