Emulating bitwise operations

Posted By: jenGs

Emulating bitwise operations - 02/22/13 22:17

Hi,

I need bitwise operations in a shader.
But I learned that this is not possible with d3d9.
Is there a way to emulate this behaviour.

For Example:
int val = anotherVal & 0xffffffff;

Patrick
Posted By: Uhrwerk

Re: Emulating bitwise operations - 02/22/13 22:24

Maybe the following blog entry is a solution for you:

http://orenk2k.blogspot.de/2011/05/bitwise-operators-on-low-end-gpus.html
Posted By: jenGs

Re: Emulating bitwise operations - 02/22/13 22:29

Wow, this was fast laugh
Thank you for the link.
I need to study it and try some things, before I realy understand it, but it is a much better solution than what came up on my previous google searches.
Posted By: Uhrwerk

Re: Emulating bitwise operations - 02/22/13 22:39

It's basically a lookup table for all the binary operators where the result of one operator is stored in one channel of the texture.
© 2024 lite-C Forums