keijiro / MiniEngineAO

SSAO image effect from Microsoft MiniEngine, ported to Unity.
MIT License
506 stars 42 forks source link

What is (GI & 011) == 0 mean... #7

Open ignarmezh opened 3 weeks ago

ignarmezh commented 3 weeks ago

Hi! Sorry for the easiest question, but I don't understand what does if ((GI & 011) == 0) mean in your Assets/MiniEngineAO/Shaders/Downsample1.compute. 011 is octal number? Could we write this with decimal numbers? Thanks!

Invertex commented 3 weeks ago

Yes, it's an Octal-Literal, since it starts with a zero and no x afterwards.

https://microsoft.github.io/hlsl-specs/specs/hlsl.pdf (Page 13)

It may be a slight performance optimization, but I would wager it doesn't make a difference if you used an integer instead... It would be interesting to hear what @keijiro has to say about it.

But in the meantime, you can always just change it to the uint value and see if it makes any difference to the result and performance! :)