Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Basiror

Pixelshaders and Bitwise operators?

This topic is 5222 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Here is Microsoft''s documentation, listing all of the instructions supported by each version of pixel shaders. Just in glancing through them, I didn''t notice any bitwise operators.

Share this post


Link to post
Share on other sites
Pixel shader work, afaik, exclusively with floating point vector values (e.g., quads of floats) -- some of the newer implementations may have boolean registers for branching, I think, but you probably can''t do much else with those registers.

What you trying to do that requires the use of a bitwise op?

Share this post


Link to post
Share on other sites
Shaders have 3 possible data types:

floats
bools
ints

ints are likely emulated using floats.

data can be (and is usually optimally) accessed as a vector, that is to say you can declare float2, float3, or float4 (or even float2x2, float2x3, float4x4, etc.).

bitwise operators would probably be nice, but in general most hardware would cry "mamma" if you tried to do enough branching as to require a bitfield.

Share this post


Link to post
Share on other sites
I thought about BOOLMAPPING static scenes with them

a BOOLMAP is a shadowmap indicating which pixels are shadowed and which arent

so lets say we pass the bool maps without filtering and without mipmapping then you could theoretically access the Unsigned byte values in the pixel shader via a integer and check which pixels are shadowed and which not and accordingly apply ambient light and other lighting calculations

the advantage is that you can use very highres BOOLMAPs to create smooth shadows on the geometry

you could even interpolate between the shadowed and unshadowed pixels by altering the u,v coordinates inside the shader


But this is impossible to do when those damn pixelshaders don t support bitwise operators, since all the bool values shall be encoded horizontally into unsigned byte values so your BOOL map is actually [width/8][height]

this is just theory but i think it s worth the discussion imagine how smooth static shadows one could create
no more stepping effects
you could even implement a axisaligned interpolation and a 45° rotated grid interpolation within the shader

Share this post


Link to post
Share on other sites
Integer math in the pixel shader is one of the rumored features of DX10 (along with full IEEE floating point).

Basiror,
Shadow Mapping sounds similar enough to the technique you're talking about and is certainly implementable on today hardware.

[edited by - DannerGL on June 4, 2004 5:54:09 PM]

Share this post


Link to post
Share on other sites
yes i know but i thought about this feature to render my static sceens with high resolution shadows which are precalculated but require very less memory

that s why i thought about this system but good to know that they at least plan it

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!