Population Instance Caching

From Terragen Documentation from Planetside Software
Revision as of 18:59, 11 February 2021 by Redmaw (talk | contribs) (Added Population Masking Techniques tutorial to Further Reading section.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction[edit]

Population instance caching is a feature of the Populator v4 node (new in Terragen 3 ). Instance caching uses a file to store population instances instead of having to recalculate them, which can sometimes be a lengthy process.

The basic workflow for instance caching is to finalise the population and then save an instance cache file. The next time you load the project the instances will be read from the file instead of being recalculated.

Saving an Instance Cache File[edit]

When you have finalised your population you can save an instance cache file. This is very easy to do:

  • Go to the populator node's parameter view and click the Cache Settings... button. This opens a Cache Settings window.
  • Click the Save Cache button to save the cache file. Population instance cache files have a ".pop" extension.

The cache file reading related parameters are automatically set up to read the file you've just saved.

If the population needs repopulating that will be done before the cache file is saved. This makes sure the cache file accurately reflects the current settings of the populator.

Loading an Instance Cache File[edit]

It's easy to set up a populator to use a cache file:

  1. Go to the populator node's parameter view and click the "Cache Settings..." button. This opens a Cache Settings window.
  2. Check the "Use instance cache" checkbox.
  3. Click the file parameter button on the right to choose the cache file.

The populator will load the instances from the cache file.

Hints and Tips[edit]

If you move or rotate a population the cached instances will not move with it. The cached instances are fixed in the positions etc. they had when you saved the cache file. This is why you should wait until you have finished editing the population before you save a cache file.

Repopulating using the "Populate Now" button or the populate menu commands will turn off instance caching.

If you make a change to a population but want to go back to the cached instances make sure the Use instance cache parameter is checked and click the "Read Cache" button in the Cache Settings window.

Cache Settings Window[edit]

The Cache Settings window is opened using the "Cache Settings" button in the Populator v4 parameter view. It's where you save and load instance cache files. When the Cache Settings window is opened for the first time a Populator v4 Cache Settings node is created in the internal network of the populator node. You can also open the Cache Settings window via that node in the network view.

Popv4 cache settings window.jpg

This is what the various controls do:

  • Save Cache button: Click this button to save the instance cache file. If the population requires repopulating this is done before the file is saved.
  • Use instance cache: Check this to enable loading instances from a cache file. You can choose the cache file using the parameters to the right.
  • Read Cache button: This button will reload the instances from the cache file. You might want to do this if you've accidentally repopulated or something.

Known Issues[edit]

There is still some work to be done on the interaction between various Populator v4 params and the instance caching. For example some parameter changes would mean that if you repopulated the instances would no longer match those in the cache. This should turn off instance caching but currently that doesn't happen.

Deleted or modified instance information is not saved to the cache file yet. This is saved with the populator node in the project file. Modified instances are saved in the cache so you will see your modifications when using a cache, but not the information to reset them. That's part of the information saved to the project file.

Further Reading[edit]

Working with Populations
This page introduces you to populations and how to work with them.

Population Instance Editing
This guide describes how you can edit individual instances in a population to precisely control your scene.

Tutorial: Population Colour Tinting Techniques
This tutorial shows you how to use the tinting tools to change the colours of instances in lots of interesting ways.

Tutorial: Masking Populations with Inverted Fractals
This tutorial shows you some methods to create distinct bands of objects in overlapping populations.

Tutorial: Population Masking Techniques
This tutorial shows you how to create masks for populations using various techniques like Simple shape shaders and the Painted shader.

A single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene.

A parameter is an individual setting in a node parameter view which controls some aspect of the node.

A shader is a program or set of instructions used in 3D computer graphics to determine the final surface properties of an object or image. This can include arbitrarily complex descriptions of light absorption and diffusion, texture mapping, reflection and refraction, shadowing, surface displacement and post-processing effects. In Terragen 2 shaders are used to construct and modify almost every element of a scene.