BBC BASIC raytracer in 432 characters
61–70 of 96 posts
Re: BBC BASIC raytracer in 432 characters
#62The dither effect looks really neat on ray trace, then I remembered thats just your average news paper photo. Still would be cool to see it in a game.
Re: BBC BASIC raytracer in 432 characters
#63Earlier quoted context omitted.
> rem if instead y component is negative, make a checkerboard of pieces of sky I'd maybe phrase this a bit differently – in both cases it uses the v coordinate to calculate the shade but whereas the sky is a simple gradient, the plane has a "ground fog" type effect that can be adjusted with those +.3 and +.2 magic constants.
i was trying to figure out how the ground fog happens, and i still don't
Re: BBC BASIC raytracer in 432 characters
#64https://www.pouet.net/prod.php?which=78045 Incredible raytraced demo in 256 bytes.
last year i wrote a tetris in arm assembly https://asciinema.org/a/622461 and was pleased to get it down below 1024 bytes then i looked and rrrola's 4is256 https://www.pouet.net/prod.php?which=29286 is a working tetris in under 256 bytes, and it's better than mine because it has colors and scoring. i could blame a little bit of inflation on arm being 32-bit rather than 16-bit, but not 4×
Re: BBC BASIC raytracer in 432 characters
#65a thing that puzzles me is how https://bbcmic.ro/?t=9ctpk is only 4× faster in emulation (about 30 seconds per scan line and so on the order of 2 hours for the whole image) i'm running this on a ryzen 5 3500u at 2400 megahertz. the acorn electron which supposedly takes 8 hours and 40 minutes is a 1 megahertz 6502 when running from ram, roughly, 262144 instructions per second. at 2 ipc one core of the ryzen should be…
The Firefox profiler suggests it's spending most of its time doing nothing, waiting for the next Window.requestAnimationFrame.
Re: BBC BASIC raytracer in 432 characters
#66Earlier quoted context omitted.
all the basics i used on processors that slow were surprisingly inefficient, even for an interpreted languages i thought they had to be, running on processors with that little memory. though later on i learned about forth, which is surprisingly efficient for an interpreted language a more likely explanation is that sophie wilson was just a better hacker than bill gates and paul allen
Yeah, BBC BASIC is really good. Both the language design and the implementation. I loved it at the time, and the more I think back on it the more impressed I am. Like it had a very decent suite of floating-point routines, which if I remember right were very performant. In a 32KB ROM!
Re: BBC BASIC raytracer in 432 characters
#67In something like python, an analogous thing is turtle graphics. Is there something more similar (but still very basic) in python for something like this? A mini graphical language?
Re: BBC BASIC raytracer in 432 characters
#68This is interesting and serves as a potential "hook" for getting people interested in coding. I understand the BASIC appeal! In something like python, an analogous thing is turtle graphics. Is there something more similar (but still very basic) in python for something like this? A mini graphical language?
Re: BBC BASIC raytracer in 432 characters
#69In 398 characters, I can give it error diffusion dithering capabilities, which makes the code smaller and the output quality a bit better: https://bbcmic.ro/#%7B%22v%22%3A1%2C%22program%22%3A%22MODE1... It would look even better with bidirectional error diffusion, but that requires reading back memory which I don't know how to do.
https://chat.openai.com/share/6e754fa1-531d-432e-a767-8c8132...
Re: BBC BASIC raytracer in 432 characters
#70Earlier quoted context omitted.
last year i wrote a tetris in arm assembly https://asciinema.org/a/622461 and was pleased to get it down below 1024 bytes then i looked and rrrola's 4is256 https://www.pouet.net/prod.php?which=29286 is a working tetris in under 256 bytes, and it's better than mine because it has colors and scoring. i could blame a little bit of inflation on arm being 32-bit rather than 16-bit, but not 4×
The upper limit of instruction density on x86 is much higher than any RISC.