[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
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Project "Increased Terrain Distance"

Post by Interkarma »

Nystul wrote:I am currently fighting 2 issues, any advice is appreciated.

1.) object placement at locations at higher altitudes is wrong (objects are placed too low or too high (flying around)). I tested this with the tools without additional scripts when using TerrainScale of 6 one can spot these effects in mountain regions with higher altitude:

Image

I first thought of floating-point-precision issues, but we are dealing with a maximum height value of 9234, which should not be too much... or what do you think
Effects get more dramatic when exaggerating heights even more (with objects off position about half the player height)
Sounds like a small bug in calculating location elevation. Can you hit me with map pixel coords or region/location name for the screenshot above? I'll take a look at what's going on. :)

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

Re: Project "Increased Terrain Distance"

Post by Nystul »

mapPixelX: 847, mapPixelY: 447
TerrainScale 6 (if you increase it further, the effect becomes more evident)

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

Re: Project "Increased Terrain Distance"

Post by Interkarma »

Cheers mate, I'll take a look. My feeling is this will likely be precision-related. Unlike the X-Z axes where I've taken care to reduce precision requirements, the Y axis is fairly loose. A minute precision difference between terrain system and model placement calculation can be enough to cause a discrepancy of a few centimetres like that. Fortunately, there are a few ways to skin this cat. :)

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

Re: Project "Increased Terrain Distance"

Post by Nystul »

the effect is ignorable in your implementation with small TerrainScale values, but as I bump up the heights this gets really heavy

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

Re: Project "Increased Terrain Distance"

Post by LypyL »

Regarding the fog, it's something I'm planning on getting to in the future (I've just been turning off the fog for now when using the enhanced sky)- but if IIRC, the fog gets tinted by the exterior ambient light setting on the Player Ambient Light scipt, which is attached to the player object.

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

Re: Project "Increased Terrain Distance"

Post by Interkarma »

The DaggerfallSky script sets fog colour based on field cameraClearColor, which is read from bottom row of native sky frame at that time of day. It also uses this colour for clearing camera before rendering. You should double-check that my SkyRig prefab or DaggerfallSky script are not in the scene (or disabled) when using another sky solution.

BTW, check out the new GlobalFog effect. It's pretty cool. I can imagine it being used for fog around graveyards among other things.

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

Re: Project "Increased Terrain Distance"

Post by LypyL »

The DaggerfallSky script sets fog colour based on field cameraClearColor, which is read from bottom row of native sky frame at that time of day. It also uses this colour for clearing camera before rendering. You should double-check that my SkyRig prefab or DaggerfallSky script are not in the scene (or disabled) when using another sky solution.
My enhanced sky script disables the skyrig whenever it's active, so that shouldn't be an issue. At least in my testing I've never experienced any issues :D
BTW, check out the new GlobalFog effect. It's pretty cool. I can imagine it being used for fog around graveyards among other things.
Ohhhh that's nice. I could also see it being used in certain areas of dungeons (like the large open areas). Another thing I want to see is dust particles in the desert.

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

Re: Project "Increased Terrain Distance"

Post by Nystul »

Interkarma wrote:Cheers mate, I'll take a look. My feeling is this will likely be precision-related. Unlike the X-Z axes where I've taken care to reduce precision requirements, the Y axis is fairly loose. A minute precision difference between terrain system and model placement calculation can be enough to cause a discrepancy of a few centimetres like that. Fortunately, there are a few ways to skin this cat. :)
would like to have a solution for this. how could one tackle this issue? ;)

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

Re: Project "Increased Terrain Distance"

Post by Interkarma »

Like I said, I'll take a look when I can. I've been stuck under a huge pile of work for the last 6 weeks or so, so my output is sadly reduced. Hopefully I can get back to spending more time on the Tools in the next few weeks.

But I totally understand that you're in the thick of and want a solution faster, so let's bounce some ideas around. :)

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).

I hope that makes sense. I'm wrapping up a 15 hour work day and I'm truly smashed out of my head with sleepy-eyes. This also means I can't guarantee accuracy of above information, so go easy on me if it's not that helpful. I'll edit in the morning for clarity if needed. :D

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

Re: Project "Increased Terrain Distance"

Post by Nystul »

I didn't intend to put stress on you ;)
I know what you are talking about, I had almost zero time lately to work on my terrain ideas :(
thanks for your suggestion, I will take a closer look at it. I will further take a closer look at floating origin and I want to try to expand the concept to the y-axis as well. The reason for this is that I also experience heavy shadow glitches with my modifications. I am not sure but I think it is related to high altitudes and floating-point precision there. ;)
my todo-list is getting larger than smaller everytime I spend more time on thinking^^

Post Reply