by s_gourichon · 2y ago · 0 comments
* colored spheres (like you did)
* (one) checkerboard surface
* self-shadowing (like you did)
* cast shadows (like you did)
* partial or total specular reflection!
See https://www.cpc-power.com/index.php?page=detail&num=19283
The webpage displays the color (left) and green (right) versions on hovering your pointer over the ribbon (above). Image 1 and 2 are okay in both cases, image 3 is clearly tuned for color screen, image 4 for green screen.
Or direct links to the relevant variants:
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
https://www.cpc-power.com/extra_lire_fichier.php?extra=cpcol...
Well, you impressed me (and others) with your simple bet that "hey, what if I simply choose the two most popular colors" and just code that in simple BASIC. The same could be done with the shading. It would probably pick a good compromise when bright yellow meets dark red: by choosing to have the few should-be-red pixels become yellow, you avoid a bigger obviously-square-grid-based clash of colors.
Next step: error diffusion dithering would IMHO be a good bet. But maybe that becomes really to much for Basic.
I've been considering doing Raytracing on the Amstrad CPC, but in C. Perhaps using integers only, for speed.
Done that instead: https://cpcitor.itch.io/just-get-9
Hey, found this https://bbcmic.ro/?t=9ctpk via "BBC BASIC raytracer in 432 characters (mastodon.me.uk)" https://news.ycombinator.com/item?id=39023056#39023768