Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

114 Neutral

About polar01

  • Rank
  1. Hi there,   Imagine I have a C++ application, this one generate an image (in C++, CUDA, OpenCL) and then I would like to transfer this image to a specific browser that support WebGL.   The current version of the C++ software simply render into a FBO...   Is it possible to do ? how ?   Thanks for your help
  2. Hi, I m work ing on a OpenCL / Cuda application and for each gpu I generate an image. I would like to create à PBO for each GPU and be sure that each PBO is located on a specific GPU. 1) question 1: how to create à PBO on a specific GPU ? Is it possible ? Once done I would like to merge the PBO (do a simple average of the pixel color) and display them. 2) question 2: how can I merge all the PBOs and display them... What is the best solution ? Using GLSL ? Thanks a lot for your help
  3. polar01

    SetPixelFormat failed....

    Thanks, The whole code is difficult because it contains a mix of Java and C++ ! In reality I use 2 different 3D engine and both produce the same error !!!! Yes, it works with the single buffer ! But of course does not produce the right result ! I have use the Spy++ tools to check the window style and it give me the following style : 0x56000000 I also have the old version of my software (this one work well), and it also have the same style ! I have also do the following test, each time I use GetDC it give me another one (Not sure it is because of OWN_DC) Thanks
  4. Hi, I have an application that was working for a long time and suddenly the SetPixelFormat method failed ! I have search the reason for a long time, but no way, I can't find the reason ! The GetLastError return 2000 (Mean that SetPixelFormat failed !!!) I have a good Video card (gtx 590), but anyway I have the software on a lot of computer and always have the same problem ! What I have notice is the the method failed when I use the following flag : PFD_DOUBLEBUFFER Of course, I need the double buffer ! How can I debug this problem ? I'm searching for a long time and of course it is a critical problem !
  5. Hi, I'm currently working on a 3D editor and we can load very very small models or very very big ones... The problem I have is during display, due to bad zNear and zFar... I got a lot of undesired effects. I have search the web for a solution, but found nothing.... What I would like is to compute the zNear and zFar to use depending of my scene. By example by looking at the scene bounding box and the camera position & camera target... I have try the following, but I can't acheive very good results... if someone can help ? float viewportWidth = (float)surface->GetWidth(); float viewportHeight = (float)surface->GetHeight(); glViewport(0, 0, (GLsizei)viewportWidth, (GLsizei)viewportHeight); // Default float aspectRatio = viewportWidth / viewportHeight; //---- Set up the view glMatrixMode(GL_PROJECTION); // Set up the projection glLoadIdentity(); if (!camera) { gluPerspective(45, aspectRatio, 0.1f, 1000.f); return; } // reference : // delta = z * z / ( zNear * (1<<N) - z ) // // Where: // // N = number of bits of Z precision // zNear = distance from eye to near clip plane // z = distance from the eye to the object // delta = the smallest resolvable Z separation at this range. // Also see : //---- Calculate optimal near and far Z clipping planes float sceneRadius; sceneRadius = (camera->GetEye() - camera->GetEyeAt()).Length() * 2.f; // Based on the current target BB // Get buffer properties GLint mDepthBufferResolution = 16; glGetIntegerv(GL_DEPTH_BITS, &mDepthBufferResolution); float zFar = 2.f * sceneRadius + (camera->GetEye() - camera->GetEyeAt()).Length(); if (zFar < 1e-20f) zFar = 1e-20f; float zNear; if (mDepthBufferResolution >= 24) zNear = 0.00001f * zFar; else zNear = 0.01f * zFar; if (zNear < 1e-20f) zNear = 1e-20f; float Zoom = 1.f; VNFilm* film = surface->GetScene()->GetFilm(); if (film && !film->GetAutoSize()) { float filmHeight = (float)film->GetHeight(); Zoom = viewportHeight / filmHeight; } // Reference : float fov = camera->GetFOV() * 0.5f * (M_PI_F/180.f); float top = tan(fov) * zNear; float bottom = -top; float left = aspectRatio * bottom; float right = aspectRatio * top; glFrustum(Zoom * left, Zoom * right, Zoom * bottom, Zoom * top, zNear, zFar);
  6. Hi, I'm working on a 3D Software where I should be able to display a scene/model with several millions of elements, some models are 100 GB on hard drive. So, I would like to know how softwares like 3DS/Maya/... support this kind of models ? Do they play with a kind of LOD model, out of core system, simplified models etc... ? Do you know all the way to do ? If you know algorithms etc... it is great too :-) Thanks
  7. Thanks, When I will try to zoom on the microprocessor I will not see the mountain correctly, I will got a flipping effect ! And playing with several layers of objects is complex... it is difficult to handle interesection between objects ! :-P Not sur that this problem has a real solution.... ;-)
  8. Thanks a lot, I already re-compute zNear and zFar for each frame depending of the scene, camera etc... but for some extreme scenes (imagine a microprocessor in a mountain) it will not work because the scale between the 2 objects (microprocessor & mountain) are really big !! So, I'm searching for a solution...
  9. Hi, Imagine I have a small object in a big scene, by example a car and a floor (it is just an example). The car has normal dimensions, but the floor is a plane that is 10000 x greater (It can be something more complex than a plane of course). So, if I set the zNear/zFar based on the plan, then the car is not displayed ! So, if I set the zNear/zFar based on the car, then the plane is flickering and is not correctly displayed ! I'm searching for a solution ... so, if someone can help because I have no idea to solve this problem. Thanks
  10. polar01


    Hi Rob OpenRL is NOT a standard, it is just a commercial company that use a 'similar' name compared to OpenGL. At first, when you see OpenRL its API looks similar to OpenGL... so it sounds simple, but is it really a good idea ? By example, does a plane has the same device than a car ? :-) You have several others SDK for this.
  11. Does someone has an idea to solve the problem. Far and near plane are important, so they depend of the scene (size of the scene). - I can use the scene bounding box to change/compute the far/near plane ? - Have you experimented this ? There is no side effect ? Thanks
  12. Hi, I currently use the following code to set up my perspective. gluPerspective(45, aspectRatio, 0.1f, 1000.f); The problem is that with large objects, or very small one... I see nothing. If I update the near/far planes... I got precisions problems with the gluUnproject etc... So, can you tell me how you handle this ? Thx
  13. Hi, I'm currently working on a picking algorithm WITHOUT OpenGL ! The algorithm work fine, but I have problem to transform the mouse X,Y into a "3D ray" for the picking. To test, I have try with OpenGL like this (but it doesn't work !!) glMatrixMode(GL_PROJECTION); // Set up the projection glLoadIdentity(); float aspectRatio = ((float)surface->GetWidth()) / surface->GetHeight(); gluPerspective(45, aspectRatio, 0.1f, 10000); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt( camera->GetEye().x, camera->GetEye().y, camera->GetEye().z, camera->GetEyeAt().x, camera->GetEyeAt().y, camera->GetEyeAt().z, camera->GetEyeUp().x, camera->GetEyeUp().y, camera->GetEyeUp().z); double matModel[16]; double matProj[16]; GLint viewport[4]; glGetDoublev(GL_PROJECTION_MATRIX, matProj); glGetDoublev(GL_MODELVIEW_MATRIX, matModel); glGetIntegerv(GL_VIEWPORT, viewport); GLdouble o[3]; GLdouble t[3]; gluUnProject ( x, surface->GetHeight() - y, 0.0, matModel, matProj, viewport, &o[0], &o[1], &o[2]); gluUnProject ( x, surface->GetHeight() - y, 1.0, matModel, matProj, viewport, &t[0], &t[1], &t[2]); out->o.x = o[0]; out->o.y = o[1]; out->o.z = o[2]; out->d.x = t[0] - o[0]; out->d.y = t[1] - o[1]; out->d.z = t[2] - o[2]; out->d = Normalize(out->d); The problem is that I cannot use OpenGL, so I have this code : //--- Get the camera axis VNCamera* camera = surface->GetScene()->GetActiveCamera(); Vector3 eye = camera->GetEye(); Vector3 eyeAt = camera->GetEyeAt(); Vector3 axisz = Normalize(eyeAt - eye); Vector3 axisy = camera->GetEyeUp(); Vector3 axisx = Cross(axisz, axisy); //---- Origin out->o = eye; //---- Direction // Project mouse to space float fx = x; float fy = surface->GetHeight() - 1.f - y; // Normalize to [-1 , 1] fx /= surface->GetHeight(); fy /= surface->GetHeight(); fx -= 0.5f; fy -= 0.5f; fx *= 2; fy *= 2; // Adapt for FOV float fovInRadians = 45.f * (M_PI / 180.0f); fx *= tanf(fovInRadians); // Project the mouse coordinate on the Z-far-plane out->d.x = axisx.x * fx + axisy.x * fy + eyeAt.x; out->d.y = axisx.y * fx + axisy.y * fy + eyeAt.x; out->d.z = axisx.z * fx + axisy.z * fy + eyeAt.x; // Compute the direction out->d = out->d - eye; out->d = Normalize(out->d); out->mint = 0; out->maxt = INFINITY; I'm unable to find the problem with the last code, in order to pick in an OpenGL windows ! So, if you have an idea ? Thx
  14. Both :-( For now, it is normal to have an object with 500.000 faces ! Of course, I can create a BVH on objects, and then another for the set of faces (per object). But it will request a lot of time to build this structure !
  15. Yes, it is my questions :-) Which space subdivision should I use ? BVH KDTree Grid BSP Octree By example BVH or KDTree are very fast (with improved versions like SBVH etc....). But the problem is that I have to create the tree and it has a cost (time) ! and whta happen if I change my geometry, each time I have to rebuild the BVH ! Also, what happend if I have models with millions of triangles ! So, my question is to check if there are better alternatives ?
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!