# Shih-Chin

## Performance Tips of NumPy ndarray

When I did homework assignments of the famous Deep Learning course CS231n from Stanford, I was so impressed by 100X↑ performance boost by using broadcasting mechanism in NumPy. However, broadcasting doesn’t always speed up computation, we should also take into account memory usage and memory access pattern [2], or we will get a slower execution instead. This post shows several experiments and my reasoning of why certain operation is performant or not.

Python , NumPy

## Maya Scripting Primer

For many of my artist colleagues who want to learn scripting in Maya, one of their motivations is mostly to automate repetitive or time-consuming manual tasks. Since Maya can show all command history of our user interactions in Script Editor. Therefore, if we know how to perform target instructions manually, we could write a script of all corresponding commands. But finding the equivalent commands is not straightforward in some situations. Besides looking up documentation, we need other strategies.

Maya API

## Data Interpolation with Radial Basis Functions (RBFs)

Radial Basis Functions (RBFs) is one of the commonly used methods to interpolate multi-dimensional data. RBFs creates smooth and less oscillating interpolation than inverse distance weighting (IDW) does. It has many applications in Computer Graphics, such as surface reconstruction [3], animation blending [1], facial retargeting, color calibration [4], and etc. Despite of the variety of its applications, those applications all have a common theme called scattered data interpolation.

Math

## Aperture & f-number

I have been using DSLR for over 10 years, I thought I knew few knowledge about photography. But after I watched a wonderful online course of digital photography by Prof. Marc Levoy [1], I just found there were so many details I weren’t aware before. The thing embarrassed me the most was that I incorrectly related f-number to lens aperture size. This post is trying to introduce the idea of f-number starting from scene radiance.

Photography , PBR

## Self-Study Tips

When I decided to be a guest lecturer at NCKU last year, I kept asking myself what is the most important thing I wish I’d learned in school. I carefully reviewed my current skill sets and found most of my skills were developed at work. Besides sharing knowledge about Computer Graphics, I think there is a more fundamental competency we need to develop in school, that is continuous learning.

Study

## Learning by Teaching, as a Guest Lecturer

I was privileged to be a guest lecturer to give five lectures about Computer Graphics at National Cheng Kung University (NCKU) in Taiwan. When I prepared the course materials, I deeply realized again that the best way to learn a topic is to teach someone else (especially to a person who never heard about Computer Graphics before). In order to avoid teaching wrong ideas, I had carefully reviewed what I known from ground up and derived each mathematical equation in the textbooks. This post is about what I’ve learned in those few months.

Study

## Realistic Human Skin with Normalized Diffusion & GGX

After implementing BSSRDF importance sampling for Normalized Diffusion and GGX BRDF, I started wondering how realistic could the appearance of human skin be achieved with the combination of these two models. The whole development process is quite interesting, because it’s a perfect combination of my two interests: programming and photography. With only one diffusion layer and two specular layers on top, I tried to find the way to make it as realistic as possible. » read more »
Arnold , BSSRDF

## BSSRDF Importance Sampling of Normalized Diffusion

Highly scattering materials like milk or skin can’t be precisely modeled by BRDF only, because light would scatter multiple times before exiting the material at different locations. Bidirectional surface scattering distribution function (BSSRDF) is used to describe radiance transfer across the surface boundary with diffusion profile for multiple scattering events. To solve subsurface light transport efficiently, there are several approaches to model and evaluate the diffusion profile. Recently, Burley [5] has proposed an artist-friendly diffusion profile with only two exponential functions and the most attracting thing is that it’s not only intuitive for artists to use but also faster to evaluate. » read more »
Arnold , BSSRDF , Importance Sampling

## Using Min Pixel Width with Care in Arnold

Keeping objects opaque makes Arnold render much faster. When we render a bunch of hairs, min pixel width is useful to make the hair look softer. However, if the min pixel width is not equal to zero, the opacity of hair ribbon would change subtly, and those ribbons are not always opaque anymore! Furthermore, according to the ribbon thickness measured in screen space at render time, we might surprisedly get different render results. » read more »
Arnold

## Sampling Visible Normals for GGX BRDF

The standard approach proposed by Walter et al. [1] for importance sampling of GGX BRDF is to use the PDF proportional to distribution of microfacet normal $$D(\omega)$$. However, $$D(\omega)$$ is not view-dependent, thus it would waste lots of samples when the incoming direction is near grazing angles. In addition, the small value of $$D(\omega)\vert m\cdot n\vert$$ at grazing angle would make the sample value as high as hundreds to millions in some situations and cause fireflies in render results. » read more »
Arnold , BRDF , Importance Sampling