Uniform Userdata

Recently, while building my tilemap shader (https://forums.coronalabs.com/topic/59174-making-a-tilemap-shader), I hit up against a wall. It turns out there’s currently no way to get more than 4 numbers into your shader, and I had to do some bit manipulation to tease extra values out of them. Unfortunately, this turned out to be only available for desktop GLSL. Without doing some extensive contortions (figuratively, I mean - you don’t actually have to do contortions at your computer and - voila! - more variables. It doesn’t work like that.), there’s really no way to get more values into your shader.

But! (permit me to use a sentence fragment here for effect)

In the effects guide page, it looks like you can add more variables to your shader through “Uniform Userdata”: https://docs.coronalabs.com/guide/graphics/customEffects.html#uniform-userdata. The problem is… It’s listed as a “forthcoming feature”.

So I get to my question for the Corona staff. Is this “forthcoming” because it’s incomplete, or forthcoming because it’s undocumented? If the former, when’s the ETA on it? If the latter, when’s the ETA on documentation? I’d really love to have this feature so that my tilemap shader can proceed in development. Plus, I’m sure other people also need more variables in their shader.

  • Caleb

Anyone? I’d really like to have a statement on this, because the shader was looking really good. The only thing hindering it is the lack of inputs :(.

  • Caleb

Ok. I realized built-in Corona shaders use uniform userdata (or some such thingy). From the docs:

object.fill.effect = "filter.colorMatrix" object.fill.effect.coefficients = { 1, 0, 0, 0, --red coefficients 0, 1, 0, 0, --green coefficients 0, 0, 1, 0, --blue coefficients 0, 0, 0, 1 --alpha coefficients } object.fill.effect.bias = { 0.6, 0.1, 0, 0 }

Man, that would be great to have for developers… What’s the status on this? Anyone?

  • Caleb

I assume you’ve seen this?:

https://docs.coronalabs.com/api/library/graphics/defineEffect.html#uniformdata-optional

it’s clearly “already there” (and working), i think it’s just the docs that are the “forthcoming feature”

btw, i would never suggest that it might be enlightening to unzip a compiled apk and hex dump libcorona.so

nope, you won’t hear that from me

:wink:

Anything to say about this from the Corona staff?

@davebollinger: :ph34r:

  • Caleb

Anyone? I’d really like to have a statement on this, because the shader was looking really good. The only thing hindering it is the lack of inputs :(.

  • Caleb

Ok. I realized built-in Corona shaders use uniform userdata (or some such thingy). From the docs:

object.fill.effect = "filter.colorMatrix" object.fill.effect.coefficients = { 1, 0, 0, 0, --red coefficients 0, 1, 0, 0, --green coefficients 0, 0, 1, 0, --blue coefficients 0, 0, 0, 1 --alpha coefficients } object.fill.effect.bias = { 0.6, 0.1, 0, 0 }

Man, that would be great to have for developers… What’s the status on this? Anyone?

  • Caleb

I assume you’ve seen this?:

https://docs.coronalabs.com/api/library/graphics/defineEffect.html#uniformdata-optional

it’s clearly “already there” (and working), i think it’s just the docs that are the “forthcoming feature”

btw, i would never suggest that it might be enlightening to unzip a compiled apk and hex dump libcorona.so

nope, you won’t hear that from me

:wink:

Anything to say about this from the Corona staff?

@davebollinger: :ph34r:

  • Caleb