added OpenCL cloth demo, contributed by AMD.
updated GpuSoftBodySolvers updated DirectCompute cloth demo
This commit is contained in:
@@ -1,4 +1,22 @@
|
||||
/*
|
||||
Bullet Continuous Collision Detection and Physics Library
|
||||
Copyright (c) 2010 Advanced Micro Devices
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty.
|
||||
In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it freely,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
|
||||
class piece_of_cloth
|
||||
{
|
||||
@@ -171,7 +189,8 @@ public:
|
||||
|
||||
pd3dImmediateContext->PSSetShaderResources(0,1,&texture2D_view);
|
||||
|
||||
pd3dImmediateContext->DrawIndexed( (width*3*2+2 + height*width*3*2), 0, ( UINT )pSubset->VertexStart );
|
||||
//pd3dImmediateContext->DrawIndexed( (width*3*2+2 + height*width*3*2), 0, ( UINT )pSubset->VertexStart );
|
||||
pd3dImmediateContext->DrawIndexed( ((height-1)*(width-1)*3*2), 0, ( UINT )pSubset->VertexStart );
|
||||
}
|
||||
|
||||
SAFE_RELEASE(pd3dImmediateContext);
|
||||
@@ -246,7 +265,7 @@ public:
|
||||
|
||||
|
||||
//unsigned int indices[] = {0,1,2, 1,3,2};
|
||||
unsigned int* indices = new unsigned int[width*3*2+2 + height*width*3*2];
|
||||
unsigned int* indices = new unsigned int[(height-1)*(width-1)*3*2];
|
||||
|
||||
for(int y = 0; y < height-1; y++)
|
||||
{
|
||||
@@ -265,7 +284,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
bufferDesc.ByteWidth = sizeof(unsigned int)*(width*3*2+2 + height*width*3*2);
|
||||
|
||||
bufferDesc.ByteWidth = sizeof(unsigned int)*((height-1)*(width-1)*3*2);
|
||||
bufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
|
||||
|
||||
InitData.pSysMem = indices;
|
||||
|
||||
Reference in New Issue
Block a user