22. Import a shader without guessing its type
Use a built-in preset when it does the job. Import a shader when you have a specific effect and understand its inputs. A shader written for another engine or a shader website is not automatically ready to run.
1. Create or select an asset in Asset Designer and set its kind to Shader.
2. Browse to a .gdshader, .glsl, .frag or .fs file. Read the import result before applying.
3. For Godot source, the file must begin with shader_type spatial; or shader_type canvas_item;.
4. Choose a spatial asset for a 3D surface. Choose a canvas asset for a room screen shader, GUI or overlay.
5. Apply the asset and assign it through the destination’s Imported Shader selector.
6. Save and test in the intended renderer. Keep the source license and attribution with your project.
| Importer boundary | What to do |
|---|---|
| Simple GLSL fragment with void main() | The limited converter can translate a predictable fragment subset. |
| Canvas GLSL fragment | The converter recognizes the pca3d:canvas marker. Otherwise GLSL imports as spatial. |
| Vertex program, includes or Shadertoy mainImage | Convert it manually to a compatible Godot shader first. |
| Custom uniform controls | Do not assume the built-in preset sliders populate arbitrary uniforms. Use suitable defaults or a deliberate custom setup. |
| A shader selected on a surface | It replaces that surface’s built-in effect layers while selected. |
A shader can compile and still be wrong for its destination. A room screen shader needs to read the rendered screen; an object shader needs the surface’s texture or material inputs. A plain ColorRect does not supply a model’s texture automatically.
