# Shader Extension

**URL:** <https://forum.makecode.com/t/shader-extension/4860>\
**Category:** Show & Tell\
**Tags:** extension\
**Created:** [December 9, 2020, 1:21am UTC](https://forum.makecode.com/t/shader-extension/4860 "2020-12-09T01:21:12Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [February 25, 2021, 11:39pm UTC](https://forum.makecode.com/t/shader-extension/4860/21 "2021-02-25T23:39:37Z")

</div>

You need a specialised program to split the processing power over multiple computers, and the thing you want to do has to support being split up over multiple computers. And I don’t think MakeCode on RPi will do that.

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [February 26, 2021, 1:41am UTC](https://forum.makecode.com/t/shader-extension/4860/22 "2021-02-26T01:41:17Z")

</div>

I think de should file a feature request for this.  
@richard?

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [February 26, 2021, 5:02am UTC](https://forum.makecode.com/t/shader-extension/4860/23 "2021-02-26T05:02:56Z")

</div>

But who is gonna use it? If they implement it, I probably still won’t use it.

---

<div class="post-metadata">

**Author:** ![carlosleyva](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlosleyva](https://forum.makecode.com/u/carlosleyva)\
**Post date:** [February 26, 2021, 5:23pm UTC](https://forum.makecode.com/t/shader-extension/4860/24 "2021-02-26T17:23:58Z")

</div>

this is great

---

<div class="post-metadata">

**Author:** ![Primal\_Nexus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/primal_nexus/32/3540_2.png) [@Primal\_Nexus](https://forum.makecode.com/u/Primal_Nexus)\
**Post date:** [February 26, 2021, 5:27pm UTC](https://forum.makecode.com/t/shader-extension/4860/25 "2021-02-26T17:27:24Z")

</div>

I think @UnsignedArduino is right- ‘stacking Pi’s’ would be hard for MakeCode to decipher, and also like @UnsignedArduino said, no one is really going to use 5-10 Raspberry Pi’s to just help with a heavy game

---

<div class="post-metadata">

**Author:** ![Raed438](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/raed438/32/24469_2.png) [@Raed438](https://forum.makecode.com/u/Raed438)\
**Post date:** [June 27, 2021, 7:43am UTC](https://forum.makecode.com/t/shader-extension/4860/26 "2021-06-27T07:43:22Z")

</div>

Use shader extension when you make mineshaft tilemap

---

<div class="post-metadata">

**Author:** ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)\
**Post date:** [June 1, 2023, 8:34pm UTC](https://forum.makecode.com/t/shader-extension/4860/27 "2023-06-01T20:34:10Z")

</div>

Can you add a feature where you can change what color is darker than another? This would be useful if someone were to use a custom color palette

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 1, 2023, 9:40pm UTC](https://forum.makecode.com/t/shader-extension/4860/28 "2023-06-01T21:40:41Z")

</div>

good idea! I should do that at some point. Need to figure out what the block for that should look like, though. Something like “set [pink] shade level [one] to [orange]” would be pretty tedious to use

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [June 1, 2023, 11:40pm UTC](https://forum.makecode.com/t/shader-extension/4860/29 "2023-06-01T23:40:58Z")

</div>

I think some things have to be manually defined. Although I think you should make the shader enums poppable so you can add your own presets, and you can map each color in that shader preset so you can have as many as you want

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 5, 2023, 5:42pm UTC](https://forum.makecode.com/t/shader-extension/4860/30 "2023-06-05T17:42:04Z")

</div>

it definitely would be manually defined, but it might be easier to use an image like this:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/9f3ec7e066496ea162eeb4270f24b4f29c5c0a12.png)

the problem with this approach is just that it would require documentation, since i don’t think i could communicate this in the space of one block. way easier to use though

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 5, 2023, 5:43pm UTC](https://forum.makecode.com/t/shader-extension/4860/31 "2023-06-05T17:43:08Z")

</div>

in case it was unclear, that image has 1 column for each color and the colors get darker as you move down.

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [June 5, 2023, 7:21pm UTC](https://forum.makecode.com/t/shader-extension/4860/32 "2023-06-05T19:21:04Z")

</div>

This could be useful for a lightening an image instead of darkening it

---

<div class="post-metadata">

**Author:** ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)\
**Post date:** [June 5, 2023, 7:37pm UTC](https://forum.makecode.com/t/shader-extension/4860/33 "2023-06-05T19:37:48Z")

</div>

> [@richard](#):
>
> set [pink] shade level [one] to [orange]

this might be possible if you add a plus button that allows you to change multiple colors

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [June 20, 2023, 11:30pm UTC](https://forum.makecode.com/t/shader-extension/4860/34 "2023-06-20T23:30:44Z")

</div>

What about using the _help_ button? It could pop out one of those pages where you could line out the docs for it.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 20, 2023, 11:50pm UTC](https://forum.makecode.com/t/shader-extension/4860/35 "2023-06-20T23:50:32Z")

</div>

there will be some major updates to this extension in the near future!

in particular, i moved the performance intensive code into C++ so it will be quite a bit faster.

here’s a preview, but don’t try using it yourself yet (this is a debug build of arcade):

> **[Microsoft MakeCode Arcade](https://arcade.makecode.com/app/8f1b8d246eaf80f76785c68fcac195e773f38bec-34db1b70ea#pub:_PY647XFmyfkR)**
>
> Develop your programming skills by quickly creating and modding retro arcade games with Blocks and JavaScript in the MakeCode editor

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 20, 2023, 11:56pm UTC](https://forum.makecode.com/t/shader-extension/4860/36 "2023-06-20T23:56:36Z")

</div>

also, that code should run on hardware! pygamer at least, meowbit might not have enough memory but that’s just because of the demo and not the shader code

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [July 3, 2023, 5:16pm UTC](https://forum.makecode.com/t/shader-extension/4860/37 "2023-07-03T17:16:39Z")

</div>

I was just reviewing this the other day when I was experimenting with some colors, and I realized that this actually has repeating within it… (for example)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/45a87727658b4bdfc4a02dc37724b7347dd6585d.png)

I thought that this might be another approach which would involve less redundancy

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f6738e318f45dfb074c97b211d6bfc696b894a3f.png)

Here, you don’t need to define

yellow → orange → brown → purple → black  
and orange → brown… black

separately because orange is included in the first “shader map” (that’s how I’ll refer to it)  
As you can see I significantly reduced the number of columns needed here, since you can just recycle some maps for other colors (as shown in this simple diagram)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f76bbc537ac654f7aa0c71383b6cdeda54a19131.png)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [July 3, 2023, 5:26pm UTC](https://forum.makecode.com/t/shader-extension/4860/38 "2023-07-03T17:26:36Z")

</div>

@Sarge that’s true, but i feel like there might be some color palettes where you could include a color in more than one ramp with different colors coming after it. For example you could have:

orange → red → brown

and in the same palette:

pink → red → purple

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [July 4, 2023, 9:36pm UTC](https://forum.makecode.com/t/shader-extension/4860/39 "2023-07-04T21:36:12Z")

</div>

Hmm… maybe a block to toggle between using normal maps (your way) and compact maps? 🤔  
You don’t have to include this obviously, I understand it might get a little complicated 😅

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [July 5, 2023, 3:31am UTC](https://forum.makecode.com/t/shader-extension/4860/40 "2023-07-05T03:31:55Z")

</div>

Btw scaling is broken for shaders

[Previous page](https://forum.makecode.com/t/shader-extension/4860.md?page=1)

[Next page](https://forum.makecode.com/t/shader-extension/4860.md?page=3)
