Remove Localization Remove Shaders Remove Sprite
article thumbnail

Cocos Shader Tutorial 1.0 - about UV

Cocos

The vertical axes of textures and picture pixels is shown above, when sampling textures in shaders, that is from top to bottom, which is top-right corner. Use UV in Shader Both 2D and 3D shaders in Cocos are obtained in the vertex shader (VS) and passed to the pixel shader (FS). x,waveFactor.y-uv0.y); x,waveFactor.y-uv0.y);

Shaders 98
article thumbnail

Shader Problem in IOS

Cocos

I have a question related to shaders. I created a game in which I added a shader; it works fine in web mobile and Android, but in iOS it gives an error during rendering. How to solve this issue version-3.8.2 17:49:37 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm:

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

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,

Shaders 40
article thumbnail

Shader Problem in IOS

Cocos

There is also two more custom shader // Copyright (c) 2017-2020 Xiamen Yaji Software Co., 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,

Shaders 40
article thumbnail

[CC 3.7.3] Shader Error?

Cocos

I am having an issue with creating shader. I couldn’t include the cc-local. CCProgram sprite-vs %{. #if if USE_LOCAL #include <builtin/uniforms/cc-local> // <-- Error Here GL_INVALID_OPERATION: It is undefined behaviour to have a used but unbound uniform buffer. Hello Cocos Team.

Shaders 40
article thumbnail

[CC 3.7.3] Shader Error?

Cocos

I am having an issue with creating shader. I couldn’t include the cc-local. CCProgram sprite-vs %{. #if Hello Cocos Team. No errors were shown at the editor, but when I previewed I got the following error at the browser console.

Shaders 40