Skip to content

Commit 5adfc4b

Browse files
authored
Fixed missing _controlled_variation_ variable for 3D PBR material (contributed by williamchange)
Fixed missing _controlled_variation_ variable for 3D PBR material
2 parents bad8707 + d153c4f commit 5adfc4b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

addons/material_maker/nodes/material_3d.mmg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"}",
6666
"void fragment() {",
6767
"\tfloat _seed_variation_ = 0.0;",
68+
"\tvec4 _controlled_variation_ = vec4(0.0);",
6869
"$begin_generate",
6970
"\tALBEDO = $albedo_color.rgb*$albedo_tex(vec4(texcoords_3d, 0.0));",
7071
"\tMETALLIC = $metallic*$metallic_tex(vec4(texcoords_3d, 0.0));",
@@ -122,6 +123,7 @@
122123
"}",
123124
"void fragment() {",
124125
"\tfloat _seed_variation_ = 0.0;",
126+
"\tvec4 _controlled_variation_ = vec4(0.0);",
125127
"$begin_generate",
126128
"\tALBEDO = $albedo_color.rgb*$albedo_tex(vec4(texcoords_3d, 0.0));",
127129
"\tMETALLIC = $metallic*$metallic_tex(vec4(texcoords_3d, 0.0));",
@@ -173,6 +175,7 @@
173175
"\t\t",
174176
"\t\tvoid surf (Input IN, inout SurfaceOutputStandard o) {",
175177
"\t\t\tfloat _seed_variation_ = 0.0;",
178+
"\t\t\tfloat4 _controlled_variation_ = float4(0.0,0.0,0.0,0.0);",
176179
"$if $(param:world)",
177180
"\t\t\tfloat3 texcoords_3d = IN.worldPos;",
178181
"$else",
@@ -379,6 +382,7 @@
379382
"$definitions hlsl,rename_buffers,unreal",
380383
"\tfixed4 generated_shader(float3 texcoords_3d, out float metallic, out float roughness, out float3 emission, out float occlusion) {",
381384
"\t\tfloat _seed_variation_ = 0.0;",
385+
"\t\tfloat4 _controlled_variation_ = float4(0.0,0.0,0.0,0.0);",
382386
"$begin_generate hlsl,rename_buffers,unreal",
383387
"\t\t// sample the generated texture",
384388
"\t\tfixed4 rv = tofloat4($albedo_tex(texcoords_3d), 1.0)*$albedo_color;",
@@ -525,6 +529,7 @@
525529
"",
526530
"void fragment() {",
527531
"\tfloat _seed_variation_ = 0.0;",
532+
"\tvec4 _controlled_variation_ = vec4(0.0);",
528533
"$begin_generate",
529534
"\tALBEDO = $albedo_color.rgb*$albedo_tex(vec4(texcoords_3d, 0.0));",
530535
"\tMETALLIC = $metallic*$metallic_tex(vec4(texcoords_3d, 0.0));",
@@ -539,4 +544,4 @@
539544
]
540545
},
541546
"type": "material_export"
542-
}
547+
}

0 commit comments

Comments
 (0)