• 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.
Sign in to follow this  
Followers 0
Plerion

ZFighting on ATI, perfect on NVIDIA

13 posts in this topic

Hello

 

I am currently rendering water and i have discovered some issues with z-fighting on ATI. I use glPolygonOffset on the water rendering to avoid z-fighting for the water.

glPolygonOffset(1.1f, 4.0f);
Pipeline::render(gLiquidGeometry, gTexInput);
glPolygonOffset(0, 0);

 

While on NVIDIA water looks perfect without any artifacts like in the following picture for ATI it is completely messed up. Not only do i get weird artifacts but it also "moves" around all the time, you might see that if you move between the 3 pictures which are taken from different camera angles.

 

NVIDIA:

51540b0cb5900_Water_OK.jpg

 

ATI:

51540c2a8cdfc_Water_BAD1.jpg

51540c2a8c93e_Water_BAD2.jpg

51540c2a8cb71_Water_BAD3.jpg

 

So i wondered: What could be the reason for that? Does anyone know any issues with that?

 

Greetings

Plerion

Edited by Plerion
0

Share this post


Link to post
Share on other sites

This isn't really answering your question but might help you sidestep the problem. I find that the most portable and hassle-free way of z-biasing is to switch to a slightly different projection matrix, typically, I push the near Z out by a small amount.

1

Share this post


Link to post
Share on other sites

Hello C0lumbo

 

I tested that before and got the same problem, working for NVIDIA, not working on my ATI card, sadly.

 

But on a side note, it doesnt matter if i use some anti-zfighting method or not, on the NVIDIA card i never ever have any zfighting at all even on nearly coplanar triangles...

 

@Hodgman:

Which part do you mean? I create the z-buffer in the pixel format with 24 bit depth and 8 bit stencil.

 

PS:
I already had a lot of problems with my ATI card (AMD HD 6990) and OpenGL. The driver had several issues and all that could go wrong went wrong.

 

Greetings

Plerion

0

Share this post


Link to post
Share on other sites

Hello Matias Goldberg

 

Thank you very much for your hints. Im currently trying to get GPU PerfStudio 2 to work with my application but so far the furthest ive got is "Connecting..." without any notable change....

 

/EDIT:
Ah, seems like the usual issue: Im running on Win8 and nothing works there...

 

Greetings

Plerion

Edited by Plerion
0

Share this post


Link to post
Share on other sites

glPolygonOffset is allowed to be implementation-dependent and shouldn't be considered a general purpose "z-fighting fix".  See http://www.opengl.org/sdk/docs/man/xhtml/glPolygonOffset.xml

 

units

Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0.

 

So you probably don't have a bug, just conformant (but unwanted and annoying) behaviour. Best to construct your geometry so that it doesn't z-fight in the first place (admittedly not always possible).

Edited by mhagain
1

Share this post


Link to post
Share on other sites

Hello mhagain

 

I disabled all z-fighting measures in my program but still i have the same result, NVIDIA OK, ATI/AMD unbearable. So i guess that its as Matias suspected a z-buffer issue. But sadly i have no chance to get GPU PerfStudio 2 to run or give any output at all and so i have no idea what z-buffer my ATI-Card is using. I also dont know of another method to get that information.

 

Greetings

Plerion

0

Share this post


Link to post
Share on other sites
GPU PerfStudio uses a network connection to connect to your program which is acting as a server (provided you launched your program by drag 'n dropping your exe to GPUPerfServer.exe).

Check that your Firewall isn't blocking GPUPerfServer.exe & your application too for incoming connections.
1

Share this post


Link to post
Share on other sites

Yes, i used the manual that comes with GPU PerfStudio 2. My application starts with the server, the client detects that a server is running with OpenGL. Next i press the pause button in the client, a window pops up "Capturing frame" as caption and "Connecting..." as content. And thats how it remains, no change (The server receives like 10 messages from the client then it halts.)

0

Share this post


Link to post
Share on other sites
Bummer. Sometimes these programs get stuck on something weird we do on our end. Try to see if you can hook PerfStudio to a simple hello world.
If it can't, then it's something driver related or OS
1

Share this post


Link to post
Share on other sites

Hi again

 

i decided to work on my NVIDIA graphics card as long as i cant GPU PerfStudio to work as changing the depth buffer wont interfer with that work. I also realized that my problem seems to bigger than i thought. I added my first models to the scene and there everything is even worse, i already added some tweaking with glPolygonOffset which added a lot more pseudo-precision but the results are still way worse than my previous version of the same graphics data with DirectX. Here i have an image:

5156b7ff5a14a_obj.jpg

 

The red line shows the range in which the model flickers. Where it as now is the minimum and it "moves out of the ground" until it reaches the red line if i pan the camera left and right or move it. This is a huge bummer as im only a few units away from the object (my zNear is 0.5 and zFar is 500) and its already that huge. It feels like im having some sort of 8 bit depth buffer...

 

My pixelformat looks like that:

mPixelFormat.cAlphaBits = mPixelFormat.cRedBits = mPixelFormat.cBlueBits = mPixelFormat.cGreenBits = 8;
mPixelFormat.cColorBits = 32;
mPixelFormat.cDepthBits = 24;
mPixelFormat.cStencilBits = 8;
mPixelFormat.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
mPixelFormat.nSize = sizeof(mPixelFormat);
mPixelFormat.iPixelType = PFD_TYPE_RGBA;

 

/EDIT:
Sadly i still am not able to determine what depth buffer is used.... on nvidia i can get parallel nsight, but it wont work as im using VS 2012 and nsight will support VS 2012 in a few months :|

 

Greetings

Plerion

Edited by Plerion
0

Share this post


Link to post
Share on other sites

For some reason its really difficult to set color/alpha/depth bits of the display in OpenGL (Java + LWJGL wrapper). Half the configurations won't work (probably some relation I don't know).

 

That particular configuration (8 bit alpha, 8 bit stencil, 32 bit color, 24 bit depth) works on my end (OpenGL 3.3 core context, GTX560 Ti).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0