Skip to content

Add Imaginando VS 2 export target - #1533

Open
douglas-carmichael wants to merge 1 commit into
RodZill4:masterfrom
douglas-carmichael:add-imaginando-vs2-export-target
Open

Add Imaginando VS 2 export target#1533
douglas-carmichael wants to merge 1 commit into
RodZill4:masterfrom
douglas-carmichael:add-imaginando-vs2-export-target

Conversation

@douglas-carmichael

Copy link
Copy Markdown

Imaginando VS 2 export target

Adds an Imaginando VS 2 export target to the standard PBR (material) and
Unlit (material_unlit) material nodes, plus a section in Exporting
Materials
.

Imaginando VS 2
(Visual Synthesizer) is an audio-visual instrument whose materials are single
GLSL fragment shaders with a JSON manifest and a small predeclared environment
(time, alpha, color, resolution, texCoord, fragColor). The target
generates one .vs2.frag text file:

  • the VS 2 JSON manifest (uuid via $uid(0), display name via
    $(file_prefix)),
  • generated definitions via $definitions float_uniform_to_const,vs2 — the
    small custom vs2 filter renames elapsed_time to VS 2's time and bakes
    vec2/vec3/mat2 uniforms, in the same string-replacement style as the
    built-in unity/unreal filters,
  • a void main() that evaluates the material's albedo, emission and opacity
    inside $begin_generate (VS 2 layers are unlit, so lighting inputs such as
    roughness/normal are intentionally not exported) and applies VS 2's layer
    alpha.

Testing

Byte-identical target definitions have been exercised as external export
targets (user://export_targets/*.mme) on macOS with Material Maker 1.7, both
from the GUI and via --export-material --target "Imaginando VS 2", and the
resulting files import and render in VS 2. Embedded and external targets share
the same code path in gen_material.gd, so behavior is identical.

Known limitations (called out in the documentation)

  • $uid() emits 32 hex digits without hyphens, while VS 2 uses the canonical
    hyphenated UUID form; inserting hyphens in 8-4-4-4-12 grouping yields a valid
    v4 uuid. If there is interest, a follow-up could add a template function that
    emits the hyphenated form directly, which would remove this caveat.
  • Materials using buffer-based nodes (blur, warp, …) cannot be expressed as a
    single fragment shader; such exports reference textures VS 2 cannot provide.

Adds an 'Imaginando VS 2' export target to the standard PBR and Unlit
material nodes. It generates a single GLSL fragment shader (.vs2.frag)
importable by Imaginando's VS 2 (Visual Synthesizer): the material's
albedo/emission/opacity channels adapted to VS 2's predeclared
environment (time, alpha, color, resolution, texCoord, fragColor),
preceded by the JSON manifest VS 2 requires, with float/vector uniforms
baked via float_uniform_to_const and a custom text filter renaming
elapsed_time to VS 2's time.

Documented in the Exporting Materials page, including the two known
limitations (unhyphenated $uid output; buffer-based nodes cannot be
expressed in a single fragment shader).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant