preparation to receive camera image data from physics server

increase shadowmap world size default to 50 units (meter), 10 units (meter) was too small for most examples.
This commit is contained in:
erwin coumans
2016-05-31 10:23:04 -07:00
parent de9bd65c19
commit 14aa666c6f
21 changed files with 301 additions and 22 deletions

View File

@@ -19,7 +19,7 @@ subject to the following restrictions:
bool useShadowMap=true;//false;//true;
int shadowMapWidth=8192;
int shadowMapHeight=8192;
float shadowMapWorldSize=10;
float shadowMapWorldSize=50;
#define MAX_POINTS_IN_BATCH 1024
#define MAX_LINES_IN_BATCH 1024

View File

@@ -657,6 +657,19 @@ SimpleOpenGL3App::~SimpleOpenGL3App()
delete m_data ;
}
void SimpleOpenGL3App::getScreenPixels(unsigned char* rgbaBuffer, int bufferSizeInBytes)
{
int width = (int)m_window->getRetinaScale()*m_instancingRenderer->getScreenWidth();
int height = (int)m_window->getRetinaScale()*m_instancingRenderer->getScreenHeight();
if ((width*height*4) == bufferSizeInBytes)
{
glReadPixels(0,0,width, height, GL_RGBA, GL_UNSIGNED_BYTE, rgbaBuffer);
int glstat = glGetError();
b3Assert(glstat==GL_NO_ERROR);
}
}
//#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
static void writeTextureToFile(int textureWidth, int textureHeight, const char* fileName, FILE* ffmpegVideo)

View File

@@ -24,6 +24,7 @@ struct SimpleOpenGL3App : public CommonGraphicsApp
virtual void registerGrid(int xres, int yres, float color0[4], float color1[4]);
void dumpNextFrameToPng(const char* pngFilename);
void dumpFramesToVideo(const char* mp4Filename);
void getScreenPixels(unsigned char* rgbaBuffer, int bufferSizeInBytes);
void drawGrid(DrawGridData data=DrawGridData());
virtual void setUpAxis(int axis);

View File

@@ -718,15 +718,6 @@ void Win32Window::runMainLoop()
void Win32Window::startRendering()
{
pumpMessage();
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); //clear buffers
//glCullFace(GL_BACK);
//glFrontFace(GL_CCW);
// glEnable(GL_DEPTH_TEST);
}