Eric's Blog


- Game Dev - Tool Dev - Math - Machine Learning -


  1. Improve Tile-based Light Culling with Spherical-sliced Cone

    Table of Contents The Problem of Sphere-Frustum Test Cone Test Spherical-sliced Cone Test Extend to Clustered Light Culling Tile-based method is used in both deferred and forward rendering. Since light calculation is expensive, one of the main goal for improving tile-based method is to provide more accurate and efficient light…

    on Graphics

  2. Stop Using Normal Matrix

    For rendering, I used to calculate normal matrix to transform vertex normal from model space to world space or view space. The normal matrix is defined as the inverse transpose of upper-left 3x3 matrix of the model matrix, from this article. Of course matrix inverse is not a cheap operation…

    on Math, Graphics

  3. Fast 4x4 Matrix Inverse with SSE SIMD, Explained

    Table of Contents Transform Matrix Inverse General Matrix Inverse Appendix 1 Appendix 2 Before we start, think about this question: do we really need the inverse of a general matrix? I came to this problem when writing a math library for my game engine. If you are making a game…

    on Math, SSE

  4. Conversion between View Space Linear and Screen Space Linear

    Some background of this problem: when doing screen space reflection, we need to shoot a ray from every pixel to find out reflection color. However we don’t want to march the ray in view space, because for example you have a ray pointing relatively inwards or outwards to the…

    on Math, Graphics

  5. Calculate Minimal Bounding Sphere of Frustum

    I came across this problem when fixing shadow shimmering in Cascaded Shadow Map, but it could be used in many other cases. To describe what we are going to do more specifically: given a frustum with near plane \(n\), far plane \(f\), and field of view angle \(fov\), we need…

    on Math, Graphics

  6. A Different Way to Understand Quaternion and Rotation

    Before We Start Quaternion is widely used in game engines to represent 3D rotation. As a game engineer you might be using quaternion explicitly or implicitly in your daily work, but do you really understand what is going on under the hood when you are calling “rotate a vector” or…

    on Math