Jump to content

Advanced Kopernicus: textures from PQSMods


The White Guardian

Recommended Posts

Perhaps one of the biggest issues for Kopernicus modders is textures. "How do you make textures?" is a common question, but the answer is easy. Textures can be obtained from various sources, but perhaps one of the most convenient ways and the one that will likely result in stockalike planets is by generating planets from PQSMods. This method requires two things:

- Kopernicus itself

- KittopiaTech, 'A Kopernicus visual editor', which can be found here:

Got all of that? Okay then! The next step is writing the config as usual, but 'forget' to specify the ScaledVersion (leave it out completely)

An example of a config:

Spoiler

@Kopernicus:AFTER[Kopernicus]
{
    Body
    {
        name = ProceduralPlanet
        cacheFile = ProceduralPlanet/Cache/ProceduralPlanet1.bin
        Template
        {
            name = Minmus
            removeAllPQSMods = true
        }
        Properties
        {
            description = Procedural planet
            radius = 200000
            rotates = true
            rotationPeriod = 60000
            tidallyLocked = false
            initialRotation = 0
            geeASL = 0.5
            timewarpAltitudeLimits = 0 10000 17500 25000 40000 60000 80000 200000
            ScienceValues
            {
                landedDataValue = 7
                inSpaceLowDataValue = 6.5
                inSpaceHighDataValue = 6
                recoveryValue = 8
                spaceAltitudeThreshold = 175000
            }
        }
        Orbit
        {
            referenceBody = Sun
            semiMajorAxis = 9000000000
            inclination = 0
            eccentricity = 0.009
            longitudeOfAscendingNode = 0
            argumentOfPeriapsis = 0
            meanAnomalyAtEpoch = 0
            epoch = 0
            color = 0.5,0.5,0.5,1.0
        }
        PQS
        {
            Mods
            {
                [We will add mods to this later]
            }
        }
    }
}

Alrighty then! We will not add the ScaledVersion yet, because we do not have the textures to update the ScaledSpace with so it's no use specifying it. The planet will still work, however, in ScaledSpace it will have the textures of the templated planet, in the example, Minmus.

Now, to build the terrain, there are many PQSMods that you can use, but we'll keep it simple for now. Let's use VertexSimplexHeightAbsolute for now.

An example of the mod VertexSimplexHeightAbsolute:

VertexSimplexHeightAbsolute
{
	seed = 123
	deformity = 100
	octaves = 3
	persistence = 0.5
	frequency = 1
	enabled = true
	order = 2
}

However, since we are going to use this mod twice, we need to add a value called 'name'. Example:

VertexSimplexHeightAbsolute
{
	name = HeightModAlpha
	seed = 123
	deformity = 100
	octaves = 3
	persistence = 0.5
	frequency = 1
	enabled = true
	order = 2
}

The 'name' does not matter, as long as the two mods have different names. Anyhow, the 'Mods' part of your config should look like this now:

VertexSimplexHeightAbsolute
{
	name = HeightMod1
	seed = 123
	deformity = 5000
	octaves = 3
	persistence = 0.5
	frequency = 1
	enabled = true
	order = 2
}
VertexSimplexHeightAbsolute
{
	name = HeightMod2
	seed = 456
	deformity = 2500
	octaves = 3
	persistence = 0.5
	frequency = 1
	enabled = true
	order = 3
}

Note that both mods have different 'seeds', this is to make sure that the mods do not affect the same terrain, so it'll result in varied terrain instead of a planet that is suffering from 'hill-layercakes'.

Note that the second mod is loaded later (it's 'order' is higher), this is because the first mod will add hills, and the second mod is meant to fine-tune it. Change the deformity to increase or decrease the effects, raise or lower the frequency if you think your planet has too many hills, you can change the values a bit and see what happens. The best way to do this is later, after loading the planet, by pressing CTRL+P to open Kittopia, edit the PQSMods and see what happens in-game.

Anyhow, we've already got some nice hills, but how do we color the terrain? There are many colormods as well, but the one I use most of the time is HeightColorMap. Example code:

HeightColorMap
{
	blend = 0.5
	enabled = true
	order = 10 //make this number higher than the HeightMods
	LandClasses
	{
		Class
		{
			name = Base
			altitudeStart = 0
			altitudeEnd = 0.1
			color = 0.1,0.1,0.1,1.0
			lerpToNext = true
		}
		Class
		{
			name = Low
			altitudeStart = 0.1
			altitudeEnd = 0.6
			color = 0.1,0.1,0.6,1.0
			lerpToNext = true
		}
		Class
		{
			name = Mid
			altitudeStart = 0.6
			altitudeEnd = 0.8
			color = 0.2,0.2,0.8,1.0
			lerpToNext = true
		}
		Class
		{
			name = High
			altitudeStart = 0.8
			altitudeEnd = 2
			color = 1.0,1.0,1.0,0.8
			lerpToNext = false
		}
	}
}

HeightColorMap colors the terrain based off the altitude. You can learn more about this mod in my guide on PQSMods, found here:

And done! You can now load the planet, and it will work just fine! To prove it, I have loaded the example, and this is the result:

As you can see, it looks pretty good! But, how do you export textures through Kittopia?

In-game, press CTRL+P. Then, click 'planet selection' and select your planet. Click 'export textures', then click 'update scaledspace'.

Kittopia will now export the textures and is even nice enough to show the results immediately after completion! You can then close KSP.

Next up: editing the config: specify scaledspace. Now that we have the textures, found in GameData/KittopiaTech/Textures/[PlanetName]

Move them to whatever location you want, then add this to the config:

ScaledVersion
{
	type = [Vacuum or Atmospheric]
	fadeStart = 0
	fadeEnd = 0
	Material
	{
		texture = [FILEPATH]/[NAME OF THE EXPORTED COLORMAP].png
		normals = [FILEPATH]/[NAME OF THE EXPORTED NORMAL MAP].png
		shininess = 0.09
		specular = 0.0,0.0,0.0,1.0
	}
}

As you can see, you don't even have to change the files' names, as long as you write the filepaths correctly. But it gets better: the exported Normal map is completely fine! No DXT5_nm conversion needed! And, if you place the textures in a folder named 'PluginData' and specify the file format (in the example .png), you can even enable OnDemandLoading!

And done! You have just made a completely procedural planet! But the possibilites do not end there, there are far more PQSMods that you can use, an example is VertexHeightNoise, that adds mountains, hills, etc to your planet depending on the type. Check the PQSMods guide I wrote for more info on various mods (I'll add info as time progresses)

But there is one step that nobody should forget: if you edit your planet's config file, after editing, ALWAYS remove the planet's 'Cache.bin' file, otherwise the old scaledspace model will stay in place while landing, which is a very eerie sight, though easy to fix.

Also, did you just realize what you've made? You have made:

- A stable, working planet

- Using NO EXTERNAL TEXTURES AT ALL

- THAT IS PROCEDURALLY GENERATED!

Isn't it fantastic? Happy planetbuilding, Kerbs!

Edited by The White Guardian
Link to comment
Share on other sites

I think it would be very helpful if within these tutorials an explanation was also given to the effect that the variables have for each parameter within each PQS you wish to list, for example

VertexSimplexHeight
	{
	deformity = x
	frequency = x
	octaves = x
	persistence = x
	seed = x
	}

i.e. Deformity: "Example variables with detailed explanation as to what effect this has on the terrain. Also include breakdown as to how these numbers are interpreted by KSP (would require examining source code)."

At the moment the understanding of PSQMods is a bit of a black magic as no documentation has been written to break them down as to what they actually do. If you were to do this extensively and properly, I'm sure there would be many who would be grateful if you decided to do so.

Just my 2 cents. :D

Link to comment
Share on other sites

39 minutes ago, Poodmund said:

I think it would be very helpful if within these tutorials an explanation was also given to the effect that the variables have for each parameter within each PQS you wish to list, for example


VertexSimplexHeight
	{
	deformity = x
	frequency = x
	octaves = x
	persistence = x
	seed = x
	}

i.e. Deformity: "Example variables with detailed explanation as to what effect this has on the terrain. Also include breakdown as to how these numbers are interpreted by KSP (would require examining source code)."

At the moment the understanding of PSQMods is a bit of a black magic as no documentation has been written to break them down as to what they actually do. If you were to do this extensively and properly, I'm sure there would be many who would be grateful if you decided to do so.

Just my 2 cents. :D

This guide focuses on choosing the right PQSMods and how to export the textures. In-depth explanation of PQSMods (what PQSMod does what, and what does each variable do?) is another guide, found here:

I'll update this thread later though, it might indeed come in handy.

Edited by The White Guardian
Link to comment
Share on other sites

Umm... I mean, it worked, but... It looks a bit ugly...

BPJZRgR.png

Code:

@Kopernicus:AFTER[KOPERNICUS]
{
	Body
	{
		name = Prolla
		cacheFile = MoonsPlus/DunaPlusRevived/Cache/Prolla.bin
		Template
		{
			name = Dres
			removeAllPQSMods = true
		}
		Properties
		{
			description = Prolla is a medium sized moon orbiting Duna a bit closer than Ike. Scientists say that this moon was created by an asteroid stike on Duna, a similar event to how Ike was formed.
			radius = 75000
			geeASL = 0.125
			rotationPeriod = 20000
			rotates = true
			tidallyLocked = false
			initialRotation = 0
			isHomeWorld = false
			timewarpAltitudeLimits = 0 2500 5000 7500 10000 150000 200000 300000
			ScienceValues
			{
				landedDataValue = 5
				splashedDataValue = 5
				flyingLowDataValue = 0
				flyingHighDataValue = 0
				inSpaceLowDataValue = 13
				inSpaceHighDataValue = 11
				recoveryValue = 9
				flyingAltitudeThreshold = 5000
				spaceAltitudeThreshold = 10000
			}	
		}
		Orbit
		{
			referenceBody = Duna
			color = 0.75,0.1,0.15,1
			inclination = 2.0
			eccentricity = 0.05
			semiMajorAxis = 1416000 
			longitudeOfAscendingNode = 0
			argumentOfPeriapsis = 0
			meanAnomalyAtEpoch = 0
			epoch = 0
		}
		PQS
                                {
                                                Mods
                                                {
                                              	                 VertexSimplexHeightAbsolute
                                              	                 {
	                                                 	 name = HeightMod1
	                                            		 seed = 123
	                                       	    	 deformity = 5000
	                                      	       	 octaves = 3
	                                     	        	 persistence = 0.5
	                                      	       	 frequency = 1
	                                       	       	 enabled = true
	                                        		 order = 2
                                              	                 }
                                              	                 VertexSimplexHeightAbsolute
	                                                 {
		                                                 name = HeightMod2
		                                                 seed = 456
		                                                 deformity = 2500
		                                                 octaves = 3
		                                                 persistence = 0.5
		                                                 frequency = 1
	                                                 	 enabled = true
		                                                 order = 3
                                              	                 }
                                              	                 HeightColorMap
                                              	                 {
	                                              	                 blend = 0.5
	                                              	                 enabled = true
	                                              	                 order = 10
	                                              	                 LandClasses
	                                              	                 {
	                                              	                 	Class
	                                              	                 	{
	                                              	                 		name = Base
		                                              	                 	altitudeStart = 0
		                                              	                 	altitudeEnd = 0.1
		                                              	                 	color = 0.75,0.1,0.15,1.0
		                                              	                 	lerpToNext = true
	                                              	                 	}
		                                              	                 Class
	                                              	                 	{
		                                              	                 	name = Low
		                                              	                 	altitudeStart = 0.1
		                                              	                 	altitudeEnd = 0.6
		                                              	                 	color = 0.85,0.1,0.15,1.0
		                                              	                 	lerpToNext = true
		                                              	                 }
		                                              	                 Class
		                                              	                 {
		                                              	                 	name = Mid
		                                              	                 	altitudeStart = 0.6
		                                              	                 	altitudeEnd = 0.8
		                                              	                 	color = 0.75,0.1,0.15,1.0
	                                              	                 		lerpToNext = true
		                                              	                 }
		                                              	                 Class
		                                              	                 {
		                                              	                 	name = High
		                                              	                 	altitudeStart = 0.8
		                                              	                 	altitudeEnd = 2
		                                              	                 	color = 1.0,0.9,0.9,0.8
		                                              	                 	lerpToNext = false
		                                              	                 }
	                                              	                 }
                                              	                 }
                                                }
                                }
                }
}

 

Also what's up with the black squares in the corner? Is that because it's based off Dres?

Link to comment
Share on other sites

19 hours ago, SmashingKirby148 said:

-snip-

It looks like an issue with textures to me. However, in the config, why don't you specify the ScaledVersion if you've obtained the textures? Add the following:

ScaledVersion
{
	type = Vacuum
	fadeStart = 0
	fadeEnd = 0
	Material
	{
		texture = [FILEPATH]
		normals = [FILEPATH]
		shininess = 0.07352
		specular = 0.0,0.0,0.0,1.0
	}
}

Then try again. In the [FILEPATH]'s, specify a filepath to the textures exported through Kittopia.

As for the 'black corners', those are from the terrain textures Dres uses.

Edited by The White Guardian
Link to comment
Share on other sites

17 minutes ago, The White Guardian said:

It looks like an issue with textures to me. However, in the config, why don't you specify the ScaledVersion if you've obtained the textures? Add the following:


ScaledVersion
{
	type = Vacuum
	fadeStart = 0
	fadeEnd = 0
	Material
	{
		texture = [FILEPATH]
		normals = [FILEPATH]
		shininess = 0.07352
		specular = 0.0,0.0,0.0,1.0
	}
}

Then try again. In the [FILEPATH]'s, specify a filepath to the textures exported through Kittopia.

As for the 'black corners', those are from the terrain textures Dres uses.

Oh yeah! Whoops. :P

Wait, exported?... OOOOHHHHH.... Ohh... so that's why it looks like Dres from the map and until the ScaledSpace kicks in! :o

Yeah, I'm gonna switch it back to Ike. :P

Where does the ScaledVersion line go? Is it under PQS Mods?

(And sorry for being late as well. I had homework to do. Thankfully I didn't get too much homework, just Irish. :D I'm blabbering again...)

Link to comment
Share on other sites

9FrjPoa.png

This is what it looks like from far away. That's the actualy texture, so Even though it looks bland, I could be able to tweak it.

But then...

HR7KZKW.png

For some reason, it get's brighter! I changed the template to Bop, but it still has the same problem as Dres, so I'm gonna do more fiddling.

For the brightness problem, I could just brighten the texture, but it's gonna look different in the end. I want the moon to be mostly red with white mountains, not the other way around.

2 minutes ago, The White Guardian said:

Allow me


@Kopernicus:AFTER[Kopernicus]
{
	Body
	{
		name = [BadS name]
		Scaledversion
		{
		}
	}
}

 

Oh. I put it way down in the code. It might be the reason I'm having the problems above. -.-;

Link to comment
Share on other sites

Change the materialType. Add this:

		PQS
		{
			maxQuadLenghtsPerFrame = 0.03
			minLevel = 2
			maxLevel = 12
			minDetailDistance = 8
			materialType = AtmosphericOptimized
			Material
			{
				saturation = 1
				contrast = 1.1
				tintColor = 1,1,1,0
				texTiling = 1000
				texPower = 0.6
				multiPower = 0.2
				groundTexStart = 2000
				groundTexEnd = 15000
				steepTiling = 300
				steepPower = 1
				steepTexStart = 100000
				steepTexEnd = 200000
				deepTex = BUILTIN/snow
				deepTexScale = 1,1
				deepTexOffset = 0,0
				deepMultiTex = BUILTIN/snow
				deepMultiTexScale = 1,1
				deepMultiTexOffset = 0,0
				deepMultiFactor = 1
				mainTex = BUILTIN/distantground
				mainTexScale = 1,1
				mainTexOffset = 0,0
				mainMultiTex = BUILTIN/distantground
				mainMultiTexScale = 1,1
				mainMultiTexOffset = 0,0
				mainMultiFactor = 1
				highTex = BUILTIN/distantground
				highTexScale = 1,1
				highTexOffset = 0,0
				highMultiTex = BUILTIN/distantground
				highMultiTexScale = 1,1
				highMultiTexOffset = 0,0
				highMultiFactor = 1
				snowTex = BUILTIN/snow
				snowTexScale = 1,1
				snowTexOffset = 0,0
				snowMultiTex = BUILTIN/snow
				snowMultiTexScale = 1,1
				snowMultiTexOffset = 0,0
				snowMultiFactor = 1
				steepTex = BUILTIN/snow
				steepTexScale = 1,1
				steepTexOffset = 0,0
				deepStart = 0
				deepEnd = 0.2
				mainLoStart = 0
				mainLoEnd = 0.2
				mainHiStart = 0.2
				mainHiEnd = 0.5
				hiLoStart = 0.2
				hiLoEnd = 0.5
				hiHiStart = 0.8
				hiHiEnd = 1
				snowStart = 0.8
				snowEnd = 1
				fogColor = 0.7313433,0.7313433,0.7313433,1
				heightFallOff = 1
				globalDensity = -8E-06
				atmosphereDepth = 55000
				fogColorRampScale = 1,1
				fogColorRampOffset = 0,0
				planetOpacity = 1
			}
			Mods
			{
				...
			}
		}
	}
}

Try that.

Link to comment
Share on other sites

1 hour ago, SmashingKirby148 said:

Well, good bye DunaPlusRevived and EvePlusRevived AND MoonsPlus. -_-;

Why the long face? Could you describe what you are trying to build exactly? Perhaps I could help, because I think the issue lies in choosing the right template and PQSMods.

Edited by The White Guardian
Link to comment
Share on other sites

4 minutes ago, The White Guardian said:

Why the long face? Could you describe what you are trying to build exactly?

Sorry, I was just having a rough day. I trying to revive my old DunaPlus and EvePlus mod, but pack them into one mod called MoonsPlus which adds new moons for Duna, Eve, Moho, Kerbin, Dres, maybe Jool and Eeloo.

Link to comment
Share on other sites

Just now, SmashingKirby148 said:

Sorry, I was just having a rough day. I trying to revive my old DunaPlus and EvePlus mod, but pack them into one mod called MoonsPlus which adds new moons for Duna, Eve, Moho, Kerbin, Dres, maybe Jool and Eeloo.

A rather interesting concept, though be careful, adding too many moons will clutter up the Kerbol system, and I actually don't think Kerbin needs any more moons. Perhaps one more, but not more than that.

I think it's better to make 'modules' instead, let users choose which planet(s) they want more moons for.

Also, two PQSMods that I think will surely help are VertexHeightNoise and VertexSimplexNoiseColor.

HeightColorMap: depending on the noisetype, generates mountains and stuff on the surface. Example:

				VertexHeightNoise
				{
					type = RiggedMultifractal
					seed = 25139
					deformity = 2000
					frequency = 1
					lacunarity = 1
					persistence = 0.8
					octaves = 6
					enabled = true
					order = 8
				}

And VertexSimplexNoiseColor: for this mod, specify two colors. Kopernicus will then color the terrain randomly using colors in between the two colors specified, and the blending effect depends on the 'blend' value. Example:

				VertexSimplexNoiseColor
				{
					seed = [number here]
					blend = 0.45
					colorStart = (brightest color)
					colorEnd = (less bright color)
					octaves = 5
					persistence = 0.5
					frequency = 2.0
					enabled = true
					order = [number here]
				}

 

Link to comment
Share on other sites

4 minutes ago, The White Guardian said:

A rather interesting concept, though be careful, adding too many moons will clutter up the Kerbol system, and I actually don't think Kerbin needs any more moons. Perhaps one more, but not more than that.

I think it's better to make 'modules' instead, let users choose which planet(s) they want more moons for.

Also, two PQSMods that I think will surely help are VertexHeightNoise and VertexSimplexNoiseColor.

HeightColorMap: depending on the noisetype, generates mountains and stuff on the surface. Example:


				VertexHeightNoise
				{
					type = RiggedMultifractal
					seed = 25139
					deformity = 2000
					frequency = 1
					lacunarity = 1
					persistence = 0.8
					octaves = 6
					enabled = true
					order = 8
				}

And VertexSimplexNoiseColor: for this mod, specify two colors. Kopernicus will then color the terrain randomly using colors in between the two colors specified, and the blending effect depends on the 'blend' value. Example:


				VertexSimplexNoiseColor
				{
					seed = [number here]
					blend = 0.45
					colorStart = (brightest color)
					colorEnd = (less bright color)
					octaves = 5
					persistence = 0.5
					frequency = 2.0
					enabled = true
					order = [number here]
				}

 

Ok, I'll try that.

Also, I'm only adding 2 moons for Duna, 1 for Eve, 1 for Moho, 1 for Dres, 1 for Jool and 1 for Eeloo. It's not that cluttered. ;)

 

Link to comment
Share on other sites

Just now, SmashingKirby148 said:

Ok, I'll try that.

Also, I'm only adding 2 moons for Duna, 1 for Eve, 1 for Moho, 1 for Dres, 1 for Jool and 1 for Eeloo. It's not that cluttered. ;)

 

That is indeed by far not enough moons to clutter up anything. Oh, and you may copy the VertexHeightNoise example I posted a few comments above. In fact, I recommend you to, it generates hill-terrain like you can see from orbit on Duna and Dres.

Link to comment
Share on other sites

2 minutes ago, The White Guardian said:

That is indeed by far not enough moons to clutter up anything. Oh, and you may copy the VertexHeightNoise example I posted a few comments above. In fact, I recommend you to, it generates hill-terrain like you can see from orbit on Duna and Dres.

Wow! Thank you! :D

Link to comment
Share on other sites

3 minutes ago, SmashingKirby148 said:

Ok, so I removed the code which was making that annoying white-as-snow fog, but that gave me the same problem of the moon being very dark from the map. :(

Then ONLY specify the Saturation and Contrast in the Materials node, remove everything else.

By that I mean the Materials node in PQS

I meant this code:

		PQS
		{
			maxQuadLenghtsPerFrame = 0.03
			minLevel = 2
			maxLevel = 12
			minDetailDistance = 8
			materialType = AtmosphericOptimized
			Material
			{
				saturation = 1
				contrast = 1.1
			}
			Mods
			{
				...
			}
		}
	}
}

Add this. Alter the saturation and contrast for changing the terrain brightness.

Edited by The White Guardian
Link to comment
Share on other sites

1 hour ago, The White Guardian said:

Then ONLY specify the Saturation and Contrast in the Materials node, remove everything else.

Alrighty. And also, I basically saw the result already (when I go close to it because map is dark, I'll fix that now) and it's a bit boring. It looks very stockalike, just boring. How do you get craters? I was messing around with KittopiaTech and saw a PQS mod about craters or something. Is that it?

And it turned the planet completely black once in ScaledSpace. And it's still dark from the map. :(

Link to comment
Share on other sites

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