ssloy / tinyraytracer

A brief computer graphics / rendering course
https://github.com/ssloy/tinyraytracer/wiki
5k stars 333 forks source link

Tinyraytracer on ESP32 #7

Open tobozo opened 5 years ago

tobozo commented 5 years ago

Hello and thanks for this génialissime project 👍

Just to let you know I tried your code on ESP32 and it worked just fine with very little modification. The ESP32 doesn't have that much ram so I applied a direct TFT rendering approach instead of using the framebuffer.

https://github.com/tobozo/ESP32-Raytracer

manthrax commented 5 years ago

Rad! Pocket RayTracer! How long to render a frame on the TFT?! I would legit love to have a keychain device that raytraces :D

ssloy commented 5 years ago

Wow, that's very cool, thank you!

tobozo commented 5 years ago

I'll add a timer to the code when back from work, but it takes about 20 seconds to render.

It's far from being able to render an amiga boing ball animation in real time, but still impressive for a 240MHz MCU :-)

ssloy commented 5 years ago

ESP + OLED, binary image with simple test if the color is >128.

1.5s for the 64 x 128 screen size.

tobozo commented 5 years ago

looks like a LoRa Heltec build ^_^

interesting how that ssd1306 seems to have burn traces from its usual duty, I always thought this would never happen on OLEDs.

do you have an estimation of its total uptime ? I haven't observed this yet but I guess it's time to add dimming to my own ssd1306 projects

ssloy commented 5 years ago

3 weeks of constant uptime. Now with dithering :)

tobozo commented 5 years ago

I wish this OLED was capable of doing stable grayscales

tobozo commented 5 years ago

*currently testing multiple image rendering to sdcard as jpeg data, I've modified this jpeg library so it uses the psram

the ambition behind this is obviously to play a pre-rendered animation although I'm not sure yet jpeg is the right choice to achieve a fast frame rate when playing later (GIF compression is less efficient but supports transparency+partial writes)

tobozo commented 5 years ago

Dimensions: 128x64 Rendering time: ~3s per frame Frames: 60

bouncing-60 frames 128x64

Youtube link

ssloy commented 5 years ago

Fantastic. Can't wait for my display to arrive :)

tobozo commented 5 years ago

getting closer to the Amiga Boing ball sphere material, playing a 2D animation over it just because ...

https://youtu.be/yg1FgM8eU6U

ssloy commented 5 years ago

Awesome!

tobozo commented 5 years ago

I'll just put this here as it somehow seems relevant :rofl:

image

Source: https://twitter.com/txsector/status/1119280135922827264