Physically Based Rendering

Started by
6 comments, last by Infinisearch 7 years, 7 months ago

So a while back on this forum I had asked if somebody could explain PBR to me, and most of the responses I got were to first implement basic lighting with diffuse & specular maps and then move on to more complex lighting. Now that I've done that I've gone through a few siggraph presentations that have helped me understand what PBR actually is. I was having trouble implementing this in my engine, but then I stumbled across this blog post: https://dirkiek.wordpress.com/2015/05/31/physically-based-rendering-and-image-based-lighting/

which explained everything quite well and included a sample to show how everything worked entirely.

However the sample used DirectXTK and since I am a beginner it was extremely confusing to understand how things worked since there were so many files to go through just to find a simple Material Struct. So far I have only written my engine with 1 header file, 1 cpp file & 1 effects file (I know I should use classes and additional header files to make the code easier to read and work with but for the time being I just want to get PBR up and running and I will then re-write everything for ease of use).

I'm not trying to ask for someone's code or to help me copy/paste code but could someone help explain how the direct lighting brdf's (forget the Image Based Lighting Part) are working in his sample?

This wouldn't have been a problem but I haven't had much experience with something like DirectXTK.

Advertisement

If you cut the extra specular and fresnel stuff out of PBR, which is a lot of the code trying to get the most realistic specular, you are left with a simple thing: metals have no diffuse term only specular. Non-metals have diffuse + specular.

And roughness is just a term for the physical surface and simply changes the directions of light bounces.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

I tried to implement what you said but I still can't get anything to work. All these papers and talks about PBR are great but I honestly need a good sample to look at to really understand and implement it. Any ideas on some resources that have samples or show how to implement PBR? I'm beginning to consider to stay with my current lighting system because of the lack of tutorials for PBR available on the internet. The one I found https://dirkiek.wordpress.com/2015/05/31/physically-based-rendering-and-image-based-lighting/ is good but uses DirectXTK which makes things a pain in the ass for a beginner.

Maybe this helps: https://www.shadertoy.com/results?query=pbr

I guess it's easier to go from OpenGL shader than from full DirectX sample

I know this sounds demanding but could someone write a tutorial for the implementation of PBR? I feel entirely lost when it comes to implementation since there are hardly any tutorials, there are a few presentations and papers but I'm not at the stage to be able to understand these equations and be able to implement this without any help.

Just as an aside (not just directed at this thread, but engine marketing in general) PBR is not a noun, it's an adjective! That means that it isn't one particular thing. It's a description that can apply to many different things.

There's different ways to describe a rendering algorithm.
e.g.
* artistic -- no rules.
* empirical -- based on observations -- such as Phong specular which is based on the observation that specular highlights appear in the reflection direction, and a power curve is a good function for changing the size of a lobe (intuition over evidence).
* theoretical -- building a model of reality and extracting some rules from that model -- such as Cook Torrance, based on microfacet theory, which will produce good result wherever the assumptions of the theory hold true (e.g. Not cloth, where you'd use microfibre theory instead).
* observational -- use something like a gonioreflectometer to gather a big table of data and then use it as a look-up-table to render from.

Then additionally:
* physically based -- is based on real evidence or tested theory, and obeys physical laws such as the conservation of energy and Helmholtz reciprocity.

Artistic/empirical techniques are not PBR. Theoretical/observational techniques *can* be PBR.

In real-time/games, we always use approximations, so to be able to argue that your game is 'PBR' you'd first have to understand PBR in general and be able to measure the difference between the true formulas and your approximated ones.
A good place to start with that is the PBRT book.

Theory is always an approximation to the real world. The you further approximate when implementing a renderer. I feel the trend that the last approximation, to get it real time, is becoming less significant.

IIRC I think this might have what you're looking for: http://www.frostbite.com/2014/11/moving-frostbite-to-pbr/

-potential energy is easily made kinetic-

This topic is closed to new replies.

Advertisement