Search Unity

[Released] Pixel Rotation Sprite - rotate your pixel art

Discussion in 'Assets and Asset Store' started by FrischGebraut, Apr 28, 2017.

  1. FrischGebraut

    FrischGebraut

    Joined:
    Jul 24, 2013
    Posts:
    28
    prs_title.jpg

    Hi guys!

    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.

    Cheers
     
    shamsfk likes this.
  2. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    I wish you released it 6 months earlier) When I'll need something of that sort again I'm gonna try it.
     
  3. zullo91

    zullo91

    Joined:
    Nov 1, 2013
    Posts:
    14
    Nice!

    Could you post a .gif to show how your shader work on a sprite in pixel art in Unity3D ?
    For example: show an 360 sprite rotation.
    Thx.
     
  4. FrischGebraut

    FrischGebraut

    Joined:
    Jul 24, 2013
    Posts:
    28
    pixel_rotation_sprite_demo.gif
    Hope that helps ;)
     
  5. ZerricK

    ZerricK

    Joined:
    Dec 23, 2015
    Posts:
    2
    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!
     
  6. FrischGebraut

    FrischGebraut

    Joined:
    Jul 24, 2013
    Posts:
    28
    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 :D
     
  7. ZerricK

    ZerricK

    Joined:
    Dec 23, 2015
    Posts:
    2
    Ok, i just realised that my question is a bit dumb xD so nvm^^
     
  8. SeanC88

    SeanC88

    Joined:
    Apr 21, 2012
    Posts:
    19
    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?

    Thanks!
     
  9. xogus4396

    xogus4396

    Joined:
    Sep 13, 2019
    Posts:
    1
    Hello!
    Pixel Rotation does not work properly in Unity 2018.4.8f1. Is there a solution?
     
  10. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    102
    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?
     
  11. FreshlyBrewed

    FreshlyBrewed

    Joined:
    Nov 12, 2019
    Posts:
    4
    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.).
     
  12. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    102
    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:)
     
  13. meebou

    meebou

    Joined:
    Mar 6, 2017
    Posts:
    46
    This Thread is weird :-D "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? :)