Author Topic: Is There a Problem with the LOD Sytem???  (Read 982 times)

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8269
Is There a Problem with the LOD Sytem???
« on: October 21, 2018, 11:54:46 PM »
After 12 hrs yesterday and 14 hours today obsessing over this stuff my brain is mush.  So I may be totally off base, but I figures it is worth verifying.

I was playing with importing custom AC3D shapes into a custom terrain.  I was exporting HTC shapes and looking at how things were setup and then creating objects using the same pattern. 

I was mostly successful but I was seeing a few very minor anomalies that almost certainly wouldn't be visible in game, but were irritating my OCD.    I was seeing very subtle scintillating effects on some polys that in times gone by would suggest to me two polys overlapping too close to each other.  It appeared to be the low LOD shape interfering with the High LOD shape.  Bu that shouldn't have been due to the distance settings I copied from HTC objects. 

At one point, I had a bug where my shapes were not aligned properly and I was clearly seeing my low LOD shape at the same time as my high LOD shape.  WTF?


So I created a test object where instead of the multiple LOD objects being laid on top of each other, I had them offset so I could watch how the distance settings operated.  I had copied the distance settings from an exported standard HTC shape Bld000 (although many objects settings seem to do the same thing).  I then converted and tested within the OE.

(See attached image LOD_Close.png)
Up close you can see the poly from the Low LOD are being rendered from the get go!  Even though it should only be the high LOD this close. WTF?  You see it here because I have separated the shapes from occupying the same space.

As I pull back, the distance settings start fading out the high LOD shape as expected. (See atached images LOD_Mid.png nad LOD_Far.png)

Within the high LOD range are we putting all the polys from both LOD through the pipeline at the same time?

I also am attaching AC3D file with the distance settings I copied from HTC object bld000  to check what I did.  Just doesn't seem right to me. uhhg.  Need beer.  Need sleep.

OMG.  OK.  Get the ac3d file from here since you won't let me attach it!  https://www.dropbox.com/s/1jgso95f7czlutl/tstlod.ac?dl=0


:salute,
CptTrips





Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10899
Re: Is There a Problem with the LOD Sytem???
« Reply #1 on: October 22, 2018, 01:11:50 AM »
Is there a problem with the system, not that I know.

High definition with the most verts should visible close up and fade with distance like your cube.

Low definition shapes with fewer verts can be invisible up close, if you so create them that way, but are meant to replace the high def objects at distance for marginal PCs.

Your screen shots have the shapes sort of labeled correctly. The "Low" shows from zero to long distance and the "High" cube fades as expected.

The only thing I can question is your use of LOD in the images, which is reversed from matching up with the screen shots and your statement: "It appeared to be the low LOD shape interfering with the High LOD shape.  Bu that shouldn't have been due to the distance settings I copied from HTC objects."



The anomaly you describe can be over come by slightly offsetting the surfaces. For instance, creating a flat surface shape to cover the underlying ground, at zero elevation relative to a flat terrain tile will always cause a herringbone pattern. I find it best to create the flat surface shape a fraction of an inch above zero when making the shape. That way when placing the shape at zero elevaton I don't worry about tweaking each objects elevation.

The absolute worst thing you can do in creating ac3d objects is to use double sided textures. Make that mistake and you might as well forget about all the work involved using LODs.
Easy in-game again.
Since Tour 19 - 2001

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8269
Re: Is There a Problem with the LOD Sytem???
« Reply #2 on: October 22, 2018, 10:21:04 AM »
Is there a problem with the system, not that I know.

I could be wrong on this, but let me at least make sure I'm clear.  My noodle was over-baked by the time I wrote that last night.  :eek:

So, ignore that the two shapes in my test aren't different detail levels of the same shape as they normally would be.  Ignore that they are offset spatially; they are two groups in the same model definition.  All that was done just so I could more easily observe the LOD behavior. The sphere has the settings for the low LOD group, the cube has the settings for the high LOD group copied from the standard HTC shape bld000.

Expected behavior: 

I would expect the high LOD group to be rendered up close and the low LOD object to be absent.  As you pull away, I'd expect the high LOD shape to begin to fade out and the low LOD shape to fade in at the start of that transition range.  At some max distance, I'd expect the high LOD shape to fade completely and cease to be rendered, leaving only the low LOD grp.


Test:

I copied the LOD settings from a standard HTC object bld00 and used them as a canonical example.  They distance settings were:

Hi LOD Cube:
MaxDisplayDist=700.000000
MaxFadeRange=100.000000

Low LOD Sphere:
MinDisplayDist=600.000000
MaxDisplayDist=10000000.000000
MinFadeRange=150.000000
MaxFadeRange=150.000000

So based on these settings, it would appear the low LOD sphere should NOT have been rendered inside of 600, only the high LOD cube.   At range 600, the high LOD should have begun to fade out, and the low LOD sphere should have begun to fade in.  After range 700, only the low LOD sphere would be rendered.


Observed behavior:

The high LOD settings seemed to be working fine.   It was rendered in close and faded out at the expected distance.  The low LOD sphere appeared to be rendered the entire time.  Even at distance 0.

The Point?

Normally, you might not notice this effect as the two meshes are very similar and the occupy the same space.  Visually, it would appear to be working fine.  However, the system might be processing way more polys than are needed when flying close over complex scenes.  All the polys of the high LOD group AND all the polys of the low LOD group for no purpose.  And some shapes have multiple low LOD grps (low, very low, etc) so you might end up processing double the number of polys needed for no visual advantage.  At least, that is my concern. 

Might not make a huge difference with a powerful graphics card, but might be a problem for people with marginal systems.

Or I could be totally wrong, which would be nice to learn too so I can make sure and set up the LOD properly on my custom shapes.


:salute,
CptTrips




« Last Edit: October 22, 2018, 10:37:10 AM by CptTrips »
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12397
      • http://www.hitechcreations.com
Re: Is There a Problem with the LOD Sytem???
« Reply #3 on: October 22, 2018, 12:43:06 PM »
Depends which object you were testing with, some objects have an alpha blend over lap in LOD ranges to prevent popping.

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8269
Re: Is There a Problem with the LOD Sytem???
« Reply #4 on: October 22, 2018, 12:58:07 PM »
Depends which object you were testing with, some objects have an alpha blend over lap in LOD ranges to prevent popping.

The test model (see dropbox link) just has two simple meshes with the data fields copied from bld000.  Nothing else in this case.  No dead shapes or other LOD levels.  Just high and low.

So given that, should the setting "MinDisplayDist=600.000000" have prevented the low LOD sphere mesh from rendering inside of 600?  Or am I misunderstanding the meaning of that parameter?

Thanks in advance.


[edit, or maybe I didn't do something else right with that model that's causing this behavior.  That is always a possibility.   :D]

« Last Edit: October 22, 2018, 01:35:33 PM by CptTrips »
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12397
      • http://www.hitechcreations.com
Re: Is There a Problem with the LOD Sytem???
« Reply #5 on: October 22, 2018, 01:39:23 PM »
You are understanding min correctly, but also the real number will very greatly depending on user settings and field of view. With 2 lods like yours and change at 600.

First LOD would have min of 0 and max of 600, next LOD would have min of 600 and max of100,000

HiTech

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8269
Re: Is There a Problem with the LOD Sytem???
« Reply #6 on: October 22, 2018, 02:01:42 PM »
You are understanding min correctly, but also the real number will very greatly depending on user settings and field of view. With 2 lods like yours and change at 600.

First LOD would have min of 0 and max of 600, next LOD would have min of 600 and max of100,000

HiTech

OK.  Well, there is just something I'm not getting my head around.  I'll chew on it further.

As another test, I exported the bld000 and did nothing other than remove the high and dead shape groups from the model.  So the only shape group left was low that had a min dist at d600.

Importing it into OE I am seeing that shape rendered even when the view is directly up against it (see attached screenshot).  I can't be outside of d600 in that view so I wouldn't have expected it to be rendered. 

Oh, well.  I don't need to understand it.  I'll just set my shapes up like yours.  :D

I guess the root of my confusion is that I can see based on my settings the system rendering the hi LOD all the way out to infinity, or rendering the low LOD even up close,  I just don't see why they would be rendered both at the same time except during the limited cross-fade transition. 

[Maybe the OE is not following the same rendering rules as the in-game view?  Maybe I'm chasing ghosts?  Or maybe I'm just too dense to get what you are saying.  ;)]

« Last Edit: October 22, 2018, 02:16:53 PM by CptTrips »
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8269
Ahhh Haaah!!!
« Reply #7 on: October 24, 2018, 12:31:34 PM »
I think I have found an important clue.

I wrote this up because it appeared to me that the min display distance setting was not functioning.  And it clearly wasn't in my sphere/cube or exported/re-imported bld000 examples.

I checked to make sure I didn't have the alpha phase property checked and it did not, but I can see how that would have a similar effect.

However, what I found was that if I checked the alpha phase on and the hit ok, then edit tree again and checked it back off (Should have just been back where I started) , it is now fixed!  The low LOD group now does not display at close range.

So there was some error introduced in either the export, or import that caused the low LOD group to behave as if it had alpha phase turned on even though it shouldn't have been on and didn't show as on, and toggling the property on and off again in the OE fixed it again. 

Wiggling that checkbox fixed both my low LOD sphere and the low LOD bld000 tests.

So, I'm not as crazy as you probably think I am!  At least not in this context.  :)

So now my fear is, what other setting get mangled in the export/import workflow???   :O
« Last Edit: October 24, 2018, 12:37:30 PM by CptTrips »
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.