   bug??? DrawPrimitiveUP
  I'm making a function that determines whether a point is visible (for drawing lens flares only if the light source is visible).I use pixel queries, they seem to work okay, but the thing is that after using the DrawPrimitiveUP function that draws a single point the rest of the scene goes black (nothing is rendered).I do:Vertex3D v ( pos );lpDevice->DrawPrimitiveUP ( D3DPT_POINTLIST, 1, (void*) &v, sizeof v );The Vertex3D class is just a vertex structure that contains information about the vertex; it has color, normal, texture coordinates and position. The vertex is used in my vertex buffer and it works ok.   
  A side effect of using DrawPrimitiveUP is that the vertex buffer binding on stream 0 is removed. Do you have set it again?   ;Quote:Original post by DemirugA side effect of using DrawPrimitiveUP is that the vertex buffer binding on stream 0 is removed. Do you have set it again?Oh, thanks a lot!I thought about that, but now you mentioned it, I saw that I'm using an internal variable curVB and a function that sets the vertex buffer does nothing if the buffer already equals curVB =)   ;  If you're just trying to check if a single point is in view, you'd most likely be better off transforming it on the CPU. By drawing it with the GPU and reading a value back, you'd nearly surely be doing more work than just the single matrix multiply you'd need to do on the CPU. Add to that the fact you'd only get results from the GPU several frames later, it just isn't the best solution, IMO, unless you have over 50 of these.Hope I understood what you were trying to do :).   