Jump to content

xLODGen - Terrain LOD beta 111 for FNV, FO3, FO4, FO4VR, TES5, SSE, TES5VR, ENDERAL, ENDERALSE


sheson

Recommended Posts

14 minutes ago, Mousetick said:

I understand what 'Optimize Unseen' does but I'm not knowledgeable/smart enough to determine by myself what is best or why, so I follow others' recommendations in this regard.

Would anyone care to explain the difference of opinion between sheson and Z, specifically for LOD4, and the reasons why they both might be correct under different circumstances or considerations.

I should point out that xLODGen's default 'Optimize Unseen' is OFF for LOD Level 4. xLODGen and DynDOLOD's defaults are usually pretty good for all users in general and balanced for 'good enough' quality with minimal performance impact.

Thanks.

From Terrain-LOD-Readme.txt:
Optimize Unseen: on = merge large chunks of triangles under water resulting in less vertices. x = merge triangles and move shallow vertices under water to at least this distance below the water surface. The higher the value the more detail of the coast line is retained and less z-fighting between water and shallow terrain.

LOD level 4 with a good quality < 5 or so already has detailed coast lines very close to the original terrain. 0 is already perfect.

There should be no (not much) z-fighting in the first LOD level. If there is, it also probably happens in the active cells already and should probably be addressed by editing the actual landscape.

Setting optimize unseen to higher numbers means there can be steep, unnaturally dropped/combined/flattened terrain under water. In the first LOD level 4 there is a chance of that being seen depending on the underwater clarity, but there could also be holes to the skymesh.

Link to comment
Share on other sites

38 minutes ago, sheson said:

Setting optimize unseen to higher numbers means there can be steep, unnaturally dropped/combined/flattened terrain under water. In the first LOD level 4 there is a chance of that being seen depending on the underwater clarity, but there could also be holes to the skymesh.

Thanks for the clarifications.

Is the following picture a correct representation of what might happen as a result of using optimize unseen = x?

image.png

32 minutes ago, sheson said:

x = merge triangles and move shallow vertices under water to at least this distance below the water surface.

x is the depth at which the terrain LOD is sunk. But what characterizes shallow vertices? E.g. at what distance from the water surface is a vertex considered shallow?

Link to comment
Share on other sites

31 minutes ago, Mousetick said:

Thanks for the clarifications.

Is the following picture a correct representation of what might happen as a result of using optimize unseen = x?

image.png

x is the depth at which the terrain LOD is sunk. But what characterizes shallow vertices? E.g. at what distance from the water surface is a vertex considered shallow?

All terrain vertices that are below water height but higher than water height minus the value from optimized unseen are set to water z minus the value from optimized unseen.

So shallow terrain under water becomes these large flat areas that are the distance of the value from optimize unseen from the water level and their triangles are combined as much as possible.

Check a LOD level 32 BTR with NifSkope that has water. Solitude, Marsh, Ocean area.

Link to comment
Share on other sites

45 minutes ago, sheson said:

All terrain vertices that are below water height but higher than water height minus the value from optimized unseen are set to water z minus the value from optimized unseen.

OK, makes sense. This brings more questions :)

Is the size (X/Y/Z dimensions) of the combined chunk by the underwater triangle optimization a constant or a function of the LOD mesh quality?

If it's a function, wouldn't it make sense to use a low x value (e.g. 25 for LOD 4) for optimize unseen with high quality (e.g. 5 or greater for LOD 4) to prevent z-fighting and avoid steep drops while retaining some not too flattened detail?

Link to comment
Share on other sites

58 minutes ago, Mousetick said:

OK, makes sense. This brings more questions :)

Is the size (X/Y/Z dimensions) of the combined chunk by the underwater triangle optimization a constant or a function of the LOD mesh quality?

If it's a function, wouldn't it make sense to use a low x value (e.g. 25 for LOD 4) for optimize unseen with high quality (e.g. 5 or greater for LOD 4) to prevent z-fighting and avoid steep drops while retaining some not too flattened detail?

If all vertices of a triangle are lower than water minues optimize unseen they are ignored/optimized away, making a flat ground with as large as possible triangles.

Whatever you do with terrain LOD Level 4 that causes it to not match the edge of full terrain can lead to visible gabs or drops between the two.
Do you have any z-fighting between water and terrain LOD level 4 which does not already happen at the edge of the active cells? The consider shortening the LOD Level 4 distance (or just the terrain LOD multiplier) and do whatever needs to be done to LOD Level 8.

If 25 or 50 help and work for LOD Level 4, then just use it. Much higher values will most likely cause visual issues though.

Link to comment
Share on other sites

From what we've gathered, higher values at LOD 4 (or any level, really) theoretically should improve performance, right?

If shorelines of water bodies in any LOD level look accurate enough at full-LOD transition, and there isn't any noticeable z-fighting at a given maximum value of Optimized Unseen in a given LOD level, doesn't it make sense in terms of optimizing triangles rendered to use the highest value possible?

This is why we use the following values in the Step SSE guide ... so if things look good with these values on all shorelines, please provide a rationale for NOT using these max values at a given level in terms of quality-performance trade-off (note that some of these values could possibly be increased, since we didn't exhaustively test the exact 'sweet-spot' values at each level ... these appear to be 'safe' for the Step build):

  • LOD4: 500 (Protect Boraders ticked), quality=2
  • LOD8: 525, quality=4
  • LOD16: 625, quality=6
  • LOD32: 550, quality=0

PS: In case it isn't clear from the above, I'm not arguing here, just asking if any of the above is incorrect thinking in terms of performance-quality: if it looks good with max values and those quality settings, then everything is A-OK and higher values are theoretically better performance?

Link to comment
Share on other sites

9 hours ago, z929669 said:

From what we've gathered, higher values at LOD 4 (or any level, really) theoretically should improve performance, right?

If shorelines of water bodies in any LOD level look accurate enough at full-LOD transition, and there isn't any noticeable z-fighting at a given maximum value of Optimized Unseen in a given LOD level, doesn't it make sense in terms of optimizing triangles rendered to use the highest value possible?

This is why we use the following values in the Step SSE guide ... so if things look good with these values on all shorelines, please provide a rationale for NOT using these max values at a given level in terms of quality-performance trade-off (note that some of these values could possibly be increased, since we didn't exhaustively test the exact 'sweet-spot' values at each level ... these appear to be 'safe' for the Step build):

  • LOD4: 500 (Protect Boraders ticked), quality=2
  • LOD8: 525, quality=4
  • LOD16: 625, quality=6
  • LOD32: 550, quality=0

PS: In case it isn't clear from the above, I'm not arguing here, just asking if any of the above is incorrect thinking in terms of performance-quality: if it looks good with max values and those quality settings, then everything is A-OK and higher values are theoretically better performance?

Higher values for optimize unseen typically means more vertices/triangles are used for the coastlines, which means less triangles for above ground.
What really changes the number of triangles is combing submerged triangles, which happens with when optimize unseen is not off.
With graphics cards from the past decade or so, triangle count does not matter as much anymore. Draw calls are unaffected.

Moving vertices under water of triangles that cross the water plane causes the triangles to be steeper. This makes the coastlines look geometric. The higher the value, the actual shore line is moved inland to the edge of triangles that are completely above ground. That makes for ugly coastlines close up, that do not align well with the full terrain at the edge and the shift when full terrain replaces it when the cells attach can be visible.

With higher optimize unseen values for LOD Level 4, submerged triangles under water are of deleted, leaving holes in the under water terrain.
Just combining under water terrain triangles without dropping them or only by a small mount, can make shallow terrain under water worse, since the combined triangles are the height of the under water vertices close to the coast, meaning the surface of the remaining large triangles are not as deep as the original terrain.

The entire area in a LOD mesh has a finite number of max 65536 triangles which in this case typically require about half of that number of vertices, the artificial limit of 32768 set by LODGen. For LOD Level 4 it means it is possible to fit the entire full terrain resolution, e.g. quality -1. For the higher LOD levels it means that vertices have to be optimized away. If more vertices are used for coastlines, it means less vertices for the above water terrain, hence the combining of underwater triangles.

Quality 2: off, on, 550

off.pngon.png550.png

The noticeable shift between off/on and 550 is similar to the shift between full terrain and LOD when cells attach/detach.
If performance is of concern then "on" already removes the majority of triangles. If that causes more z-fighting, then dropping the under water vertices helps at the expense of geometric non matching coastlines. Since it seems nobody reported issues with the missing terrain, I guess the murky underwater covers that up in most load orders.

  • +1 1
  • Thanks 1
Link to comment
Share on other sites

8 hours ago, sheson said:

Higher values for optimize unseen typically means more vertices/triangles are used for the coastlines, which means less triangles for above ground.
What really changes the number of triangles is combing submerged triangles, which happens with when optimize unseen is not off.
With graphics cards from the past decade or so, triangle count does not matter as much anymore. Draw calls are unaffected.

Moving vertices under water of triangles that cross the water plane causes the triangles to be steeper. This makes the coastlines look geometric. The higher the value, the actual shore line is moved inland to the edge of triangles that are completely above ground. That makes for ugly coastlines close up, that do not align well with the full terrain at the edge and the shift when full terrain replaces it when the cells attach can be visible.

With higher optimize unseen values for LOD Level 4, submerged triangles under water are of deleted, leaving holes in the under water terrain.
Just combining under water terrain triangles without dropping them or only by a small mount, can make shallow terrain under water worse, since the combined triangles are the height of the under water vertices close to the coast, meaning the surface of the remaining large triangles are not as deep as the original terrain.

The entire area in a LOD mesh has a finite number of max 65536 triangles which in this case typically require about half of that number of vertices, the artificial limit of 32768 set by LODGen. For LOD Level 4 it means it is possible to fit the entire full terrain resolution, e.g. quality -1. For the higher LOD levels it means that vertices have to be optimized away. If more vertices are used for coastlines, it means less vertices for the above water terrain, hence the combining of underwater triangles.

Quality 2: off, on, 550

off.pngon.png550.png

The noticeable shift between off/on and 550 is similar to the shift between full terrain and LOD when cells attach/detach.
If performance is of concern then "on" already removes the majority of triangles. If that causes more z-fighting, then dropping the under water vertices helps at the expense of geometric non matching coastlines. Since it seems nobody reported issues with the missing terrain, I guess the murky underwater covers that up in most load orders.

Thanks for this explanation and these example shots.

In theory, is this the best setting for performance-quality trade-off favoring quality (i.e., no z-fighting of coastline water observed in-game)?

image.png

 

Is this ensuring no z-fighting "just in case", given previous setting is true?

image.png

 

Is this favoring performance a bit, given previous settings are true?

image.png

 

Finally, I'm assuming the settings for LOD8|16|32 I posted previously are 'good' for the p-q trade-off. It's quality of LOD4 we are mostly concerned about.

  • LOD8: 525, quality=4
  • LOD16: 625, quality=6
  • LOD32: 550, quality=0

 

PS: And 'yes' underwater is of no concern, since it's not apparent in my experience for our build.

8 hours ago, sheson said:

Since it seems nobody reported issues with the missing terrain, I guess the murky underwater covers that up in most load orders.

 

Link to comment
Share on other sites

1 hour ago, z929669 said:

Thanks for this explanation and these example shots.

In theory, is this the best setting for performance-quality trade-off favoring quality (i.e., no z-fighting of coastline water observed in-game)?

image.png

 

Is this ensuring no z-fighting "just in case", given previous setting is true?

image.png

 

Is this favoring performance a bit, given previous settings are true?

image.png

 

Finally, I'm assuming the settings for LOD8|16|32 I posted previously are 'good' for the p-q trade-off. It's quality of LOD4 we are mostly concerned about.

  • LOD8: 525, quality=4
  • LOD16: 625, quality=6
  • LOD32: 550, quality=0

 

PS: And 'yes' underwater is of no concern, since it's not apparent in my experience for our build.

I do not really test different settings. I would expect  there to not really be much of a performance difference between 0 and 1,2 with optimize unseen, unless there is already a struggling overloaded load order with low/limited VRAM were every saved byte counts.
I prefer LOD Level 4 terrain to match full terrain perfectly for zero shifts when it switches. Any optimize unseen is affecting the coastlines negatively in that regard. I still assume optimize unseen on or low values risks actually causing more z-fighting because of the shallow combined triangles. Hence I do not recommend to use Optimize Unseen for LOD Level 4 for best quality.
I do not notice obvious water/z-fighting of LOD level 4 (like with higher LOD levels, map without using optimize unseen) that does not already happen in attached cells.

I just give general tips like here https://dyndolod.info/Help/xLODGen#Generating-Terrain-LOD-Meshes, as the actual "best" values highly depend on the game version, load order, hardware and personal preference.

  • Thanks 1
Link to comment
Share on other sites

Observe the swamp area around Morthal as viewed from Solitude... probably the best location to test such changes. With higher LOD4 fBlockLevel0Distance levels, it may be more important for Optimize Unseen to remove distant z-fighting. I know we have it cranked rather higher than I would otherwise prefer in the Step guide due to grass LOD in Whiterun Tundra region. It may be feasible to halve fSplitDistanceMult to shorten that distance just for the terrain LOD.

Link to comment
Share on other sites

1 hour ago, DoubleYou said:

Observe the swamp area around Morthal as viewed from Solitude... probably the best location to test such changes. With higher LOD4 fBlockLevel0Distance levels, it may be more important for Optimize Unseen to remove distant z-fighting. I know we have it cranked rather higher than I would otherwise prefer in the Step guide due to grass LOD in Whiterun Tundra region. It may be feasible to halve fSplitDistanceMult to shorten that distance just for the terrain LOD.

There might be a bit of a conundrum then, since grass LOD kind of requires "perfect" terrain LOD otherwise it may just float/disappear because of coarse terrain LOD, so my gut instinct would try to avoid showing it with LOD Level 8 terrain. It will probably still be good enough, also because of under water triangles being combined and so the everything above water can use more triangles.

Link to comment
Share on other sites

Very interesting discussion about LOD4 Optimize Unseen.

I'd like to bring up another point:

On 7/12/2023 at 5:40 PM, sheson said:

There is no point in generating mipmaps for normal map textures in Skyrim as game does not use them. It just prolongs generation time.
Only the mipmaps of LOD 4 diffuse textures are used by the game.

From https://dyndolod.info/Help/xLODGen#Generating-Terrain-LOD-Textures:

Quote

MipMap should only be enabled for LOD4 and the Build diffuse. The game does not use mipmaps for higher LOD levels and never for terrain LOD normalmap textures.

Sorry to ask, but "Skyrim" and "the game" can be a bit ambiguous. So just to make sure, can you confirm this applies to Skyrim SE?

The STEP Guide which I've been following up to now for Terrain LOD generation instructs to enable mipmaps for LOD 4 normals:

XLODGen_LOD4.jpg

This seems incorrect, then. Harmless, but a waste of time (longer generation), of disk space (larger texture files) and possibly VRAM as well.

What about LOD 32? Does it differ from LOD 8 and 16 regarding all mipmaps being useless?

The STEP Guide instructs to enable mipmaps for both LOD 32 diffuse and normals:

XLODGen_LOD32.jpg

This looks incorrect, too.

Thanks.

Link to comment
Share on other sites

50 minutes ago, Mousetick said:

Very interesting discussion about LOD4 Optimize Unseen.

I'd like to bring up another point:

From https://dyndolod.info/Help/xLODGen#Generating-Terrain-LOD-Textures:

Sorry to ask, but "Skyrim" and "the game" can be a bit ambiguous. So just to make sure, can you confirm this applies to Skyrim SE?

The STEP Guide which I've been following up to now for Terrain LOD generation instructs to enable mipmaps for LOD 4 normals:

XLODGen_LOD4.jpg

This seems incorrect, then. Harmless, but a waste of time (longer generation), of disk space (larger texture files) and possibly VRAM as well.

What about LOD 32? Does it differ from LOD 8 and 16 regarding all mipmaps being useless?

The STEP Guide instructs to enable mipmaps for both LOD 32 diffuse and normals:

XLODGen_LOD32.jpg

This looks incorrect, too.

Thanks.

Skyrim = Skyrim LE/SE/AE/VR

If it says mipmaps are only used by terrain LOD Level 4 diffuse in the active cell fade, then it means they are not used anywhere else.

If you have feedback or question for third party guide, you should make a post on its forum, discord etc.

Link to comment
Share on other sites

9 minutes ago, sheson said:

If it says mipmaps are only used by terrain LOD Level 4 diffuse in the active cell fade, then it means they are not used anywhere else.

If you have feedback or question for third party guide, you should make a post on its forum, discord etc.

I just wanted to confirm my understanding and vet my assessment with you first so I wouldn't look like a clown by providing erroneous feedback.

Also as you know the STEP Guide folks are the same crew hosting this forum, and they regularly read this topic, so by posting here I could kill 2 birds with 1 stone :)

Thanks.

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.