We will entertain your mind, enhance your brain, expand your lifestyle.

Vector computation

As the 15th puzzle, a part of the pattern strongly reflects the light of the light, and it was used as a hint.

A hint image was prepared separately from the pattern in the shader, and this was used as the metallic value of the material. However, with this implementation, the hint image can be seen due to the difference in texture other than where the light is hitting.

ChatGPT

Therefore, in the shader, we decided to enable metallic only when the camera is in the direction where the light from the light is reflected to the pixel. This requires determining whether the light direction vector and the camera direction vector are approximately axisymmetric with respect to the normal vector at the pixel.

When we asked ChatGPT (via Bing) about this axisymmetric determination, it gave us the (presumably) correct answer, and when I asked for a formula, it returned it in Latex format.

Make it simple

However, it was not possible to calculate how close to axisymmetric it was with this formula. Therefore, we decided to make a simple judgment using a vector as shown in the figure below.

Add the light direction vector and the camera direction vector for the target pixel, and measure (subtract) the distance between this and the normal vector. If this distance is less than the threshold, it will be metallic and the target shader will be expressed as below.