• Advertisement

DeathCarrot

Member
  • Content count

    99
  • Joined

  • Last visited

Community Reputation

188 Neutral

About DeathCarrot

  • Rank
    Member
  1. ping -w

    'man ping' says: -w deadline Specify a timeout, in seconds, before ping exits regardless of how many packets have been sent or received. In this case ping does not stop after count packet are sent, it waits either for deadline expire or until count probes are answered or for some error notification from network.
  2. C++ include necessity checker?

    Yes, I certainly seem to have spoken too soon. I guess for the majority of files you "just" need to run it through a preprocessor and parse for tokens of interest, noting down which files they came from in the process; but the aforementioned non-trivial cases would make it considerably more difficult. I guess there's other things such as if you have #ifdef WIN32 #include <windows.h> #else #include <X11/Xlib.h> #endif and you're on a *nix system, you probably won't have a windows.h to check through. Also, related to that, what would you preprocess the files with (definition wise)? #include <console.h> ... #ifdef DEBUG Console::cout << "Debug message: " << str; #endif would need to be preprocessed both with DEBUG defined and undefined to see whether the console is required. (Having the app add an #ifdef around the #include would be nice, of course =P) But you certainly wouldn't want it to evaluate every possibility of: #ifdef THIS_IS_NEVER_DEFINED GIBBERISH!(*&%()@# #endif .. I guess those can be solved by having the user input a list of potential valid preprocessor definitions. The non-self-sufficient headers are certainly the bigger issue, though. Ignoring them would be one way to go I suppose. @Bregma - Preprocessing the input file isn't much of a hurdle as GCC already provides this functionality not only in executable form, but also a convenient library (libcpp). I think the major issues are more fundamental issues, such as what the application should do in non-trivial circumstances.
  3. C++ include necessity checker?

    Interesting, I might make this over summer if I have any time to spare. Certainly doesn't sound like an insurmountable task. Thanks for the replies guys.
  4. C++ include necessity checker?

    While makedepend does kind of do what I want, It's not quite what I'm looking for. Firstly, unless it has functionality not documented in the man-page, it's per-object, not per-file (would be find if I wanted just to clean .cpp files). Its output is also a bit tedious to work with (simply a list of tens or even hundreds of header files for each object file). Just to clarify, I don't want a compile-time solution, I want to modify the source and header files themselves. For example, if a .cpp file had a function which used my console class for debugging purposes some time ago, but doesn't use it anymore, I'd like to get rid of the #include "console.h" from the top which I'd forgotten to take out. Or an example of one which is potentially more difficult to catch: #include "b.h" class A { B *ref; }; I'd like this to be optimised to class B; class A { B *ref; };
  5. I'm working on a 100+ file source tree in a personal project and I'm convinced I could seriously improve the compile time by clearing out unnecessary #includes. Is there a tool that could check whether anything is referenced from within a header, if the header has been included previously in the chain, and possibly whether it's just a pointer reference so you could just declare the class instead of including the header? I'm running Linux if that makes any difference.
  6. FBO cubemap = slow

    I think I'll give this a bump before I admit defeat.
  7. Yeah I don't think there's any 'quick' way of reading a texture, modifying it and sending it back. How are you modifying it? Might the modifications be possible to compute in a fragment shader?
  8. A more efficient glVertex*

    There's quite a few VBO tutorials out there, but I recall this one was the best out of the ones I came across.
  9. FBO cubemap = slow

    The scene is trivial, I've done it with a completely empty scene as well and the framerate is the same. Cubemap resolution doesn't seem to affect the framerate, 512x512 and 2048x2048 both run at 13fps. I'll try one face per frame, I hope that doesn't introduce seams. Thanks for the replies guys. EDIT: tried the update one face per frame, and it introduced a lot of artifacts with a moving light. Not as bad with two or three faces per frame, but still very noticeable.
  10. FBO cubemap = slow

    I'm trying to implement shadowmapping using a cubemap FBO (render depth to RGB via frag shader), it works great on my GF8800 GTS (350 fps with single light, although I get around 600 with a single regular square map, but in terms of milliseconds that's not a huge difference). The problem is it seems to kill the performance on my laptop with a GF7600 Go. With a regular shadowmap I get around 60fps (and it only went down a couple of fps when I put a few more more in), but it goes down to 13 when I use a cubemap. It happens with both int and float texture formats, and regardless of if I have any form of texture filtering on or if there's anything drawn into it. Here's the way I initialise the FBO if it's of any help: glGenFramebuffersEXT (1, &id); glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, id); glGenRenderbuffersEXT(1, &zbuf); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, zbuf); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, zbuf); glGenTextures(1, &img); glBindTexture(GL_TEXTURE_CUBE_MAP, img); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); . . . glTexImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X, img, 0); width and height are always equal and power-of-two. I've flung some timers around and it seems the time is begin spent mainly in (re-)binding the FBO and switching from face to face, which I do like so: for(int face=0;face<6;face++) { glBindFrameBufferEXT(GL_FRAMEBUFFER_EXT, id); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_BIT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X+face, img, 0); /* RENDER SCENE HERE */ glBindFrameBufferEXT(GL_FRAMEBUFFER_EXT, 0); } Commenting out the glFrameBufferTexture2DEXT puts the framerate up from 13 to 19, a 24ms improvement (though not terribly useful as then the shadow is only rendered on one face). This is the way it's all supposed to be done, right? GPU is 256MB Geforce 7600 Go, driver 169.12, running 32-bit Gentoo Linux, Xorg 7.3. Haven't tried on Windows as a couple of the libs I'm using don't like MinGW and I don't want to get Visual Studio just for this.
  11. Silverlight: Battlefield

    Quote:Original post by Lode How can I play it from my browser in Archlinux? Haven't tried it personally, but Moonlight is Mono's Silverlight implementation. Still nowhere near finished so OP's game may not work.
  12. OpenGL OpenGL without X11

    I would also recommend using SDL (or similar) unless there's Xlib functionality you need which they don't offer (I'm not aware of any SDL-like libraries that support multiple monitors properly, for example). Pretty much all of the big-name Linux ports for Id, Epic and the like use SDL so it's not like it's not a 'proper' way to do it. [smile]
  13. Aah, well that would certainly explain the error, thanks. So for full shadows from a point-light I need 6 separate FBOs? Either that or render the depth component onto a colour buffer. Suggestions? What about depth renderbuffers in cubemaps? Thanks.
  14. I couldn't find any resources on this so I pieced it together from here and there so it could be completely wrong, but this initialisation is causing a GL_FRAMEBUFFER_UNSUPPORTED_EXT error (The class itself is a mess as it handles all kinds of FBOs, not just shadow cubemaps, but these are the gl commands that are being run in it in this instance): glGenFramebuffersEXT(1, &id); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id); glGenTextures(1, &img); glBindTexture(GL_TEXTURE_CUBE_MAP, img); glTexImage2D (GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL_DEPTH_COMPONENT24, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); . . . glTexImage2D (GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL_DEPTH_COMPONENT24, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X, img, 0); glDrawBuffer(0); glReadBuffer(0); glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); The final command there returns GL_FRAMEBUFFER_UNSUPPORTED_EXT. Also, to select which face to render to, I just use glFramebufferTexture2DEXT right? Thanks.
  15. Shadows not being projected correctly

    I've solved the issue with the help of the offical OpenGL forums, turns out the library I'm using doesn't invert matricies properly.
  • Advertisement