JamesD Posted October 6, 2021 Share Posted October 6, 2021 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...). 2 Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 7, 2021 Author Share Posted October 7, 2021 I'll take the lack of responses as a no. Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted October 8, 2021 Share Posted October 8, 2021 LOL Look in the TI-99 dev sub for some work which is being done on the TI for raycasting. Technically not 8-bit but it is 8-bit enough, and not technically ray tracing but some optimism for the future. 1 Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 Raycasting and raytracing aren't the same thing, but I'm okay with talking about either one. I know a lot has been done with raycasting on several machines, but I hadn't seen the TI stuff yet. 1 Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 Pretty sure this is an optimized version of what I based my code on. 1 Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 I altered the palette since I stopped trying to match the C64 image many changes ago. Looks a lot better. 1 Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 Just an FYI, the shadow is the same color as my first image. It just looks darker because I switched the light grey to white. 1 Quote Link to comment Share on other sites More sharing options...
DragonGrafx-16 Posted October 9, 2021 Share Posted October 9, 2021 1 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted October 9, 2021 Share Posted October 9, 2021 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? Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 (edited) 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 October 9, 2021 by JamesD Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 8 hours ago, DragonGrafx-16 said: That's pretty impressive for 1MHz. Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted October 9, 2021 Share Posted October 9, 2021 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. 1 Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted October 9, 2021 Share Posted October 9, 2021 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. Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 9, 2021 Author Share Posted October 9, 2021 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 1 Quote Link to comment Share on other sites More sharing options...
Classic Pac Posted October 10, 2021 Share Posted October 10, 2021 I just think this is amazing Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 11, 2021 Author Share Posted October 11, 2021 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. Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted October 11, 2021 Share Posted October 11, 2021 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. Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 11, 2021 Author Share Posted October 11, 2021 (edited) 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 October 11, 2021 by JamesD Quote Link to comment Share on other sites More sharing options...
JamesD Posted October 13, 2021 Author Share Posted October 13, 2021 Ugh... working on an Apple II port but there are some differences in it's BASIC Quote Link to comment Share on other sites More sharing options...
Iamgroot Posted October 22, 2021 Share Posted October 22, 2021 An FYI, There is a machine language demo of ray-tracing for the Apple II on Asimov. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.