CastorX

Members
  • Content count

    164
  • Joined

  • Last visited

Community Reputation

132 Neutral

About CastorX

  • Rank
    Member
  1. HDR Blur

    Hi everyone,   I want to add a new HDR highlight blur to my game. The best would be: even a very light but small area of pixels could do a bigger blurred lighter area. I've seen quite good quality highlight blur (in newer games) that covers a larger area of the screen but no blurring artifacts, the edges/transitions are very smooth. Any idea how to do that?
  2. Bullet Physics object combine

    Thanks for the reply. I think I wil try to do that with a hinge and check if it works weel enough.
  3. Hi everyone,   I'm using bullet engine as my physical engine in my game. After solving many problems gathering a lot of information (even from GD.NET) I have another problem. I want to "weld" two rigid bodies. For example My model is a bed. It consists of the wooden frame and the mattress. But I want to handle it as one DYNAMIC object with different properties like friction of wooden parts and the mattress and different collision object for them. The above example might not be the best, but I want to do something like that. Thanks in advance!
  4. Multi material in Bullet

    Hi everyone,   I've seen that "btMultimaterialTriangleMeshShape" can be used as a multimetarial shape for collision detection. Can this be used for non-static objects too? As far as I know it's parent is the BVH mesh shape but that can only be used for static objectes. Any way to do the same for nonstatic objects?
  5. BulletPhysics Question

    Hello everyone, Recently I've started my new small game project. During the desing I've decided to use BulletPhysics as the game's physical engine. But now I'm in a big truoble. I want to do the followings: When two objects collide the specified sound has to be played. This depends on the material applied on the colloding trinagles of the objects. The sound sould be played (so the collision should be reported) only once (when the real collision happens, not on continous contact), depending on the impact speed and angle. Alternatively if the above method is not possible it is also ok just to report if two "kind" of objects collide without reporting the material. Any idea how to do this? I googled my problem and turned out that there are many methods to report object-object collision via callbacks but I can't find any correct sample code on the internet. It looks that the BulletPhysics is relly fast, but there are only a very few good tutorial. At least I was not able to find one I need to do this. If anyone knows how to do that or has a link to a good tutorial please help. Thanks in advance!
  6. BulletPhysics Question

    Hello everyone, I'm writing a small spaceship sim game. I've decided to use BulletPhysics as physics engine and now I have a problem. When the spaceship falls fast against the ground and hits it one part of the ship "merges into" the ground and the whole ship starts shaking. Num subsetps is at 10 but I've tried it with 30 too. I use btCompoundShape with btConvexHullShapes for the ship and btBvhTriangleMeshShape for the "ground". Any ideas? Thanks in advance!
  7. Hi Everyone! I want to render my scene to a texture. Right now I'm using FBO and initializing it the in following way: [source lang="cpp"] GL.BindTexture(TextureTarget.Texture2D, glRefColorTexture); GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Clamp); GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Clamp); GL.TexImage2D(TextureTarget.Texture2D, 0, intPixFormat, resX, resY, 0, pixFormat, pixType, IntPtr.Zero); GL.BindTexture(TextureTarget.Texture2D, 0); GL.GenRenderbuffers(1, out glRefDepthTexture); GL.BindRenderbuffer(RenderbufferTarget.Renderbuffer, glRefDepthTexture); GL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.DepthComponent16, resX, resY); GL.GenFramebuffers(1, out glRefFrameBufferObj); GL.BindFramebuffer(FramebufferTarget.Framebuffer, glRefFrameBufferObj); GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, TextureTarget.Texture2D, glRefColorTexture, 0); GL.FramebufferRenderbuffer(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, RenderbufferTarget.Renderbuffer, glRefFrameBufferObj); [/source] This works. Without anti-aliasing of course, but I have to use AA too. So I googled it and found the funftion: glRenderbufferStorageMultisample(...). But in my case it is not working, and have no idea why. FramebufferErrorCode shows that it's inclomplete. Does anyone have any idea why is it not working and how should I make it work? Many thanks for any post!
  8. Hy! If I have two bounding boxes and one ray, how can I determine which bounding box has a closer intersections on the ray? (exact points or distances are not required) I need a simple solution, because it will be implemented on GPU. Something like this: int CloserOnRay(AABB a, AABB b, Ray r) { // ??? if(a is closer) return 0 // a is closer or only "a" has an intersection point with r if(b is closer) return 1 // b is closer or only "b" has an intersection point with r return -1; // No intersection. } But this does not compare bounding box distances, just gives a boolean value. I hope someone can give some help... Thank you guys!
  9. In this case the animation determines the direction, but I think the direction should control the "facing" of the model and your animation. How do you animate your model? What tools/toolkits are you using? Do you use XNA or DX?
  10. Do you mean you have a 3D model with transformed vertices and you want to calculate the orientation? Then you have to simply multiply the (0,0,1) vector with the rotation part of the matrix you used to transform the vertices of your model. Assuming that the model originally faced to (0,0,1) direction. Or in case of paths you need to know the mathematical functions (and their derivate) of the path.
  11. Hello everyone! I've been writing an OpenCL ray-caster with BVH accelerator for a few weeks now. Recently I have newer done anything in OpenCL, so I've found that there are a few "nerve-racking" things in OpenCL (or in the nVidia OCL driver) I will never understand. One of these is the following: There are 2 versions of my ray-caster: One with SDL and OpenCL, and one with OpenGL and OpenCL interop. The SDL version uses global storage space to store vertices, normals, etc. and OpenCL images to store the nodes of the BVH, SDL surfaces to draw what was drawn in the output buffer (openCL buffer). And the other version uses OpenGL to show the content of the output buffer, since it is a (512*512) texture too, and uses OpenGL textures to store the node data. I've tested booth versions, and... well, the performance results are strange. The ray caster function runs 16 times in the kernel to get more precise measurement data. Only the running time of the clEnqueueNDRangeKernel(...) was measured, like this: clFinish S = Time() clEnqueueNDRangeKernel clFinish F = Time() PERF = F - S; SDL version time: 1110 ms GLCL version time: 870 ms Thats's not very much perf. penalty, but the only real difference was that I've used OpenGL textures instead of OpenCL images. I know that the OpenGL textures has a hardware cache but why doesn't an OpenCL images work the same way? Has anyone heard about this before?
  12. Moving objects in Direct3D

    I don't know how does your renderGameCharacter work but you should try this: Create matrix -> Set transform -> Render scene D3DXMatrixTranslation(&matrix_Boogle, 0.0, -10.0, 0.0); d3ddev->SetTransform(D3DTS_WORLD, &matrix_Boogle); renderGameCharacter(d3ddev); D3DXMatrixTranslation(&matrix_GameScene, 0.0, 0.0, 0.0); d3ddev->SetTransform(D3DTS_WORLD, &matrix_GameScene); renderGameScene(d3ddev);
  13. Good 3D Modelling Tool?

    Hy! For poly modelling: free: Blender, K-3D commercial: Lightwave3D (very good for poly modelling), Maya or 3DSMax
  14. RGBAF16 to pbo

    OMG! Shame on me! I'm so amateur!!!!! Thank you for the replies I taught that RGBAF16 means 16 bytes (float, float, float, float), not BITS! It works now. THANK YOU ALL! This happnes when you start programming something complex in OpenGL without knowing the basics...
  15. RGBAF16 to pbo

    OK, I know I need one PBO for each target, it works with RGBA pixel format, but it does not work with ARGBA16F floating point format, I have tried everything. I always get OpenCL OUT_OF_RESOURCES error.