• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Shaders Draw rotated sprites pixelated (solved)

S

Scott97

Guest
Hi all,

So I am not sure if shaders are necessary to achieve this, but what I am looking for is a way to draw sprites to the screen so they are rotated, but are drawn pixelated.

What I am looking for is something like rotsprite : http://pixelation.org/index.php?topic=10510.0

Any suggestions on how I should approach this?

Thanks for your time!
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
From what I know, so far there are no successful implementations of RotSprite's algorithm as a shader, since specifics of algorithm (multi-pass rendering with per-pixel algorithms) make it problematic to implement in a real-time pipeline.

Would be curious to hear if you find some way around this.
 
S

Scott97

Guest
Thanks for your reply YellowAfterLife!

If it was at all possible to get rotsprite algorithm as a shader, that would be great because it gives quite impressive results. However, for my purpose, that is not necessary, so I was wondering if you might know a simpler method that is lower quality.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Thanks for your reply YellowAfterLife!

If it was at all possible to get rotsprite algorithm as a shader, that would be great because it gives quite impressive results. However, for my purpose, that is not necessary, so I was wondering if you might know a simpler method that is lower quality.
For the most basic thing, you would untick the "interpolate colors between pixels" checkbox in Global Game Settings - (desired platform) - Graphics. Whether that will yield a feasible result in your case will depend on art style used and rotation angles.
 
S

Scott97

Guest
Yep so I had interpolate unticked.
But the problem I have, is that I am scaling all pixels by 2, to fit the screen.
In this picture, the bow that the player is holding is drawn using draw_sprite_ext, and is rotated by an angle. If you can see, it is drawn with small pixels while all the objects are drawn with big pixels.

upload_2016-11-3_21-31-56.png
This is what I am trying to fix.

I guess I should have included this in my question. Anyway, thanks again for your time.
 
D

Drewster

Guest
Yep so I had interpolate unticked.
But the problem I have, is that I am scaling all pixels by 2, to fit the screen.
In this picture, the bow that the player is holding is drawn using draw_sprite_ext, and is rotated by an angle. If you can see, it is drawn with small pixels while all the objects are drawn with big pixels.

View attachment 4042
This is what I am trying to fix.

I guess I should have included this in my question. Anyway, thanks again for your time.
I've had some success making the sprite larger than needed and downscaling. But if you really want it to look good, draw the sprite at an assortment of angles and use those when rotating. I know that sucks. Or draw it dynamically from code. Or use swf sprite.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Yep so I had interpolate unticked.
But the problem I have, is that I am scaling all pixels by 2, to fit the screen.
In this picture, the bow that the player is holding is drawn using draw_sprite_ext, and is rotated by an angle. If you can see, it is drawn with small pixels while all the objects are drawn with big pixels.

View attachment 4042
This is what I am trying to fix.

I guess I should have included this in my question. Anyway, thanks again for your time.
Depending on how you deal with this, you may want to surface_resize the application_surface to be 1x of actual game resolution - if you've set the room' view' port to be 2x of view size, A_S will be created at port size at game start, yielding you the seen effect.
 
Top