• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

powly k

Members
  • Content count

    65
  • Joined

  • Last visited

Community Reputation

657 Good

About powly k

  • Rank
    Member
  1. Upload them only once just before rendering - though the driver will probably already do this for you behind the scenes.     The more important point you might want to consider is how you measure your performance. If you get >1000fps with those various effects, your scene is probably too small to test on. If your rendering is not the bottleneck, then your memory lanes are. So you could probably throw a way more complex scene at the program and it'd run at the same speed. Another point is that measuring with fps can be deluding - a drop from 1200fps to 170fps is not that massive, the render times went from 1ms to 6ms - you should maybe measure which parts take how much time, opengl has time query objects for this.
  2. For 1: the default context is a compatibility profile, it should let you mix up any and all OpenGL extensions and versions your graphics card supports. This often makes writing it less nice; I'd recommend to stick to either the core 3.3 or 4.3 profiles, depending on what hardware you have. That way you'll have way less driver dependent behaviour to debug.
  3. This is all about the probability of each path. As with all monte carlo integration, you have to compensate the values of each sample with the probability of choosing that sample. The probability of hitting a point or directional light with a random chance is exactly 0; they're a single point on a continuous hemisphere. On the other hand, such lights act as dirac functionals; their contribution is only non-zero at a single point and infinitely large there. This, when integrating over the hemisphere, means that you can just pull them out of the integral and sum them with the approximation of the integral; the indirect lighting.   In a mathematic sense all surfaces and lights are equal (which makes sense, secondary or tertiary light sources are just as much light sources as primary ones) but when actually tracing the scene it makes sense to try to focus on the important stuff; this also leads to importance sampling of materials and multiple importance sampling of materials and lights together.   A lot of these approaches result in the exact same results - you can trace two bounces per incoming ray, for example, just keep track of your probabilities and you'll be fine as in the result will be unbiased. The vast majority of the ideas and research on the subject don't really focus on getting the result right, but reducing variance (which is visible as noise). With bidirectional path tracing using multiple importance sampling and materials that are importance sampled accurately, you can save a lot of rendering time (orders of magnitude) and get the same level of noise in your results.
  4. OpenGL

    glFlush() is a signal to the driver that you want to have all the submitted rendering ready before you go on with the code. And you're correct, as far as I know the wait occurs on SwapBuffers() and there's nothing you can do about it - why precisely would you, though? The best you can do is probably to measure frame time and if your frames are consistently shorter than your desired frame rate, do some extra stuff. It would also kind of fight the nature of VSYNC to be able to control it - the display works on a specific rate, it cannot be altered by programs.
  5. There are languages that index arrays defined for N elements in [1...N] (matlab comes to mind) or even [0...N] (Blitz Basic).   There is a good reason for the typical choice of [0...N-1], but it goes somewhat deep. You need to remember that the end result of the code is meant to run on actual hardware. In this case you want to access memory, but memory itself doesn't know the concept of an "array". It knows what data it holds and what index it's at. The most important thing is that an array is actually some index to the memory, and more precisely it's the index of the first member of the array. To access this, there is the typical array[j] syntax, which pretty much means "give me the j:th element of array 'array' " which is the same as finding the bit of memory that's at array+j. Since array is an index in the global memory and j is the index inside that array, we can just sum them to find the location of j in the memory.   Now, it (hopefully) makes sense to choose that the first element of "array" is at memory address "array", not at "array+1", so the first element should be at array[0] instead of array[1], since it gets translated to an actual memory address. Why it ends at N-1 instead of N is because we still want to have N elements - and if we count from 0 and go forwards until we have N elements, we reach element N-1.   This is, of course, only a chosen convention but it implies other nice things, like for(int i = 0; i<N; i++) /*operate on array[i]; */ instead of for(int i = 1; i<N+1; i++) /*operate on array[i]*/; the length of the for loop can instantly be seen from the ending condition instead of having to remember to take one out - it's a simple thing, but would cause (I believe) even more headache, especially for beginners or less enthusiastic programmers.
  6. Bump mapping is a lighting effect and completely unrelated. You just want to add some offsets to where you read your texture from in the GLSL shader - where you have something like texture(textureUniform, uv); try uv*=strength; texture(textureUniform, vec2(uv.x*sqrt(1.0-uv.y*uv.y*.5),uv.y*sqrt(1.0-uv.x*uv.x*.5))/strength); or some other similar mapping from square to disc instead.
  7. What? Last time I checked the red book was about what people did in the 90s.   http://www.opengl-tutorial.org/ should be a nice introduction to OpenGL if you already generally know what's going on but want to learn the API.
  8. [url=http://www.iquilezles.org/blog/?p=1911]The last few paragraphs of this post[/url] explain the reconstruction from Z buffer quite nicely, but go ahead and show a bit of your code if you're still having troubles. Your second picture looks just like a typical SSAO, so your problem is indeed most likely in the reconstruction.   The real problem here is that corners [url=http://nothings.org/gamedev/ssao/]don't look like that[/url]. SSAO is a fakey trick and doesn't really resemble real world lighting too much. If you tone it down enough so it's not black noisy bars but a slight darkening at some places, it can be a nice artistic touch.
  9. Just do more draw calls then, that really is the simplest and very probably most efficient solution. Keep all the fully opaque stuff in one batch, though. You could reorder your objects otherwise (read their coordinates and texture atlas IDs from an attribute buffer or a lookup texture or something). There are tricks to do actual order independent transparency too, but they need relatively new hardware and/or are very computationally demanding.
  10. I would definitely try adding 0.5*PixelSize to your UV coordinates - sampling at texel edges tends to be problematic. I'd also play around with the size of hpix, at least halving and doubling are usually good candidates to fix sampling artifacts.
  11. Things faster than A* include, for example, summing two numbers, calculating a dot product or doing nothing at all. Most problems have many good solutions, and the best one must be picked by you depending on the specifics. And even better than a good solution is avoiding the problem altogether, which is also sometimes possible.
  12. OpenGL

    Winding is probably not it - if you don't specifically enable backface culling, it's not on. What I'd try is first negative z values for the vertices and then ditching the matrix multiplication to see if the matrix is really okay.
  13. What you do in your shaders tends to matter a lot more than how many triangles you rasterize. The only actual way to know these is, like you said, to test it yourself.
  14. That very much seems to be the issue, if averaging 4 images that should be different doesn't produce a blurred result. Can you actually somehow verify that the 4 samplers have different textures attached?
  15. Okay, since you can't actually read from an FBO but only use an FBO to render to a texture and then read that texture, here's the question: do you set up the active textures, bindings and uniforms correctly? How this should go is like this:   set active texture to N bind your texture[N] to GL_TEXTURE_2D glUniform1i(uniform N location, N)   N loops through 1...4, obviously. What this sounds like is you forgetting to call the gluniform1i - all the uniforms samplers are texture unit 0 unless you specify otherwise.   And please, do "uniform sampler2D Blur1, Blur2, Blur3, Blur4;" instead of what you do now. And to be extra sure, always set the alpha to something.