M.leafcard

From TrainzOnline
Revision as of 14:55, 6 June 2024 by N3vpolsen (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

m.leafcard is a variation on the m.pbrmetalmasked material. Introduced with the new foliage system "link=https://online.ts2009.com/mediaWiki/index.php/HowTo/Build_a_tree_with_PlantFactory", it is used when creating leaf cards on trees and plants.

The blue channel of the parameters texture is used to modulate the strength of the directional lighting. This is intended to give the feel of individual leaves being deeper inside the tree and shadowed from all directions, even though the leaf card as a whole is not shadowed. (Note that this is the same channel used for Ambient Occlusion on m.pbrmetal; the leaf card materials do not support ambient occlusion.)

Full brightness (100% blue channel) gives a standard lighting response, while darker values give a weaker response to directional lighting.

Here is an example of what the blue (AO) channel could look like in the parameters texture.


Directional light Scattering.jpg


This page describes content format v5.6 and assumes that the FBX file format is used as a data source for any meshes.

Contents

Texture Slots

The following texture slots are used for this material. All textures should typically have the same dimensions unless they represent a uniform color, however this is not strictly enforced.

Albedo

RGB: The albedo map defines the base color of each texel. The sRGB color space is used.

A: The alpha channel provides a "black and white" masked alpha channel. Black indicates full transparency, meaning that the fragment is discarded. White indicates full opacity, meaning that rendering proceeds as per m.pbrmetal. If the alpha channel is omitted, this material acts exactly as m.pbrmetal except with lower performance. Note that unlike legacy Trainz materials, PBR materials do not autodetect opacity mode based on the texture in use. The content creator must select the appropriate material for their desired outcome. Runtime texture replacement should not expect to replace an opaque texture with a blended or masked texture and have the material update automatically.

You may need to include an alpha-hint tag in your albedo texture.txt file. See .texture.txt_Files. If creating a double sided material using metadata you should also consider using a blend-mode tag. See Mesh_metadata_file.


Albedo Texture Example

PortalAlbedowAlpha.png

Color Channel Separated

PortalAlbedo.png

Alpha Channel Separated

PortalAlpha.png

Normal

RGB: Surface normal map. This defines which way the surface is facing, relative to the interpolated vertex normals. Since this is an XYZ format rather than color data, it should never be modified in Photoshop. Using Photoshop to add a fourth channel or copy/paste smaller textures into a texture atlas is acceptable. Per-pixel manipulation or use of filters on the "RGB" channels is not acceptable.

Normal Texture Example with no Alpha Channel (Parallax)

Pbrnormalmap1.jpg


Parameter

This texture is comprised of four separate channels which each form a separate data element. Linear color space (not sRGB) is used for these channels.

Pbrparametersall.jpg


R: Emissive. This causes the texture to have an internal glow, even when no external light is present. Used for phosphors, permanently-lit markings, etc. The glow color is based on the albedo. Note that this glow does not cast light upon surrounding surfaces except via the Bloom post-processing effect.


Parameters (Emissive - Red Channel) Texture Example

Pbrparametersemissivemap1.jpg

G: Roughness. Defines whether the surface reflections are shiny (0.0) or matte (1.0). See the PBR metal workflow for details.


Parameters (Roughness - Green Channel) Texture Example

Pbrparametersroughnessmap1.jpg

B: Ambient Occlusion. Defines whether the surface is exposed to ambient lighting conditions (1.0) or affected only by direct lighting (0.0).


Parameters (Ambient Occlusion - Blue Channel) Texture Example

Pbrparametersambientocclusionmap1.jpg

A: Metallicity. Defines whether the surface is metallic (1.0) with the albedo used to colorize reflected light, or dielectric (0.0) with the albedo used to colorize the surface. While intermediate values are not physically accurate, they may be used to emulate subsurfaces which are partially metallic. See the PBR metal workflow for details.


Parameters (Metallic - Alpha Channel) Texture Example

Pbrparametersmetallicmap1.jpg

Examples

Personal tools