? Realistic Raytracer ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Realistic Raytracer

Submitted
Updated
Author
Simeon
Public Key
EKR432HE
Min. Compat.
All
Version
1.0
Size
7.8KB
Rating
11 votes
Description A slow, yet realistic raytracing engine that handles sphere luminance, light refractions, and reflections. Notes This is a tech demo to prove that it is possible to do, but this is also very processor heavy and as such, should be considered a benchmark instead of a program.
Categories
Keywords
18 Comment(s) Shelly Shelly https://www.youtube.com/watch?v=derarJkl0OI That's running on a 216 MHz microcontroller! The 3DS has a dual-core processor (quad-core on New3DS), and a PICA200 GPU, yet can't render anywhere near that speed. 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website except this isn't running on a 3DS it's running in an interpreter on a 3DS amihart amihart I just get a random assortment of pixels... MochaProbably MochaProbably Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies https://youtu.be/ghOnicrDT6Q TheV360 TheV360 Third Year My account is over 3 years old Website First Day Joined on the very first day of SmileBASIC Source Website Night Person I like the quiet night and sleep late. Express Yourself SmileBASIC unfortunately can't run like this. This demo is running on the 3DS's actual CPU, while SmileBASIC operations have to go through interpreters and functions and abstractions, each slowing them down a little bit. 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website That's just a silly demo anyway. The 3DS's GPU can produce much better effects at a useful speed. So, you could make something like that in SB, and it would be just as practical (as in, not at all practical) as the homebrew version. snail_ snail_ Helper Received for being very helpful around SmileBASIC Source Achievements OSP Contest 2 Contest Participant I participated in the second SmileBASIC Source OSP Contest! Night Person I like the quiet night and sleep late. Express Yourself There would be a point to this demo if it were rendering a realistic scene and not a few spheres. MochaProbably MochaProbably Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Drawing I like to draw! Hobbies So you think maybe possibly you could make this faster? NateDogg1232 NateDogg1232 Night Person I like the quiet night and sleep late. Express Yourself Avatar Taboo I didn't change my avatar for 180 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Quick thing, to edit the quality of the rendering, change STEPSZ at the beginning 12Me21 12Me21 Head Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website Why is the image so noisy? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies I've been trying to figure that out too. It isn't supposed to be like that Nathaniel generated this: Not on a 3DS, but that is what the result should look like I will update the key if I can find out what's causing the problem. Shelly Shelly This might sound dumb, but is it possible that it is due to floating-point losses? I would need to analyze the code to confirm this, but it seems likely. If so, is there any way to change it so that it uses simulated floating point math? Like the DS? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Simulated floating points I think are a bad idea, usually end up being slower But it's possible that you're correct I don't fully understand the code myself either (since it's a port) so good luck to you but if you are right then the fix is as easy as initializing the variables to 0.0 It's a little late for a response but I'll go back and look at the code, and see if I can improve performance and make the end result look better Thanks! Shelly Shelly Yeah, I agree with you that the code is likely too confusing to be changed. I also agree that simulated floating points would be slower, I just wanted to point out that it might reduce noise. Good luck! kenchic kenchic Avatar Taboo I didn't change my avatar for 180 days Website Second Year My account is over 2 years old Website Good Page Hidden Achievements this is scarily good snail_ snail_ Helper Received for being very helpful around SmileBASIC Source Achievements OSP Contest 2 Contest Participant I participated in the second SmileBASIC Source OSP Contest! Night Person I like the quiet night and sleep late. Express Yourself Raytracing* Not to be THAT guy, but raycasting is when you shoot rays into a 2D map to figure out wall distance etc. Ray TRACING is when you follow light rays backward from the camera to the scene. Regardless, nice work. Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Oh, oops, thanks! PesticidePoison PesticidePoison Good Page Hidden Achievements Spring 2017 Contest Runner Up I placed 2nd in the SmileBASIC Source Spring 2017 Contest! Programming Contest Second Year My account is over 2 years old Website Lol, I was waiting for someone to point that out. (By the way, great work Simeon)