diff --git a/material_maker/panels/preview_2d/preview_2d.gd b/material_maker/panels/preview_2d/preview_2d.gd index d2fcf3cb3..25fab8fb6 100644 --- a/material_maker/panels/preview_2d/preview_2d.gd +++ b/material_maker/panels/preview_2d/preview_2d.gd @@ -194,6 +194,8 @@ func create_image(renderer_function : String, params : Array, image_size : int) var tmp_material = ShaderMaterial.new() tmp_material.shader = Shader.new() tmp_material.shader.code = MMGenBase.generate_preview_shader(source, source.output_type, "uniform vec2 mm_texture_size;\nuniform float mm_chunk_size = 1.0;\nuniform vec2 mm_chunk_offset = vec2(0.0);\nvoid fragment() {COLOR = preview_2d(mm_chunk_offset+mm_chunk_size*UV);}") + for u in source.uniforms: + tmp_material.set_shader_parameter(u.name, u.value) mm_deps.material_update_params(MMShaderMaterial.new(tmp_material)) var renderer = await mm_renderer.request(self) renderer = await renderer.render_material(self, tmp_material, image_size, source.output_type != "rgba")