Sign in to follow this  

vertex texture + create texture after release

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(,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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this