Jump to content
  • Advertisement
Sign in to follow this  
joeblack

vertex texture + create texture after release

This topic is 3206 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

hello, in my application i'm using physX for computing. I would like to save output to float texture, this texture pass to VS and use it as world matrix. But when i try it i got very strange results (i can see some triangles but they are strange rotated). When i passed result of physics as matrix to VS everithing was ok. But i can pass only one matrix so all vertices was moving, but they were moving right way. here is initialization of texture : D3DXCreateTexture(engine::getDevice(),2,2,1,D3DUSAGE_DYNAMIC,D3DFMT_A32B32G32R32F,D3DPOOL_DEFAULT,&forceTextureBuffer1) (right now i have only one moving object so i need only 2x2 texture) here is way i fill data to texture : This->scenes[This->currentScene]->updateArray(forceArray); forceTextureBuffer1->LockRect(0,&m_rectLocked,NULL,0); memcpy((float*)m_rectLocked.pBits, forceArray, 4*2*2*sizeof(float)); forceTextureBuffer1->UnlockRect(0); void sceneDesc::updateArray(float *&forceArray) { WORD numActors = scene->getNbActors(); NxActor** actors = scene->getActors(); for (WORD i=0; i < numActors;++i) { NxActor* actor = *actors++; if (i == 26) { actor->getGlobalPose().getColumnMajor44(forceArray); } } } here is VS : float4x4 worldMatrix; worldMatrix[0]= tex2Dlod(Sampler,float4(0,0,0,0)).abgr; worldMatrix[1]= tex2Dlod(Sampler,float4(0.5,0,0,0)).abgr; worldMatrix[2]= tex2Dlod(Sampler,float4(0,0.5,0,0)).abgr; worldMatrix[3]= tex2Dlod(Sampler,float4(0.5,0.5,0,0)).abgr; OUT.hposition = mul(float4(position.xyz,1),mul(worldMatrix,worldViewProj)); (when i pass worldMatrix as matrix objects are moving in right way) also i would like to know if i can use D3DXCreateTexture for creating new one after i release texture

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!