luboslenco пре 1 година
родитељ
комит
d9dbdb6d28
42 измењених фајлова са 143 додато и 129 уклоњено
  1. BIN
      armorforge/Assets/Scene.arm
  2. BIN
      armorlab/Assets/Scene.arm
  3. 4 4
      armorlab/Sources/UINodesExt.ts
  4. 3 3
      armorlab/Sources/nodes/InpaintNode.ts
  5. 2 2
      armorlab/Sources/nodes/PhotoToPBRNode.ts
  6. 2 2
      armorlab/Sources/nodes/TilingNode.ts
  7. 3 3
      armorlab/Sources/nodes/UpscaleNode.ts
  8. 1 1
      armorlab/Sources/nodes/VarianceNode.ts
  9. BIN
      armorpaint/Assets/Scene.arm
  10. 2 2
      armorpaint/Sources/MakeMaterial.ts
  11. 2 2
      armorpaint/Sources/RenderPathPreview.ts
  12. 12 11
      armorpaint/Sources/SlotLayer.ts
  13. BIN
      armorsculpt/Assets/Scene.arm
  14. 3 3
      armorsculpt/Sources/ImportMesh.ts
  15. 1 1
      armorsculpt/Sources/MakeMaterial.ts
  16. 17 16
      base/Sources/Base.ts
  17. 1 1
      base/Sources/BoxPreferences.ts
  18. 1 1
      base/Sources/BoxProjects.ts
  19. 1 1
      base/Sources/Config.ts
  20. 1 1
      base/Sources/Context.ts
  21. 3 3
      base/Sources/ExportArm.ts
  22. 8 7
      base/Sources/ExportTexture.ts
  23. 4 4
      base/Sources/ImportArm.ts
  24. 19 19
      base/Sources/ImportBlendMesh.ts
  25. 1 1
      base/Sources/ImportEnvmap.ts
  26. 2 2
      base/Sources/ImportMesh.ts
  27. 2 2
      base/Sources/NodesMaterial.ts
  28. 2 2
      base/Sources/Project.ts
  29. 2 2
      base/Sources/RenderPathBase.ts
  30. 1 1
      base/Sources/TabMaterials.ts
  31. 1 1
      base/Sources/TabTextures.ts
  32. 6 4
      base/Sources/UIBase.ts
  33. 1 1
      base/Sources/UIBox.ts
  34. 5 3
      base/Sources/UIFiles.ts
  35. 3 3
      base/Sources/UIHeader.ts
  36. 1 1
      base/Sources/UIMenu.ts
  37. 3 2
      base/Sources/UINodes.ts
  38. 4 4
      base/Sources/UIView2D.ts
  39. 3 3
      base/Sources/UtilMesh.ts
  40. 10 7
      base/Sources/UtilRender.ts
  41. 4 2
      base/Sources/UtilUV.ts
  42. 2 1
      misc/pad/Sources/main.ts

BIN
armorforge/Assets/Scene.arm


BIN
armorlab/Assets/Scene.arm


+ 4 - 4
armorlab/Sources/UINodesExt.ts

@@ -41,14 +41,14 @@ class UINodesExt {
 
 					if (texbase != null) {
 						let texpaint = render_path_render_targets.get("texpaint").image;
-						g2_begin(texpaint, false);
+						g2_begin(texpaint);
 						g2_draw_scaled_image(texbase, 0, 0, Config.getTextureResX(), Config.getTextureResY());
 						g2_end();
 					}
 
 					if (texnor != null) {
 						let texpaint_nor = render_path_render_targets.get("texpaint_nor").image;
-						g2_begin(texpaint_nor, false);
+						g2_begin(texpaint_nor);
 						g2_draw_scaled_image(texnor, 0, 0, Config.getTextureResX(), Config.getTextureResY());
 						g2_end();
 					}
@@ -60,7 +60,7 @@ class UINodesExt {
 					let texpaint_pack = render_path_render_targets.get("texpaint_pack").image;
 
 					if (texocc != null) {
-						g2_begin(texpaint_pack, false);
+						g2_begin(texpaint_pack);
 						g2_set_pipeline(Base.pipeCopyR);
 						g2_draw_scaled_image(texocc, 0, 0, Config.getTextureResX(), Config.getTextureResY());
 						g2_set_pipeline(null);
@@ -68,7 +68,7 @@ class UINodesExt {
 					}
 
 					if (texrough != null) {
-						g2_begin(texpaint_pack, false);
+						g2_begin(texpaint_pack);
 						g2_set_pipeline(Base.pipeCopyG);
 						g2_draw_scaled_image(texrough, 0, 0, Config.getTextureResX(), Config.getTextureResY());
 						g2_set_pipeline(null);

+ 3 - 3
armorlab/Sources/nodes/InpaintNode.ts

@@ -55,7 +55,7 @@ class InpaintNode extends LogicNode {
 
 			Console.progress(tr("Processing") + " - " + tr("Inpaint"));
 			Base.notifyOnNextFrame(() => {
-				g2_begin(InpaintNode.image, false);
+				g2_begin(InpaintNode.image);
 				g2_draw_scaled_image(source, 0, 0, Config.getTextureResX(), Config.getTextureResY());
 				g2_end();
 
@@ -127,7 +127,7 @@ class InpaintNode extends LogicNode {
 					}
 				}
 
-				g2_begin(InpaintNode.temp, false);
+				g2_begin(InpaintNode.temp);
 				// g2_drawImage(image, -x * 512, -y * 512);
 				g2_draw_scaled_image(image, 0, 0, 512, 512);
 				g2_end();
@@ -164,7 +164,7 @@ class InpaintNode extends LogicNode {
 				let start = num_inference_steps - init_timestep;
 
 				TextToPhotoNode.stableDiffusion(InpaintNode.prompt, (img: image_t) => {
-					// result.g2_begin(false);
+					// result.g2_begin();
 					// result.g2_draw_image(img, x * 512, y * 512);
 					// result.g2_end();
 					InpaintNode.result = img;

+ 2 - 2
armorlab/Sources/nodes/PhotoToPBRNode.ts

@@ -48,7 +48,7 @@ class PhotoToPBRNode extends LogicNode {
 					let x = i % tilesX;
 					let y = Math.floor(i / tilesX);
 
-					g2_begin(PhotoToPBRNode.temp, false);
+					g2_begin(PhotoToPBRNode.temp);
 					g2_draw_scaled_image(source, PhotoToPBRNode.borderW - x * PhotoToPBRNode.tileW, PhotoToPBRNode.borderW - y * PhotoToPBRNode.tileW, -Config.getTextureResX(), Config.getTextureResY());
 					g2_draw_scaled_image(source, PhotoToPBRNode.borderW - x * PhotoToPBRNode.tileW, PhotoToPBRNode.borderW - y * PhotoToPBRNode.tileW, Config.getTextureResX(), -Config.getTextureResY());
 					g2_draw_scaled_image(source, PhotoToPBRNode.borderW - x * PhotoToPBRNode.tileW, PhotoToPBRNode.borderW - y * PhotoToPBRNode.tileW, -Config.getTextureResX(), -Config.getTextureResY());
@@ -142,7 +142,7 @@ class PhotoToPBRNode extends LogicNode {
 					///end
 
 					let temp2 = image_from_bytes(u8a.buffer, PhotoToPBRNode.tileW, PhotoToPBRNode.tileW);
-					g2_begin(PhotoToPBRNode.images[from], false);
+					g2_begin(PhotoToPBRNode.images[from]);
 					g2_draw_image(temp2, x * PhotoToPBRNode.tileW, y * PhotoToPBRNode.tileW);
 					g2_end();
 					Base.notifyOnNextFrame(() => {

+ 2 - 2
armorlab/Sources/nodes/TilingNode.ts

@@ -30,7 +30,7 @@ class TilingNode extends LogicNode {
 
 	override getAsImage = (from: i32, done: (img: image_t)=>void) => {
 		this.inputs[0].getAsImage((source: image_t) => {
-			g2_begin(TilingNode.image, false);
+			g2_begin(TilingNode.image);
 			g2_draw_scaled_image(source, 0, 0, Config.getTextureResX(), Config.getTextureResY());
 			g2_end();
 
@@ -52,7 +52,7 @@ class TilingNode extends LogicNode {
 	static sdTiling = (image: image_t, seed: i32/* = -1*/, done: (img: image_t)=>void) => {
 		TextToPhotoNode.tiling = false;
 		let tile = image_create_render_target(512, 512);
-		g2_begin(tile, false);
+		g2_begin(tile);
 		g2_draw_scaled_image(image, -256, -256, 512, 512);
 		g2_draw_scaled_image(image, 256, -256, 512, 512);
 		g2_draw_scaled_image(image, -256, 256, 512, 512);

+ 3 - 3
armorlab/Sources/nodes/UpscaleNode.ts

@@ -50,7 +50,7 @@ class UpscaleNode extends LogicNode {
 			image_unload(UpscaleNode.temp);
 		}
 		UpscaleNode.temp = image_create_render_target(size1w, size1h);
-		g2_begin(UpscaleNode.temp, false);
+		g2_begin(UpscaleNode.temp);
 		g2_draw_scaled_image(source, 0, 0, size1w, size1h);
 		g2_end();
 
@@ -96,7 +96,7 @@ class UpscaleNode extends LogicNode {
 			let tileSource = image_create_render_target(tileSize + 32 * 2, tileSize + 32 * 2);
 			for (let x = 0; x < Math.floor(size1w / tileSize); ++x) {
 				for (let y = 0; y < Math.floor(size1h / tileSize); ++y) {
-					g2_begin(tileSource, false);
+					g2_begin(tileSource);
 					g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, -source.width, source.height);
 					g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, source.width, -source.height);
 					g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, -source.width, -source.height);
@@ -106,7 +106,7 @@ class UpscaleNode extends LogicNode {
 					g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, source.width, source.height);
 					g2_end();
 					let tileResult = UpscaleNode.doTile(tileSource);
-					g2_begin(result, false);
+					g2_begin(result);
 					g2_draw_sub_image(tileResult, x * tileSize2x, y * tileSize2x, 64, 64, tileSize2x, tileSize2x);
 					g2_end();
 					image_unload(tileResult);

+ 1 - 1
armorlab/Sources/nodes/VarianceNode.ts

@@ -27,7 +27,7 @@ class VarianceNode extends LogicNode {
 		let strength = (VarianceNode.inst.inputs[1].node as any).value;
 
 		VarianceNode.inst.inputs[0].getAsImage((source: image_t) => {
-			g2_begin(VarianceNode.temp, false);
+			g2_begin(VarianceNode.temp);
 			g2_draw_scaled_image(source, 0, 0, 512, 512);
 			g2_end();
 

BIN
armorpaint/Assets/Scene.arm


+ 2 - 2
armorpaint/Sources/MakeMaterial.ts

@@ -182,7 +182,7 @@ class MakeMaterial {
 			let current = _g2_current;
 			if (current != null) g2_end();
 			MakeMaterial.bakeNodePreviews();
-			if (current != null) g2_begin(current, false);
+			if (current != null) g2_begin(current);
 		}
 
 		let m = Project.materials[0].data;
@@ -336,7 +336,7 @@ class MakeMaterial {
 			let rts = render_path_render_targets;
 			let texpaint_live = rts.get("texpaint_live");
 
-			g2_begin(image, false);
+			g2_begin(image);
 			g2_draw_image(texpaint_live.image, 0, 0);
 			g2_end();
 		}

+ 2 - 2
armorpaint/Sources/RenderPathPreview.ts

@@ -78,7 +78,7 @@ class RenderPathPreview {
 		///end
 
 		render_path_set_target("mgbuffer0");
-		render_path_clear_target(clearColor, 1.0);
+		render_path_clear_target(clearColor, 1.0, clear_flag_t.COLOR | clear_flag_t.DEPTH);
 		render_path_set_target("mgbuffer0", ["mgbuffer1", "mgbuffer2"]);
 		render_path_draw_meshes("mesh");
 
@@ -128,7 +128,7 @@ class RenderPathPreview {
 		///end
 
 		render_path_set_target("gbuffer0");
-		render_path_clear_target(clearColor, 1.0);
+		render_path_clear_target(clearColor, 1.0, clear_flag_t.COLOR | clear_flag_t.DEPTH);
 		render_path_set_target("gbuffer0", ["gbuffer1", "gbuffer2"]);
 		render_path_draw_meshes("mesh");
 

+ 12 - 11
armorpaint/Sources/SlotLayer.ts

@@ -204,7 +204,7 @@ class SlotLayer {
 		g4_clear(baseColor); // Base
 		g4_end();
 		if (baseImage != null) {
-			g2_begin(raw.texpaint, false);
+			g2_begin(raw.texpaint);
 			g2_draw_scaled_image(baseImage, 0, 0, raw.texpaint.width, raw.texpaint.height);
 			g2_end();
 		}
@@ -227,7 +227,7 @@ class SlotLayer {
 	static invertMask = (raw: SlotLayerRaw) => {
 		if (Base.pipeInvert8 == null) Base.makePipe();
 		let inverted = image_create_render_target(raw.texpaint.width, raw.texpaint.height, tex_format_t.RGBA32);
-		g2_begin(inverted, false);
+		g2_begin(inverted);
 		g2_set_pipeline(Base.pipeInvert8);
 		g2_draw_image(raw.texpaint, 0, 0);
 		g2_set_pipeline(null);
@@ -265,18 +265,18 @@ class SlotLayer {
 
 		if (Base.pipeMerge == null) Base.makePipe();
 		if (SlotLayer.isLayer(raw)) {
-			g2_begin(l.texpaint, false);
+			g2_begin(l.texpaint);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_image(raw.texpaint, 0, 0);
 			g2_set_pipeline(null);
 			g2_end();
 			///if is_paint
-			g2_begin(l.texpaint_nor, false);
+			g2_begin(l.texpaint_nor);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_image(raw.texpaint_nor, 0, 0);
 			g2_set_pipeline(null);
 			g2_end();
-			g2_begin(l.texpaint_pack, false);
+			g2_begin(l.texpaint_pack);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_image(raw.texpaint_pack, 0, 0);
 			g2_set_pipeline(null);
@@ -284,7 +284,7 @@ class SlotLayer {
 			///end
 		}
 		else if (SlotLayer.isMask(raw)) {
-			g2_begin(l.texpaint, false);
+			g2_begin(l.texpaint);
 			g2_set_pipeline(Base.pipeCopy8);
 			g2_draw_image(raw.texpaint, 0, 0);
 			g2_set_pipeline(null);
@@ -292,7 +292,8 @@ class SlotLayer {
 		}
 
 		///if is_paint
-		g2_begin(l.texpaint_preview, true, 0x00000000);
+		g2_begin(l.texpaint_preview);
+		g2_clear(0x00000000);
 		g2_set_pipeline(Base.pipeCopy);
 		g2_draw_scaled_image(raw.texpaint_preview, 0, 0, raw.texpaint_preview.width, raw.texpaint_preview.height);
 		g2_set_pipeline(null);
@@ -341,7 +342,7 @@ class SlotLayer {
 
 			let _texpaint = raw.texpaint;
 			raw.texpaint = image_create_render_target(resX, resY, format);
-			g2_begin(raw.texpaint, false);
+			g2_begin(raw.texpaint);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_scaled_image(_texpaint, 0, 0, resX, resY);
 			g2_set_pipeline(null);
@@ -353,13 +354,13 @@ class SlotLayer {
 			raw.texpaint_nor = image_create_render_target(resX, resY, format);
 			raw.texpaint_pack = image_create_render_target(resX, resY, format);
 
-			g2_begin(raw.texpaint_nor, false);
+			g2_begin(raw.texpaint_nor);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_scaled_image(_texpaint_nor, 0, 0, resX, resY);
 			g2_set_pipeline(null);
 			g2_end();
 
-			g2_begin(raw.texpaint_pack, false);
+			g2_begin(raw.texpaint_pack);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_scaled_image(_texpaint_pack, 0, 0, resX, resY);
 			g2_set_pipeline(null);
@@ -385,7 +386,7 @@ class SlotLayer {
 			let _texpaint = raw.texpaint;
 			raw.texpaint = image_create_render_target(resX, resY, tex_format_t.RGBA32);
 
-			g2_begin(raw.texpaint, false);
+			g2_begin(raw.texpaint);
 			g2_set_pipeline(Base.pipeCopy8);
 			g2_draw_scaled_image(_texpaint, 0, 0, resX, resY);
 			g2_set_pipeline(null);

BIN
armorsculpt/Assets/Scene.arm


+ 3 - 3
armorsculpt/Sources/ImportMesh.ts

@@ -77,7 +77,7 @@ class ImportMesh {
 
 		let _makeMesh = () => {
 			let raw = ImportMesh.rawMesh(mesh);
-			if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm", padding: 1 });
+			if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm" });
 
 			let md: mesh_data_t = mesh_data_create(raw);
 			Context.raw.paintObject = Context.mainObject();
@@ -129,7 +129,7 @@ class ImportMesh {
 				}
 				let imgmesh = image_from_bytes(f32.buffer, Config.getTextureResX(), Config.getTextureResY(), tex_format_t.RGBA128);
 				let texpaint = Project.layers[0].texpaint;
-				g2_begin(texpaint, false);
+				g2_begin(texpaint);
 				g2_set_pipeline(Base.pipeCopy128);
 				g2_draw_scaled_image(imgmesh, 0, 0, Config.getTextureResX(), Config.getTextureResY());
 				g2_set_pipeline(null);
@@ -144,7 +144,7 @@ class ImportMesh {
 
 		let _addMesh = () => {
 			let raw = ImportMesh.rawMesh(mesh);
-			if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm", padding: 1 });
+			if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm" });
 
 			let md: mesh_data_t = mesh_data_create(raw);
 

+ 1 - 1
armorsculpt/Sources/MakeMaterial.ts

@@ -176,7 +176,7 @@ class MakeMaterial {
 			let current = _g2_current;
 			if (current != null) g2_end();
 			MakeMaterial.bakeNodePreviews();
-			if (current != null) g2_begin(current, false);
+			if (current != null) g2_begin(current);
 		}
 
 		let m = Project.materials[0].data;

+ 17 - 16
base/Sources/Base.ts

@@ -1015,7 +1015,7 @@ class Base {
 		let texpaint = render_path_render_targets.get("texpaint").image;
 		let texpaint_nor = render_path_render_targets.get("texpaint_nor").image;
 		let texpaint_pack = render_path_render_targets.get("texpaint_pack").image;
-		g2_begin(texpaint, false);
+		g2_begin(texpaint);
 		g2_draw_scaled_image(Res.get("placeholder.k"), 0, 0, Config.getTextureResX(), Config.getTextureResY()); // Base
 		g2_end();
 		g4_begin(texpaint_nor);
@@ -1596,7 +1596,7 @@ class Base {
 		Base.makeTempImg();
 		if (const_data_screen_aligned_vb == null) const_data_create_screen_aligned_data();
 
-		g2_begin(Base.tempImage, false); // Copy to temp
+		g2_begin(Base.tempImage); // Copy to temp
 		g2_set_pipeline(Base.pipeCopy);
 		g2_draw_image(l0.texpaint, 0, 0);
 		g2_set_pipeline(null);
@@ -1642,7 +1642,7 @@ class Base {
 			}
 
 			///if is_paint
-			g2_begin(Base.tempImage, false);
+			g2_begin(Base.tempImage);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_image(l0.texpaint_nor, 0, 0);
 			g2_set_pipeline(null);
@@ -1663,7 +1663,7 @@ class Base {
 				g4_end();
 			}
 
-			g2_begin(Base.tempImage, false);
+			g2_begin(Base.tempImage);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_image(l0.texpaint_pack, 0, 0);
 			g2_set_pipeline(null);
@@ -1712,7 +1712,8 @@ class Base {
 			if (l1masks != null) {
 				if (l1masks.length > 1) {
 					Base.makeTempMaskImg();
-					g2_begin(Base.tempMaskImage, true, 0x00000000);
+					g2_begin(Base.tempMaskImage);
+					g2_clear(0x00000000);
 					g2_end();
 					let l1: any = { texpaint: Base.tempMaskImage };
 					for (let i = 0; i < l1masks.length; ++i) {
@@ -1724,7 +1725,7 @@ class Base {
 			}
 
 			if (l1.paintBase) {
-				g2_begin(Base.tempImage, false); // Copy to temp
+				g2_begin(Base.tempImage); // Copy to temp
 				g2_set_pipeline(Base.pipeCopy);
 				g2_draw_image(Base.expa, 0, 0);
 				g2_set_pipeline(null);
@@ -1746,7 +1747,7 @@ class Base {
 
 			///if is_paint
 			if (l1.paintNor) {
-				g2_begin(Base.tempImage, false);
+				g2_begin(Base.tempImage);
 				g2_set_pipeline(Base.pipeCopy);
 				g2_draw_image(Base.expb, 0, 0);
 				g2_set_pipeline(null);
@@ -1767,7 +1768,7 @@ class Base {
 			}
 
 			if (l1.paintOcc || l1.paintRough || l1.paintMet || l1.paintHeight) {
-				g2_begin(Base.tempImage, false);
+				g2_begin(Base.tempImage);
 				g2_set_pipeline(Base.pipeCopy);
 				g2_draw_image(Base.expc, 0, 0);
 				g2_set_pipeline(null);
@@ -1787,11 +1788,11 @@ class Base {
 
 		///if krom_metal
 		// Flush command list
-		g2_begin(Base.expa, false);
+		g2_begin(Base.expa);
 		g2_end();
-		g2_begin(Base.expb, false);
+		g2_begin(Base.expb);
 		g2_end();
-		g2_begin(Base.expc, false);
+		g2_begin(Base.expc);
 		g2_end();
 		///end
 
@@ -1800,7 +1801,7 @@ class Base {
 		// Merge height map into normal map
 		if (heightToNormal && MakeMaterial.heightUsed) {
 
-			g2_begin(Base.tempImage, false);
+			g2_begin(Base.tempImage);
 			g2_set_pipeline(Base.pipeCopy);
 			g2_draw_image(l0.texpaint_nor, 0, 0);
 			g2_set_pipeline(null);
@@ -1830,7 +1831,7 @@ class Base {
 		Base.makeTempImg();
 
 		// Copy layer to temp
-		g2_begin(Base.tempImage, false);
+		g2_begin(Base.tempImage);
 		g2_set_pipeline(Base.pipeCopy);
 		g2_draw_image(l.texpaint, 0, 0);
 		g2_set_pipeline(null);
@@ -1901,7 +1902,7 @@ class Base {
 			Context.raw.pdirty = 0;
 			Context.raw.rdirty = 2;
 
-			if (current != null) g2_begin(current, false);
+			if (current != null) g2_begin(current);
 			return;
 		}
 		///end
@@ -1955,7 +1956,7 @@ class Base {
 			Context.raw.ddirty = 2;
 			Context.raw.rdirty = 2;
 			Context.raw.layersPreviewDirty = true; // Repaint all layer previews as multiple layers might have changed.
-			if (current != null) g2_begin(current, false);
+			if (current != null) g2_begin(current);
 			Context.raw.layer = _layer;
 			Base.setObjectMask();
 			Context.raw.tool = _tool;
@@ -1983,7 +1984,7 @@ class Base {
 		Context.raw.rdirty = 2;
 		Context.raw.tool = _tool;
 		Context.raw.fillTypeHandle.position = _fillType;
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 	}
 
 	static setObjectMask = () => {

+ 1 - 1
base/Sources/BoxPreferences.ts

@@ -285,7 +285,7 @@ class BoxPreferences {
 					///end
 
 					History.reset();
-					g2_begin(current, false);
+					g2_begin(current);
 				}
 
 				///if is_paint

+ 1 - 1
base/Sources/BoxProjects.ts

@@ -197,7 +197,7 @@ class BoxProjects {
 
 					ImportArm.runProject(path);
 
-					if (current != null) g2_begin(current, false);
+					if (current != null) g2_begin(current);
 					UIBox.hide();
 				}
 				if (ui.is_hovered) zui_tooltip(path);

+ 1 - 1
base/Sources/Config.ts

@@ -177,7 +177,7 @@ class Config {
 		let current = _g2_current;
 		if (current != null) g2_end();
 		RenderPathBase.applyConfig();
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 	}
 
 	static loadKeymap = () => {

+ 1 - 1
base/Sources/Context.ts

@@ -82,7 +82,7 @@ class Context {
 		MakeMaterial.parseMeshMaterial();
 		MakeMaterial.parsePaintMaterial();
 
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 
 		UIBase.hwnds[TabArea.TabSidebar0].redraws = 2;
 		UIView2D.hwnd.redraws = 2;

+ 3 - 3
base/Sources/ExportArm.ts

@@ -141,7 +141,7 @@ class ExportArm {
 		let tex = render_path_render_targets.get(Context.raw.renderMode == RenderMode.RenderForward ? "buf" : "tex").image;
 		let mesh_icon = image_create_render_target(256, 256);
 		let r = app_w() / app_h();
-		g2_begin(mesh_icon, false);
+		g2_begin(mesh_icon);
 		///if krom_opengl
 		g2_draw_scaled_image(tex, -(256 * r - 256) / 2, 256, 256 * r, -256);
 		///else
@@ -150,7 +150,7 @@ class ExportArm {
 		g2_end();
 		///if krom_metal
 		// Flush command list
-		g2_begin(mesh_icon, false);
+		g2_begin(mesh_icon);
 		g2_end();
 		///end
 		let mesh_icon_pixels = image_get_pixels(mesh_icon);
@@ -427,7 +427,7 @@ class ExportArm {
 			if (!Project.packedAssetExists(raw.packed_assets, assets[i].file)) {
 				let image = Project.getImage(assets[i]);
 				let temp = image_create_render_target(image.width, image.height);
-				g2_begin(temp, false);
+				g2_begin(temp);
 				g2_draw_image(image, 0, 0);
 				g2_end();
 				tempImages.push(temp);

+ 8 - 7
base/Sources/ExportTexture.ts

@@ -179,7 +179,8 @@ class ExportTexture {
 			if (l1masks != null && !bakeMaterial) {
 				if (l1masks.length > 1) {
 					Base.makeTempMaskImg();
-					g2_begin(Base.tempMaskImage, true, 0x00000000);
+					g2_begin(Base.tempMaskImage);
+					g2_clear(0x00000000);
 					g2_end();
 					let l1: any = { texpaint: Base.tempMaskImage };
 					for (let i = 0; i < l1masks.length; ++i) {
@@ -191,7 +192,7 @@ class ExportTexture {
 			}
 
 			if (l1.paintBase) {
-				g2_begin(Base.tempImage, false); // Copy to temp
+				g2_begin(Base.tempImage); // Copy to temp
 				g2_set_pipeline(Base.pipeCopy);
 				g2_draw_image(Base.expa, 0, 0);
 				g2_set_pipeline(null);
@@ -212,7 +213,7 @@ class ExportTexture {
 			}
 
 			if (l1.paintNor) {
-				g2_begin(Base.tempImage, false);
+				g2_begin(Base.tempImage);
 				g2_set_pipeline(Base.pipeCopy);
 				g2_draw_image(Base.expb, 0, 0);
 				g2_set_pipeline(null);
@@ -233,7 +234,7 @@ class ExportTexture {
 			}
 
 			if (l1.paintOcc || l1.paintRough || l1.paintMet || l1.paintHeight) {
-				g2_begin(Base.tempImage, false);
+				g2_begin(Base.tempImage);
 				g2_set_pipeline(Base.pipeCopy);
 				g2_draw_image(Base.expc, 0, 0);
 				g2_set_pipeline(null);
@@ -252,11 +253,11 @@ class ExportTexture {
 
 		///if krom_metal
 		// Flush command list
-		g2_begin(Base.expa, false);
+		g2_begin(Base.expa);
 		g2_end();
-		g2_begin(Base.expb, false);
+		g2_begin(Base.expb);
 		g2_end();
-		g2_begin(Base.expc, false);
+		g2_begin(Base.expc);
 		g2_end();
 		///end
 		///end

+ 4 - 4
base/Sources/ImportArm.ts

@@ -220,7 +220,7 @@ class ImportArm {
 
 				if (isMask) {
 					_texpaint = image_from_bytes(lz4_decode(ld.texpaint, ld.res * ld.res * 4), ld.res, ld.res, tex_format_t.RGBA32);
-					g2_begin(l.texpaint, false);
+					g2_begin(l.texpaint);
 					// g2_set_pipeline(Base.pipeCopy8);
 					g2_set_pipeline(project.is_bgra ? Base.pipeCopyBGRA : Base.pipeCopy); // Full bits for undo support, R8 is used
 					g2_draw_image(_texpaint, 0, 0);
@@ -230,7 +230,7 @@ class ImportArm {
 				else { // Layer
 					// TODO: create render target from bytes
 					_texpaint = image_from_bytes(lz4_decode(ld.texpaint, ld.res * ld.res * 4 * bytesPerPixel), ld.res, ld.res, format);
-					g2_begin(l.texpaint, false);
+					g2_begin(l.texpaint);
 					g2_set_pipeline(project.is_bgra ? Base.pipeCopyBGRA : Base.pipeCopy);
 					g2_draw_image(_texpaint, 0, 0);
 					g2_set_pipeline(null);
@@ -238,14 +238,14 @@ class ImportArm {
 
 					///if is_paint
 					_texpaint_nor = image_from_bytes(lz4_decode(ld.texpaint_nor, ld.res * ld.res * 4 * bytesPerPixel), ld.res, ld.res, format);
-					g2_begin(l.texpaint_nor, false);
+					g2_begin(l.texpaint_nor);
 					g2_set_pipeline(project.is_bgra ? Base.pipeCopyBGRA : Base.pipeCopy);
 					g2_draw_image(_texpaint_nor, 0, 0);
 					g2_set_pipeline(null);
 					g2_end();
 
 					_texpaint_pack = image_from_bytes(lz4_decode(ld.texpaint_pack, ld.res * ld.res * 4 * bytesPerPixel), ld.res, ld.res, format);
-					g2_begin(l.texpaint_pack, false);
+					g2_begin(l.texpaint_pack);
 					g2_set_pipeline(project.is_bgra ? Base.pipeCopyBGRA : Base.pipeCopy);
 					g2_draw_image(_texpaint_pack, 0, 0);
 					g2_set_pipeline(null);

+ 19 - 19
base/Sources/ImportBlendMesh.ts

@@ -77,7 +77,7 @@ class ImportBlendMesh {
 			let hasuv = uvdata != null;
 			let texa = hasuv ? new Int16Array(numtri * 3 * 2) : null;
 			let hascol = Context.raw.parseVCols && coldata != null;
-			let cola = hascol ? new Int16Array(numtri * 3 * 3) : null;
+			let cola = hascol ? new Int16Array(numtri * 3 * 4) : null;
 
 			let tri = 0;
 			let vec0 = vec4_create();
@@ -187,15 +187,15 @@ class ImportBlendMesh {
 							col2r = ParserBlend.read8(bl);
 							col2g = ParserBlend.read8(bl);
 							col2b = ParserBlend.read8(bl);
-							cola[tri * 9    ] = col0r * 128;
-							cola[tri * 9 + 1] = col0g * 128;
-							cola[tri * 9 + 2] = col0b * 128;
-							cola[tri * 9 + 3] = col1r * 128;
-							cola[tri * 9 + 4] = col1g * 128;
-							cola[tri * 9 + 5] = col1b * 128;
-							cola[tri * 9 + 6] = col2r * 128;
-							cola[tri * 9 + 7] = col2g * 128;
-							cola[tri * 9 + 8] = col2b * 128;
+							cola[tri * 12    ] = col0r * 128;
+							cola[tri * 12 + 1] = col0g * 128;
+							cola[tri * 12 + 2] = col0b * 128;
+							cola[tri * 12 + 3] = col1r * 128;
+							cola[tri * 12 + 4] = col1g * 128;
+							cola[tri * 12 + 5] = col1b * 128;
+							cola[tri * 12 + 6] = col2r * 128;
+							cola[tri * 12 + 7] = col2g * 128;
+							cola[tri * 12 + 8] = col2b * 128;
 							col1r = col2r;
 							col1g = col2g;
 							col1b = col2b;
@@ -371,15 +371,15 @@ class ImportBlendMesh {
 								texa[tri * 6 + 5] = Math.floor((1.0 - uv2[1]) * 32767);
 							}
 							if (hascol) {
-								cola[tri * 9    ] = col0r * 128;
-								cola[tri * 9 + 1] = col0g * 128;
-								cola[tri * 9 + 2] = col0b * 128;
-								cola[tri * 9 + 3] = col1r * 128;
-								cola[tri * 9 + 4] = col1g * 128;
-								cola[tri * 9 + 5] = col1b * 128;
-								cola[tri * 9 + 6] = col2r * 128;
-								cola[tri * 9 + 7] = col2g * 128;
-								cola[tri * 9 + 8] = col2b * 128;
+								cola[tri * 12    ] = col0r * 128;
+								cola[tri * 12 + 1] = col0g * 128;
+								cola[tri * 12 + 2] = col0b * 128;
+								cola[tri * 12 + 3] = col1r * 128;
+								cola[tri * 12 + 4] = col1g * 128;
+								cola[tri * 12 + 5] = col1b * 128;
+								cola[tri * 12 + 6] = col2r * 128;
+								cola[tri * 12 + 7] = col2g * 128;
+								cola[tri * 12 + 8] = col2b * 128;
 							}
 							tri++;
 						}

+ 1 - 1
base/Sources/ImportEnvmap.ts

@@ -40,7 +40,7 @@ class ImportEnvmap {
 		}
 
 		// Down-scale to 1024x512
-		g2_begin(ImportEnvmap.radiance, false);
+		g2_begin(ImportEnvmap.radiance);
 		g2_set_pipeline(Base.pipeCopy128);
 		g2_draw_scaled_image(image, 0, 0, 1024, 512);
 		g2_set_pipeline(null);

+ 2 - 2
base/Sources/ImportMesh.ts

@@ -104,7 +104,7 @@ class ImportMesh {
 
 	static _makeMesh = (mesh: any) => {
 		let raw = ImportMesh.rawMesh(mesh);
-		if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm", padding: 1 });
+		if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm" });
 
 		let md: mesh_data_t = mesh_data_create(raw);
 		Context.raw.paintObject = Context.mainObject();
@@ -182,7 +182,7 @@ class ImportMesh {
 
 	static _addMesh = (mesh: any) => {
 		let raw = ImportMesh.rawMesh(mesh);
-		if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm", padding: 1 });
+		if (mesh.cola != null) raw.vertex_arrays.push({ values: mesh.cola, attrib: "col", data: "short4norm" });
 
 		let md: mesh_data_t = mesh_data_create(raw);
 

+ 2 - 2
base/Sources/NodesMaterial.ts

@@ -2823,7 +2823,7 @@ class NodesMaterial {
 		let sw = ui._w / zui_nodes_SCALE();
 		for (let val of vals) {
 			let pos = val[4];
-			let col = color_from_floats(val[0], val[1], val[2]);
+			let col = color_from_floats(val[0], val[1], val[2], 1.0);
 			zui_fill(pos * sw, 0, (1.0 - pos) * sw, zui_nodes_LINE_H() - 2 * zui_nodes_SCALE(), col);
 		}
 		ui._y += zui_nodes_LINE_H();
@@ -2858,7 +2858,7 @@ class NodesMaterial {
 		else if (val[4] < 0.0) val[4] = 0.0;
 
 		let chandle = zui_nest(zui_nest(nhandle, 0), 4);
-		chandle.color = color_from_floats(val[0], val[1], val[2]);
+		chandle.color = color_from_floats(val[0], val[1], val[2], 1.0);
 		if (zui_text("", Align.Right, chandle.color) == State.Started) {
 			let rx = nx + ui._w - zui_nodes_p(37);
 			let ry = ny - zui_nodes_p(5);

+ 2 - 2
base/Sources/Project.ts

@@ -39,7 +39,7 @@ class Project {
 
 			ImportArm.runProject(path);
 
-			if (current != null) g2_begin(current, false);
+			if (current != null) g2_begin(current);
 		});
 	}
 
@@ -285,7 +285,7 @@ class Project {
 			app_notify_on_init(Base.initLayers);
 		}
 
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 
 		Context.raw.savedEnvmap = null;
 		Context.raw.envmapLoaded = false;

+ 2 - 2
base/Sources/RenderPathBase.ts

@@ -498,9 +498,9 @@ class RenderPathBase {
 	static drawGbuffer = () => {
 		render_path_set_target("gbuffer0"); // Only clear gbuffer0
 		///if krom_metal
-		render_path_clear_target(0x00000000, 1.0);
+		render_path_clear_target(0x00000000, 1.0, clear_flag_t.COLOR | clear_flag_t.DEPTH);
 		///else
-		render_path_clear_target(null, 1.0);
+		render_path_clear_target(null, 1.0, clear_flag_t.DEPTH);
 		///end
 		if (MakeMesh.layerPassCount == 1) {
 			render_path_set_target("gbuffer2");

+ 1 - 1
base/Sources/TabMaterials.ts

@@ -270,7 +270,7 @@ class TabMaterials {
 			Context.raw.material = SlotMaterial.create(Project.materials[0].data);
 			Project.materials.push(Context.raw.material);
 			TabMaterials.updateMaterial();
-			g2_begin(current, false);
+			g2_begin(current);
 			History.newMaterial();
 		}
 	}

+ 1 - 1
base/Sources/TabTextures.ts

@@ -120,7 +120,7 @@ class TabTextures {
 											///end
 
 											let target = image_create_render_target(TabTextures.to_pow2(img.width), TabTextures.to_pow2(img.height));
-											g2_begin(target, false);
+											g2_begin(target);
 											g2_set_pipeline(Base.pipeCopy);
 											g2_draw_scaled_image(img, 0, 0, target.width, target.height);
 											g2_set_pipeline(null);

+ 6 - 4
base/Sources/UIBase.ts

@@ -1077,7 +1077,8 @@ class UIBase {
 				if (SlotLayer.isGroup(l)) continue;
 				let target = l.texpaint_preview;
 				let source = l.texpaint;
-				g2_begin(target, true, 0x00000000);
+				g2_begin(target);
+				g2_clear(0x00000000);
 				// g2_set_pipeline(l.isMask() ? Base.pipeCopy8 : Base.pipeCopy);
 				g2_set_pipeline(Base.pipeCopy); // texpaint_preview is always RGBA32 for now
 				g2_draw_scaled_image(source, 0, 0, target.width, target.height);
@@ -1094,7 +1095,8 @@ class UIBase {
 			let l = Context.raw.layer;
 			let target = l.texpaint_preview;
 			let source = l.texpaint;
-			g2_begin(target, true, 0x00000000);
+			g2_begin(target);
+			g2_clear(0x00000000);
 			// g2_set_pipeline(Context.raw.layer.isMask() ? Base.pipeCopy8 : Base.pipeCopy);
 			g2_set_pipeline(Base.pipeCopy); // texpaint_preview is always RGBA32 for now
 			g2_draw_scaled_image(source, 0, 0, target.width, target.height);
@@ -1135,7 +1137,7 @@ class UIBase {
 				}
 			}
 			zui_end();
-			g2_begin(null, false);
+			g2_begin(null);
 		}
 
 		if (!UIBase.show || sys_width() == 0 || sys_height() == 0) return;
@@ -1170,7 +1172,7 @@ class UIBase {
 		///end
 
 		zui_end();
-		g2_begin(null, false);
+		g2_begin(null);
 	}
 
 	///if (is_paint || is_sculpt)

+ 1 - 1
base/Sources/UIBox.ts

@@ -105,7 +105,7 @@ class UIBox {
 			zui_end();
 		}
 
-		g2_begin(null, false);
+		g2_begin(null);
 
 		UIBox.draws++;
 	}

+ 5 - 3
base/Sources/UIFiles.ts

@@ -176,14 +176,15 @@ class UIFiles {
 										if (Base.pipeCopyRGB == null) Base.makePipeCopyRGB();
 										icon = image_create_render_target(image.width, image.height);
 										if (f.endsWith(".arm")) { // Used for material sphere alpha cutout
-											g2_begin(icon, false);
+											g2_begin(icon);
 
 											///if (is_paint || is_sculpt)
 											g2_draw_image(Project.materials[0].image, 0, 0);
 											///end
 										}
 										else {
-											g2_begin(icon, true, 0xffffffff);
+											g2_begin(icon);
+											g2_clear(0xffffffff);
 										}
 										g2_set_pipeline(Base.pipeCopyRGB);
 										g2_draw_image(image, 0, 0);
@@ -284,7 +285,8 @@ class UIFiles {
 							let sw = image.width > image.height ? w : Math.floor(1.0 * image.width / image.height * w);
 							let sh = image.width > image.height ? Math.floor(1.0 * image.height / image.width * w) : w;
 							icon = image_create_render_target(sw, sh);
-							g2_begin(icon, true, 0xffffffff);
+							g2_begin(icon);
+							g2_clear(0xffffffff);
 							g2_set_pipeline(Base.pipeCopyRGB);
 							g2_draw_scaled_image(image, 0, 0, sw, sh);
 							g2_set_pipeline(null);

+ 3 - 3
base/Sources/UIHeader.ts

@@ -314,7 +314,7 @@ class UIHeader {
 						let current = _g2_current;
 						g2_end();
 						UtilRender.makeDecalPreview();
-						g2_begin(current, false);
+						g2_begin(current);
 					}
 				}
 
@@ -383,7 +383,7 @@ class UIHeader {
 					g2_end();
 					UtilRender.makeTextPreview();
 					UtilRender.makeDecalPreview();
-					g2_begin(current, false);
+					g2_begin(current);
 				}
 			}
 
@@ -395,7 +395,7 @@ class UIHeader {
 						g2_end();
 						// UtilUV.cacheUVMap();
 						UtilUV.cacheTriangleMap();
-						g2_begin(current, false);
+						g2_begin(current);
 						// wireframeHandle.selected = drawWireframe = true;
 					}
 					MakeMaterial.parsePaintMaterial();

+ 1 - 1
base/Sources/UIMenu.ts

@@ -224,7 +224,7 @@ class UIMenu {
 					let current = _g2_current;
 					g2_end();
 					UtilUV.cacheUVMap();
-					g2_begin(current, false);
+					g2_begin(current);
 					MakeMaterial.parseMeshMaterial();
 				}
 				///end

+ 3 - 2
base/Sources/UINodes.ts

@@ -563,7 +563,8 @@ class UINodes {
 		if (w < 1) w = 1;
 		if (h < 1) h = 1;
 		UINodes.grid = image_create_render_target(w, h);
-		g2_begin(UINodes.grid, true, UINodes.ui.t.SEPARATOR_COL);
+		g2_begin(UINodes.grid);
+		g2_clear(UINodes.ui.t.SEPARATOR_COL);
 
 		g2_set_color(UINodes.ui.t.SEPARATOR_COL - 0x00050505);
 		step = 20 * zui_SCALE(UINodes.ui);
@@ -995,7 +996,7 @@ class UINodes {
 
 		zui_end(!UINodes.showMenu);
 
-		g2_begin(null, false);
+		g2_begin(null);
 
 		if (UINodes.showMenu) {
 			///if (is_paint || is_sculpt)

+ 4 - 4
base/Sources/UIView2D.ts

@@ -154,13 +154,13 @@ class UIView2D {
 					let current = _g2_current;
 					if (current != null) g2_end();
 					layer = Base.flatten();
-					if (current != null) g2_begin(current, false);
+					if (current != null) g2_begin(current);
 				}
 				else if (SlotLayer.isGroup(layer)) {
 					let current = _g2_current;
 					if (current != null) g2_end();
 					layer = Base.flatten(false, SlotLayer.getChildren(layer));
-					if (current != null) g2_begin(current, false);
+					if (current != null) g2_begin(current);
 				}
 
 				tex =
@@ -232,7 +232,7 @@ class UIView2D {
 					let y = UIView2D.ui.input_y - ty - UIView2D.wy;
 					Base.notifyOnNextFrame(() => {
 						let texpaint_picker = render_path_render_targets.get("texpaint_picker").image;
-						g2_begin(texpaint_picker, false);
+						g2_begin(texpaint_picker);
 						g2_draw_scaled_image(tex, -x, -y, tw, th);
 						g2_end();
 						let a = new DataView(image_get_pixels(texpaint_picker));
@@ -374,7 +374,7 @@ class UIView2D {
 			///end
 		}
 		zui_end();
-		g2_begin(null, false);
+		g2_begin(null);
 	}
 
 	static update = () => {

+ 3 - 3
base/Sources/UtilMesh.ts

@@ -19,7 +19,7 @@ class UtilMesh {
 		let va0 = new Int16Array(vlen * 4);
 		let va1 = new Int16Array(vlen * 2);
 		let va2 = new Int16Array(vlen * 2);
-		let va3 = paintObjects[0].data.vertex_arrays.length > 3 ? new Int16Array(vlen * 3) : null; // +1 padding
+		let va3 = paintObjects[0].data.vertex_arrays.length > 3 ? new Int16Array(vlen * 4) : null;
 		let ia = new Uint32Array(ilen);
 
 		let voff = 0;
@@ -52,7 +52,7 @@ class UtilMesh {
 			// Tex
 			for (let j = 0; j < vas[2].values.length; ++j) va2[j + voff * 2] = vas[2].values[j];
 			// Col
-			if (va3 != null) for (let j = 0; j < vas[3].values.length; ++j) va3[j + voff * 3] = vas[3].values[j];
+			if (va3 != null) for (let j = 0; j < vas[3].values.length; ++j) va3[j + voff * 4] = vas[3].values[j];
 			// Indices
 			for (let j = 0; j < ias[0].values.length; ++j) ia[j + ioff] = ias[0].values[j] + voff;
 
@@ -73,7 +73,7 @@ class UtilMesh {
 			scale_pos: maxScale,
 			scale_tex: 1.0
 		};
-		if (va3 != null) raw.vertex_arrays.push({ values: va3, attrib: "col", data: "short4norm", padding: 1 });
+		if (va3 != null) raw.vertex_arrays.push({ values: va3, attrib: "col", data: "short4norm" });
 
 		UtilMesh.removeMergedMesh();
 		let md: mesh_data_t = mesh_data_create(raw);

+ 10 - 7
base/Sources/UtilRender.ts

@@ -141,7 +141,7 @@ class UtilRender {
 		MakeMaterial.parseMeshMaterial();
 		Context.raw.ddirty = 1; // Refresh depth for decal paint
 
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 	}
 
 	static makeTextPreview = () => {
@@ -166,14 +166,15 @@ class UtilRender {
 			Context.raw.textToolImage = image_create_render_target(texW, texW, tex_format_t.R8);
 			///end
 		}
-		g2_begin(Context.raw.textToolImage, true, 0xff000000);
+		g2_begin(Context.raw.textToolImage);
+		g2_clear(0xff000000);
 		g2_set_font(font);
 		g2_set_font_size(fontSize);
 		g2_set_color(0xffffffff);
 		g2_draw_string(text, texW / 2 - textW / 2, texW / 2 - textH / 2);
 		g2_end();
 
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 	}
 
 	static makeFontPreview = () => {
@@ -188,7 +189,8 @@ class UtilRender {
 		if (Context.raw.font.image == null) {
 			Context.raw.font.image = image_create_render_target(512, 512, tex_format_t.RGBA32);
 		}
-		g2_begin(Context.raw.font.image, true, 0x00000000);
+		g2_begin(Context.raw.font.image);
+		g2_clear(0x00000000);
 		g2_set_font(font);
 		g2_set_font_size(fontSize);
 		g2_set_color(0xffffffff);
@@ -196,7 +198,7 @@ class UtilRender {
 		g2_end();
 		Context.raw.font.previewReady = true;
 
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 	}
 
 	static makeBrushPreview = () => {
@@ -341,7 +343,8 @@ class UtilRender {
 		if (Base.pipeMerge == null) Base.makePipe();
 		l = RenderPathPaint.liveLayer;
 		let target = Context.raw.brush.image;
-		g2_begin(target, true, 0x00000000);
+		g2_begin(target);
+		g2_clear(0x00000000);
 		g2_set_pipeline(Base.pipeCopy);
 		g2_draw_scaled_image(l.texpaint, 0, 0, target.width, target.height);
 		g2_set_pipeline(null);
@@ -357,7 +360,7 @@ class UtilRender {
 		Context.raw.brush.previewReady = true;
 		Context.raw.brushBlendDirty = true;
 
-		if (current != null) g2_begin(current, false);
+		if (current != null) g2_begin(current);
 	}
 
 	static makeNodePreview = (canvas: zui_node_canvas_t, node: zui_node_t, image: image_t, group: zui_node_canvas_t = null, parents: zui_node_t[] = null) => {

+ 4 - 2
base/Sources/UtilUV.ts

@@ -36,7 +36,8 @@ class UtilUV {
 
 		let texa = mesh.vertex_arrays[2].values;
 		let inda = mesh.index_arrays[0].values;
-		g2_begin(UtilUV.uvmap, true, 0x00000000);
+		g2_begin(UtilUV.uvmap);
+		g2_clear(0x00000000);
 		g2_set_color(0xffcccccc);
 		let strength = resX > 2048 ? 2.0 : 1.0;
 		let f = (1 / 32767) * UtilUV.uvmap.width;
@@ -72,7 +73,8 @@ class UtilUV {
 		let mesh = merged;
 		let texa = mesh.vertex_arrays[2].values;
 		let inda = mesh.index_arrays[0].values;
-		g2_begin(UtilUV.trianglemap, true, 0xff000000);
+		g2_begin(UtilUV.trianglemap);
+		g2_clear(0xff000000);
 		let f = (1 / 32767) * UtilUV.trianglemap.width;
 		let color = 0xff000001;
 		for (let i = 0; i < Math.floor(inda.length / 3); ++i) {

+ 2 - 1
misc/pad/Sources/main.ts

@@ -288,7 +288,8 @@ function draw_minimap() {
 		minimap = image_create_render_target(minimap_w, minimap_h);
 	}
 
-	g2_begin(minimap, true, ui.t.SEPARATOR_COL);
+	g2_begin(minimap);
+	g2_clear(ui.t.SEPARATOR_COL);
 	g2_set_color(0xff333333);
 	let lines = storage.text.split("\n");
 	let minimap_full_h = lines.length * 2;