Skip to content

Commit

Permalink
Devlog 10
Browse files Browse the repository at this point in the history
  • Loading branch information
flabbet committed Nov 8, 2024
1 parent df8d077 commit 2f5e51a
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions website/blog/2024-11-2024-devlog10.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
title: PixiEditor Devlog 10 - Snap it, paint it, node it up
authors: flabbet
tags: [ devlog, pixieditor2.0 ]
keywords: [ pixieditor, devlog, pixieditor2.0 ]
description: "Devlog 10 of PixiEditor 2.0 development"
image: /img/blog-posts/devlog10/cover.png
---

I was gone for 2 months, but I promise I cooked something good. Check it out in this devlog.

{/*truncate*/}

## Foreword

My every two-week schedule of dev logs got a little bit messed up. However, as always, I spent all of this time working on cool features and unexpected reworks.

I'm very happy with the progress, and I hope you will be, too. Let's get started.

## Snapping

[In the previous devlog](/blog/2024/09/13/devlog9) I've introduced vector tools. But imagine making vectors without snapping, I tried, but it's not fun, don't recommend it, 0/10.

So, I've added snapping to the editor. It works for both raster and vector tools.

<video src="/videos/devlog10/snapping.mp4" muted width={750} controls/>

As you can see, snapping is handled automatically based on layers and document size. It's not perfect yet, but it's a good start.

I hope it will make your life easier when working with vectors.

## Painting tools

New toolset! At the moment there are already 3 toolsets in PixiEditor 2.0. Raster, Vector, and now Painting.

But what is it exactly? You could already "paint" with the pen tool in 1.0, however, it was suited for pixel art only, and it was not very comfortable to use for high-resolution images.
Basically, the main difference is that the pen in the Painting toolset draws soft edges. Here's a comparison:

<video src="/videos/devlog10/painting.webm" muted width={750} controls/>

At the moment there is no brush engine that would allow you to change the brush shape, but it's planned for the future.
We are very happy about the growing capabilities of PixiEditor and strongly believe that we can make a universal tool for all kinds of image editing.

I'm just getting started.

## New renderer

There was one major problem with our vectors implementation, we only had a raster renderer, which means that vectors were pixelated during editing, and only rendered in high quality when exporting to SVG.

Some apps like Affinity Photo live with a solution like this, but it didn't satisfy me. If PixiEditor is going to be a universal tool, it needs to be able to render vectors in high quality.
That's why I've ripped apart almost the whole rendering pipeline and made it from scratch, with vectors in mind.

Of course, I wouldn't be myself if I didn't go a little bit overboard. During the closed beta, some users reported, that drawing is more "clunky" than in 1.0, and for a good reason. There was a major difference in
rendering code between 1.0 and the closed beta of 2.0. To remind you, 1.0 was written in an entirely different technology called WPF, and 2.0 is basically rewritten from scratch in a new technology, Avalonia.

Honestly, 1.0 rendering is state of the art in my opinion, the amount of crazy optimizations and hacks [Equbuxu](https://github.com/Equbuxu) had to do to make it work is just insane. Almost the whole processing was done on the CPU and
this thing was still faster than most of my GPU-accelerated attempts in 2.0.

You may be wondering, if it was so good, why remake it in the first place? Well, simply because our requirements changed. Firstly node-based editing forced us to rework the whole rendering pipeline, and secondly,
vectors, the topic I am covering right now. The previous renderer was excellent at simply drawing, PixiEditor 2.0 a long time ago stopped being just a drawing app.

So after many, many attempts and tons of hours put into the research of rendering, I think I managed to create a solution that is both fast, flexible, and capable of drawing vectors in high quality.

<video src="/videos/devlog10/rendering.webm" muted width={750} controls/>


> _Okay smartass, but what about exporting? You can't just put a high-quality vector into a low-resolution PNG._

Yes, this is true, for raster images, these vectors are rasterized. But for SVGs, they are exported as vectors, it is as simple as that.

You can mix vectors and raster images however you want and both will work in any format you will export to.

I've added different rendering modes, so you can preview your image both in high dpi and rasterized versions.

Here's a comparison of rendering modes on a 64x64 canvas:

![High Dpi mode](/img/blog-posts/devlog10/highres.png)

![Rasterized mode](/img/blog-posts/devlog10/lowres.png)

For some nerds out here, I've made a Vulkan renderer, that blits PixiEditor textures directly to the screen, this is how I resolved the "clunky" drawing issue. Now it's buttery smooth.
If you are interested in the code, you can check it out [here](https://github.com/PixiEditor/Drawie/tree/main/src/Drawie.Interop.VulkanAvalonia).


## Other Quality of Life improvements

There are uncountable small improvements that I've made during this time, and I won't cover all of them, but there are a few that I think are worth mentioning.

### Size infoboxes

When drawing shapes, you can now see the size of the shape you are drawing, as well as its rotation. This is very useful when you want to draw shapes with specific dimensions.

![Size infoboxes](/img/blog-posts/devlog10/size.png)

### Immediate editing of selected shapes

In 1.0, to set the shape's color, fill, stroke, etc. you had to redraw the shape to apply changes. In 2.0, you can edit these properties immediately after selecting the shape.

<video src="/videos/devlog10/shapeedit.webm" muted width={750} controls/>

### Animation improvements

- After the first closed beta, we got a lot of feedback about the animation system, one of the issues was that merging layers caused frames to be lost. This is now fixed, and merging layers will merge cels as well.

- Additionally, the layers view now respects the layer's order, it doesn't change anything in the final image, but it's more intuitive and was also requested by the community.

- Previously the smallest animation cel was 2 frames long instead of 1. It technically was only an issue on the last frame of the animation, since previous frames were overwritten by the next frame, but it was
not intuitive and got fixed.

## What's next?

So what's next? I'm planning to release a new closed beta soon ([register here](https://forms.gle/ssDB13PqZ5Cp5FQL7)), with all of these features and more. Besides that, the PixiEditor 2.0 release is very close!
I'll spill some milk, we're planning to release an Early Access version around the new year, so stay tuned!
Binary file added website/static/img/blog-posts/devlog10/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/blog-posts/devlog10/size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/videos/devlog10/painting.webm
Binary file not shown.
Binary file added website/static/videos/devlog10/rendering.webm
Binary file not shown.
Binary file added website/static/videos/devlog10/shapeedit.webm
Binary file not shown.
Binary file added website/static/videos/devlog10/snapping.mp4
Binary file not shown.

0 comments on commit 2f5e51a

Please sign in to comment.