30 Aug 2017
I’ve been using two monitors for about two years now, and there are a lot of great wallpapers that are made for a dual monitor setup. Recently, I saw a low-poly wallpaper that I liked, and wanted something similar. The problem: How to find a colorful low-poly image with the correct resolution. So I’ve made a small tool that can generate low-poly wallpapers in custom resolutions, and it runs in the browser. It used the JS library, Trianglify, which can generate SVG backgrounds.
In the tool you can customize the result by setting a variance and size of the triangles in the generated SVG image. You can split the wallpaper into several chunks, change the color scheme, and download the wallpaper as a PNG image.
Another project I might do in the future, is to extend this generator by creating a custom version of Trianglify.
The tool can be found at here.
16 Aug 2017
I’ve used git for version control for a good while now, but I’ve never really tried to understand the difference between merging and rebasing. I guess I’m a bit lazy that way, having a “If it works, it works” mentality. I’ve now spent some time figuring out the difference, and try making a short and understandable post about it.
git rebase and
git merge, solves the same problem. Taking changes from one branch and integrating them into another. The difference happens in how changes are spliced together.
A typical use case is having a master and a feature branch. You want the changes from the master into the feature branch. Doing the
git merge master command from the feature branch will create a new merge commit in your feature branch. A merge is basically a new commit, with two parents.
Whereas, rebasing will put the feature branches’ changes onto the master branch. The
git rebase master will effectively move the commits to the tip of the master branch. Another way of looking at it is that you are relocating the place where you branched out from master to a more recent place in master’s history. In addition, a rebase will for every commit in feature create a new identical commit on top of master.
Advantages and Disadvantages of Rebasing
- Cleaner history that is easier to read.
- Slightly harder than merging.
- Rewrites the commit history. which might be problematic.
- You can’t see when changes from master were incorporated into feature.
- Gives you the ability to use interactive rebasing. You can remove intermediate backup commits and replace it with a single commit. You can also reword your commit messages.
- Maybe the best way to incorporate changes another developer made on master onto your feature branch.
Advantages and Disadvantages of Merging
- Merging is a non-destructive operation
- Each merge creates a commit, which might clutter the branches’ history.
- Traceability. You have a merge commit, which indicates that a convergence between two branches has taken place.
Finally, I would like to point out that the explanation above might be incorrect. It’s based on my current understanding of git. And I’m by no means a git wizard. Please read the references below to get a more thorough explanation.
Atlassian git tutorial
Blog post explaining the difference well
01 Jul 2017
Just learned how to do UV mapping in Blender, and thought I should write it down before I forget.
Currently, I’m doing the Learn 3D Modelling course at Udemy. I’m now past the basic modelling stuff, and wanted some practice. I decided to do a chessboard, and yup, you guessed it, not that challenging since it’s basically a square shape. It does not look anything like a chessboard, without the checker pattern.
So I decided to try out UV map painting, to see if I could turn this nondescriptive shape into a bona fide chessboard.
UV Mapping in Blender Recipe
1. Adding Seams
- The 3D model is complete and texturing is the next step. Your first step is to create seams to help Blender unwrap your model’s surface onto a flat plane. The plane area is where you’ll do the painting later on.
- Enter edit mode
- Open the tools section in the left sidebar
<T> of the 3D View
- Pick edge select mode to select seams on your model.
- Select edges that you want to convert to a seam. A loop selection of edges will create a disconnected island, which is good, when organizing the UV map later on. Create several of these. For instance, the chessboard was split by 4 seams. Top, bottom and two of the sides.
- To create the seam, scroll down in the
Shading/UVs section of the tools side panel, and make a seam when you are satisfied with an edge selection. You will find a button called
- After you’ve created some seams, select the entire model in edit mode by pressing
<A>. Then, click
Unwrap in the drop down which will appear immediately after.
2. Clean the UV Map
- Open a
UV/Image Editor View. You will probably see something similar to this:
- To see if all the face sections are disconnected, use the
island UV selection tool. Right click on each face and see if only that face section is highlighted.
As you can see, two of the faces are still connected. To separate them select all the polygons of one section using the
UV face selection tool and press the
<Y> key. Use the grab tool
<G> to see if the area is separated. More details here.
Then, reorganize the UV map by rotating, scaling and moving UV islands. The shortcuts are
<G> key, respectably.
3. Create the Texture and UV Layout Image
- Go to the
Texture tab. Create a new texture.
Type from none to Image or Video
- In the
Image section, click new. Create a new image with width and height of 2048 and select a white color. Give it a sensible name. For instance, chessboardtex.
- Then, in the
Mapping section, change
Coordinat to UV , and find the UV map in the
Map drop down.
- Go to the
UV/Image Editor, select chessboardtex in the menu that appears after clicking the image icon in the toolbar. The white texture image will appear in the background of the UV map.
Image menu item now has an asterisk. This is because you have not saved the image yet. Use the
Save As Image option.
- If you want to do the UV paining in an external program, such as Photoshop or Gimp, you’ll probably want the UV layout as a reference when painting. Press
UVs and in the menu, select
Export UV layout.
4. UV Paining
- Open an image editor (Photshop, Gimp or similar). Add the saved texture image and the UV layout image on top, in a new layer.
- Go wild painting. Below is my finished chessboard texture.
- In Blender’s
UV/Image Editor, go
Image and press
Reload image, to see the updated texture on your 3D model.
5. Add Model to Unity
You now have a textured model in Unity.
Exporting & Editing UV Maps
26 Jun 2017
If you’re on Windows computer and using Atom, you might have encountered this error in your terminal, when running
Error: EPERM: operation not permitted, unlink 'C:\user\equalpasta\somepath\project\build'
A Google search reveals that variations of this error are a common problem.
Why does this happen? How to fix it? One reason can be the Atom editor. Turns out having the build folder expanded in Atom can cause this. It seems like Atom locks the folder if expanded in the project view, when running
Minimize the build folder in Atom, and re-run ‘gulp watch’.
This solved the issue for me.