*/}}
Jelajahi Sumber

glocation adapt

YimingWu 1 tahun lalu
induk
melakukan
b2034cabea
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      resources/la_modelling.c

+ 1 - 0
resources/la_modelling.c

@@ -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);