# No Valid Render Function Found!

**URL:** <https://forum.electromage.com/t/no-valid-render-function-found/1116>\
**Category:** Patterns and Code\
**Created:** [March 28, 2021, 6:02pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116 "2021-03-28T18:02:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 28, 2021, 6:02pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/1 "2021-03-28T18:02:05Z")

</div>

My code from v2 seems to not want to port to the V3… I am getting the above error message across multiple patterns. Any ideas on what might be going on?

Thanks!

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [March 28, 2021, 10:20pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/2 "2021-03-28T22:20:43Z")

</div>

I’ve seen this a couple of times using the Pixelblaze 3 with a 16x16 matrix and the default matrix mapping function. It comes and goes w/2D patterns. At one point as an experiment, I just coded a 1D render function:

`render(index) { ; }`

into 2D patterns that didn’t have one, and haven’t seen the problem since.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 29, 2021, 2:04pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/3 "2021-03-29T14:04:12Z")

</div>

I get that error message for any 2D calls in any pattern I have tried to load into the v3.

For example, @zranger1 , your code for Task #6 -

export function render2D(index,x,y) {  
renderer(index,x,y);  
}

In all cases I get a “Looks ok, pattern is live!” message.

Why would an “error” like this come and go? This does not seem acceptable. I do not know what to do with your suggestion above.

I was having enough challenge figuring out how to simply map into 2 and 3D on my V2, given time and brains constraints …

For example: This code is shown and “live” in the mapper -

function (pixelCount) {  
width = 8  
var map = []  
for (i = 0; i \< pixelCount; i++) {  
y = Math.floor(i / width)  
x = i % width  
x = y % 2 == 1 ? width - 1 - x : x //zigzag  
map.push([x, y])  
}  
return map  
}

And it provides an entree to 3D… but I have no idea how to actually implement it, no fully-fleshed discussion is given, only something about the code being out in your browser. So, being a novice, I just have no idea what to do in a time-effective manner.

Further:

If I paste the following as a new pattern in V3-land, running a 16x16, I get the fading rainbow, but the first row and a half are dark.

```auto
export function render2D(index, x, y) {
    hsv(x, 1, y)
}

```

---

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [March 29, 2021, 4:09pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/4 "2021-03-29T16:09:17Z")

</div>

lets break the problem down:

1. you always need a render() (even if it’s not really used)

2. you don’t always need a render2D() or render3D(), but if you specify them, you need to have a map that has 2d or 3d coordinates or it’ll give you problems. If you give both, PB is supposed to pick the one matching your mapping (based on number of coordinates given in the map)

3. as for mapping, that’s ‘real’ JS code, and all it is supposed to do is return a set of arrays, coordinates in 2d or 3d… if you are having problems with it, check your settings. We have other discussions on mappings, so I’d start there.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 29, 2021, 4:18pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/5 "2021-03-29T16:18:47Z")

</div>

Thanks for getting back @Scruffynerf . I appreciate it.

All the code I am trying to transpo to the V3 has render calls  
All the render2D code I am trying to transpo works on the V2  
None of it works on the V3.

That is the first problem.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 29, 2021, 6:18pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/6 "2021-03-29T18:18:55Z")

</div>

> [@Scruffynerf](#):
>
> If you give both, PB is supposed to pick the one matching your mapping (based on number of coordinates given in the map)

This really helps as I see this code specifying both 2D and 3D render and did not know what was going on.

> [@Scruffynerf](#):
>
> as for mapping, that’s ‘real’ JS code,

Yes, OK. But I was/am puzzled as to where this map code goes and how it integrates with the other operating pattern code. Like, how does the mapper integrate with your other code?

By the way, I doubt I will ever be a brilliant or even smart programmer. First, I want to design and build a 3D pattern pattern testbed of approximately 1024 Px, integrated with a (scrolling) matrix display, perhaps some UI.

That’s my present goal. I wouldn’t mind getting up to some speed with programming but there are many more people like yourself who smarter than me and already up to speed… so, with a little help from my friends I may build something.

ps I will indeed pore through the search results for “mapping” on the forum. I’m pretty sure there is a wealth of info there.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [March 29, 2021, 6:48pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/7 "2021-03-29T18:48:56Z")

</div>

Hi @JustPete,  
The pixel map is a set of coordinates that tell Pixelblaze where your pixels live physically (in 2D or 3D). The pixel map is a static list of coordinates. That is to say, it doesn’t change once configured.

You can enter those coordinates as a JSON formatted array, like: `[[1,2], [3,4], ...]`. Alternatively, you can also use some JavaScript code that generates that same array of coordinates. Once the coordinates are generated, that code doesn’t run again. This is handy if you don’t want to type them out, which can be tedious and boring, especially if they follow a regular pattern like the 8x8 panels.

There’s no interaction with the pattern code, other than the resulting coordinates tell the pattern where each pixel is via the `render2D / render3D` functions.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 29, 2021, 7:44pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/8 "2021-03-29T19:44:25Z")

</div>

OK. So the mapper page/code is a “live feed” to whatever pattern you have running. This was not clear until I messed with it a while. Fantastic, that works! Perhaps there is another way… also?

Am still getting the “No Valid Render Function” error with the V3.  
Settings are as follow:  
WS2812 neopixel/  
256 Px  
800 kbps (the only data speed offered)

Are there any other pertinent settings to look at?

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [March 29, 2021, 9:00pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/9 "2021-03-29T21:00:50Z")

</div>

The mapper does live update the pixel map when you edit the contents. After that, any code in the mapper tab doesn’t run. These coordinates are then fed in to render2D or render3D depending on how many dimensions are defined in the map. A pattern can have any combination of render functions exported, and it looks for a `render`, `render2D`, and `render3D`.

The “No Valid Render Function” error doesn’t care about the LED types or pixel counts. This can happen if the pattern doesn’t export an appropriate render function for the loaded pixel map.

For instance, if your pattern only has `render2D`, it will not work with a 3D pixel map. Likewise with `render3D` and a 2D map. If your pattern has a plain old `render` exported, then it will be used when it can’t find a better fit, or if there is no pixel map.

For broad compatibility, a pattern can export all 3 functions, and the appropriate render will be called depending on what pixel map is loaded (or not loaded).

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [March 29, 2021, 10:44pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/10 "2021-03-29T22:44:55Z")

</div>

I’m still pretty sure I’ve seen the “No Valid Render Function” intermittently on patterns and maps that work perfectly on PB2. It doesn’t seem to happen on patterns with at least both render() and render2d() exported.

I’ve just switched to Pixelblaze 3 for my “main” development – my feeling is that the web environment is not yet as stable as the PB2’s. On Windows 10 Firefox, I get periodic glitches, dropping of web socket connection to the browser and the occasional hang that requires a Pixelblaze restart to recover. Being as it’s a brand new product on a brand new hardware platform, this is not unexpected, and I’ve been working around it without really paying attention. I’ll put some time in and try to come up with a 100% repro case and/or some actual data this week!

---

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [March 30, 2021, 12:31am UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/11 "2021-03-30T00:31:48Z")

</div>

> [@JustPete](#):
>
> mapper page/code is a “live feed” to whatever pattern you have running

No, it’s not. It doesn’t pay any attention to your pattern. It’s ONLY displaying the points it’s been told and runs a basic rainbow iteration thru them.

Many make that mistake, I’ve seen it before here.  
Might need to clarify that better on mapper page.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 30, 2021, 2:21am UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/12 "2021-03-30T02:21:04Z")

</div>

> [@wizard](#):
>
> The mapper does live update the pixel map when you edit the contents. After that, any code in the mapper tab doesn’t run.

and this statement

> [@Scruffynerf](#):
>
> No, it’s not. It doesn’t pay any attention to your pattern. It’s ONLY displaying the points it’s been told and runs a basic rainbow iteration thru them.

… could be resolved somewhat through this

> [@Scruffynerf](#):
>
> Might need to clarify that better on mapper page.

What would be helpful is a schematic or whatever coders call it of operational block logic and sequence/relationship of parts such as how and when to use mapper and how it affects/is inserted in/ported to pattern code, how and when to use a JSON array and etc.

Thank you for thinking of it!

I will note, that changing the mapper type does live-change the pattern appearance on my 16 x 16, per the first statement above, for lots of good looks!

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 30, 2021, 2:26am UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/13 "2021-03-30T02:26:05Z")

</div>

That sounds interesting… whatever repro is… 😄

Let me/us know if you figure some stuff on the rendering of 2D (3D?) code. I’d be interested to here just if/how weird or not my v3 behavior is.

---

<div class="post-metadata">

**Author:** ![zranger1](https://forum.electromage.com/user_avatar/forum.electromage.com/zranger1/32/301_2.png) [@zranger1](https://forum.electromage.com/u/zranger1)\
**Post date:** [March 30, 2021, 3:20am UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/14 "2021-03-30T03:20:53Z")

</div>

@JustPete, “repro” is just short for reproduce – having a “repro case” means that you have documented a way to reproduce a problem at will. It makes it much easier for the developer to fix, especially in the case of intermittent bugs, which tend to hide if they see the programmer coming…

On the 2D/3D thing, make sure you’ve got your mapping function set up and saved, reload the pattern, and if that doesn’t fix it, try adding dummy render functions to the pattern for any dimensionality it doesn’t already have. Below are suitable “dummy” functions for 1D, 2D and 3D. Just copy the functions you need at the bottom of the pattern.

```auto
export function render(index) { hsv(0,1,1); } // all red
export function render2D(index,x,y) { hsv(0.6667,1,1) ; } // all blue
export function render3D(index,x,y,z) { hsv(0.333,1,1); } // all green

```

These can also help as diagnostics: If you paste in only the missing render functions, and your display suddenly turns all red, green or blue, it indicates that your map may not be set up correctly.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 30, 2021, 4:47pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/15 "2021-03-30T16:47:03Z")

</div>

Code was running well this morning, but later became glitchy.

---

<div class="post-metadata">

**Author:** ![Scruffynerf](https://forum.electromage.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@Scruffynerf](https://forum.electromage.com/u/Scruffynerf)\
**Post date:** [March 30, 2021, 10:14pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/16 "2021-03-30T22:14:01Z")

</div>

Did you sacrifice the 3 chickens required, a red, a green and a blue one? PB tends to slow down if you don’t refresh the chickens periodically.

---

<div class="post-metadata">

**Author:** ![wizard](https://forum.electromage.com/user_avatar/forum.electromage.com/wizard/32/4_2.png) [@wizard](https://forum.electromage.com/u/wizard)\
**Post date:** [March 30, 2021, 11:28pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/17 "2021-03-30T23:28:45Z")

</div>

Officially, Pixelblaze does not require any chicken (or other animal) sacrifices.

Only human sacrifices are required, in the form of free-time… And perhaps the occasional singed skin when soldering.

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 31, 2021, 12:36am UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/18 "2021-03-31T00:36:32Z")

</div>

I think those chickens did some real good. (Unofficially, of course). That added peacock tongue and eye of newt didn’t hurt either.

There must be a happy butterfly flapping its wings somewhere in Mongolia…

---

<div class="post-metadata">

**Author:** ![JustPete](https://forum.electromage.com/user_avatar/forum.electromage.com/justpete/32/1832_2.png) [@JustPete](https://forum.electromage.com/u/JustPete)\
**Post date:** [March 31, 2021, 2:55pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/19 "2021-03-31T14:55:42Z")

</div>

Fantastic news! No render errors and code just chugging along, happy as can be for over 18 hours now.

Some pretty fine work you all are doing here, and much appreciated, generous help.

I am reminded, “With a little help from my friends”. Kudos and thanks, folks!

Now off to 3D-land.

---

<div class="post-metadata">

**Author:** ![SeaLaVie](https://forum.electromage.com/user_avatar/forum.electromage.com/sealavie/32/666_2.png) [@SeaLaVie](https://forum.electromage.com/u/SeaLaVie)\
**Post date:** [April 5, 2021, 12:06pm UTC](https://forum.electromage.com/t/no-valid-render-function-found/1116/20 "2021-04-05T12:06:19Z")

</div>

I also have seen this “no valid render function” when trying a few downloaded patterns on my V3 running a single 588 pixel strip of WS2815s. For instance on the “Firework Nova” pattern I got this error every time I tried to load the file.

[Next page](https://forum.electromage.com/t/no-valid-render-function-found/1116.md?page=2)
