Port a shader
port_shaderTranslates shader code between Unity ShaderLab, Godot, three.js, and GLSL/Shadertoy, mapping types, intrinsics, and uniforms into a first draft that flags leftovers to fix.
Instructions
Translates shader code between engines as a faithful first draft: Unity ShaderLab (surface shaders → fragment() with ALBEDO/NORMAL_MAP/METALLIC/ROUGHNESS/EMISSION/ALPHA; vertex/fragment shaders → vertex()/fragment() with varyings) → Godot .gdshader with Properties as uniforms (hints, ranges, _ST tiling), HLSL types/intrinsics/built-ins mapped (float4→vec4, lerp→mix, tex2D→texture, saturate→clamp, _Time.y→TIME, UnityObjectToClipPos→VERTEX, unity_ObjectToWorld→MODEL_MATRIX…); Shadertoy or plain GLSL → Godot canvas_item (iTime/iResolution/iChannelN/fragCoord mapped, Y flipped) or a three.js ShaderMaterial module; Godot .gdshader → three.js ShaderMaterial (uniforms object included) or Unity ShaderLab (canvas_item → sprite shader, spatial → Standard surface shader). Lighting models and coordinate spaces differ per engine, so the result lists leftovers (identifiers with no equivalent) and PORT: markers; compile it in the target engine before trusting it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"to": "<to>"
},
"name": "port_shader"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Target: godot, threejs or unity. | |
| out | No | Output file (default workspace/shaders/<name>.<ext>). | |
| file | No | Shader file (.shader, .gdshader, .glsl, .hlsl, .cginc). | |
| name | No | Shader name for the output. | |
| content | No | Shader code instead of file. |