If I leave my game running (about 4mins) all of a sudden it will stop drawing correctly. All the colors go away only thing that remains are the
outlines and the fog. The program doesn't stop however I can still move and hear sounds just video doesnt look right. If I move
or minimize it then bring it back the video never draws to the window again.
Anyone know what could cause this?
1min in:
4min in:
Game stops drawing correctly
Nothing in OpenGL is directly related to timers.
This means the bug is not really directly part of your graphics core but probably something elsewhere in your engine that cascades into this result.
Check the accuracy on your timers.
If you are running your game in microsecond units (as you should), you obviously need to store the time in an unsigned 64-bit type (unsigned long long or unsigned __int64).
You are probably already doing this.
But if you are using ::QueryPerformanceCounter() then you have to be careful how you convert the returned value to microseconds.
If you multiply by 1000000ULL and then divide by ::QueryPerformanceFrequency(), you will overrun your 64 bits fairly quickly.
You need to store the temporary result into a 96-bit integer when you multiply by 1000000ULL.
Additionally, you may need to set the thread affinity or process affinity to avoid BIOS bugs on some hardware.
http://msdn.microsoft.com/en-us/library/ms644904(v=vs.85).aspx
This may not be related to your problem at all, but it is impossible to tell since it is definitely some part of your engine and no one has any way of knowing the details of your engine but you.
By the way my coworker plays that game.
L. Spiro
This means the bug is not really directly part of your graphics core but probably something elsewhere in your engine that cascades into this result.
Check the accuracy on your timers.
If you are running your game in microsecond units (as you should), you obviously need to store the time in an unsigned 64-bit type (unsigned long long or unsigned __int64).
You are probably already doing this.
But if you are using ::QueryPerformanceCounter() then you have to be careful how you convert the returned value to microseconds.
If you multiply by 1000000ULL and then divide by ::QueryPerformanceFrequency(), you will overrun your 64 bits fairly quickly.
You need to store the temporary result into a 96-bit integer when you multiply by 1000000ULL.
Additionally, you may need to set the thread affinity or process affinity to avoid BIOS bugs on some hardware.
http://msdn.microsoft.com/en-us/library/ms644904(v=vs.85).aspx
This may not be related to your problem at all, but it is impossible to tell since it is definitely some part of your engine and no one has any way of knowing the details of your engine but you.
By the way my coworker plays that game.
L. Spiro
Perhaps you are creating textures or vbo non stop and you run out of vram. Use a debugger http://www.opengl.org/wiki/Debugging_Tools
such as
GLIntercept
such as
GLIntercept
As V-man said, it's likely a memory issue. My best guess (from not looking at any code) is that you are allocating some memory every single frame, and not cleaning up after yourself. Are you recreating the array that holds your vertices/texcoords every frame, or are you using VBO's?
On a side note, if you are trying to render as many cubes as the actual Minecraft, I strongly suggest using VBO's, octrees, and enough culling that you are eliminating about 95% of the map if you aren't already.
Are you making a MC clone because you think yours will be better, or because you want to prove to someone that you are capable? I'd hope it's the latter.
On a side note, if you are trying to render as many cubes as the actual Minecraft, I strongly suggest using VBO's, octrees, and enough culling that you are eliminating about 95% of the map if you aren't already.
Are you making a MC clone because you think yours will be better, or because you want to prove to someone that you are capable? I'd hope it's the latter.
As V-man said, it's likely a memory issue. My best guess (from not looking at any code) is that you are allocating some memory every single frame, and not cleaning up after yourself. Are you recreating the array that holds your vertices/texcoords every frame, or are you using VBO's?
On a side note, if you are trying to render as many cubes as the actual Minecraft, I strongly suggest using VBO's, octrees, and enough culling that you are eliminating about 95% of the map if you aren't already.
Are you making a MC clone because you think yours will be better, or because you want to prove to someone that you are capable? I'd hope it's the latter.
This is not a clone, it does use a textured voxel engine though. Mine will not have crafting or mining. Mine will be more about puzzles, block physics (fire spreading, water being proportional), and also have RPG elements.
Also, yes I am culling about 96% of the world
However I am not using VBO's.
(below player green square and white boxes show line of sight)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement