This section explains how to create and adjust your own colour schemes. Each of the scenes folders in Morphyre contains a large number of Xml files which contain all the different colour schemes for each type of scene.
Each XML file consists of a <SceneList> element containing one or more <Scene> Elements:
<SceneList> <Scene id="tutorial1_default"> <Filename>bin/tutorial1.pur3s</Filename> <Data> <Type>scene</Type> <SceneId>tutorial1</SceneId> <SchemeId>default</SchemeId> <Weight>1.0</Weight> <Styles>chilled</Styles> </Data> </Scene> </SceneList>
NOTE: Scene.id must be unique for each scene, and is generally <SceneId> plus an underscore plus <SchemeId>.
The <Filename> element points to the position of the compiled scene file that will make up the scene.
In the <Data> element there are a few elements that it's useful to include in all Scenes.
In addition, most of Morphyre's scenes have backgrounds and foregrounds which can be used from XML. If you look at the files for these you'll see elements such as <BgType>, <BgTexture>, etc. inside the <Data> element...
<BgType>BG_SKYBOX</BgType> <BgTexture>skybox1</BgTexture> <BgTexture2/> <MidType>MD_WARP</MidType> <MidTexture/> <FgType>FG_ENVMAP_SOLID</FgType> <FgTexture>skybox1_front.jpg</FgTexture> <BgColour>0xFFFFFFFF</BgColour> <MaskColour>0xFF000000</MaskColour>
These describe a colour scheme and always need to exist for any scenes that use Colour Schemes. <BgType> can be any one of the following, and <BgTexture> usually contains the filename of a texture that is used for it (sometimes 2 textures are needed and that's when BgTexture2 is used...
BG_NONE Solid background, bgColour is the colour of it
BG_SKYBOX Use a skybox background. Texture on skybox. Filenames without an ending refer to 6 images in the form of a skybox. bgColour is the brightness of the skybox
BG_BASSCUBE Use a skybox background that twists with bass. Texture on skybox. Filenames without an ending refer to 6 images in the form of a skybox. bgColour is the brightness of the skybox
BG_FLOW 'Flow' the image using giess-type patterns. use texture as colour map, bgColour is the brightness it is rendered in.
BG_RECURSE Recursive tilling of the image. no texture needed, bgColour is the brightness of each iteration
BG_RECURSEWARP Recursive warping of the image. no texture needed, bgColour is the brightness of each iteration
BG_ARROWS arrows moving across the screen. BgTexture is the background, BgTexture2 is the arrow texture, bgColour is ignored.
BG_OMATIC R4-style O-matic... Layers of the given texture, spiralling into the distance. bgColour is the colour of the background
BG_WARPDRIVE Sparks of texture flying by, on a skybox background. BgTexture is the skybox, BgTexture2 is the spark. bgColour affects both textures.
BG_WARPING R4-style background warping - BgTexture contains a texture that is drastically warped in all directions
BG_STATICIMAGE Display a static image in the background, filename is in BgTexture
BG_VIDEO Display a video in the background, filename is in BgTexture
<BgColour> is the colour of the background. It is a 32 bit number specifying the red/green/blue and opaqueness (A) as 0xAABBGGRR (like the web colours, but with red and green swapped). Usually the AA part should be FF (totally opaque), and for most backgrounds you just make it white (0xFFFFFFFF). However for some backgrounds such as BG_OMATIC it's very useful, or it can be used for tinting SkyBoxes.
Then, you have the mid-layer in <MidType>, which is currently either MD_NONE or MD_WARP (warp the background around the foreground object). <MidTexture> is unused at the moment, but may be used later when more mid layer types are added.
<MaskColour> is the colour of the mask layer - this is a darker layer that sits behind the foreground and dims the background where it is dispayed. If the number behins 0xFF it is opaque, if it begins 0x00 it's transparent and isn't drawn.
Finally <FgType> and <FgTexture> determine how the foreground is rendered. Note that some scenes that aren't solid such as the Spark/Particle scenes ignore this. Possible values are:
FG_ENVMAP_SOLID render the foreground as an environment map using FgTexture
FG_ENVMAP_TRANSPARENT render the foreground as an environment map using FgTexture, but make the object transparent
FG_ENVMAP_BG_SOLID render the foreground as an environment map using a copy of what's on the background
FG_ENVMAP_BG_COLORMAP render the foreground as an environment map using a copy of what's on the background, but looking up the Red and Green components of the background in FgTexture as X and Y
For scenes that contain 3d Models, the model can often be overidden using the <Model> element, for example by adding:
As Morphyre contains so many colour schemes, we can't create them all by hand. Instead, we use two special XML files and a special tool.
MorphyrePro\scenes\build\ColourSchemes.xml contains a list of all the main colour schemes (which can be applied to any scene). The data is as described above - if you add an item to it (note that having a unique colour scheme ID is vital) and follow the steps below then the colour scheme you described will be created for all schemes.
MorphyrePro\scenes\build\SceneInfo.xml contains a list of all Scenes that Colour Schemes are to be calculated for. Inside a scene you can specify:
<Weight> This will multiply the 'weight' of each colour scheme by this value too... If you don't like the Scene make it small and the scene will be chosen less, or make it big and the scene will be chosen more often.
<NotStyles> You can specify styles for Colour Schemes, but sometimes the Scene itself messes it up - for instance you might have a black and white style but the scene has colour in it - in this case you specify <NotStyles>blackwhite</NotStyles> and none of the colour schemes used will have the 'black and white' theme.
<Not> Specifying ColourSchemes inside here will apply *all* Colour schemes in ColourSchemes.xml to the scene *except* the ones specified.
<Data> - This will add a unique colour scheme just for that scene - it's like writing a new Scene XML file, but it gets appended to the big auto-generated scene_id.xml file
<TemplatedBackground id="..."> Specifying a colour scheme ID in one of these elements will turn it into a scene template that will be added to templates.xml and will be made available in Morphyre UI for you to change the background on.
Note that doing the following will overwrite any modifications you made to existing XML files in the scenes directory (and templates.xml). To avoid this, just create new xml files with your extra colour schemes instead of changing the standard Morphyre Xml files.
Simply do the following to create the 'real' scene Xml files from ColourScheme.xml and SceneInfo.xml:
And you're done! Next time you start Morphyre UI you'll have all the new colour schemes you created available.