A Graphics Guy's Note
/posts/
Recent content in Posts on A Graphics Guy's NoteHugo -- gohugo.ioenFri, 13 Nov 2020 00:00:00 -0800Practical Tips for Implementing Subsurface Scattering in a Ray Tracer
/posts/practical_tips_for_implementing_subsurface_scattering_in_a_ray_tracer/
Fri, 13 Nov 2020 00:00:00 -0800/posts/practical_tips_for_implementing_subsurface_scattering_in_a_ray_tracer/Subsurface scattering has always been a challenge in computer graphics. Even in offline rendering, some of the common practical solutions are nowhere near unbiased. In certain algorithms, there are some pretty aggressive assumptions made to make things under control. However, despite the complexity in subsurface scattering algorithms, it is by no means a feature that can be missing from a practical rendering engine. Major commercial renderers, like Arnold, Cinema 4D, etc, all have very sophisticated and solid implementation of SSS.Basic Color Science For Graphics Engineer
/posts/basic_color_science_for_graphcis_engineer/
Thu, 29 Nov 2018 00:00:00 -0800/posts/basic_color_science_for_graphcis_engineer/For more than a decade, we have been doing HDR rendering in our game engines, which means the intermediate render targets won’t be limited by the precision of the color formats. It is an even more important concept after the emerging of physically based rendering, which is almost what everyone does these days. However, after so much effort rendering everything in linear color space, it is quite wasteful that we can only display colors with only limited chromaticity and luminance defined by sRGB space due to limitations of LDR monitor and TVs.Sampling Anisotropic Microfacet BRDF
/posts/sample_anisotropic_microfacet_brdf/
Wed, 18 Jul 2018 00:00:00 -0700/posts/sample_anisotropic_microfacet_brdf/I am working on material system in my renderer recently. My old implementation of microfacet models only supports isotropic BRDF, as a result of which, it can’t render something like brushed metals in my renderer. After spending three days in my spare time to extend the system to support anisotropic microfacet BRDF, I easily noticed how much mathematics that it needs to understand all the importance sampling methods. The fact that $ \theta $ and $ \phi $ are somewhat correlated makes the importance sampling a lot more complex than isotropic model.How does PBRT verify BXDF
/posts/how_does_pbrt_verify_bxdf/
Fri, 09 Mar 2018 00:00:00 -0800/posts/how_does_pbrt_verify_bxdf/Unit test for BXDF in offline rendering turns out to be way more important than what I thought it would be. I still remember it took me quite a long time when I debugged my bi-directional path tracing algorithm before I noticed there was a little BXDF bug, which easily led to some divergence between BDPT and path tracing. Life will be much easier if we could find any potential BXDF problem at the very beginning.Volume Rendering in Offline Renderer
/posts/volume_rendering_in_offline_renderer/
Thu, 10 Nov 2016 00:00:00 -0800/posts/volume_rendering_in_offline_renderer/Finally, I have some time reading books, spending several days digesting the volume rendering part of PBRT, there are loads of stuff that interest me. Instead of repeating the theory in it, I decided to put some key points in my blog with some brief introduction and then provide some derivations which are not mentioned in the book.
.row {
display: -ms-flexbox; display: flex;
-ms-flex-wrap: wrap; flex-wrap: wrap;
padding: 0 4px;
}
.Image Based Lighting in Offline and Real-time Rendering
/posts/image_based_lighting_in_offline_and_realtime_rendering/
Wed, 07 Sep 2016 00:00:00 -0700/posts/image_based_lighting_in_offline_and_realtime_rendering/Image-based lighting is a practical way to enhance the visual quality of computer graphics. I used to be confused by it until I read the book “High Dynamic Range Imaging”, which provides a very clear explanation about IBL. And I actually have implemented the algorithm in my offline renderer before, it was just that I didn’t know it is IBL. The book PBRT has some materials talking about it without explicitly mentioning the term.Instant Radiosity in my Renderer
/posts/instant_radiosity_in_my_renderer/
Mon, 08 Feb 2016 00:00:00 -0800/posts/instant_radiosity_in_my_renderer/I read about this instant radiosity algorithm in the book physically based rendering 3rd these days. It is mentioned as instant global illumination though, they are actually the same thing. I thought it should be a good algorithm until I have implemented in renderer, I’m afraid that it is not quite an efficient one. Although it is also unbiased like path tracing and bidirectional path tracing, the convergence speed is just terribly low comparing with the others.The Missing Primary Ray PDF in Path Tracing
/posts/the_missing_primary_ray_pdf_in_path_tracing/
Thu, 04 Feb 2016 00:00:00 -0800/posts/the_missing_primary_ray_pdf_in_path_tracing/I was always wondering why don’t we take the PDF of primary ray into account in a path tracer. Sadly there aren’t many resources available explaining it. I guess the book Physically based rendering 3rd will provide some explanation, however it is not released yet. After some searching on the internet, I finally got something to explain it. It actually gets cancelled with the terms in importance function and LTE. It gets cancelled in a very elegant way that we don’t need to put any resources on it at all, which is why many open-source ray tracer don’t consider it in the first place.Practical implementation of MIS in Bidirectional Path Tracing
/posts/practical_implementation_of_mis_in_bidirectional_path_tracing/
Sat, 16 Jan 2016 00:00:00 -0800/posts/practical_implementation_of_mis_in_bidirectional_path_tracing/In my previous post, I talked some basic stuff about naive bidirectional path tracing. However it is hard to show any real value since there are always too much noise comparing with best solutions depending on the scene to be rendered. That is because the contribution of each specific path is not properly weighted. And multiple importance sampling can be the key to the issue, the following comparison shows big difference between different methods.Naive Bidirectional Path Tracing
/posts/naive_bidirectional_path_tracing/
Sun, 03 Jan 2016 00:00:00 -0800/posts/naive_bidirectional_path_tracing/I posted a blog about path tracing some time ago, I didn’t regard it as a simple algorithm until I got my hands dirty on bidirectional path tracing. It really took me quite a while to get everything hooked up. Getting BDPT (short for bidirectional path tracing) converging to the same result with path tracing is far from a trivial task, any tiny bug hidden in the renderer will drag you into a nightmare.Physically Based Shading in Games
/posts/physically_based_shading_in_games/
Sat, 05 Dec 2015 00:00:00 -0800/posts/physically_based_shading_in_games/Physically based shading has been around for years, it not only eases the workflow for artist, but also delivers high quality shading with neglectable overhead, I see no reason to avoid it in today’s game. Here is an image taken from UE4 document.
When the term first came out, I was totally no idea what this new stuff is. And it took me quite a while to get some basic idea on it because there are so many materials and some of them are a little confusing.Glass Material Simulated by Microfacet BXDF
/posts/glass_material_simulated_by_microfacet_bxdf/
Wed, 11 Nov 2015 00:00:00 -0800/posts/glass_material_simulated_by_microfacet_bxdf/Microfacet model can not only be used for rough metal, it can also be used to simulate rough glass material. This blog is about rendering glass material with microfacet model. Basically all of the theory comes from this paper. Different from the pure refraction model mentioned in my previous blog, the bxdf mentioned here can also refract a single incident ray into multiple directions instead of just one.
The above image is generated with my renderer.Sampling Microfacet BRDF
/posts/sample_microfacet_brdf/
Sun, 01 Nov 2015 00:00:00 -0700/posts/sample_microfacet_brdf/I’m working on microfacet brdf model for my renderer these days, noticing that it is more than necessary to provide a separate sampling method for microfacet brdf instead of using the default one, which is usually used for diffuse like surfaces and highly inefficient for brdf with spiky shape, such as mirror like surfaces. The following image is one generated by the default sampling method:
The left monkey has pure reflection brdf which is mentioned in my previous blog post, the right one uses the microfacet model with zero as roughness value.Derivation of pure Specular Reflection BRDF
/posts/derivation_of_pure_specular_reflection_brdf/
Thu, 22 Oct 2015 00:00:00 -0700/posts/derivation_of_pure_specular_reflection_brdf/The book “Physically Based Rendering” already explains it, however I found it a little bit confusing the first time I read the chapters, which are chapters 8.2.2/8.2.3. And I also saw that there is one error of this chapter mentioned by Jérémy Riviere in the errata page. Although he provides a correct change on the equation however it is not clearly connected with the following context.
This is a memo for me recording the derivation of specular reflection in a more clear way.Monte Carlo Integral with Multiple Importance Sampling
/posts/monte_carlo_integral_with_multiple_importance_sampling/
Mon, 10 Aug 2015 00:00:00 -0700/posts/monte_carlo_integral_with_multiple_importance_sampling/The book physically based rendering doesn’t spend too much effort explaining MIS, however it does mention it. In order to be more familiar with MIS(Multiple Importance Sampling), I spent some time reading Veach’s thesis. The whole thesis is relatively long, however the chapter about MIS is kind of independent to the other ones. Worth taking some notes in case I forget later.
Monte Carlo Integral Monte Carlo tries to solve integral problem by random sampling.Basics about path tracing
/posts/basics_about_path_tracing/
Mon, 20 Jul 2015 00:00:00 -0700/posts/basics_about_path_tracing/I tried path tracing two years ago in my ray tracer. However without taking some notes, I’ve already forgotten almost everything about it. Recently I reviewed the theory and the code, picked up something from it. I’d like to take some notes so that I can get it immediately next time I forget it. Before everything, here is a Cornell box scene rendered with path tracing:
I really want to render something different using my ray tracer, however it doesn’t have a GUI editor so far.Directional Light Map from the Ground Up
/posts/directional_light_map_from_the_groud_up/
Wed, 24 Jun 2015 00:00:00 -0700/posts/directional_light_map_from_the_groud_up/A couple of days ago, an artist asked me what exactly a directional light map is. I found this page talking about the solutions in Unity 3D and explained to him. And I am reading the book “Real time rendering“ these days, it also talks about directional light map, which gives a more detailed and low-level explanation on it. Sounds like a very interesting topic, so I decided to take some notes.Unleash the power of Direct3D 12
/posts/unleash_the_power_of_direct3d_12/
Wed, 17 Jun 2015 00:00:00 -0700/posts/unleash_the_power_of_direct3d_12/Direct3D12 is about to come. There are several presentations available in GDC this and last year talking about the new features in it. I’m gonna list some of the changes that D3D12 introduces in this post. It only covers some of the changes.
The big picture Different from its predecessors, D3D12 mainly aims at reducing CPU overhead. Improving CPU performance is the first priority in this new API. Of course that’s not to say there is nothing more.Tessellation on DX11
/posts/tessellation_on_d3d11/
Tue, 16 Jun 2015 00:00:00 -0700/posts/tessellation_on_d3d11/One of the most important changes that DX11 has made is the brand new feature called tessellation. By introducing three more stages, graphics programmer can tessellate their triangles on the fly. There are some benefits:
Models with more geometry detail. With phong tessellation, it smoothes the silhouette so that no sharp edge corner will be visible. Combined with displacement map, tessellation can produce bump surfaces in a much more realistic way than what can be achieved with normal map or POM.