Jump to content

Tutorial: Terrain Textures in Kopernicus


Recommended Posts

So you have your own planet or moon and you want to make it look as good from close by as it does from up in orbit? Good terrain textures are the best way to make this happen. In this tutorial I will explain how to properly apply both stock and custom terrain textures to your planets using Kopernicus. This lesson is based on what I learned myself while learning to do this for my own mod OPM.

 

The tutorial consists of 2 parts:

  1. Applying textures to the terrain

  2. Making the textures appear where you want

 

Texture application

Note: for this step you can use built-in textures from the game or use your own custom textures. I will explain how you can do both.

 

Open up your body’s cfg in something like Notepad++ (Windows’ Notepad won’t do). To edit the terrain textures we have to use the Material node. If you've never touched terrain textures, you probably won't have this in your config yet. Here is where it goes (excuse bad formatting, blame the forum software):

@Kopernicus:AFTER[Kopernicus]
{  
	Body
    {
		PQS
        {
			Material
			{
			}
        }		
    }
}

So material is where we're going to do our magic. There's one thing that we have to do outside of the material node though and that's to set the material type. Not all stock planets use the same one and, since some types work less well than others, we're going to define the type so that we're always working with the best one.

@Kopernicus:AFTER[Kopernicus]
{  
	Body
    {
		PQS
        {
			materialType = AtmosphericExtra		
			Material
			{			
			}
        }		
    }
}

From now on everything we'll be doing in side of the Material node. For those who've dabbled with texturing before KSP 1.1, note that AtmosphericExtra is the successor to AtmosphericOptimized. If you used that before, use AtmosphericExtra now.

Before we start writing the material, you need to know that there are four texture slots we can use:

  1. Low: covers the lowest part of the terrain
  2. Mid: covers the area between low and high
  3. High: covers the highest part of the terrain
  4. Steep: covers all the steep areas like cliff faces, crater walls, the sides of mountains, etc. It will overlap with the three previous areas as steep parts can be anywhere

So now we know that, we can start adding the textures to these areas:

			Material
			{
				steepTex = CTTP/Textures/snow
				steepTexScale = 1,1
				steepTexOffset = 0,0
				steepBumpMap = CTTP/Textures/snow_normal
				steepBumpMapScale = 1,1
				steepBumpMapOffset = 0,0
				lowTex = CTTP/Textures/snow
				lowTexScale = 1,1
				lowTexOffset = 0,0
				lowBumpMap = CTTP/Textures/snow_normal
				lowBumpMapScale = 1,1
				lowBumpMapOffset = 0,0
				midTex = CTTP/Textures/snow
				midTexScale = 1,1
				midTexOffset = 0,0
				midBumpMap = CTTP/Textures/snow_normal
				midBumpMapScale = 1,1
				midBumpMapOffset = 0,0
				highTex = CTTP/Textures/sand
				highTexScale = 1,1
				highTexOffset = 0,0
				highBumpMap = CTTP/Textures/sand_normal
				highBumpMapScale = 1,1
				highBumpMapOffset = 0,0
			}

You see a lot of repeating stuff, so I'll only need to explain four of the values to help you understand what everything does:.

  • ...Tex: sets the main texture for this area
  • ...BumpMap: sets the bump map (or normal map) texture for this area. This doesn't have to look anything like your main texture, but if you want a unified look it's best you do.
  • ...Scale: sets the scale of the texture on the X and Y axis. The default 1,1 is what looks the best, so use that.
  • ...Offset: offsets the bumpmap from the main texture on the X and Y axis. The default 0,0 is what looks the best, so use that.

You'll see I've pointed the textures to a folder called CTTP. This is the Community Terrain Texture Pack  (still need to make a thread for this how others can use this). This is how you point to a custom terrain texture. Just replace the folder path to the one that matches your texture (YourModFolder/Textures/YourTexture for example).

You can also use the builtin terrain textures found in KSP. These are lower quality and not all textures have a matching bump map, but you won't have to put custom textures in your mod. Here's a list of builtin terrain textures. To apply them you have to use a different folder path: 

midBumpMap = BUILTIN/RockyGround

Next we're going to define how often these textures are applied to your planet. To prevent this code from becoming to long, imagine that the previous entries are also in Material.

			Material
			{
				steepNearTiling = 5000
				steepTiling = 50
				lowNearTiling = 5000
				lowMultiFactor = 50
				lowBumpNearTiling = 5000
				lowBumpFarTiling = 50
				midNearTiling = 5000
				midMultiFactor = 50
				midBumpNearTiling = 5000
				midBumpFarTiling = 50
				highNearTiling = 5000
				highMultiFactor = 50
				highBumpNearTiling = 5000
				highBumpFarTiling = 50			
			}

The higher the values you give to this tiling, the more detailed the terrain will become. Too much however will create noticeable tiling, making it look fake. So there's a fine balance. 5000/50 as shown above works well for textures with 1024x1024 resolution and what's on the texture looks close by, rather than far away. Is it 1024x1024 and the texture is far away (the case for CTTPs cliff and beach textures for example) than I've found 2500/25 to be a good fit.

An explanation of the rest in the code above:

  • NearTiling determines how often the texture tiles close to the player
  • Tiling, MultiFactor and FarTiling (Squad didn't make it consistent) determine how often the texture tiles far away from the player. This works best if lower than NearTiling
  • Steep only has NearTiling and Tiling for some reason, and these settings are used for the main texture and the bump map

STILL WRITING, WANTED TO MAKE SURE IT SAVED

Edited by CaptRobau
Link to comment
Share on other sites

  • 4 months later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...