Remove Alpha Remove Localization Remove Sprite
article thumbnail

Shader display problem

Cocos

// Copyright (c) 2017-2020 Xiamen Yaji Software Co., 1.0], editor: {type: color} } endColor: { value: [1.0, o.r = o.g = o.b = gray; #endif #if USE_HORIZONTAL o.rgb *= mix(startColor, endColor, vec4(uv0.x)).rgb; rgb; #endif #if USE_VERTICAL o.rgb *= mix(startColor, endColor, vec4(uv0.y)).rgb; 1.0], editor: {type: color} } endColor: { value: [1.0,

Shaders 52
article thumbnail

Shader Problem in IOS

Cocos

pos = inTransform * pos; //cc_matViewProj * #endif uv0 = a_texCoord; #if SAMPLE_FROM_RT CC_HANDLE_RT_SAMPLE_FLIP(uv0); #endif color = a_color; vec2 singleStepOffset = vec2(3.0/4096.0, sum.r); // o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0); #if IS_GRAY float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b;

Shaders 40
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Shader Problem in IOS

Cocos

o.r = o.g = o.b = gray; #endif #endif o *= color; ALPHA_TEST(o); return o; } }% and in ts file I’m doing this let material = this.coverSprite.getSharedMaterial(0); material.setProperty('inTransform', transform); I have changed layout(set = 2, binding =12) uniform sampler2D cc_spriteTexture;

Shaders 40
article thumbnail

[CC 3.7.3] Shader Error?

Cocos

So, I just copied from the built-in sprite effect file to mine. Now, back to the issue, I think, only “cc_matWorld” is used from #include <builtin/uniforms/cc-local> If I commented both of these lines, there were no error. I’m just learning how a shader works. But, everything stopped working as intended.

Shaders 40
article thumbnail

Shader doesn't work on brower, or run it in the editor

Cocos

y * sin(rad); o.rgb *= mix(startColor.rgb, endColor.rgb, smoothstep(edge1, edge2, diagCoord)); o *= color; ALPHA_TEST(o); return o; } }% [topic] When I use above codes, the shaders I apply to the sprite work fine when I’m in the editor, or when I run it in an emulator. 1.0], editor: {type: color} } endColor: { value: [1.0, x * cos(rad) + uv0.y

Shaders 40
article thumbnail

Shader doesn't work on brower, or run it int the editor

Cocos

y * sin(rad); o.rgb *= mix(startColor.rgb, endColor.rgb, smoothstep(edge1, edge2, diagCoord)); o *= color; ALPHA_TEST(o); return o; } }% [topic] When I use above codes, the shaders I apply to the sprite work fine when I’m in the editor, or when I run it in an emulator. 1.0], editor: {type: color} } endColor: { value: [1.0, x * cos(rad) + uv0.y

Shaders 40
article thumbnail

Shader on IOS error

Cocos

CCEffect %{ techniques: - passes: - vert: sprite-vs:vert frag: sprite-fs:frag depthStencilState: depthTest: false depthWrite: false blendState: targets: - blend: true blendSrc: src_alpha blendDst: one_minus_src_alpha blendDstAlpha: one_minus_src_alpha rasterizerState: cullMode: none properties: u_dH: { value: 0.0, float g = texColor.g;

Shaders 40