Ooh Shiny
So shadows… What?! Shadows again? Yep, I’m sure you’re getting tired of hearing about it, I’m getting tired of thinking about them… But here is what I’ve done in the last few weeks. Static Rectangle V.09 ~Decoupled the filter radius from the SpotLight penumbra [1] ~Optimised shadow sampling by adding early out [2] ✦Increased sample count for shadow edges from 16 to 32 ✦Implemented "Randomly Rotated" poisson disk sampling to address some banding/muddy shadows [3] ✕Fixed pervasive SSAO issue where samples were flipping at face boundaries [4] ✦Added a simple AmbientLight that supports just colour and intensity ~Refactored Light class to support the AmbientLight ✦Added a ShadowCasterLight extension that both SpotLight and DirectionalLight extend ✦Added a Shader DAG node to the SceneGraph ✦Added the Picker pass for rendering selectable objects for user interaction ✦Added Outline renderer that renders outlines around selected objects ✦Added SelectionManager to manage selection state [1] I moved shadow softness to an explicit property on the light itself. In retrospect, this wasn’t the good idea I thought it was, it meant lights without penumbras could only have hard shadows without coming up with some other solution. Dumb. [2] I now do 4 samples first to check if the fragment is in shadow. Most fragments are either fully lit or fully in shadow, so those now only need 4 samples instead of 16. [3] The first fix was randomly rotating the sample kernel, which helped but introduced noise. So I swapped to using a blue noise (ironic) texture to drive the rotation instead. [4] The samples flipping directions at face boundaries was causing hard edges/obvious faceting. It was most obvious on curved objects and I had noticed it on the AT-ST model but shrugged it off. When I dropped a sphere into the scene I couldn’t ignore it. Shader Time After putting shadows to bed (for now…) I turned my attention to shaders. ...