Studio Yotsuba
Back to Node List

Surface Export

surface_export

Writes a Surface as a set of PNG texture maps (albedo, normal, height, AO, emission, roughness) for game engines.

Reviewed
Guide available

Input Ports

NameTypeDescription
Surface
surface
Surface
Required
Surface to export as texture maps.

Output Ports

NameTypeDescription
Preview
preview
Image
Albedo preview of the exported surface.
Warnings
warnings
Text
Warnings about omitted maps, mixed-generation additions, or whole-set skips.

Parameters

NameTypeDefaultRangeDescription / Options
Base Path
path
FilePath
——

Base .png path. Map suffixes are appended to the file name (e.g. brick.png -> brick_n.png).

Save Mode
save_mode
Enum
Disabled—

Controls when this node writes files.

  • DisabledDisabled
  • CreateIfMissingCreateIfMissing
    Keep existing files and add only missing maps. This can leave maps from different generations together.
  • CreateSetIfMissingCreateSetIfMissing
    Write the whole map set only when none of its target files exists.
  • OverwriteOverwrite
Naming
naming
Enum
Suffix—

File naming convention for the map set.

  • SuffixSuffix
    base.png / base_n.png / base_h.png / base_ao.png / base_e.png / base_r.png
  • UnityUnity
    base_Albedo / base_Normal / base_Height / base_Occlusion / base_Emission / base_Roughness
  • GodotGodot
    base_albedo / base_normal / base_height / base_ao / base_emission / base_roughness
Normal Y Axis
normal_convention
Enum
OpenGL—

Normal map green channel convention of the target engine.

  • OpenGLOpenGL
    Green channel points up (+Y). Used by Godot, Blender.
  • DirectXDirectX
    Green channel points down (-Y). Used by Unity, Unreal.
Scale
scale
Int
11–16

Integer nearest-neighbor upscale applied to all maps.

Albedo
export_albedo
Bool
true—

Write the albedo map.

Normal
export_normal
Bool
true—

Write the normal map if present.

Height
export_height
Bool
true—

Write the height map if present.

AO
export_ao
Bool
true—

Write the ambient occlusion map if present.

Emission
export_emission
Bool
true—

Write the emission map if present.

Roughness
export_roughness
Bool
true—

Write the roughness map if present.

Overview

Exports a Surface as a set of PNG textures for a game engine, including albedo, normal, and height. This is the exit for engine-side HD-2D rendering, with selectable naming conventions for Godot/Unity and normal-map Y-axis convention.

  • Side effect: yes (has_side_effects: true, writes files)

Usage tips

  • Go-to engine settings: Godot StandardMaterial3D → naming=Godot / normal=OpenGL; Unity Lit → naming=Unity / normal=DirectX. See Examples below.
  • Follow the standard export-node workflow: use save_mode = Disabled while building, and switch to Overwrite only when exporting.
  • CreateIfMissing adds only missing maps to an existing set and warns when that mixes generations. Use CreateSetIfMissing for all-or-none creation of the set.
  • Set integer enlargement with scale here when pixel art should display larger in the engine.
  • Choose the exit by responsibility: for one fully lit PNG from PixPipeline, use surface_light_preview → batch_export; for engine-side lighting, use this node.

Common pitfalls

  • Normals look recessed in the engine: the normal Y-axis convention does not match. Choose OpenGL/DirectX for the engine. Internal storage is OpenGL; G is flipped only for DirectX.
  • No files are written: save_mode is still Disabled, as with the other Export nodes.
  • Some selected maps are missing: the input Surface has no data for those maps. Check warnings and the internal _omitted_maps result for their stable map IDs.

Technical details

  • Internal normal maps use the OpenGL convention (+Y up). Only DirectX output flips G with flip_normal_map_y() from pxn-core.
  • Enlargement uses nearest-neighbor interpolation through scale_image_nearest() from pxn-core.
  • Enabled maps absent from the input Surface are explicitly omitted; no neutral textures are synthesized. warnings and _omitted_maps: List<Text> report their stable IDs. _written_maps: List<Text> contains only maps actually written by this run, while unchanged / already-exists remain distinguishable through _effect_outcome.

Examples

  • Use Image To Surface → Surface Export to create a map set that an HD-2D engine can load as a material.
  • For Godot StandardMaterial3D, use naming=Godot / normal=OpenGL. For Unity Lit, use naming=Unity / normal=DirectX.

Related nodes

  • solid_render / model_render / image_to_surface — supply the Surface to export
  • surface_light_preview + batch_export — alternate route for a lit PNG from the app
  • model_gltf_export — import the mesh itself
  • tiled_tileset_export — export in tileset format
Back to Node List