Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Stock Art Model Problems


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 jsuffolk   Members   -  Reputation: 316

Like
0Likes
Like

Posted 08 December 2012 - 09:35 PM

As a hobbyist game developer I typically take the route of purchasing 3D stock art assets. However, recently with the purchase of a very large model I've a number of problems:

1) For some reason parts of the model appear to flicker when rendered in game. This is visible in the following video (look at the bottom right of the large ship model):



What causes this and can it be fixed with basic model editors (blender)?

2) The ship's high poly count (747,767 tris) causes my game to slow to a crawl on lesser hardware. I think it's purely the high poly count that causes the framerate lag, since even when I disable physics on the model and use a very basic shader it's still lags. While my desktop rig can play the game just fine, my laptop chokes badly on the framerate to the point of being unplayable.

The ship is this one:

http://www.turbosquid.com/FullPreview/Index.cfm/ID/577841

The writeup seems to suggest I can reduce the level of detail by not drawing submeshes, but perhaps I could somehow get the best of both worlds with some kind of level of detail throttling based on computer capabilities (my desktop CAN handle the higher detail)?

I ran some checks on the model, it has "non-manifold" elements, that wouldn't cause the flickering issue would it?



Sponsor:

#2 jsuffolk   Members   -  Reputation: 316

Like
0Likes
Like

Posted 09 December 2012 - 10:35 AM

So I figured out some strategies for reducing the level of detail and that's working to help me run it on my lesser computers...

1) Submesh Frustum Culling - I was just doing model level frustum culling, which meant the big ship was culled all or nothing. Doing it on each submesh individually helped a ton, in fact this alone made the game playable again.
2) Occlusion culling - I haven't yet implemented this one, but should help me squeeze a little more out of the hardware
3) LOD algorithms - if all else fails, the meshes in the large model are categorized by level of detail and I could stop drawing the detail submeshes at a certain distance. This would greatly reduce the poly count and really reduce hardware reqs, but since this one would cause noticable visual degradation I think I'll reserve this for the weakest GPUs

But I still am at a loss for what causes the flicker... anybody know?

#3 JTippetts   Moderators   -  Reputation: 8659

Like
2Likes
Like

Posted 09 December 2012 - 11:01 AM

Looks like z-fighting to me. Z-fighting happens when two polygons in the mesh are co-planar and overlapping. Float precision errors cause scanlines of the polygons to alternate in visibility, showing first one then the other as the viewpoint moves. You should be able to go in with Blender and fix the overlapping faces.

#4 jsuffolk   Members   -  Reputation: 316

Like
0Likes
Like

Posted 09 December 2012 - 09:08 PM

Thanks JTippets I think you called it. Wasted a few hours trying to fix this, apparently my blender skills are inadequate so I guess I'll have to find a 3D artist at some point to get it cleaned up.

#5 BCullis   Crossbones+   -  Reputation: 1813

Like
1Likes
Like

Posted 10 December 2012 - 09:38 AM

Just to add on to the topic, Z-fighting doesn't just happen if polygons are co-planar, it can also occur simply due to float imprecision if two polygons are close enough and the z-scale of your view*projection matrix is too large. In those cases you see it happen far from the camera's "eye" point, as precision drops as you approach the far plane.
Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too

#6 jsuffolk   Members   -  Reputation: 316

Like
0Likes
Like

Posted 11 December 2012 - 08:05 AM

That actually sounds exactly like what I'm seeing: Z-fighting goes away as you get near to the ship. Too bad the fix just isn't as simple as just moving up the far plane.

Perhaps that's why Blender remove duplicate faces didn't fix it...

Edit: Maybe it *is* as simple as moving the near/far planes - changing the near plane to 10 almost eliminated the issue. Unfortunately the player ship was also getting clipped.

Edited by jsuffolk, 11 December 2012 - 08:19 AM.


#7 jsuffolk   Members   -  Reputation: 316

Like
1Likes
Like

Posted 11 December 2012 - 10:24 AM

No amount of moving the near/far planes fixed it. However, there was a simple fix:

Added a line to my shaders to use a logarithmic z-buffer as described here:
http://blogs.xnainfo.com/post/Logarithmic-Depth-Buffer.aspx

Since every object uses the same z-buffer it must be applied to every shader, though.

#8 BCullis   Crossbones+   -  Reputation: 1813

Like
0Likes
Like

Posted 11 December 2012 - 10:42 AM

That's a great find, thanks for sharing!
Hazard Pay :: FPS/RTS in SharpDX
DeviantArt :: Because right-brain needs love too




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS