|
@@ -23,6 +23,7 @@ extern LA MAIN;
|
|
|
extern struct _tnsMain *T;
|
|
|
|
|
|
void la_ReadGLocation(tnsOffscreen* off, int x, int y,float* xyz0){
|
|
|
+ if(!off->pColor[2]){ tnsVectorSet3(xyz0,0,0,0); return; }
|
|
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, off->FboHandle);
|
|
|
glReadBuffer(GL_COLOR_ATTACHMENT2); glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
|
|
glReadPixels(x,y,1,1, GL_RGBA, GL_FLOAT, xyz0);
|