Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 27 November 2008 - 04:56 PM
Posted 28 November 2008 - 03:19 PM
Jason Zink :: DirectX MVP
Direct3D 11 engine on CodePlex: Hieroglyph 3
Direct3D Books: Practical Rendering and Computation with Direct3D 11, Programming Vertex, Geometry, and Pixel Shaders
Articles: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article (original):: Fast Silhouettes Article
Games: Lunar Rift
Posted 29 November 2008 - 02:15 PM
Posted 29 November 2008 - 02:33 PM
Posted 30 November 2008 - 07:39 AM
Quote:
Original post by CProgrammer
Well to do what you explained you simply use bitwise operations.
So say your depth value is N*3 bits and we'll call it d.
Then just store it as follows:
mask = (pow(2, N)-1)
r = d & mask
g = (d << N) & mask
b = (d << (N*2)) & mask
To get d back do:
d = r & mask
d = d >> N
d = d+(g & mask)
d = d >> N
d = d+(b & mask)
-CProgrammer
Jason Zink :: DirectX MVP
Direct3D 11 engine on CodePlex: Hieroglyph 3
Direct3D Books: Practical Rendering and Computation with Direct3D 11, Programming Vertex, Geometry, and Pixel Shaders
Articles: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article (original):: Fast Silhouettes Article
Games: Lunar Rift
Posted 30 November 2008 - 01:01 PM
Posted 30 November 2008 - 03:05 PM
Jason Zink :: DirectX MVP
Direct3D 11 engine on CodePlex: Hieroglyph 3
Direct3D Books: Practical Rendering and Computation with Direct3D 11, Programming Vertex, Geometry, and Pixel Shaders
Articles: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article (original):: Fast Silhouettes Article
Games: Lunar Rift
Posted 01 December 2008 - 01:31 PM
Posted 01 December 2008 - 03:27 PM
Jason Zink :: DirectX MVP
Direct3D 11 engine on CodePlex: Hieroglyph 3
Direct3D Books: Practical Rendering and Computation with Direct3D 11, Programming Vertex, Geometry, and Pixel Shaders
Articles: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article (original):: Fast Silhouettes Article
Games: Lunar Rift
Posted 02 December 2008 - 04:00 PM
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.