[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I wrote a program that loads an SVG, treats the paths like pieces

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 5

File: sketchy.jpg (2MB, 2844x1600px) Image search: [Google]
sketchy.jpg
2MB, 2844x1600px
I wrote a program that loads an SVG, treats the paths like pieces of glass, and then simulates visible photon transport through the glass.

The results came out quite nice, so I thought I'd share them.

(1 million photons, 6 CPU hours)
>>
File: bg_color.jpg (2MB, 2844x1600px) Image search: [Google]
bg_color.jpg
2MB, 2844x1600px
The source code is available here: https://github.com/cjosey/svg_ray

It's tricky to set up, convoluted to use, and probably coded horribly. It also doesn't support a lot of SVG features yet, and I've only tested it on a few files. The readme lists off the features I know are unsupported.

On the bright side, the code parallelizes very well, at the cost of RAM and disk space.

(1 million photons, 7 CPU hours)
>>
File: bg2.jpg (954KB, 2844x1600px) Image search: [Google]
bg2.jpg
954KB, 2844x1600px
The colors are partially artificial. The photon spectrum in each pixel is weighted by a function based on the path color in the original image. If color tints are disabled, you can see some (in this case, minor) prism effects.

(4 million photons, 30 CPU hours)
>>
File: owari.jpg (3MB, 3440x1440px) Image search: [Google]
owari.jpg
3MB, 3440x1440px
The resulting images are quite huge unfortunately. There's a lot of statistical noise in the image, so it compresses poorly.

Also, this is pretty much all the SVGs I could find in the /w/ archive the code supports. I'll try to add some more support if I get time.

(900 thousand photons, 34 CPU hours)
>>
>>1956670
Interesting. Reminds me of https://benedikt-bitterli.me/tantalum/
Is this similar?
>>
This is pretty cool. Nice work OP.
>>
>>1956678
It was what inspired me to write this. The main differences are that his uses the GPU so is far faster, mine is less restrictive on geometry, and I use slightly more accurate reflection physics.
>>
What language, by chance did you code it in?,
>>
>>1956811
He posted his code (https://github.com/cjosey/svg_ray). It's 100% Julia.
>>
sorry im not that good in programming could someone explain this to me and also tell me how to use this??
>>
I'm going to try to add clipping paths and shapes soon, which will basically complete the SVG feature set. I think I finally figured out a way to do clipping paths that wouldn't kill performance. Once that's done, I'll finally have a few more images to post.

I also added an installation guide for Windows (I was surprised it worked at all) here: https://github.com/cjosey/svg_ray/blob/master/INSTALL.md . It also has a really basic theory section, that I intend to expand on.
>>
File: ayano.jpg (2MB, 3840x2160px) Image search: [Google]
ayano.jpg
2MB, 3840x2160px
After an absurd amount of CPU time (1000 CPU hours on a small cluster), I finally rendered another.

I really need to add GPU acceleration.
>>
It's really cool
Nice work op
I'll be sure to check out when I get home
>>
Great stuff OP. What CPU are you using to render these?
>>
>>1959771
The first 4 are rendered on my desktop, an i5-3570k. The last one was rendered on a 20 node cluster with dual Xeon E5420s per node.

I'm trying to figure out a way to make it take less time, but the options really are moving it to GPU or solving a much harder problem (calculate the bounding surface so that an image consists of one cell).
Thread posts: 15
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.