I recently released a small package on the assetstore called “Pixel Rotation Sprite”. The package is an editor extension that you can use to get pixelated rotation on your sprites. This is a nice visual effect when you are working with pixel art. Check out the assetstore page for some more information and pictures on the effect.
There is actually a similar package already on the assetstore that I considered using in my own project. However I kind of disliked the workflow. I wanted the effect to be purely visual so that I could just put it on any of my sprites and use the GameObject like I normaly would. So I decided to create my own solution.
I ended up writing a custom shader that does the rotation for me. This means the actual texture is not modified and the package does not use Texture2D.SetPixel or Texture2D.Apply. However it also means you do not have access to individual pixels of the rotated sprite in code.
I found this to be quiet a cool effect for pixel art games and it does not require much effort to integrate it into a project. I thought some people might be interested so I released it on the assetstore for a few bucks
Here is the assetstore link if you are interested: Assetstore Link
If you have any questions or comments feel free to leave them down here.
I would to like it if you can choose the Pixel per Units on the Sprites. Like if you want a bit bigger/smaller pixels in the rotation. Can you maybe add this? But it’s a great asset!
I don’t know if I understand you correctly. You can change the pixels per unit on the sprite as usal. The shader will always rotate the pixel art pixel by pixel. So no matter what you choose for the size of the sprite in world space the sprite will always be rotated in local pixel space. Otherwise it wouldn’t really make sense because the point of the asset is to match a rotated sprite with the look of other pixel art which wouldn’t work if the rotation would happen with a diffrent pixel size. But as I said, maybe I just don’t understand what you mean exactly
I just purchased your Pixel Rotation asset and am excited to use it, but it seems it only works for games built on an XY plane. I am making a top down game where movement happens along XZ and rotations around Y Axis. Unfortunately, it seems the shader only recognizes rotations around Z. Is there a way to modify this to allow for your choice of axis?
Is this asset stil available somewhere? I’ve been trying to create this effect in shader graph myself but I can’t get it to work. I can’t find the asset on the asset store any longer, could you elaborate on how you created the effect if it’s no longer up for purchase?
The asset is no longer available because I don’t have time to support it anymore. Unfortunately, I don’t have the shader at hand right now but it is not too difficult to implement. The trick is to convert the UVs to pixel coordinates, rotate, and convert back to UVs and sample the texture. This ensures that you stick to the fixed pixel grid and don’t get a “smooth” rotation you would get from rotating UVs directly. If I remember correctly, most of the required values (pivot point, sprite size, etc.) were just passed to the shader using MaterialPropertyBlocks. Other than that, most of this asset was tooling around making the shader more user-friendly (e.g. converting transform rotation to shader rotation, etc.).
Thanks for the explanation!! I’m trying to create this in shader graph but haven’t got it working yet. I did create a shader that pixelizes sprites so they match the ppu of my game, but now trying the rotation:-)
This Thread is weird “WizzDE” started the thread and created the shader, then “FreshlyBrewed” answered that he is not working on that shader anymore. So is that the same guy?
Anyway, could someone explain a newbie again, how to make a shader (maybe with shader graph) to get that pixelated rotation?