John Campbell @daddygame.dev · Feb 13

An attempt at converting an arbitrary normal into a primary axis (for cubemap-alike operations) without branches. Pretty sure there's better ways of doing this but tricky to find online as I'm not sure what the 'proper' name for this op is.

0 likes 1 replies

?

Replies

John Campbell · Feb 13

This is one of those cases where I can't tell if the hoop-jumping to avoid branches actually comes out as an overall win, so something to benchmark later. In particular 'ceil' seems like a wildcard that could go either way, although Shader Playground suggests it's quite cheap.