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
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
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 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

[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 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
article thumbnail

Does Spine work with USE_INSTANCING?

Cocos

Hello, I’m working on a custom material/effect with a USE_INSTANCING branch that works on sprites, but does not work on a spine character. I’ve tried the different animation cache modes, and enable/disable batch. The effect is a duplicate of builtin-spine , with the instancing branches added and the two_color branch removed.

Texture 40
article thumbnail

Shader Help required (UV distortion with cc_time[0])

Cocos

1.0 - newUV.x), min(newUV.y, 1.0 - newUV.y)); // Calculate the flame distortion amount based on the distance from the edge float distortionAmount = flameIntensity * (1.0 - smoothstep(0.0, 1.0 - newUV.x), min(newUV.y,

Shaders 40