[MOD] Distant Terrain

A curated forum for compatible and maintained mods. Users are unable to create new topics in this forum but can reply to existing topics. Please message a moderator to have your mod moved into this forum area.
Post Reply
User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Project "Increased Terrain Distance"

Post by Nystul »

Uncanny_Valley wrote:That's some great work. I love the progress that you made thus far. Have you increased the resolution of the height map, or is that still the same as before?
no, it is still the 1000x500 altitude map

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Project "Increased Terrain Distance"

Post by Interkarma »

Nystul wrote:
Interkarma wrote: Completely ignoring cities for a minute, do nature flats in the wilderness more or less align correctly to the ground at such high terrain scales, or do they float a little also?

If nature flats in wilderness seem to align OK, my first strategy would be to change how a location's vertical position is assigned to work more like nature flats. There's probably a discrepancy between Unity's representation of terrain heights and the calculated average position from source data. The more you scale the terrain, the more the discrepancy is scaled also. The nature flats work differently in that they use SampleHeight() directly from live Terrain. This may yield more accurate alignment of fixed structures than the current method of calculating city height based on source data.

In short, see how nature flats use SampleHeight() in TerrainHelper.cs (line 537) and try to apply this method to cities in StreamingWorld.cs (starting at line 691).
that was an easy fix!
my todo list becomes shorter and shorter :)
Awesome! Glad that worked out. :)
Nystul wrote:there are some issues left (but i am not sure if it is a good idea to tackle them before releasing the planned demo, since I don't know how much work is involved in fixing these issues:

-) the sun of Lypyl's Enhanced Sky Mod is in front of the far terrain (not occluded correctly by the far terrain)
-) fog color does not match the color of the enhanced sky - this is especially an issue when it is night and you can see bright grey fog in the night :/
-) in high altitudes false shadows/moire effect pattern type shadows start to appear (I think this is a floating point issue and could be solved by using floating-origin script with y-axis incorporation), see this screenshot:

Image
You'd be right on the shadows. I start noticing artifacts after you exceed 1000 units in any direction. I'm sure the other few issues won't be too hard to resolve.

BTW, that mouse problem is a known issue that I fixed in another project. I must not have moved the fix over to DFTFU yet. I'll make sure this is in the next push.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Project "Increased Terrain Distance"

Post by Interkarma »

Nystul wrote:this is what I am messing around with currently:

Image

Mountains are a bit too high I think (does one know how high they should be in terms of altitude values? have to check the elderscrolls wiki
Holy...

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Project "Increased Terrain Distance"

Post by LypyL »

Nystul wrote:
Interkarma wrote:

-) the sun of Lypyl's Enhanced Sky Mod is in front of the far terrain (not occluded correctly by the far terrain)
-) fog color does not match the color of the enhanced sky - this is especially an issue when it is night and you can see bright grey fog in the night :/
:
The sun issue - That's because flares are blocked by collider so without them they will be rendered. I have a potential fix I've been working on for the problem for the horizon without the extended terrain but hopefully it should help most of the time with it as well. Unfortunately it requires turning off the flare layer on the main camera which is probably not viable in the long term as there might be other flares being used down the line...but for the demo and beyond the fix (should) work. The worst case scenario is to just get rid of the flare.

the fog - As I pointed out before, I simply haven't gotten to it yet...

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Project "Increased Terrain Distance"

Post by Nystul »

Interkarma wrote: BTW, that mouse problem is a known issue that I fixed in another project. I must not have moved the fix over to DFTFU yet. I'll make sure this is in the next push.
ah ok, I deleted my comment on this, after trying to reproduce it and failing to do so ;)
Interkarma wrote: Holy...
:D
There was a little bug in my computation formula that prevented water positions on the mainland to appear, I have fixed that in the meantime
LypyL wrote: The sun issue - That's because flares are blocked by collider so without them they will be rendered. I have a potential fix I've been working on for the problem for the horizon without the extended terrain but hopefully it should help most of the time with it as well. Unfortunately it requires turning off the flare layer on the main camera which is probably not viable in the long term as there might be other flares being used down the line...but for the demo and beyond the fix (should) work. The worst case scenario is to just get rid of the flare.

the fog - As I pointed out before, I simply haven't gotten to it yet...
I will try if terrain colliders on the far terrain are the solution. If this all it needs I would be happy

For the fog color: I tried to set fog color according to the cloud colors (in function setTextureColor() in CloudGenerator.cs) - this sometimes works, but often does not give a suitable color to be used as fog color:

Code: Select all

  RenderSettings.fogColor = cloudColors.Evaluate(timeRat);
If I would only manage to sample the right color from the sky in an easy way (of course one could render the skybox to a texture and read from there, but this feels like too much overhead just for retrieving one color value)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Project "Increased Terrain Distance"

Post by Nystul »

I have added colliders to the far terrain, though it doesn't seem to work
This is strange because i tried to set them up in the same way as in DaggerfallTerrain.cs
normal terrain occludes the flare, far terrain does not - strange
maybe I did something wrong
anyway, I will finish version 1.2 of my script asap
btw, I would not deactivate the flare in the demo, even if it doesn't get occluded correctly by the far terrain, it looks to good and the problem does not happen that often ;)

edit:
IncreasedTerrainDistance v1.2 is available here (including the optional ImprovedWorldTerrain script):
http://s000.tinyupload.com/?file_id=240 ... 7561644920

here are the other files I have changed in the last weeks - (you will need the changes from StreamingWorld.cs and TerrainHelper.cs for the ImprovedWorldTerrain script to work):
http://s000.tinyupload.com/?file_id=677 ... 8006571323

changes in the WoodsFile.cs were experiments on my side with the woods.wld file (it supports file export now and stores the noisemap data in a separate buffer now)
changes in the ExplorerMode.cs are small: keypress m shows the distance from water map (used this for debugging), I want to show a world map later instead of it, keypress n exports the woods.wld file (to hardcoded path in WoodsFile.cs in function private bool Write()) which one would have to change to the desired output path of course

edit: unfortunately the far terrain positioning suffers from a bug, I thought I solved this already but it seems to strike back in an bitchy way ;) I will update the link when I solved this. Though I can't estimate how long it will take

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Project "Increased Terrain Distance"

Post by LypyL »

It looks like it still requires disabling the flare layer on the main camera

After a quick check, it looks like removing flare layer from main camera, distance camera, enabling the flare layer on sky camera and adding default layer to the flare's list of ignored layers (or moving the enhanced sky controller so it doesn't intersect with the terrain colliders) makes it work - but I'll need to test it further to make sure.
unfortunately the far terrain positioning suffers from a bug, I thought I solved this already but it seems to strike back in an bitchy way ;) I will update the link when I solved this. Though I can't estimate how long it will take
Is that what's causing the distant terrain to shift / move around weirdly? I didn't recall it happening in 1.1, but I'm not sure if that was the case.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Project "Increased Terrain Distance"

Post by Nystul »

LypyL wrote: Is that what's causing the distant terrain to shift / move around weirdly? I didn't recall it happening in 1.1, but I'm not sure if that was the case.
exactly, I am not sure what reintroduced this bug or if it was never really fixed.
one can easy reproduce it by entering high-runspeed-mode with key "h" and running into one direction, after a few blocks it starts to behave weird ;)

edit: this gets more and more mysterious. I tested the new version on my system at work and it worked without any problem out of the box. No terrain shift/move at all. I have to find the difference in the two setups...
edit2: I found the culprit: active floatingorigin script in PlayerAdvanced. Interkarma, where do one have to put this script and activate it. Somehow I found it on 3 different places: PlayerAdvanced, Camera and StreamingWorld - is this correct?

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Project "Increased Terrain Distance"

Post by Nystul »

LypyL wrote:It looks like it still requires disabling the flare layer on the main camera

After a quick check, it looks like removing flare layer from main camera, distance camera, enabling the flare layer on sky camera and adding default layer to the flare's list of ignored layers (or moving the enhanced sky controller so it doesn't intersect with the terrain colliders) makes it work - but I'll need to test it further to make sure.
that made the trick!

User avatar
LypyL
Posts: 512
Joined: Sun Mar 22, 2015 3:48 am

Re: Project "Increased Terrain Distance"

Post by LypyL »

You can get rid of the terrain colliders on the distant terrain if you want, I've tested that idea I had for a fix and it seems to be working. Any luck with the terrain bug?

Post Reply