Found another potential optimization, breaking up instruction dependency, and allowing better pipeline while quarter-rate rcp runs.
Got mixed results here, either no net gain or ~5% gain. Probably depends on the compiler, but should use this formulation eitherway.
I see Stubbe's octahedral decode opt in almost every usage I come across. But I've never seen it used for encoding.
The same symmetry applies here! and its ~50% faster.
Especially important for octahedral-encoded textures, as it's required for every sample! please RT.
Octahedral-encoded indirect specular map, with added border so it allows bilinear filtering, pre-convolved mips & trivially tiled within texture atlas.
shadertoy.com/view/43G3Dd









