Advertisement

Real Time CPU Path Tracing

Started by March 23, 2020 11:50 AM
3 comments, last by Turbo14 4 years, 8 months ago

Working on a path tracer… right now it has a variable sample rate per pixel since where ever the light hits is transformed to screen space and that pixel is sampled… each light ray bounces 20 times before another primary light ray is cast. I made a video using a 2 core cpu with 4 threads. Currently there are 3 worker processes that actually calculate the light bounces and 1 process does the image composition and blurring.

It's made using local udp networking to communicate through the different processes since unity doesn't allow using their components on multiple threads so it should scale pretty well with more cores.

This was made with unity btw.

I made a ray tracer about a year ago that had GI and ambient occlusion and had no noise since the light rays weren't randomized but I kinda need randomized rays in this case to make sure the screen is evenly rendered, it wasn't scalable to multiple cores and was kinda slow. This one can have the performance adjusted to the user's liking.

This has about 17 active light rays. But they are variable bases on current performance. It's render resolution is 192x108.

Anyways, enjoy.

Oops Accidentally posted in wrong form… maybe I can get someone to move it to graphics programming?

Edit uploaded new vid… rendering at 384x216

New screen at 256x144, can get almost the whole screen to update per frame at this resolution. I guess what I'm doing is more photon mapping than path tracing though. I also should of mentioned that it's a progressive renderer. Doesn't take that long to get decent looking render while looking at the same thing though.

I know it's pretty basic right now with just diffuse lighting with gi and ao but I'll be adding more advanced features soon. I Hope to have all types of surface properties implemented.

Advertisement

Here's a 1024x576 shot… took about a minute to get the final image. It was running at about 60 fps, but since it's a progressive renderer it doesn't do a full image per frame… what's more important here is the pixels per second, which was about 700k for this render. Lower res renders do more pixels a sec, I'm guessing since the program has to randomly access a smaller screen buffer.

Previous renders were kinda dark, here's a brightened one. Looks a little grainy due to higher contrast. The bilinear filter darkens the image so I had to multiply the colors after the blur.

This topic is closed to new replies.

Advertisement