Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 Jul 2002
Offline Last Active Sep 01 2015 01:30 PM

Posts I've Made

In Topic: How to determine if object is in view

20 July 2015 - 02:37 PM

Sorry for the off-topic again... what cards are you using?


Depends on the customer but typically its NVidia Quadro K2000 or K4200.  We even have some Quadro 2000 (no 'K' version).  Always Quadro, however.  I have no control over that unfortunately. 



The best practice for z-fighting (since about ~8 years ago) is to use a 32 bit float depth buffer (DXGI_FORMAT_D32_FLOAT in D3D termsand to also swap the near and far parameters before you create your perspective matrix (so that e.g. near is 10000 and far is 0.1).


The 32-bit Z-buffer would probably make a big difference however even on recent (NVidia Quadro) cards however I cannot seem to create a 32-bit depth buffer without losing my multi-sample buffer bits.  That means no anti-aliasing which makes scene look worse than having Z-fighting. 


As for swapping the near and far parameters I remember seeing this talked about in an Outerra article


In my previous reply I add that I am using Vega Pirme and I do not have access to their projection matrix.  I would have to take over the rendering pipeline.  Which I may have to eventually do but that will not be easy.


So let's say I do take over the projection matrix and swap near and far values, does this solution "just work" given that I change the depth test type?  Seems too easy.


Something along those lines is probably the most robust solution. You can do two completely seperate passes -- one where you render the entire scene except for your own aircraft, and another where you only render your own aircraft... and then layer them over the top of each other.

If you draw your own aircraft first, you can enable writing to the stencil buffer during that pass. Then during the second pass, you can enable stencil testing, such that you only allow writing to pixels where the stencil buffer still contains a zero. That will save a bit of performance as you won't waste time shading pixels that will end up being hidden.

This is along the lines of what L. Spiro suggested.  Given my limitations with the depth buffer size and projection matrix reversed near/far plane matrix this solution may be my only robust solution even though it costs some in performance. 


Based on both of your feedback I have decided to drop further investigation into a "better hack" and pursue the 2-pass render.  I tried this a few years ago but after having trouble with the shadows I gave up.... perhaps too quickly.  There may be a way to manipulate Vega Prime's dynamic shadow object to swap to both channels or maybe create two dynamic shadow objects.  There are pros and cons to working with third party libaries and I may be running into the con as far as what I can do using their system of classes (and not have access to source code).


Thanks so much.  I feel encouraged to give the 2-channel (ie 2-pass) rendering another try.



In Topic: How to determine if object is in view

20 July 2015 - 02:08 PM

This should be handled in the same way as guns are handled in FPS games.
Draw the scene once with depths 500.0-130,000, clear the depth buffer, and draw the plane with depths 1.0-100.0 (or whatever is guaranteed to bound your airplane) over that.
Both passes perform full shadowing, only the objects and depths change.

L. Spiro


Thanks!  To add more details to this I use a third party library called Vega Prime which handles much of the internal graphics rendering.  Following their "canned" usage model is what told me you could only have one dynamic shadow generator for one channel.  But perhaps with some digging I can figure out how to do as you suggest and render the channel with shadows on both channels without driving the system to its knees.

In Topic: How to determine if object is in view

15 July 2015 - 01:11 PM

What's the resolution of your depth buffer? Check if you're using a 16-bit depth buffer. If so, bump it up to a 24-bit one. Then, move your near and far planes back to how you had them originally.

Good call. But we already have the depth buffer max'd out to 24 bits which is supported by the video cards we use.  Typical flights sims don't have this problem as bad because you can LOD you far geometry out of the scene, no flicker if not being rendered.  But camera view zooming messes up the works.


A co-worker this morning said I would be polishing the horse and buggy wheels if I continue down the masking track even if it used pixel perfect resolution.  They suggest I buy a new car and pursue my second approach which is a design change.


But I still am interested in knowing how to detect the object is in view.

In Topic: 3D Minigame Ideas

22 December 2010 - 09:31 AM

Do they need to be original or can they be "knock-offs"?

If ideas about existing games is ok then some come to mind:

- Wii Play Tanks game
- Wii Resort sword dueling
- Toontown games like:
- shoot character from cannon into water bucket. (I love this one!)
- catch falling things, player with most at end of round wins
- swim through rings

Board games
- Connect four in 3D
- Checkers
- you name it
- matching game

Do you need full games for our portfolio or can they be demos?


In Topic: HELP!! I would really be grateful if someone looked at my code.

08 October 2010 - 08:04 AM

I think you're making a wise decision. Learning how to program while starting with small, simple programs will help you develop knowledge and confidence along the way.