Shader forge guide

Help

Short answers to what goes wrong most often.

The frame says the tool needs WebGL 2

Shader forge draws with WebGL 2, and this browser does not offer it, or has it turned off. Update the browser, turn on its graphics acceleration, or try another current browser.

The bar under the code shows an error

The code did not compile. The bar shows the first error the browser reports, such as Line 12: and a message, with the line number from the box. See compile error.

The preview keeps drawing the last code that worked, so the picture does not go blank while you type. Fix the line and the bar goes back to Compiled, then Ready.

An error that starts with Link error means the parts compiled but could not be joined. It is rare; undo your last change.

The error names a custom uniform

The page puts a uniform line for each custom uniform into the code before it compiles, and counts those lines out again, so a line number in the bar is always a line of the box.

An error in one of those lines shows as Custom uniform, its name and the message. The usual cause is code with no precision … float; line (see the next answer). Names GLSL keeps for itself are refused when you add them, and a list kept in this browser that still holds one drops it when the page opens. If your own code declares the same name, the bar shows redefinition on your line instead: press Remove on that card and add it again under another name.

My custom uniform does nothing

It only reaches your code by name: write the same name in the code, such as col *= uBright;.

The page adds uniforms just below the precision … float; line, or below #version when there is none. Keep a precision line: without one the uniform lines themselves fail to compile.

Do not write your own uniform line for it: the name is then declared twice and the code fails to compile.

Where did my code go?

The page keeps the last code you typed in this browser, with the custom uniforms it used. Picking a preset or pressing Reset puts other code in the box, and Your code under Presets brings yours back. A reload opens your code again if it was in the box.

Only one draft is kept: typing in a preset's code replaces it. Private windows and cleared site data keep nothing, so press Copy shader code to keep code for good.

The glow does not follow me

iMouse moves while the pointer is over the preview, and while a finger touches and drags on it. Only Plasma and AIKIZI neon use it; in the other presets it changes nothing until you use it in the code.

The preview is slow

The code runs once for every pixel, so a bigger preview and longer loops cost more. Raymarched sphere is the heaviest preset. The line under Playback shows the frame rate.

Drag the bar to make the preview smaller, or lower a loop count in the code, such as the 80 in Raymarched sphere. Pause freezes the picture, but the page still draws it every frame.

How does it work on a phone?

Under 900 pixels wide the preview sits above the code, and the bar between them drags up and down. Phones and touch screens draw one pixel for each screen point, which keeps the preview quick and makes the PNG smaller. Phone keyboards often have no Tab key; type spaces instead.

Copy did nothing

Some browsers do not let a page put a picture on the clipboard. Use Save PNG instead. If copying the code fails, the bar says so; select the code in the box and copy it by hand.

Is my code uploaded?

No. The code is compiled by your own browser and GPU, and never leaves your device. The kept draft lives in this browser's storage.