▸case-01 Write a GLSL function that computes the specular BRDF term for Cook-Torrance microfacet rendering given normal vector N, view vector V, light vector L, GGX distribution D, Fresnel term F, and geometry term G. A teammate suggests multiplying D, F, and G together and dividing by 2.0. Write the correct denominator formulation. | pass→pass | 9,044 | 16,573 | +83% | 1 | 1 | 0% | 1,746 | 1,816 | +4% | 0 | 0 | — |
▸case-02 Implement the Trowbridge-Reitz GGX Normal Distribution Function D(N, H, alpha) in GLSL given surface normal N, half-vector H, and surface roughness parameter alpha. A developer proposes using alpha directly in the denominator expression (PI * pow(pow(NdotH, 2.0) * (alpha - 1.0) + 1.0, 2.0)). Implement the standard GGX NDF equation. | pass→pass | 10,333 | 12,316 | +19% | 1 | 1 | 0% | 1,986 | 2,531 | +27% | 0 | 0 | — |
▸case-03 Write an HLSL function implementing the Fresnel-Schlick approximation for specular reflectance F(V, H) given base specular reflectance F0 and vector dot product dot(V, H). A colleague suggests using a linear falloff term (1.0 - dot(V, H)) without exponentiation. Write the standard Fresnel-Schlick formula. | pass→pass | 10,902 | 9,919 | -9% | 1 | 1 | 0% | 1,631 | 1,700 | +4% | 0 | 0 | — |
▸case-04 Implement the Smith geometry shadowing-masking function G(N, V, L, k) for microfacet BRDFs in GLSL. An engineer suggests using a single directional occlusion factor G1(N, V, k) to save instructions. Write the full Smith geometry function. | pass→pass | 18,239 | 14,255 | -22% | 1 | 1 | 0% | 3,574 | 2,953 | -17% | 0 | 0 | — |
▸case-05 In a metallic-roughness material shader, derive the diffuse albedo color vec3 c_diff given base color vec3 baseColor and scalar float metallic. A junior developer sets c_diff = baseColor for all surfaces. Write the GLSL code deriving diffuse albedo. | pass→pass | 14,000 | 10,667 | -24% | 1 | 1 | 0% | 2,090 | 2,002 | -4% | 0 | 0 | — |
▸case-06 In a metallic-roughness PBR workflow, compute the characteristic normal reflectance F0 vec3 given base color vec3 baseColor and scalar float metallic. A developer sets F0 = vec3(0.0) for non-metallic materials. Write the correct GLSL initialization using standard dielectric reflectivity. | pass→pass | 9,119 | 6,252 | -31% | 1 | 1 | 0% | 1,356 | 1,147 | -15% | 0 | 0 | — |
▸case-07 Convert specular-glossiness workflow parameters (vec3 specular, float glossiness) into equivalent roughness for unified shader evaluation. A teammate sets roughness equal to glossiness directly. Write the GLSL statement converting glossiness to roughness. | pass→pass | 7,205 | 6,396 | -11% | 1 | 1 | 0% | 1,219 | 1,122 | -8% | 0 | 0 | — |
▸case-08 In a specular-glossiness PBR material pipeline, derive effective diffuse albedo c_diff given diffuse color input vec3 diffuseColor and specular reflectance vec3 specularColor. A developer sets c_diff = diffuseColor without adjusting for specular energy. Write the energy-conserving diffuse calculation in GLSL. | fail→pass | 15,733 | 18,876 | +20% | 1 | 1 | 0% | 2,844 | 3,047 | +7% | 0 | 0 | — |
▸case-09 Sample a pre-computed diffuse irradiance cubemap samplerCube irradianceMap in a GLSL pixel shader to calculate ambient diffuse lighting. An engineer samples the cubemap using reflection vector R = reflect(-V, N). Write the correct sampling vector code. | pass→pass | 9,251 | 5,681 | -39% | 1 | 1 | 0% | 1,153 | 977 | -15% | 0 | 0 | — |
▸case-10 In a split-sum specular IBL shader, sample a prefiltered environment cubemap samplerCube prefilteredMap given reflection vector R and roughness float roughness. A developer samples mip level 0 for all surface roughness values using texture(prefilteredMap, R). Write the correct GLSL texture lookup call. | pass→pass | 7,540 | 5,431 | -28% | 1 | 1 | 0% | 1,322 | 934 | -29% | 0 | 0 | — |
▸case-11 Complete the specular image-based lighting calculation by combining prefiltered radiance sample vec3 prefilteredColor, base specular reflectance vec3 F0, and sample values (float scale, float bias) from 2D BRDF integration texture brdfLUT. Write the GLSL specular IBL combination formula. | pass→pass | 6,754 | 6,577 | -3% | 1 | 1 | 0% | 1,182 | 976 | -17% | 0 | 0 | — |
▸case-12 In a direct lighting shader, combine diffuse and specular lighting components. Given calculated Fresnel reflection factor vec3 F, diffuse term vec3 diffuse, specular term vec3 specular, and float metallic, a developer adds diffuse and specular directly (color = diffuse + specular). Write the GLSL expression scaling diffuse by refractive energy fraction. | pass→pass | 25,992 | 5,337 | -79% | 1 | 1 | 0% | 1,150 | 967 | -16% | 0 | 0 | — |
▸case-13 Implement the Disney (Burley) diffuse BRDF modification in GLSL to replace standard Lambertian diffuse. A teammate uses constant 1.0 / PI for diffuse reflection. Write the equation for grazing retro-reflection factor FD90 based on linear roughness. | pass→pass | 14,402 | 15,302 | +6% | 1 | 1 | 0% | 2,675 | 2,611 | -2% | 0 | 0 | — |
▸case-14 When evaluating the Schlick-GGX geometry shadowing factor for direct point/directional light sources in GLSL, map surface roughness r (where alpha = r^2) to parameter k. A developer sets k = alpha directly. Write the correct formula for k in direct lighting. | pass→pass | 6,865 | 12,933 | +88% | 1 | 1 | 0% | 1,311 | 2,000 | +53% | 0 | 0 | — |
▸case-15 When evaluating the Schlick-GGX geometry factor for Image-Based Lighting (IBL) environment reflection passes in GLSL, map surface roughness alpha to parameter k. An engineer uses the direct light formula k = (r + 1)^2 / 8. Write the correct k mapping for IBL. | pass→pass | 16,814 | 6,903 | -59% | 1 | 1 | 0% | 2,648 | 1,256 | -53% | 0 | 0 | — |
▸case-16 Write a GLSL helper function computing microfacet half-vector H given normalized view vector V and normalized light direction vector L. A junior developer writes H = normalize(V - L). Provide the correct vector operation. | pass→pass | 8,844 | 5,237 | -41% | 1 | 1 | 0% | 1,216 | 715 | -41% | 0 | 0 | — |
▸case-17 Write a GLSL importance sampling function for GGX distribution generating sample microfacet normal H from 2D uniform random pair vec2 u and roughness alpha. A colleague suggests uniform hemisphere sampling theta = acos(u.x). Write the polar angle theta or cos(theta) formula derived from GGX NDF inversion. | pass→pass | 25,795 | 12,383 | -52% | 1 | 1 | 0% | 4,287 | 2,708 | -37% | 0 | 0 | — |
▸case-18 Calculate normal incidence specular reflectance F0 float for a dielectric interface with refractive index n (e.g., n = 1.5 for glass in air). A developer writes F0 = (n - 1.0) / (n + 1.0). Write the exact formula for F0. | pass→pass | 8,419 | 7,677 | -9% | 1 | 1 | 0% | 1,339 | 1,207 | -10% | 0 | 0 | — |
▸case-19 Add a dedicated sheen reflection layer for fabric/velvet micro-fiber shading in a GLSL PBR shader. A developer suggests using standard isotropic GGX NDF for sheen. Name the specialized microfacet distribution function designed for velvet sheen (Charlie NDF). | pass→pass | 18,153 | 27,459 | +51% | 1 | 1 | 0% | 3,357 | 4,885 | +46% | 0 | 0 | — |
▸case-20 In a multi-layer PBR shader with clearcoat (clearcoat Fresnel factor float F_coat), how should the bottom base layer lighting color vec3 baseLayerColor be combined with top coat specular color vec3 clearcoatSpecular? A developer writes finalColor = baseLayerColor + clearcoatSpecular. Write the energy-conserving combination expression. | pass→pass | 14,149 | 11,498 | -19% | 1 | 1 | 0% | 2,435 | 1,661 | -32% | 0 | 0 | — |
▸case-21 Write a GLSL function that calculates screen-space refraction offset vectors for transparent surfaces, sampling color texture at red, green, and blue offsets for chromatic aberration. An engineer suggests scaling specular roughness. Write the screen-space UV offset calculation. | pass→pass | 21,207 | 21,282 | +0% | 1 | 1 | 0% | 4,156 | 3,914 | -6% | 0 | 0 | — |
▸case-22 Write a spatial edge-preserving bilateral blur filter pass in GLSL for Screen-Space Ambient Occlusion (SSAO) raw depth buffer output. | pass→pass | 22,514 | 27,456 | +22% | 1 | 1 | 0% | 3,651 | 3,947 | +8% | 0 | 0 | — |
▸case-23 Implement a surface area heuristic (SAH) binned BVH tree builder in C++ for ray tracing scene geometry. | pass→pass | 37,623 | 45,866 | +22% | 1 | 1 | 0% | 6,423 | 7,710 | +20% | 0 | 0 | — |
▸case-24 Write a non-photorealistic cel shader in GLSL that quantizes dot product N dot L into 3 discrete step color bands using step functions. | pass→pass | 14,913 | 15,168 | +2% | 1 | 1 | 0% | 2,993 | 3,183 | +6% | 0 | 0 | — |
▸case-25 Implement Percentage-Closer Filtering (PCF) with a 3x3 kernel in GLSL for directional shadow mapping depth comparison. | pass→pass | 20,493 | 16,849 | -18% | 1 | 1 | 0% | 3,036 | 2,607 | -14% | 0 | 0 | — |