Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

VisualShaderNodeDerivativeFunc

Inherits: VisualShaderNode < Resource < RefCounted < Object

Calculates a derivative within the visual shader graph.

Description

This node is only available in Fragment and Light visual shaders.

Properties

Function

function

0

OpType

op_type

0

Precision

precision

0


Enumerations

enum OpType:

OpType OP_TYPE_SCALAR = 0

A floating-point scalar.

OpType OP_TYPE_VECTOR_2D = 1

A 2D vector type.

OpType OP_TYPE_VECTOR_3D = 2

A 3D vector type.

OpType OP_TYPE_VECTOR_4D = 3

A 4D vector type.

OpType OP_TYPE_MAX = 4

Represents the size of the OpType enum.


enum Function:

Function FUNC_SUM = 0

Sum of absolute derivative in x and y.

Function FUNC_X = 1

Derivative in x using local differencing.

Function FUNC_Y = 2

Derivative in y using local differencing.

Function FUNC_MAX = 3

Represents the size of the Function enum.


enum Precision:

Precision PRECISION_NONE = 0

No precision is specified, the GPU driver is allowed to use whatever level of precision it chooses. This is the default option and is equivalent to using dFdx() or dFdy() in text shaders.

Precision PRECISION_COARSE = 1

The derivative will be calculated using the current fragment's neighbors (which may not include the current fragment). This tends to be faster than using