Skip to reading
The Asset Importer

24. Godot and GLSL shaders

Edition 0.86.3.4

Import and check models, images, animation, audio, fonts, video and shaders, with hands-on practice files.

Download PDFView PDF page
On this page

24. Godot and GLSL shaders

Seeking changes the stream position; it does not have the same forced-play behaviour as the audio seek slider. Preview controls also do not construct a cutscene. Assign the asset in the FMV or cutscene workflow to decide when it starts, how it can be skipped, and what happens afterwards.

Test the actual distributed game on each target platform. A decoder present in an authoring installation and a video filter listing are not substitutes for that test.

Choose Kind shader to import a native Godot shader or a supported fragment-shader subset. Importing stores a reusable asset; it does not apply the effect to every model or to the screen.

Native .gdshader#

The supported native input starts with either shader_type spatial; for 3D materials or shader_type canvas_item; for 2D/GUI use. In the current importer, keep that declaration at the start of the file. A leading comment before it can prevent the simple initial check from recognising it.

Try guide-material.gdshader as a Shader asset. Its spatial shader is intended for a 3D material, not a screen overlay.

Convertible GLSL fragments#

The picker offers .glsl, .frag and .fs. This is a converter for a limited fragment subset, not a complete GLSL engine. It expects an ordinary fragment void main() and supported declarations.

The practice guide-tint.frag contains the marker // pca3d:canvas, which asks for a 2D canvas shader. Without that marker the conversion defaults to a spatial shader. The converter writes a .pca.gdshader result and retains the imported source.

Page 67 of 86Permalink
Go to page