Pixel Shader Tutorial

This pixel art shader has been causing quite a stir.

Learn more about it here: http://kushi.lv9.org/pixelartshader/index.html It’s in Japanese. Google Translate does a good job of turning it into English, but it’s not a perfect translation. This guide aims to show you how to use it. All credit to the creator, visit the website to learn about them, and their contact details.

title

The instructions are in Japanese. With online translating tools, this isn’t a big deal, but the program itself is quite hard to get started with, so let’s take a look at how to use it.

You’ll need:

First extract PixelArtShader_v1.0.0.zip. I use 7zip to extract zip files.

If you run “PixelArtShader_v1.0.0\PixelArtShader.exe” you’ll notice it flashes and closes.  It’s actually doing a batch conversion and you’ll find a bunch of images “PixelArtShader_v1.0.0\dest”. Your new images should look like this

frame0000

 

You’ve generated your first pixel art shader image.

Let’s say you want to adjust this.

The first step is to open “PixelArtShader_v1.0.0\config.teco” in a text editor. Here you can resolution, capture path, and the file being used to generate the images. Note that this is a .x file. It is not a regular DirectX file. You’ll need to install a plugin into Blender to export these. This plug in is provided.

Next open up “PixelArtShader_v1.0.0\sample1\config.teco” in a text editor. We’ll continue working with Sample 1.

2015-02-10 09_43_59-E___Files_PixelArtShader_v1.0.0_sample1_config.teco - Notepad++

First let’s look at the capture attribute. Using Google Translate this tells me “I want to rendering mode”.

capture true : batches the images to destination folder.

capture false : opens up a preview window. No images are saved.

Change capture to false.

Also uncomment camera_ignore_data and change its value to true.

Run PixelArtShader.exe again. You should get this window:

2015-02-10 09_50_19-Pixel Art Shader

 

You can tumble around the objects using left click, middle click and right click + drag. Note, this does not save anything, just gives you a preview.

Find a camera position that suites you and note the CamPos in the top right corner. Note that in the samples config file there are two values for the camera, camera_pos(ition) and camera_lookat. This program doesn’t seem to give you both, so experiment with those values.

Part Two: Blender

Warning, I’m not a Blender user, I’m a Maya user. Please feel free to correct me on Blender specific terminology.

First, we’ll install the plugin.

Go to User Preferences.

2015-02-10 10_02_08-Blender

Go to the Addons tab and click Install From File.

Choose “PixelArtShader_v1.0.0\Blender_plugin\io_export_pixel_art_shader.py” and press Install From File.

Under Categories choose User.

There should be a plugin called Import-Export: Pixel Art Shader Model Format. Click the checkbox on the very right side. You can now export custom .x files.

I’m going to edit the existing sample 1. Open “PixelArtShader_v1.0.0\sample1\src\sample1.blend” in Blender. Make some edits. I’m just duplicating some existing objects. Save the blend file and also choose file > export and choose .x. Over write “PixelArtShader_v1.0.0\sample1\sample1.x”

frame0027

 

This isn’t framed right. In Blender I select the camera, press Numpad 0 to look through it. Adjust the view.

Note, to get the same image you see through the camera in blender, change the camera focal length here to the same as camera_fov_y in your .teco files.

2015-02-10 10_35_18-Blender_ [E___Files_PixelArtShader_v1.0.0_sample1_src_sample1.blend]

 

This is the framing I’d like. Run the exe file again.

Here we see the framing in blender, with the output image.

frame0000

2015-02-10 10_40_14-Blender_ [E___Files_PixelArtShader_v1.0.0_sample1_src_sample1.blend]

Not exact. And the image sequence has no animation, but the Blender camera does. So far, I’m not sure how to use animated camera.

Let’s have a look at sample 4 that has an animated camera.

Edit “PixelArtShader_v1.0.0\config.teco”.

Comment out sample1 and uncomment sample4 like this:

// model_name "sample1\\sample1.x"
// model_name "sample2\\sample2.x"
// model_name "sample3\\sample3.x"
 model_name "sample4\\sample4.x"

sample4

So now we have a working animated camera. It seems the animation is on the camera_root node.

Here we see Andre from Super Lemonade Factory rendered with those two shaders.

frame0000

 

And a turntable.

andre

 

 

andre_gold

 

Those white glitches are coming from my gif program.

Editing palette.teco you can get different results.

2015-02-10 11_19_30-frame0003.bmp - Windows Photo Viewer

 


 

 

Making your own custom materials and palettes

frame0003

Step 1. You’ll need to enter the details of your palette into the palette.teco file. This is very customizable but also very slow to enter values.

I have four slots set up, and it looks like this:

2015-02-13 11_09_27-E___Files_PixelArtShader_v1.0.0_toycar_src_palette.teco - Notepad++

Double click “PixelArtShader_v1.0.0\toycar\src\MakePaletteTex.bat” to generate your “PixelArtShader_v1.0.0\toycar\palette.png” file. You can edit this file directly, but it may cause unexpected results.

"PixelArtShader_v1.0.0\toycar\palette.png"

“PixelArtShader_v1.0.0\toycar\palette.png”

 

 

 

 

 

I’ve decided to edit mine to look like this:

2015-02-13 11_15_42-Adobe Photoshop CS3

And now our result is:

frame0063

But first let’s look at Blender and Materials.

2015-02-13 11_17_40-Blender [E___Files_PixelArtShader_v1.0.0_toycar_src_sample4.blend]

There are some very important settings on your shader in Blender.

First of all, the hardness value should be an integer that matches up with the Material # that you specified in the palette.teco file.

The manual states you should have the Diffuse on Fresnel and the Specular always on Blinn.

andre2

2015-02-13 11_51_57-Blender_ [E___Files_PixelArtShader_v1.0.0_andre_src_sample4.blend] copy

Comments are closed.