Physics runs in a separate thread from rendering in PhysicsServerExample (preliminary)

Improve rendering performance. OpenVR experience is smooth now.
commit needs a bit more testing before pushing in main repo.
This commit is contained in:
erwin coumans
2016-07-07 19:24:44 -07:00
parent bc5a756c36
commit 60d2b99151
28 changed files with 978 additions and 188 deletions

View File

@@ -105,14 +105,20 @@ public:
}
virtual int registerGraphicsShape(const float* vertices, int numvertices, const int* indices, int numIndices)
virtual int registerTexture(const unsigned char* texels, int width, int height)
{
return -1;
}
virtual int registerGraphicsShape(const float* vertices, int numvertices, const int* indices, int numIndices,int primitiveType, int textureId)
{
int shapeIndex = OpenGLGuiHelper::registerGraphicsShape(vertices,numvertices,indices,numIndices);
int shapeIndex = OpenGLGuiHelper::registerGraphicsShape(vertices,numvertices,indices,numIndices,primitiveType, textureId);
if (shapeIndex>=0)
{
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_rgbColorBuffer,m_depthBuffer);
float rgbaColor[4] = {1,1,1,1};
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
float rgbaColor[4] = {1,1,1,1};
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
m_swRenderObjects.insert(shapeIndex,swObj);
}