• 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.

Getov

Members
  • Content count

    35
  • Joined

  • Last visited

Community Reputation

498 Neutral

About Getov

  • Rank
    Member
  1. I fixed that problem and actually I got 40-50%, and more improved performance. I will think about what you've said and try to implement something.
  2. Hello everyone! I have implemented occlusion culling in my app and I think why the problem is happening but I am not sure how to solve it. My scene is divided in different chunks (voxels) and I am rendering each voxel in a separate draw call. In the 1st pass I render only the bounding box of the voxel and I start queries to check if the voxel is visible: glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LESS); glDepthMask(GL_FALSE); for (int i=0; i<numberOfVoxels; ++i) { glBeginQuery(GL_ANY_SAMPLES_PASSED, queryHandle[i]); renderBoundingBox(i); glEndQuery(GL_ANY_SAMPLES_PASSED); } glDepthMask(GL_TRUE); In the 2nd pass I get the result from the query and if the voxel is visible I render it, otherwise - no : for (int i=0; i<numberOfVoxels; ++i) { glGetQueryObjectiv(queryHandle[i], GL_QUERY_RESULT , &voxel[i].isVisible); if (!voxel[i].isVisible) continue; glBindVertexArray(vao[i]); glDrawArrays(GL_TRIANGLES, 0, voxel[i].dataSize); } The problem appears when the bounding box is much bigger than the geometry in it, and there is huge empty gap in the box. When checking for depth test, this big box is hiding the smaller voxels behind it and this results in flickering. One potential fix I came across is to divide such almost empty bboxes into smaller ones, as described in GPU Gems. But this is not that easy to do in my app and the performance may become even worse. Do you have any other possible ideas and techniques I can use to solve that problem ?
  3. OK, I'll try that and see how it works.
  4. The thing is I am not sure how to pass that additional vertex. How can the shader know when its time to use it ? If I just add a vertex to my buffer, the result will be the same I think?   EDIT: I managed to get better results with precalculating the segment directions, fill them in an array and pass them to opengl. But the shading is not smooth and you can see the different line segments, not sure how to interpolate it.
  5. I use the same vertex buffer for "vert" and "vertNext", just with different offsets. I guess that when "vert" points to the last element of the buffer, "vertNext" is some undefined garbage and weird things happen.   Any suggestion how can I get the line segment direction ? Do I need to calculate it outside of the shader and later pass it ?
  6. Hi everyone, I hope you could give me any suggestions for my problem! I render my hair geometry in line segments. The problem I have is with the correct shading of the hair. From what I've read I understood that I need the direction of the line segment and the direction to the light source. Then the dot product of these direction vectors defines how the current vertex is shaded. My vertex data is in one array buffer and I've decided to pass to GLSL 2 pointers - one for the current vertex and one for the next vertex, so I can calculate the direction of the line segment. glEnableVertexAttribArray(gpuProgram->attrib("vert")); glVertexAttribPointer(gpuProgram->attrib("vert"), 3, GL_FLOAT, GL_FALSE, 0, NULL); glEnableVertexAttribArray(gpuProgram->attrib("vertNext")); glVertexAttribPointer(gpuProgram->attrib("vertNext"), 3, GL_FLOAT, GL_FALSE, 0, (void*)sizeof(Vertex)); Where Vertex is a struct with 3 floats.   My vertex shader: #version 150 uniform mat4 projection; uniform mat4 view; uniform mat4 model; in vec3 vert; in vec3 vertNext; in vec3 color; out vec3 fragVert; out vec3 fragColor; out vec3 fragVertNext; void main(void) { fragColor = color; fragVert = vert; fragVertNext = vertNext; gl_Position = projection * view * model * vec4(vert, 1); } My fragment shader: #version 150 uniform mat4 model; uniform vec3 lightPosition; uniform vec4 surfaceColor; in vec3 fragVertNext; in vec3 fragVert; in vec3 fragColor; out vec4 finalColor; void main(void) { vec3 lightColor = vec3(1.0, 1.0, 1.0); vec3 vertPos1 = vec3(model * vec4(fragVert, 1)); vec3 vertPos2 = vec3(model * vec4(fragVertNext, 1)); vec3 segmentDir = normalize(vertPos1-vertPos2); vec3 dirToLight = normalize(lightPosition-vertPos1); float diffCoef = 1.0 - dot(segmentDir, dirToLight); vec3 diffuse = ambient + lightColor * diffCoef * fragColor; vec3 result = min(diffuse, vec3(1.0)); finalColor = vec4(result, 1); } This is just the diffuse shading without specular reflection. And the result is wrong. I have to mention that 1 hair strand is composed of a couple line segments, and also there seems to be bug in the shading of the very last line segment - it appears black.
  7. If you want you can have a look at this code: click Specifically line 146 - computerMove() function. I have written this version in my early years when I was learning C++ and some parts of the code look horrible :D,  but the algorithm for the AI should work just fine.  
  8. I've started watching the linear algebra videos some time ago and they are really nice. But it seems short on exercises (or not deep enough)
  9. Hello,   I am looking for book or other kind of source, that has exercises related to 3D programming math - linear algebra, transformations, rotations, vector operations, coordinate systems, distance between planes, projections ... etc.   I just want to sharpen my skills and find out where my weak points are, because reading only theory without practicing it is not really useful.
  10.   Wouldnt the desktop be better (than laptop?)   It depends what you need - mobility or power. If you need to carry around your computer, laptop is the best choice, otherwise get a desktop!   Netbeans is way too heavy compared to other IDE's. I would say go with Visual Studio.
  11. Earlier this morning I found out what caused the problem. It is bug with the GLEW library. I had to change GLFW_OPENGL_CORE_PROFILE with GLFW_OPENGL_COMPAT_PROFILE. glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE); now it's working and everything seems OK.
  12. OK, I've replaced the libs, now compiles and fails at runtime: "The application was unable to start correctly (0xc000007b)"   EDIT: Managed to run it, this time it stops responding. I think that some lib bugs it but not sure which. I have no problems running other tutorials from the internet. Can you help me with the debugging process of that thing ?
  13. I am building on windows 8 x64. I did download all the libraries for 64bit version.    If I get it right - because previously I've built my project on 32bit system with 32bit libraries and now I am trying to use it with 64bit version libs ,that's why I am getting these linking errors.   So I have 2 options: 1. Replace all my x64 version libraries with x86 2. Continue using x64 libraries and make the whole project from scratch (that's not really good idea) Right ?
  14. Update: I managed to run the simple projet but I cannot run my old project. It might be some problem with the platform change ? Can this be fixed ?
  15. Hello,   That's the first time I have difficulties with setting up OpenGL.  I just bought a new laptop with windows 8 64bit and I am using Visual Studio 2012. I did the usual procedure with installing a 3d party lib just as I installed them on my previous PCs: 1. Download freeglut, glew, glfw, glut, sdl 2. Copy headers into "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include" 3. Copy libs into "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib" 4. Copy dll's into "C:\Windows\SysWOW64"   Then I downloaded the project I was developing on my other PC (was developed under windows 8 32bit if that's of any importance) and it would'n compile. The compiler threw me the following linking error:   Error 1 error LNK2001: unresolved external symbol __imp__glDrawArrays@12  - about 50 of these  Error 63 error LNK2019: unresolved external symbol __imp__glClear@4 - again about 50 of these   The project is working perfectly on my old PC.   I did try to make a simple new project: click Linked the following libraries (Properties->Linker->Input->Additional Dependencies) opengl32.lib glut32.lib glu32.lib And again it wouldn't compile, again the same linking errors: Error 1 error LNK2019: unresolved external symbol __imp__glBegin@4 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 2 error LNK2019: unresolved external symbol __imp__glClear@4 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 3 error LNK2019: unresolved external symbol __imp__glClearColor@16 referenced in function _main P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 4 error LNK2019: unresolved external symbol __imp__glColor3f@12 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 5 error LNK2019: unresolved external symbol __imp__glEnd@0 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 6 error LNK2019: unresolved external symbol __imp__glFlush@0 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 7 error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function _main P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 8 error LNK2019: unresolved external symbol __imp__glMatrixMode@4 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 9 error LNK2019: unresolved external symbol __imp__glOrtho@48 referenced in function _main P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 10 error LNK2019: unresolved external symbol __imp__glRotatef@16 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj Error 11 error LNK2019: unresolved external symbol __imp__glVertex3iv@4 referenced in function "void __cdecl drawcube(void)" (?drawcube@@YAXXZ) P:\OpenGL_Setup\OpenGL_Setup\opengl_setup.obj     I don't know if I am missing something, can you give me some ideas ?