Effect/Material problems 2.3.3

Effect/Material problems 2.3.3
0

Hello everybody!

After migration to 2.3.3 i got problem with my shader effect.

In editor v2.2.2 my shader looks like this:

In web shader looks like this:

In editor v2.3.3 shader looks as in editor v2.2.2
But in web i got just black screen

My shader code:

void main () {
vec3 col = smoothstep(0.7, 0.1, distance(vec2(0.5), v_uv0)) * vec3(0.0, 0.3, 0.45);
gl_FragColor = vec4(col, 0.25);
}

Hey @Zakhar did you solve it?

If not I’ll save your life :smiley:
I spend 4 hours to run a simple shader code correctly and found this before a lost my mind :scream: :triumph: :rage:

add this line to a component in the scene. Dynamic atlas messes up uv coordinates :scream:

cc.dynamicAtlasManager.enabled = false;

Hope it helps :wink:

or another option is set packable option to false of the texture of sprite frame of sprite onLoad like this:

this.Sprite = this.node.getComponent(cc.Sprite);
this.Sprite_Frame = this.Sprite.spriteFrame;
this.Sprite_Frame._texture.packable = false;

Hope it helps also :slight_smile:

Thank you for the answer! It works :smiling_face_with_three_hearts:

But i have new problem :face_with_symbols_over_mouth:

I am trying to declare array uniform in my shader. My uniform looks like:
uniform arrays { float test[256]; };

And i get this error from cocos compiler:
error EFX2203: uniform float test[256]: array UBO members need to be 16 bytes aligned to avoid implicit padding

What does it mean?

And one more situation:
for this uniform declaration compiler has no errors
uniform arrays { vec4 explosions[256]; };
But if i try to get property information from my material in log, i see this:
Float32Array [0, 0, 0, 0] (4)
Why is there 4 elements in log? My uniform array declared as 256 vec4