Skip to main content
GameDev.net gamedev.net
🔒 Locked

D3DXFLOAT16

Started by yurixd Nov 2, 2005 at 12:38 PM 0 replies 1.8k views
Original Post
yurixd
yurixd
Hi guys! Anyone can give me how does ir converts DirectX when reading back from a RenderTarget create with R16F format and beeing read it like this and where has been rendering using blending ?? The values that returns are perfect when they are smaller than 140 or something like this (not 128) and they are really wrong for big values as 1000... CAn anyone give me a reason ?? My program renders many times to the same position using blending hr |= this->direct3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE , true ); hr |= this->direct3DDevice->SetRenderState( D3DRS_SRCBLEND , D3DBLEND_ONE ); hr |= this->direct3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE ); and always these values are on of the show below : 0.5625, 0.0625, 0.1875 Soemtimes for the same position, rends just once, sometimes thousand of times. for example, i can see that for a (x,y) position the exact values! But, when the position has been render lots lots of time, the final value is wrong...! Is it possible to debug the blending state?? float *ptr; hr |= this->renderSurface0->LockRect( &lockedRect3, 0, D3DLOCK_READONLY ) ptr3 = (D3DXFLOAT16*)( lockedRect3.pBits ) + j * lockedRect3.Pitch/sizeof(D3DXFLOAT16) ; for ( unsigned int i = 0; i < 256; i++ ) { *ptr++ =*ptr3; ptr3=ptr3+1; } Any help will be great! Thanks, Jesus
Steven Hansen
Steven Hansen
I am having a very difficult time understanding what the problem is, so this response may not be useful (sorry).

I recently tried doing something similar with a floating point render target. Turns out my video adapter doesn't support AlphaBlending for floating point render targets. Note that no calls failed. You should check the caps for your adapter.

Hopefully this addresses your problem - if not, try to reword and we'll take another look at it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.