🔒 Locked
floating point textures
Advertisement
Original Post
hi, i want to fill a floating-point texture. i have an accsses violation in my code, which is logical, since i dont really know what i am doing. so here is my code, it is short, maybe someone here can give me a hint.
create the texure:
hr = D3DXCreateTexture(m_pd3dDevice,
64,
64,
1,
0,
D3DFMT_G32R32F,
D3DPOOL_MANAGED,
&m_pBumpMap
);
Fill it :
int i,j;
D3DLOCKED_RECT Rect;
m_pBumpMap->LockRect(0,&Rect, 0, 0);
for (i=0; i<64; i++)
{
float *Tex = ( ( (float*) Rect.pBits + Rect.Pitch * i ) );
for (j=0; j<64; j++)
{
D3DXVECTOR2 Normal( m_cN[ OffsetWrap(j,i) ].real(),
m_cN[ OffsetWrap(j,i) ].imag()
);
*Tex = Normal.y;
Tex++;
*Tex = Normal.x;
Tex++;
}
}
m_pBumpMap->UnlockRect(0);
thnx.
[edited by - ofer on February 17, 2003 12:36:18 PM]
So any luck so far , anyone?
I''ve tried to create a 16x16x16x16 bits texture (dont remember the exact format declaration constant name) and it also returns a bad pointer that results in access violation
Seems like it just doesnt wanna create it.
I have NV30 workstation car (QuadroFX 1000) and no luck, even though it supposed to support floating point textures.
Whoever tackled the prob please report back.
I''ve tried to create a 16x16x16x16 bits texture (dont remember the exact format declaration constant name) and it also returns a bad pointer that results in access violation
Seems like it just doesnt wanna create it.
I have NV30 workstation car (QuadroFX 1000) and no luck, even though it supposed to support floating point textures.
Whoever tackled the prob please report back.
quote:
Original post by thy MC
WHat''s the sense of floating point textures
RANGE! - HDR techniques for example (www.debevec.org)
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement