English 中文(简体)
Packing attributes in a texture, deferred rendering
原标题:

I m rolling a deferred shader pipe, and due to the need to keep the G-buffers in a unified format a need to compress attributes is needed. I ve sadly been unable to find some good information on how this actually is done.

I have a G-buffer format that uses 16 bits per component in a fixed point format. Sadly as I target shader model 3 hardware I can t use bit operators. So, basically, how does one go about to pack 2 8 bit values in the 0..1 range into a single 16 bit channel, also in the 0..1 range? Preferably applicable to either CG or HLSL.

问题回答

Maybe this link will help you: http://www.gamedev.net/topic/534283-hlsl-pack-two-values-into-one-component-of-a-4x16_unorm-target/

But by my experience i would say the packing costs are high. I use more Multiple Rendertargets (MRT) to save the data and this works fine for me.





相关问题
Packing attributes in a texture, deferred rendering

I m rolling a deferred shader pipe, and due to the need to keep the G-buffers in a unified format a need to compress attributes is needed. I ve sadly been unable to find some good information on how ...

HLSL and ID3DXFont/ID3DXSprite

I ve started at the beginning, and my code will capably display the grand total of some text. I ve been adding support for sprites. The trouble that I ve run in to, is that it doesn t seem to ...

Using DirectX headers from Wine to compile under MingW

I have been attempting to build HLSL shader support into VLC player. I have hit a brick wall due to lack of utility methods in d3d9.h in MingW to load a .fx file and compile the shader. So under ...

DirectX Sphere Texture Coordinates

I have a sphere with per-vertex normals and I m trying to derive the texture coordinates for the object using the algorithm: U = Asin(Norm.X) / PI + 0.5 V = Asin(Norm.Y) / PI + 0.5 With a polka dot ...

Rendering a point light using 6 spot lights?

I m trying to render 6 spot lights to create a point light for a shadow mapping algorithm. I m not sure if I m doing this right, I ve more or less followed the instructions here when setting up my ...

HLSL DirectX9: Is there a getTime() function or similar?

I m currently working on a project using C++ and DirectX9 and I m looking into creating a light source which varies in colour as time goes on. I know C++ has a timeGetTime() function, but was ...

Fetching the vertices from the backbuffer (HLSL) on XNA

Hello and sorry for the obscure title :} I`ll try to explain the best i can. First of all, i am new to HLSL but i understand about the pipeline and stuff that are from the fairy world. What i`m ...

热门标签