Microsoft MakeCode

Shader Extension

This was a request I got on stream on Monday: a shader extension!

This extension lets you use images or rectangles to define parts of the screen to shade.

Grab it at riknoll/arcade-shader

Here is an example for that gif above:

And here’s another example that @shakao made on how to use it to make shadows for sprites

warning: the more of the screen you shade, the slower your game will be! that GIF above runs at 15 FPS on my pygamer and it only has two sprites. To make your game faster, use shaders lightly and use rectangles where possible (they are much faster). Also, avoid double-shading the same area.

16 Likes

Also, don’t be afraid to use it because of that warning! Just keep it in mind if your game seems slow. Small shaders run pretty well

5 Likes

That´s satisfying. You could make optical illusions with the shaders

3 Likes

cool, how do i download extensions

1 Like
  1. Expand the Advanced tab in the editor:
    image
  2. Scroll down and click on Extensions:
    image
  3. Select an extension you want to install!

    3.1 Or, if the extension isn’t listed, then paste in the GitHub URL (for this extension, it’s https://github.com/riknoll/arcade-shader/tree/master) in the Search or enter project URL... box.

    3.2 Press enter and select the extension!
1 Like

If I set a shader sprite to be invisible, will it stop “shading” so that it will use less resources? Or can you add a block to turn shading off for a particular shader? (So it disappears, but I enable shading, then it would be right back there?)

2 Likes

@UnsignedArduino oh boy, sorry for the super late response but an invisible shader sprite does prevent it from using more resources. If you don’t see the shader effect, it isn’t happening.

3 Likes

@mmoskal would this extension work well on a Kitronik Arcade???

I’m asking in relation to the Biggest Game since we want to use @kwx’s Space Rocks 3D, which can plummet the FPS alone, so I’m wondering whether shadows will break the game.

1 Like

Shadows will probably set your Meowbit on fire if you pair it with the his space rocks 3D game. Or just won’t load because of insufficient memory. The Meowbit is already pretty tight compared to the PyGamer and PyBadges.

2 Likes

@UnsignedArduino yes, but I want to know about the Kitronik Arcade only, since that’s my hardware, hence I am asking @mmoskal to tell me.

Good info though :+1:t3:

1 Like

Oh lol sorry I thought the Kitronik Arcade was a different name for the Meowbit sorry lol :sweat_smile:

2 Likes

Oh lol @UnsignedArduino that was what is called ‘HUMAN ERROR

2 Likes

The Kitronik Arcade uses the same MCU as the Pygamer I believe, so it should be more powerful than a Meowbit. That being said, the best way to test these things usually is just to try it out!

3 Likes

Anyways, I can bet that the FPS on something even as great as the Arcade would plummet to a downright 10-20! I think that the Arcade is the best piece of hardware for MakeCode Arcade right? If so, that means that there needs to be a version 2!

It’s actually the Raspberry Pi - it can have up to 8GB of RAM it has a beefy 4 core CPU.

2 Likes

Wow @UnsignedArduino, thanks for that!

1 Like

It has infinite potential if you stack pis

I have a raspberry pi!

How do you “stack” Pis?

Complicated to explain. You can google it. It basically adds up their stats somewhat.
How to stack pis.