PBR Demo

With the website now released I've gone back to a project that began with my participation in the Learning Jam over at Handmade Network.
I initially chose to learn about BRDFs but quickly found that the Micro Facet Model was the subject I was actually interested in. The micro facet model forms the basis of any physically based rendering ("PBR") scheme, nowadays common in both games and films.

The end showcase of my learnings is a renderer implemented in Shadertoy. I went that route since it's nice to have people be able to easily run the software on their own computer.

For more information, check out the project page.

Offline Shadertoy

I was not happy with my current workflow. I would much rather use my text editor of choice (4Coder Fleury) but it's a hassle to manually be copying every change to Shadertoy, as well as not really getting the benefit of recompiling on the go.

So I decided to implement my own program that does the same thing as Shadertoy but now everything is local, which means no more copy-paste. The original source file is used instead.

Screenshot of window rendering the local shader.

This setup also provides some additional benefits.

  • It allows me to use my own flavor of glsl that more closely resembles how I write things in c/c++. I use it in all my OpenGL projects, mostly for quality of life but also it allows me to implement missing features such as file inclusion.
  • Being able to implement additional functionality like time forward/rewind.
  • Being able to do offline rendering. This is a big one. I can render in any resolution with more expensive permutations of my shaders as well as batch render for video.

Cons.

  • Currently no GUI for the window itself which means I have to check the terminal output for error messages and such, which is not very effecient. Better than before but still definitely something that warrants improvement.

Shader Setup

I chose to compile and run the shader as a compute shader, mostly because I like compute shaders. The result is then drawn onto screen with the usual screen-quad approach or not drawn at all in the case of batch batch rendering.
Note that batch rendering is currently it's own program.

Future Work

The demo has come a long way and I hope to be able to finish it soon. Currently diffuse materials are tending to look metallic which I'm currently investigating.

The demo will still be published on Shadertoy and I will need to write an additional parser that converts the code.

Until next time, enjoy a turntable batch render!