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.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:
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)
[MOD] Distant Terrain
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Project "Increased Terrain Distance"
- Nystul
- Posts: 1501
- Joined: Mon Mar 23, 2015 8:31 am
Re: Project "Increased Terrain Distance"
mapPixelX: 847, mapPixelY: 447
TerrainScale 6 (if you increase it further, the effect becomes more evident)
TerrainScale 6 (if you increase it further, the effect becomes more evident)
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Project "Increased Terrain Distance"
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.
- Nystul
- Posts: 1501
- Joined: Mon Mar 23, 2015 8:31 am
Re: Project "Increased Terrain Distance"
the effect is ignorable in your implementation with small TerrainScale values, but as I bump up the heights this gets really heavy
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Project "Increased Terrain Distance"
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.
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Project "Increased Terrain Distance"
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.
BTW, check out the new GlobalFog effect. It's pretty cool. I can imagine it being used for fog around graveyards among other things.
- LypyL
- Posts: 512
- Joined: Sun Mar 22, 2015 3:48 am
Re: Project "Increased Terrain Distance"
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 issuesThe 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.
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.BTW, check out the new GlobalFog effect. It's pretty cool. I can imagine it being used for fog around graveyards among other things.
- Nystul
- Posts: 1501
- Joined: Mon Mar 23, 2015 8:31 am
Re: Project "Increased Terrain Distance"
would like to have a solution for this. how could one tackle this issue?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.
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Project "Increased Terrain Distance"
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.
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.
- Nystul
- Posts: 1501
- Joined: Mon Mar 23, 2015 8:31 am
Re: Project "Increased Terrain Distance"
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^^
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^^