You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

[C] CE Raymarching

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/PC, Mac & Vintage Computers publicado por u/Snektron March 15, 2016, 09:39:11 PM
So i while ago i wanted to try out CE C programming. Since the CE has float support and a color screen i made a little ray marcher :)





You can view the source too:
https://github.com/Snektron/CERM
I recommend trying this out on an emulator, since it takes quite a while to generate an image.
The attached file is one made for an emulator. Since CE will freeze if it exits a program at maximum speed i've put a while(1); loop
so it doesnt quit in the program, but if you want to run it on an actual calculator you wil have to remove it and build it yourself :P
Inicia sesión o crea una cuenta para dejar un comentario
u/Dream of Omnimaga March 15, 2016, 09:49:20 PM
This looks cool. I wonder how long does it take to generate the image? Also why is the floor in the 2nd screenshot glitchy? Also can't you slow down the calculator before exiting to prevent crashes?

Anyway, I am curious about if this could be of any use if the quality was decreased considerably to save speed. It's definitively looking cool.
u/Dudeman313 March 15, 2016, 09:56:08 PM
Yes, it is pretty fancy. If you decreased the quality, I bet you could still make a pretty cool rotating Earth model.
u/Snektron March 15, 2016, 10:06:09 PM
On 100% speed it takes more than 10m to draw the model i think, so real time will be pretty impossible.
Quote from: DJ Omnimaga on March 15, 2016, 09:49:20 PM
This looks cool. I wonder how long does it take to generate the image? Also why is the floor in the 2nd screenshot glitchy? Also can't you slow down the calculator before exiting to prevent crashes?
The floor is glitchy because it doesnt have a high number of iterations. The calculator speed is set by the user, but i thought nobody wants to wait 15 min for an image :P
u/Dream of Omnimaga March 15, 2016, 10:17:52 PM
Aah ok. I was wondering since the sphere looked perfect while the floor didn't look as good.

You should try doing polygon 3D or even mode 7 stuff. Maybe even raycasting, since those would be more than fast enough on that calculator, especially in low color mode. :) @tr1p1ea once made a mode-7 engine for the CSE

u/Adriweb March 16, 2016, 01:43:01 AM
I made your program much faster (well, it's still slow, but...) by macro'ing stuff :)
PR on GitHub: https://github.com/Snektron/CERM/pull/1

(If you have a TI-Planet account, you can open the project in the online builder - maybe one day I'll have it directly linked to GitHub...)
Last Edit: March 16, 2016, 01:51:41 AM by Adriweb
u/Dudeman313 March 16, 2016, 01:50:54 AM
Did you also remove the loop, so I can try it on my CE?
I would do it myself, but I can't because I'm afraid I'd do something terribly wrong by mistake, and I'm on my Nokia E63.
u/Adriweb March 16, 2016, 01:51:33 AM
Well, I realized I made a mistake, I'm fixing it for now.
The infinite loop is still there, I'll attach a version without it.

Edit: there
Last Edit: March 16, 2016, 01:57:15 AM by Adriweb
u/Dream of Omnimaga March 16, 2016, 02:10:47 AM
Now I see what Cumred meant about being too slow to be of practical use O.O (I have CEmu set at 500% speed and it takes like 4 seconds to render one column of pixels using Adriweb's faster version. O.O
u/Adriweb March 16, 2016, 03:03:08 AM
Oh yeah. It's still slow even unthrottled (more than 1200% for me - which makes it like around 0.5s for one line)

Edit: err, I meant 0.5s not 5s :P
Last Edit: March 16, 2016, 03:43:50 AM by Adriweb
u/Dudeman313 March 16, 2016, 03:42:19 AM
Something tells me it's a good thing I didn't try to send this to my calculator... O.O
u/Dream of Omnimaga March 16, 2016, 04:24:20 AM
By the way, how fast is it if you only use a 40x30 area of the screen then scale it up?
u/Adriweb March 16, 2016, 04:26:38 AM
Using 8bpp anyway, it'd be much faster.
And combined to smaller+zoomed... yeah it might even become acceptably fast/slow.
u/Dream of Omnimaga March 16, 2016, 04:28:44 AM
Yeah I suggested lower color depth before, even 4bpp, but wouldn't that still involve rendering 320x240 pixels? My idea was to lower the resolution to reduce how many pixels need to be computed.
u/Snektron March 16, 2016, 03:29:29 PM
Quote from: Adriweb on March 16, 2016, 01:43:01 AM
I made your program much faster (well, it's still slow, but...) by macro'ing stuff :)
PR on GitHub: https://github.com/Snektron/CERM/pull/1

(If you have a TI-Planet account, you can open the project in the online builder - maybe one day I'll have it directly linked to GitHub...)
Thanks! :)

Also the project was more to test the color capabillities of the CE, i could probably make something that runs way faster but i'll have to do that in another way :P
Start a Discussion

b/PC, Mac & Vintage Computers

Computer programming discussion and project showcase

132
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal