Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting a dynamic PBR material with colorize node having errors when exported #732

Open
OwnemBro opened this issue Dec 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@OwnemBro
Copy link

OwnemBro commented Dec 6, 2024

Material Maker version:

1.4a pre

OS/device including version:

Windows 10 19045.5131

Issue description:

When loading the shader into Godot(version 4.3 stable) you are met with-

:53 - Expected array initialization.
Shader compilation failed.
./servers/rendering/renderer_rd/shader_rd.h:166 - Parameter "version" is null.

Steps to reproduce:
Connect a colorize node to the albedo of a dynamic PBR material, export to Godot 4, and use as a material in Godot 4.3 stable.

@OwnemBro OwnemBro added the bug Something isn't working label Dec 6, 2024
@puj
Copy link

puj commented Jan 13, 2025

Material Maker version:

1.4a pre

OS/device including version:

OS Name Microsoft Windows 11 Pro
Version 10.0.22631 Build 22631

Issue description:
When loading the shader into Godot(version 4.2.1 stable) you are met with-

  :59 - Expected array initialization.
  Shader compilation failed.
  res://art/1stfloor.gdshader:59 - Expected array initialization.
  Shader compilation failed.

Also busted for me using wood/marble. I guess this implicitly colorizes? Looks like issues with any colorize gradient.

Perhaps there are some latent variables being generated despite removing the "wood" node

shader_type spatial;
render_mode blend_mix,cull_back,diffuse_burley,specular_schlick_ggx
;
uniform vec3 uv1_offset = vec3(0.0, 0.0, 0.0);
uniform vec3 uv1_scale = vec3(1.0, 1.0, 1.0);
uniform int depth_min_layers = 8;
uniform int depth_max_layers = 16;
uniform vec2 depth_flip = vec2(1.0);
uniform float variation = 0.0;
varying float elapsed_time;
void vertex() {
	elapsed_time = TIME;
	UV = UV*uv1_scale.xy+uv1_offset.xy;
}
float rand(vec2 x) {
    return fract(cos(mod(dot(x, vec2(13.9898, 8.141)), 3.14)) * 43758.5);
}
vec2 rand2(vec2 x) {
    return fract(cos(mod(vec2(dot(x, vec2(13.9898, 8.141)),
						      dot(x, vec2(3.4562, 17.398))), vec2(3.14))) * 43758.5);
}
vec3 rand3(vec2 x) {
    return fract(cos(mod(vec3(dot(x, vec2(13.9898, 8.141)),
							  dot(x, vec2(3.4562, 17.398)),
                              dot(x, vec2(13.254, 5.867))), vec3(3.14))) * 43758.5);
}
float param_rnd(float minimum, float maximum, float seed) {
	return minimum+(maximum-minimum)*rand(vec2(seed));
}
float param_rndi(float minimum, float maximum, float seed) {
	return floor(param_rnd(minimum, maximum + 1.0, seed));
}
vec3 rgb2hsv(vec3 c) {
	vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
	vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
	vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
	float d = q.x - min(q.w, q.y);
	float e = 1.0e-10;
	return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c) {
	vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
	vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
	return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
const vec4 p_o515463191279_albedo_color = vec4(1.000000000, 1.000000000, 1.000000000, 1.000000000);
const float p_o515463191279_metallic = 1.000000000;
const float p_o515463191279_roughness = 1.000000000;
const float p_o515463191279_emission_energy = 1.000000000;
const float p_o515463191279_normal = 1.000000000;
const float p_o515463191279_ao = 1.000000000;
const float p_o515463191279_depth_scale = 0.560000000;
const float p_o69956628649957_color = 0.000000000;
const float p_o69956611873510_color = 0.150000000;
const float p_o69956997749578_color = 1.000000000;
const float p_o520429247450_amount1 = 0.610000000;
const vec4 p_o69956645427163_c1 = vec4(0.714843750, 0.423299640, 0.000000000, 1.000000000);
const vec4 p_o69956645427163_c2 = vec4(1.000000000, 1.000000000, 1.000000000, 1.000000000);
const float p_o69956662201372_gradient_pos[5];
const vec4 p_o69956662201372_gradient_col[5];
const float p_o69957836610977_translate_x = 0.500000000;
const float p_o69957836610977_translate_y = 0.500000000;
const float p_o69957836610977_rotate = 0.000000000;
const float p_o69957836610977_scale_x = 1.000000000;
const float p_o69957836610977_scale_y = 1.000000000;
const float seed_o69957853388074 = 18961.000000000;
const float p_o69957853388074_scale_x = 8.000000000;
const float p_o69957853388074_scale_y = 8.000000000;
const float p_o69957853388074_iterations = 8.000000000;
const float p_o69957853388074_persistence = 0.500000000;
const float seed_o515479967700 = 0.000000000;
const float p_o515479967700_rows = 64.000000000;
const float p_o515479967700_iterations = 9.000000000;
const float p_o515479967700_min_size = 0.290000000;
const float p_o515479967700_mortar = 0.000000000;
const float p_o515479967700_bevel = 0.050000000;
const float p_o515479967700_round = 0.000000000;
const float p_o515479967700_corner = 0.260000000;
const float seed_o515496740868 = 0.000000000;
const float p_o515496740868_density = 0.500000000;
// #globals: marble/combine (o69956980972476)
// #globals: blend
vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*c1 + (1.0-opacity)*c2;
}
vec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	if (rand(uv) < opacity) {
		return c1;
	} else {
		return c2;
	}
}
vec3 blend_multiply(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*c1*c2 + (1.0-opacity)*c2;
}
vec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;
}
float blend_overlay_f(float c1, float c2) {
	return (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2));
}
vec3 blend_overlay(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*vec3(blend_overlay_f(c1.x, c2.x), blend_overlay_f(c1.y, c2.y), blend_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
vec3 blend_hard_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*0.5*(c1*c2+blend_overlay(uv, c1, c2, 1.0)) + (1.0-opacity)*c2;
}
float blend_soft_light_f(float c1, float c2) {
	return (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0);
}
vec3 blend_soft_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*vec3(blend_soft_light_f(c1.x, c2.x), blend_soft_light_f(c1.y, c2.y), blend_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
float blend_burn_f(float c1, float c2) {
	return (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0);
}
vec3 blend_burn(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*vec3(blend_burn_f(c1.x, c2.x), blend_burn_f(c1.y, c2.y), blend_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
float blend_dodge_f(float c1, float c2) {
	return (c1==1.0)?c1:min(c2/(1.0-c1),1.0);
}
vec3 blend_dodge(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*vec3(blend_dodge_f(c1.x, c2.x), blend_dodge_f(c1.y, c2.y), blend_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
vec3 blend_lighten(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*max(c1, c2) + (1.0-opacity)*c2;
}
vec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*min(c1, c2) + (1.0-opacity)*c2;
}
vec3 blend_difference(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;
}
vec3 blend_additive(vec2 uv, vec3 c1, vec3 c2, float oppacity) {
	return c2 + c1 * oppacity;
}
vec3 blend_addsub(vec2 uv, vec3 c1, vec3 c2, float oppacity) {
	return c2 + (c1 - .5) * 2.0 * oppacity;
}
// #globals: adjust_hsv
vec3 rgb_to_hsv(vec3 c) {
	vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
	vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
	vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
	float d = q.x - min(q.w, q.y);
	float e = 1.0e-10;
	return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv_to_rgb(vec3 c) {
	vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
	vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
	return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
// #globals: blend2 (o520429247450)
float blend_linear_light_f(float c1, float c2) {
	return (c1 + 2.0 * c2) - 1.0;
}
vec3 blend_linear_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {
return opacity*vec3(blend_linear_light_f(c1.x, c2.x), blend_linear_light_f(c1.y, c2.y), blend_linear_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
float blend_vivid_light_f(float c1, float c2) {
	return (c1 < 0.5) ? 1.0 - (1.0 - c2) / (2.0 * c1) : c2 / (2.0 * (1.0 - c1));
}
vec3 blend_vivid_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*vec3(blend_vivid_light_f(c1.x, c2.x), blend_vivid_light_f(c1.y, c2.y), blend_vivid_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
float blend_pin_light_f( float c1, float c2) {
	return (2.0 * c1 - 1.0 > c2) ? 2.0 * c1 - 1.0 : ((c1 < 0.5 * c2) ? 2.0 * c1 : c2);
}
vec3 blend_pin_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*vec3(blend_pin_light_f(c1.x, c2.x), blend_pin_light_f(c1.y, c2.y), blend_pin_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
float blend_hard_mix_f(float c1, float c2) {
	return floor(c1 + c2);
}
vec3 blend_hard_mix(vec2 uv, vec3 c1, vec3 c2, float opacity) {
		return opacity*vec3(blend_hard_mix_f(c1.x, c2.x), blend_hard_mix_f(c1.y, c2.y), blend_hard_mix_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
float blend_exclusion_f(float c1, float c2) {
	return c1 + c2 - 2.0 * c1 * c2;
}
vec3 blend_exclusion(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	return opacity*vec3(blend_exclusion_f(c1.x, c2.x), blend_exclusion_f(c1.y, c2.y), blend_exclusion_f(c1.z, c2.z)) + (1.0-opacity)*c2;
}
vec3 blend_hue(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	vec3 outcol = c2;
	vec3 hsv, hsv2, tmp;
	hsv2 = rgb_to_hsv(c1);
	if (hsv2.y != 0.0) {
		hsv = rgb_to_hsv(outcol);
		hsv.x = hsv2.x;
		tmp = hsv_to_rgb(hsv);
		outcol = mix(outcol, tmp, opacity);
	}
	return outcol;
}
vec3 blend_saturation(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	float facm = 1.0 - opacity;
	vec3 outcol = c2;
	vec3 hsv, hsv2;
	hsv = rgb_to_hsv(outcol);
	if (hsv.y != 0.0) {
		hsv2 = rgb_to_hsv(c1);
		hsv.y = facm * hsv.y + opacity * hsv2.y;
		outcol = hsv_to_rgb(hsv);
	}
	return outcol;
}
vec3 blend_color(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	float facm = 1.0 - opacity;
	vec3 outcol = c2;
	vec3 hsv, hsv2, tmp;
	hsv2 = rgb_to_hsv(c1);
	if (hsv2.y != 0.0) {
		hsv = rgb_to_hsv(outcol);
		hsv.x = hsv2.x;
		hsv.y = hsv2.y;
		tmp = hsv_to_rgb(hsv);
		outcol = mix(outcol, tmp, opacity);
	}
	return outcol;
}
vec3 blend_value(vec2 uv, vec3 c1, vec3 c2, float opacity) {
	float facm = 1.0 - opacity;
	vec3 hsv, hsv2;
	hsv = rgb_to_hsv(c2);
	hsv2 = rgb_to_hsv(c1);
	hsv.z = facm * hsv.z + opacity * hsv2.z;
	return hsv_to_rgb(hsv);
}
// #globals: marble/graph_2/transform (o69957836610977)
vec2 transform(vec2 uv, vec2 translate, float rotate, vec2 scale, bool repeat) {
 	vec2 rv;
	uv -= translate;
	uv -= vec2(0.5);
	rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;
	rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;
	rv /= scale;
	rv += vec2(0.5);
	if (repeat) {
		return fract(rv);
	} else {
		return clamp(rv, vec2(0.0), vec2(1.0));
	}	
}
// #globals: marble/graph_2/perlin (o69957853388074)
float perlin(vec2 uv, vec2 size, int iterations, float persistence, float seed) {
	vec2 seed2 = rand2(vec2(seed, 1.0-seed));
	float rv = 0.0;
	float coef = 1.0;
	float acc = 0.0;
	for (int i = 0; i < iterations; ++i) {
		vec2 step = vec2(1.0)/size;
		vec2 xy = floor(uv*size);
		float f0 = rand(seed2+mod(xy, size));
		float f1 = rand(seed2+mod(xy+vec2(1.0, 0.0), size));
		float f2 = rand(seed2+mod(xy+vec2(0.0, 1.0), size));
		float f3 = rand(seed2+mod(xy+vec2(1.0, 1.0), size));
		vec2 mixval = smoothstep(0.0, 1.0, fract(uv*size));
		rv += coef * mix(mix(f0, f1, mixval.x), mix(f2, f3, mixval.x), mixval.y);
		acc += coef;
		size *= 2.0;
		coef *= persistence;
	}
	
	return rv / acc;
}
// #globals: bricks2
vec4 brick(vec2 uv, vec2 bmin, vec2 bmax, float mortar, float round, float bevel, float brick_height) {
	float color;
	vec2 size = bmax - bmin;
	float min_size = min(size.x, size.y);
	mortar *= brick_height;
	bevel *= brick_height;
	round *= brick_height;
	vec2 center = 0.5*(bmin+bmax);
	vec2 d = abs(uv-center)-0.5*(size)+vec2(round+mortar);
	color = length(max(d,vec2(0))) + min(max(d.x,d.y),0.0)-round;
	color = clamp(-color/bevel, 0.0, 1.0);
	vec2 tiled_brick_pos = mod(bmin, vec2(1.0, 1.0));
	return vec4(color, center, tiled_brick_pos.x+7.0*tiled_brick_pos.y);
}
vec4 brick_corner_bb(vec2 uv, vec2 bmin, vec2 bmax, float mortar, float corner, float brick_height) {
	vec2 center = 0.5*(bmin + bmax);
	vec2 size = bmax - bmin;
	float max_size = max(size.x, size.y);
	float min_size = min(size.x, size.y);
	mortar *= brick_height;
	corner *= brick_height;
	
	vec2 corner1 = vec2(bmin + mortar);
	vec2 corner2 = vec2(bmax.x - mortar - corner, bmin.y + mortar);
	vec2 corner3 = vec2(bmin.x + mortar, bmax.y - mortar - corner);
	vec2 corner4 = vec2(bmax - mortar - corner);
	vec2 top = uv.x < center.x ? corner1 : corner2;
	vec2 bottom = uv.x < center.x ? corner3 : corner4;
	vec2 positions = uv.y < center.y ? top : bottom;
	return vec4(round(fract(positions)*4096.0)/4096.0, corner, corner);
}
vec4 bricks_rb(vec2 uv, vec2 count, float repeat, float offset) {
	count *= repeat;
	float x_offset = offset*step(0.5, fract(uv.y*count.y*0.5));
	vec2 bmin = floor(vec2(uv.x*count.x-x_offset, uv.y*count.y));
	bmin.x += x_offset;
	bmin /= count;
	return vec4(bmin, bmin+vec2(1.0)/count);
}
vec4 bricks_rb2(vec2 uv, vec2 count, float repeat, float offset) {
	count *= repeat;
	float x_offset = offset*step(0.5, fract(uv.y*count.y*0.5));
	count.x = count.x*(1.0+step(0.5, fract(uv.y*count.y*0.5)));
	vec2 bmin = floor(vec2(uv.x*count.x-x_offset, uv.y*count.y));
	bmin.x += x_offset;
	bmin /= count;
	return vec4(bmin, bmin+vec2(1.0)/count);
}
vec4 bricks_rb3(vec2 uv, vec2 count, float repeat, float offset) {
	vec4 bb = bricks_rb(uv, count, repeat, offset);
	
	if ( (uv.x - bb.x) / (bb.z - bb.x) < 1.0/3.0) {
		bb.z = bb.x + (bb.z - bb.x) / 3.0;
	} else {
		bb.x = bb.x + (bb.z - bb.x) / 3.0;
	}
	return bb;
}
vec4 bricks_hb(vec2 uv, vec2 count, float repeat, float offset) {
	float pc = count.x+count.y;
	float c = pc*repeat;
	vec2 corner = floor(uv*c);
	float cdiff = mod(corner.x-corner.y, pc);
	if (cdiff < count.x) {
		return vec4((corner-vec2(cdiff, 0.0))/c, (corner-vec2(cdiff, 0.0)+vec2(count.x, 1.0))/c);
	} else {
		return vec4((corner-vec2(0.0, pc-cdiff-1.0))/c, (corner-vec2(0.0, pc-cdiff-1.0)+vec2(1.0, count.y))/c);
	}
}
vec4 bricks_bw(vec2 uv, vec2 count, float repeat, float offset) {
	vec2 c = 2.0*count*repeat;
	float mc = max(c.x, c.y);
	vec2 corner1 = floor(uv*c);
	vec2 corner2 = count*floor(repeat*2.0*uv);
	float cdiff = mod(dot(floor(repeat*2.0*uv), vec2(1.0)), 2.0);
	vec2 corner;
	vec2 size;
	if (cdiff == 0.0) {
		corner = vec2(corner1.x, corner2.y);
		size = vec2(1.0, count.y);
	} else {
		corner = vec2(corner2.x, corner1.y);
		size = vec2(count.x, 1.0);
	}
	return vec4(corner/c, (corner+size)/c);
}
vec4 bricks_sb(vec2 uv, vec2 count, float repeat, float offset) {
	vec2 c = (count+vec2(1.0)) * repeat;
	float mc = max(c.x, c.y);
	vec2 corner1 = floor(uv*c);
	vec2 corner2 = (count+vec2(1.0))*floor(repeat*uv);
	vec2 rcorner = corner1 - corner2;
	vec2 corner;
	vec2 size;
	if (rcorner.x == 0.0 && rcorner.y < count.y) {
		corner = corner2;
		size = vec2(1.0, count.y);
	} else if (rcorner.y == 0.0) {
		corner = corner2+vec2(1.0, 0.0);
		size = vec2(count.x, 1.0);
	} else if (rcorner.x == count.x) {
		corner = corner2+vec2(count.x, 1.0);
		size = vec2(1.0, count.y);
	} else if (rcorner.y == count.y) {
		corner = corner2+vec2(0.0, count.y);
		size = vec2(count.x, 1.0);
	} else {
		corner = corner2+vec2(1.0);
		size = vec2(count.x-1.0, count.y-1.0);
	}
	return vec4(corner/c, (corner+size)/c);
}
// #globals: bricks_uneven (o515479967700)
vec4 bricks_uneven2(vec2 uv, float rows, int iterations, float min_size, float seed) {
	vec4 bb;
	float random_offset = rand( vec2( seed - floor( fract(uv.y) * rows ) ) );
	uv.x += random_offset;
	bb.xy = floor(uv * vec2(1.0, rows)) / vec2(1.0, rows);
	bb.zw = floor(uv * vec2(1.0, rows)) / vec2(1.0, rows) + vec2(1.0, 1.0 / rows);
	
	for (int i = 0; i < iterations; ++i) {
		float cut = rand(vec2(seed + float(i * 100) + floor( fract(uv.y) * rows ) ));
		cut += floor(uv.x);
		if ( bb.z - cut < min_size || cut - bb.x < min_size)
			continue;
		if ( uv.x < cut) {
			bb.z = cut;
		} else {
			bb.x = cut;
		}
	}
	
	bb.xz -= random_offset;
	
	return bb;
}
vec4 o69956662201372_gradient_gradient_fct(float x) {
  if (x < p_o69956662201372_gradient_pos[0]) {
    return p_o69956662201372_gradient_col[0];
  } else if (x < p_o69956662201372_gradient_pos[1]) {
    return mix(p_o69956662201372_gradient_col[0], p_o69956662201372_gradient_col[1], ((x-p_o69956662201372_gradient_pos[0])/(p_o69956662201372_gradient_pos[1]-p_o69956662201372_gradient_pos[0])));
  } else if (x < p_o69956662201372_gradient_pos[2]) {
    return mix(p_o69956662201372_gradient_col[1], p_o69956662201372_gradient_col[2], ((x-p_o69956662201372_gradient_pos[1])/(p_o69956662201372_gradient_pos[2]-p_o69956662201372_gradient_pos[1])));
  } else if (x < p_o69956662201372_gradient_pos[3]) {
    return mix(p_o69956662201372_gradient_col[2], p_o69956662201372_gradient_col[3], ((x-p_o69956662201372_gradient_pos[2])/(p_o69956662201372_gradient_pos[3]-p_o69956662201372_gradient_pos[2])));
  } else if (x < p_o69956662201372_gradient_pos[4]) {
    return mix(p_o69956662201372_gradient_col[3], p_o69956662201372_gradient_col[4], ((x-p_o69956662201372_gradient_pos[3])/(p_o69956662201372_gradient_pos[4]-p_o69956662201372_gradient_pos[3])));
  }
  return p_o69956662201372_gradient_col[4];
}
void fragment() {
	float _seed_variation_ = variation;
	vec2 uv = fract(UV);

// #output0: marble/uniform_greyscale (o69956628649957)
float o69956628649957_0_1_f = p_o69956628649957_color;

// #output0: marble/uniform_greyscale_2 (o69956611873510)
float o69956611873510_0_1_f = p_o69956611873510_color;

// #output0: marble/uniform_greyscale_3 (o69956997749578)
float o69956997749578_0_1_f = p_o69956997749578_color;

// #output0: marble/combine (o69956980972476)
vec4 o69956980972476_0_1_rgba = vec4(o69956997749578_0_1_f, o69956611873510_0_1_f, o69956628649957_0_1_f, 1.0);

// #output0: marble/graph_2/perlin (o69957853388074)
float o69957853388074_0_1_f = perlin((uv), vec2(p_o69957853388074_scale_x, p_o69957853388074_scale_y), int(p_o69957853388074_iterations), p_o69957853388074_persistence, (seed_o69957853388074+fract(_seed_variation_)));

// #output0: marble/graph_2/perlin (o69957853388074)
float o69957853388074_0_3_f = perlin((transform((uv), vec2(p_o69957836610977_translate_x*(2.0*o69957853388074_0_1_f-1.0), p_o69957836610977_translate_y*(2.0*o69957853388074_0_1_f-1.0)), p_o69957836610977_rotate*0.01745329251*(2.0*1.0-1.0), vec2(p_o69957836610977_scale_x*(2.0*1.0-1.0), p_o69957836610977_scale_y*(2.0*1.0-1.0)), true)), vec2(p_o69957853388074_scale_x, p_o69957853388074_scale_y), int(p_o69957853388074_iterations), p_o69957853388074_persistence, (seed_o69957853388074+fract(_seed_variation_)));

// #output0: marble/graph_2/transform (o69957836610977)
vec4 o69957836610977_0_1_rgba = vec4(vec3(o69957853388074_0_3_f), 1.0);

// #output0: marble/colorize (o69956662201372)
vec4 o69956662201372_0_1_rgba = o69956662201372_gradient_gradient_fct((dot((o69957836610977_0_1_rgba).rgb, vec3(1.0))/3.0));

// #output0: marble/_2 (o69956645427163)
vec4 o69956645427163_0_1_rgba = mix(p_o69956645427163_c1, p_o69956645427163_c2, (dot((o69956662201372_0_1_rgba).rgb, vec3(1.0))/3.0));

// #code: noise (o515496740868)
vec2 o515496740868_0_uv = floor((uv)*16.0)/16.0;
// #output0: noise (o515496740868)
float o515496740868_0_1_f = step(rand(o515496740868_0_uv+vec2((seed_o515496740868+fract(_seed_variation_)))), p_o515496740868_density);

// #code: bricks_uneven (o515479967700)
vec4 o515479967700_0_rect = bricks_uneven2((uv), p_o515479967700_rows, int(p_o515479967700_iterations), p_o515479967700_min_size, float((seed_o515479967700+fract(_seed_variation_))));
vec4 o515479967700_0 = brick((uv), o515479967700_0_rect.xy, o515479967700_0_rect.zw, p_o515479967700_mortar*1.0, p_o515479967700_round*o515496740868_0_1_f, max(0.001, p_o515479967700_bevel*1.0), 1.0 / p_o515479967700_rows);
// #output0: bricks_uneven (o515479967700)
float o515479967700_0_1_f = o515479967700_0.x;

// #code: blend2 (o520429247450)
vec4 o520429247450_0_b = vec4(vec3(o515479967700_0_1_f), 1.0);
vec4 o520429247450_0_l;
float o520429247450_0_a;

o520429247450_0_l = o69956645427163_0_1_rgba;
o520429247450_0_a = p_o520429247450_amount1*1.0;
o520429247450_0_b = vec4(blend_normal((uv), o520429247450_0_l.rgb, o520429247450_0_b.rgb, o520429247450_0_a*o520429247450_0_l.a), min(1.0, o520429247450_0_b.a+o520429247450_0_a*o520429247450_0_l.a));
// #output0: blend2 (o520429247450)
vec4 o520429247450_0_1_rgba = o520429247450_0_b;

	vec3 albedo_tex = ((o520429247450_0_1_rgba).rgb).rgb;
	albedo_tex = mix(pow((albedo_tex + vec3(0.055)) * (1.0 / (1.0 + 0.055)),vec3(2.4)),albedo_tex * (1.0 / 12.92),lessThan(albedo_tex,vec3(0.04045)));
	ALBEDO = albedo_tex*p_o515463191279_albedo_color.rgb;
	METALLIC = (dot((o69956980972476_0_1_rgba).rgb, vec3(1.0))/3.0)*p_o515463191279_metallic;
	ROUGHNESS = 1.0*p_o515463191279_roughness;
	NORMAL = vec3(0.5);
	EMISSION = vec3(0.0)*p_o515463191279_emission_energy;
}

image
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants