Raytrace Core Image (Composition by gtoledo3)

Author: gtoledo3
License: Creative Commons Attribution-NonCommercial
Date: 2012.11.11
Compatibility: 10.5, 10.6, 10.7, 10.8
Categories:
Required plugins:
(none)

Nothing super fancy, but a raytracer working in core image.

I'd been thinking about doing this for awhile, from being interested in the way core image always has a dedicated image output without having to render to screen/texture to do something with the result.

It's a little bit of a pain because of typically used functions and working styles not being supported, but it works if you stay within the boundaries. It seems a little slower than GLSL. Less substantial/2D oriented fragment shaders tend to perform better when transferred, seemingly.

cybero's picture
Re: Raytrace Core Image (Composition by gtoledo3)

That is neatly done , exposing the kernel to smoothed audio input works nicely; the sky float is definitely worthy of close examination.

gtoledo3's picture
Re: Raytrace Core Image (Composition by gtoledo3)

Cool...and yep, the depth equation at the beginning can have lines commented out/in to tweak the objects that are appearing in the scene.

In glsl, you can pass a time value to the function with no problem, so it's possible to make the spheres climb up the cylinders. Here there's just a "dud" call to time to keep the compiler from screaming if someone uncomments the lines that call time or "d". :)

gtoledo3's picture
Re: Raytrace Core Image (Composition by gtoledo3)

This shows how to use core image's available ternary operation instead of if/else, which isn't allowed core image kernel language. Not anything that challenging, but it shows how to retrofit a decent amount of glsl code.

I've done this more for the sake of curiosity and comparison. I don't think it seems to perform as well as glsl, even though it's supposed to deliver optimized code during compilation by not allowing if/then/else.

PreviewAttachmentSize
blob ball raytrace.qtz8.33 KB

dust's picture
Re: Raytrace Core Image (Composition by gtoledo3)

im getting 60fps on the blob ray patch. pretty cool