Jump to content
IGNORED

Raytracing on 8 bits


JamesD

Recommended Posts

Just curious how many people have played with raytracing on 8 bit computers.

The original code was from the C64, and I know someone ported it to the Plus/4, but I haven't seen it on other machines.
This is on the TRS-80 CoCo 3.  I added the separate sky and shadow colors, as well as sped up the BASIC code quite a bit (hardware multiply patch, defined common variables at the top, put constants in variables, etc...).
unknown.png

  • Like 2
Link to comment
Share on other sites

11 hours ago, JamesD said:

Pretty sure this is an optimized version of what I based my code on.

40MHz?  I am guessing either in emulation or on a SuperCPU (20MHz, though, right?)  Holy cow.  Now yours is running emulation at 209MHz, or am I reading that incorrectly?

Link to comment
Share on other sites

52 minutes ago, OLD CS1 said:

40MHz?  I am guessing either in emulation or on a SuperCPU (20MHz, though, right?)  Holy cow.  Now yours is running emulation at 209MHz, or am I reading that incorrectly?

Not sure if the C64 is emulation or a hacked supercpu.  I'd guess the former as I'm not sure the actual hardware will go that fast.
The original code said it took about 30 hours on a C64.

I set the CoCo 3 emulation to 209MHz, but the amount of time it takes clearly isn't fast enough for what it says.
It should take under 13 hours on the CoCo 3 at it's 1.77MHz speed + my math hardware multiply patch, but I haven't finished timing it.
At 209MHz it should take under 8 minutes, but it's closer to 30 minutes.  Maybe my 3900X isn't fast enough or it's a bug?

Raytracing takes a long time so it's better to run under emulation till you are ready for a final image.

Edited by JamesD
Link to comment
Share on other sites

2 hours ago, JamesD said:

That's pretty impressive for 1MHz.

Even better, it switches the 128 into 2MHz mode "in the border," which I assume he means during the vertical blank.  Combined with some other features of the 128 -- relocatable 0-page and the upper 64k memory -- it runs 160% faster than on C64 (1MHz) hardware.

  • Like 1
Link to comment
Share on other sites

10 minutes ago, OLD CS1 said:

Yeah, I claim responsibility for dragging this away from ray tracing.  I do, however, hope to see someone take up the mantle on the TI.  We have some talented programmers over there who I think could make a go of it.

I'm fine with it

  • Like 1
Link to comment
Share on other sites

FWIW, I think the C64 version is only grey & black due to the color clash that would happen otherwise.
The Plus/4 version was basically the same, and would have the same issue even if it has a larger color palette.
I may port this to the Apple II.  It would only be black, white, and blue with the original pattern for the shadow. 
Maybe I could just make the pattern on the white, I'll have to modify the code a little for that.

Link to comment
Share on other sites

1 hour ago, OLD CS1 said:

Does compiled BASIC exist in the CoCo world?  I am sure it cannot reach the 209MHz speed of the emulator, but it should be far faster than vanilla BASIC.

There are several BASIC compilers, I'd have to see which ones supported the CoCo 3. 

I started working on an Apple II version but there is at least one significant difference in it's BASIC I'll have to figure a way around.  It only impacts a few lines of code, but that's all it takes.

 

*edit*
Since the bulk of the time is spent in math, I'm not sure how much of a speedup compiling it will offer.
 

Edited by JamesD
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...