Sign in to follow this  

General Pathtracing Rendering and Unity

This topic is 668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Edited by fire67

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. :)

Share this post


Link to post
Share on other sites

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

Edited by CulDeChu

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this