General Pathtracing Rendering and Unity

Started by
6 comments, last by koiava 8 years, 2 months ago

Hi there,

I would like to know more about pathtracing because I would like to integrate this rendering method inside Unity but I absolutely don't know how to begin.

I would be glad to read your advices, whitepapers, code, examples, etc. or anything that might help me and have some guidelines that might show me the right direction to integrate this rendering method and pipeline.

There are some people that did this but I don't know how they did that. I have some knowledge in graphic programming but consider that I am a beginner.

Thank you very much for your help.

Advertisement

It doesn't look like unity allows you to create a different render. Unity supports compute shaders you could implement one through those, but I'm betting a path tracer isn't something you need. They're still not suited well for real time applications.

I think the biggest question here is "why are you doing wanting a path tracer?" Unity is a game engine, and does "on-line" (real-time) rendering techniques, and path tracing is an "off-line" (very much not real-time) rendering. If you're looking for the really vibrant color bleeding, you might be looking for GI lightmap baking techniques instead.

If you really want to implement a path tracer, the best starting point is implementing a raytracer in general. That's what a path tracer is built on top of.

I'm sorry about any spelling or grammar mistakes or any undue brevity, as I'm most likely typing on my phone

"Hell, there's more evidence that we are just living in a frequency wave that flows in harmonic balance creating the universe and all its existence." ~ GDchat

Huh, this guy has a semi real-time solution: http://madebyevan.com/webgl-path-tracing/ that sounds like he did it via shaders.

There are realtime path tracer that are used in some 3D tools for artists. Of course there are not suited for realtime gaming at this moment but here are some realtime pathtracing.

Concerning the motivation, the aim is simply to implement a path tracer inside Unity, this is just for fun and for learning. :)

Thank you for your comments.

Anybody with some whitepapers or examples that might lead my way ?

There's a member here that wrote a tutorial of sorts that takes you all the way to loading meshes with pathtracing: http://www.gamedev.net/blog/2031-ray-tracing-devlog/

It's a fantastic tutorial, but be forwarned: it is a LOT of math. Very rewarding and pretty when you do get it all working though. Also note, that tutorial reads from the bottom post up :P

I'm sorry about any spelling or grammar mistakes or any undue brevity, as I'm most likely typing on my phone

"Hell, there's more evidence that we are just living in a frequency wave that flows in harmonic balance creating the universe and all its existence." ~ GDchat

First of all path tracing is physically based rendering method. It simulates phisical properties of light to get photorealistic images.
In physical world light ray can defined as set of photons which starts tracing from emissive surface/volume, interacts with scene surfaces/volumes and finally hits some sensor and sensor gets some contribution. To simulate this process we have to create model for light emission, light reflection and connection to camera. This method is called light tracing. You can guess that if there is lots of invisible light sources in the scene there would be really few of tham which really contributes and we would spent lots of computational resources for nothing. So this method alone is considered harmfull.
Now what about path tracing?
Path tracing is oposite of light tracing. It starts tracing from camera, calculates intersection to nearest surface, calculates reflected/refracted direction and after some scattering events it hits light and you get final contribution of specific light path.
But there is lots of light paths which might contribute to final image...
Yes it will take into account all of them but it will take infinite time. Good thing is that within one iteration you can calculate only one portion of contribution and acumullate results of iterations to get final results. This iterative method is called "Monte Carlo Integration", which is one of the best method to solve high order Integral equations. Path tracing is representation of Rendering equation.
There is lots of things you have to now before doing something usefull, but I will suggest to start from smallpt. There is also slides which describes code line by line.

This topic is closed to new replies.

Advertisement