ComfyUI Node
NORMAL BLEND (JOV_GL)
Blend two Normal maps
NORMAL BLEND (JOV_GL)
- imageA
- imageB
- RGBA
- RGB
- MASK
◄blend0.50►
◄FRAGMENT// name: NORMAL BLEND
// desc: Blend two Normal maps
// category: COMPOSE
uniform sampler2D imageA; // | Input image A to blend with image B
uniform sampler2D imageB; // | Input image B to blend with image A
uniform float blend; // 0.5; 0; 1; 0.01 | Intensity of blend
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord / iResolution.xy;
vec3 normalA = texture(imageA, uv).rgb * 2.0 - 1.0;
normalA = normalize(normalA);
vec3 normalB = texture(imageB, uv).rgb * 2.0 - 1.0;
normalB = normalize(normalB);
vec3 blendedNormal = normalize(mix(normalA, normalB, blend));
fragColor = vec4((blendedNormal * 0.5) + 0.5, 1.0);
}►
CategoryJOV_GL 🌈/COMPOSE
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| imageAopt | IMAGE | Input image A to blend with image B | |
| imageBopt | IMAGE | Input image B to blend with image A | |
| blendopt | FLOAT | 0.500–1 | Intensity of blend |
| FRAGMENTopt | STRING | // name: NORMAL BLEND // desc: Blend two Normal maps // category: COMPOSE uniform sampler2D imageA; // | Input image A to blend with image B uniform sampler2D imageB; // | Input image B to blend with image A uniform float blend; // 0.5; 0; 1; 0.01 | Intensity of blend void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = fragCoord / iResolution.xy; vec3 normalA = texture(imageA, uv).rgb * 2.0 - 1.0; normalA = normalize(normalA); vec3 normalB = texture(imageB, uv).rgb * 2.0 - 1.0; normalB = normalize(normalB); vec3 blendedNormal = normalize(mix(normalA, normalB, blend)); fragColor = vec4((blendedNormal * 0.5) + 0.5, 1.0); } | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| RGBA | IMAGE | Full channel [RGBA] image. If there is an alpha, the image will be masked out with it when using this output. |
| RGB | IMAGE | Three channel [RGB] image. There will be no alpha. |
| MASK | MASK | Single channel mask output. |