Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Texture blit shaders

Texture blit shaders are used to define the behavior of blit calls on a DrawableTexture2D.

Texture blit shaders only have one processing function, the blit() function, which runs for every pixel of the source texture inside the rect given to blit_rect().

더 보기

See Using DrawableTextures for more information on how to use texture blit shaders as part of a DrawableTexture.

렌더러 모드

렌더링 모드

설명

blend_disabled

Disable blending, values (including alpha) are written as-is. Default.

블렌드_믹스

Mix blend mode (alpha is transparency).

블렌드_추가

덧셈 블렌드 모드.

blend_sub

빼기 블렌드 모드.

blend_mul

곱셈 블렌드 모드.

참고

There is no premultiplied alpha blend mode for Texture blit shaders.

Built-In(내장)

``in``로 표시된 값은 읽기 전용입니다. ``out``로 표시된 값은 선택적으로 쓸 수 있으며 반드시 합리적인 값을 포함하지는 않습니다. ``inout``로 표시된 값은 적절한 기본값을 제공하며 선택적으로 쓸 수 있습니다. 샘플러는 기록할 수 없으므로 표시되지 않습니다.

벡터 내장 타입

전역 내장 기능은 사용자 정의 기능을 포함하여 어디에서나 사용할 수 있습니다.

내장

설명

부동 소수점 TIME

엔진이 시작된 이후의 전역 시간(초)입니다. 3,600``초마다 반복됩니다(:ref:`rollover<class_ProjectSettings_property_rendering/limits/time/time_rollover_secs>` 설정으로 변경 가능). :ref:`time_scale<class_Engine_property_time_scale>`의 영향을 받지만 일시 중지의 영향을 받지는 않습니다. 시간 척도의 영향을 받지 않는 ``TIME 변수가 필요한 경우 고유한 :ref:`global shader uniform<doc_shading_language_global_uniforms>`를 추가하고 각 프레임을 업데이트하세요.

부동 소수점 PI

PI 상수(3.141592). 원의 지름과 반 바퀴의 라디안 수에 대한 원주 비율입니다.

부동 TAU

A TAU constant (6.283185). An equivalent of PI * 2 and amount of radians in full turn.

부동 E

An E constant (2.718281). Euler's number and a base of the natural logarithm.

Blit built-ins

Source textures

Texture blit shaders have up to 4 source textures bound as inputs. These can be accessed with a sampler2D using hint_blit_source0, hint_blit_source1, hint_blit_source2, and hint_blit_source3.

내장

설명

vec4에서 FRAGCOORD

Coordinate of pixel center. In screen space. xy specifies position in viewport. Upper-left of the viewport is the origin, (0.0, 0.0).

vec2 UV에서

UV from the vertex() function. This is set to sample all of a source texture.

in vec4 MODULATE

MODULATE color passed in by RenderingServer API.

out vec4 COLOR0

Output color to blended with the DrawableTexture target. Initialized to (0.0, 0.0, 0.0, 0.0).

out vec4 COLOR1

Output color to blended with an extra DrawableTexture target. Initialized to (0.0, 0.0, 0.0, 0.0).

out vec4 COLOR2

Output color to blended with an extra DrawableTexture target. Initialized to (0.0, 0.0, 0.0, 0.0).

out vec4 COLOR3

Output color to blended with an extra DrawableTexture target. Initialized to (0.0, 0.0, 0.0, 0.0).