Page 32 of 60

[MOD] Distant Terrain

Posted: Thu Jun 14, 2018 9:42 pm
by Nystul
@Interkarma: working on an updated version of my DistantTerrain mod (and making it compatible with Uncanny Valley's "Mountains And Hills" mod).

I realized that we will run into problems with terrain samplers not using a baseHeightScale and noiseMapScale equal to DefaultTerrainSampler. Luckily it seems that Uncanny Valley's mod uses same scale factors as DefaultTerrainSampler (8.0, 4.0 which add up to a scaling factor of 12.0).

To get matching near terrain and far terrain I have to scale the small height map with this factor (I just assume it to be 12.0 for the moment).

Now what happens if the terrain sampler function GenerateSamples generates height samples with different scale is that this won't fit far terrain height values of DistantTerrain mod.

A workaround to support custom terrain samplers with different scale factor would be to introduce a settings float value for distant terrain mod. This would work but would require the user to know the correct values for the terrain sampler in use.
A better way would be if distant terrain mod could get the scale factor from the terrain sampler (like with properties MaxTerrainHeight, OceanElevation and BeachElevation)

What are your thoughts about this?

Re: [MOD] Distant Terrain

Posted: Thu Jun 14, 2018 10:21 pm
by Interkarma
I understand, and I'd be happy for the ITerrainSampler interface and base class to expose this property so others can use it.

I'm happy for you to add this so it suits your needs precisely, but just let me know if any assistance required.

Re: [MOD] Distant Terrain

Posted: Thu Jun 14, 2018 10:52 pm
by Nystul
Distant Terrain 2.3.0 (only compatible with new dfunity version with new baseline (Unity 2018.1.2f1)):
https://drive.google.com/file/d/1GoYxeU ... sp=sharing

Re: [MOD] Distant Terrain

Posted: Thu Jun 14, 2018 11:00 pm
by Nystul
Interkarma wrote: Thu Jun 14, 2018 10:21 pm I understand, and I'd be happy for the ITerrainSampler interface and base class to expose this property so others can use it.

I'm happy for you to add this so it suits your needs precisely, but just let me know if any assistance required.
Ok, I will work on it ;) Will try to coordinate with Uncanny Valley so I do not break his mod ;)

Re: [MOD] Distant Terrain

Posted: Fri Jun 15, 2018 3:31 pm
by Uncanny_Valley
Nystul wrote: Thu Jun 14, 2018 11:00 pm
Interkarma wrote: Thu Jun 14, 2018 10:21 pm I understand, and I'd be happy for the ITerrainSampler interface and base class to expose this property so others can use it.

I'm happy for you to add this so it suits your needs precisely, but just let me know if any assistance required.
Ok, I will work on it ;) Will try to coordinate with Uncanny Valley so I do not break his mod ;)
Thank your for your consideration. :) My plan is to update my mods over the weekend, and if there anything I can fix or change on my end to improve compatibility, just let me know. :)

Re: [MOD] Distant Terrain

Posted: Sat Jun 16, 2018 9:21 am
by Nystul
ok, so here is what my latest pull request does and how you can update your mod to work with next version of Distant Terrain mod:

here is a copy of the comment of the pull request:

new property MeanTerrainHeightScale and new method TerrainHeightScale added

default use is fixed terrain height scale factor - set MeanTerrainHeightScale in constructor (SimpleTerrainSampler, NoiseTerrainSampler, DefaultTerrainSampler)

more sophisticated use: terrain height scale factor depends on map pixel position - override for method TerrainHeightScale(x,y) happens in this case (used by Distant Terrain Mod's Improved Terrain Sampler)


what you will have to do (once the pull request is accepted) is to add a line to the constructor of your terrain sampler like in DefaultTerrainSampler:

Code: Select all

MeanTerrainHeightScale = baseHeightScale + noiseMapScale;
just replace baseHeightScale + noiseMapScale with your scaling factor (if it differs)

as soon as the pull request is accepted I will also update Distant Terrain from 2.3.0 to 2.4.0 (it will use new methods then)

Re: [MOD] Distant Terrain

Posted: Mon Jun 18, 2018 9:23 am
by Nystul
Distant Terrain 2.4.0 (uses new changes to Terrain Sampler, only compatible with new dfunity version with new baseline (Unity 2018.1.2f1)):
https://drive.google.com/file/d/11oVri4 ... sp=sharing

ready to be moved to Released Mods forum :)

Re: [MOD] Distant Terrain

Posted: Mon Jul 09, 2018 9:34 pm
by ZephaniahNoah
Not compatible with Enhanced Sky?
Spoiler!
Image
EDIT: My bad. Enhanced Sky just doesn't work with the current build of DFU.

Re: [MOD] Distant Terrain

Posted: Mon Jul 09, 2018 10:29 pm
by Interkarma
Nystul is working on an update for Enhanced Sky that's compatible with latest version. It's still a work in progress, but you can download best available version from this post (last post on that page).

https://forums.dfworkshop.net/viewtopic ... =40#p14123

Once Nystul is happy with the rebuilt mod, it will be placed back into Released Mods forums with a topic of its own.

Re: [MOD] Distant Terrain

Posted: Sat Jul 14, 2018 2:04 am
by Midknightprince
ZephaniahNoah wrote: Mon Jul 09, 2018 9:34 pm Not compatible with Enhanced Sky?
Spoiler!
Image
EDIT: My bad. Enhanced Sky just doesn't work with the current build of DFU.
It's been updated, it works..
make sure it's 2.1, that's the one that works for me..