This site uses cookies to improve your experience. To help us insure we adhere to various privacy regulations, please select your country/region of residence. If you do not select a country, we will assume you are from the United States. Select your Cookie Settings or view our Privacy Policy and Terms of Use.
Cookie Settings
Cookies and similar technologies are used on this website for proper function of the website, for tracking performance analytics and for marketing purposes. We and some of our third-party providers may use cookie data for various purposes. Please review the cookie settings below and choose your preference.
Used for the proper function of the website
Used for monitoring website traffic and interactions
Cookie Settings
Cookies and similar technologies are used on this website for proper function of the website, for tracking performance analytics and for marketing purposes. We and some of our third-party providers may use cookie data for various purposes. Please review the cookie settings below and choose your preference.
Strictly Necessary: Used for the proper function of the website
Performance/Analytics: Used for monitoring website traffic and interactions
I need a shader that draws the outer outline of a sprite. Since this shader draws the outer contour, I need to prepare sprites with a sufficient size in advance and disable trimming in the editor. I borrowed the framework for the shader experiment from the built-in shader “builtin-sprite.effect”, which is located in “3.8.6\resources\resources\3d\engine\editor\assets\effects\for2d”.
I’m trying to convert a shader from Shadertoy to use it within Cocos Creator, but I’m not sure how to properly translate the shader code or set up the necessary uniforms. Shader I’m trying to convert: shadertoy.com Shadertoy Build shaders, share them, and learn from the best community.
Pro Tip: Use orthographic or isometric perspectives for both 2D sprites and 3D environments. Pro Tip: Use real-time lighting rigs on 3D elements and hand-paint corresponding shadows on 2D sprites. This consistency in light behavior and texture fidelity is essential when toggling between flat sprites and dimensional meshes.
Good evening, I just finished writing my own custom shader to create 2D shadows on sprites, but I can’t find a way to increase the render area of the sprite. The sprite size is 450x450, I created an atlas and used the trim option, this reduced the frame to 156x393. Is there a way to increase the render bounds?
x version Polygon sprite, arbitrary polygon texture rendering that can be batched RiveAnimation, load Rive format animation, supports WeChat and Douyin mini games SpriterAnimation, load animation exported by Spriter, supports all platforms Supported engine versions Engine version: Cocos Creator 3.6.0 opengles2.0) can run, webgl2.0(opengles3.0)
to pass the uniform to the material like this: @ccclass("WormHole") export class WormHole extends Component { material: Material = null; onLoad() { this.material = this.getComponent(Sprite).sharedMaterial; Then create a sprite and assign the material just created to it. Finally I added the component to the Sprite. float ap = 1.0;
Beyond off-the-shelf software, top studios often develop custom shader libraries, sophisticated VFX pipelines, and precise GPU budget trackers to ensure real-time performance remains flawless. Shader Compatibility : Artists and developers collaborate to create and implement custom shaders tailored to visual effects or gameplay mechanics.
Good evening, I just finished writing my own custom shader to create 2D shadows on sprites, but I can’t find a way to increase the render area of the sprite. The sprite size is 450x450, I created an atlas and used the trim option, this reduced the frame to 156x393.
The optimization of shaders combines calculation simplification methods which lowers both shader passes and processing redundancy. Billboard Sprites reduces GPU processing through the use of simple models for distant objects.
Animation: Fix incomplete FPS spinbox display in sprite frames editor ( GH-101798 ). Shaders: Fix source_color default value ( GH-101642 ). With some further fixes like GH-102424 , GH-102497 , and GH-102477 , lightmap baking got a nice upgrade in this snapshot. Core: Add explicit error messages to Multimesh functions ( GH-101109 ).
2D characters are typically faster to design and animate, especially when using sprite sheets or rig-based tools. Hybrid games like Guilty Gear Strive and Octopath Traveler use 3D models rendered with 2D shaders, blending the strengths of both. Can you combine 2D and 3D in one game? Absolutely.
Even after modifying the vertex buffer ( vb ), the changes are not reflecting on the sprite. I understand that in Cocos Creator 3.8 , I can access the vbo and modify the vertex colors using: let ur = this.node.getComponent(UIRenderer); let vb = ur['_renderData'].chunk.vb;
manual/en/shader/write-effect-2d-sprite-gradient.html I have created custom shader to apply uv offset by just add uniform uniform Pice{ vec2 uvOffset; }; and modify uv in vertex shader: uv0 = a_texCoord + uvOffset; but i have problem that output on web is strange and different with editor uv: [0.04, 0.0] Web: if uv [0.5,
manual/en/shader/write-effect-2d-sprite-gradient.html I have created custom shader to apply uv offset by just add uniform uniform Pice{ vec2 uvOffset; }; and modify uv in vertex shader: uv0 = a_texCoord + uvOffset; but i have problem that output on web is strange and different with editor uv: [0.04, 0.0] Web: if uv [0.5,
Blockquote const sprite = this.getComponent(Sprite); const mat = sprite.customMaterial; mat.setProperty(‘dissolveThreshold’, 0.5); Version 3.6.x, x, I using this code but it not bring Property affect to shader Ok, this work if turn of Packable in main Sprite inspector
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);
In this “Unity Sprite Outline” tutorial we’ll discover how to create both a “Sprite Innerline” and a “Outer Sprite Outline”. Simply, the Inner Sprite Outline shader is drawn “inside” the sprite, while “Outer” is the opposite. Inner Sprite Outline HLSL. Outer Sprite Outline HLSL. Amplify Shader.
My sprite doesnt look right after given a material, I wanted to achieve a addtive like effect. heres what it looks like now! Im a new user and unfortunately I can only post one image. The source image has smooth alpha gradient. screenshot-20241218-160021|437x273 Im using cocos creator 3.8.3
My sprite doesnt look right after given a material, I wanted to achieve a addtive like effect. heres what it looks like now! Im a new user and unfortunately I can only post one image. The source image has smooth alpha gradient.screenshot-20241218-160021|437x273 Im using cocos creator 3.8.3
My sprite doesnt look right after given a material, I wanted to achieve a addtive like effect. heres what it looks like now! Im a new user and unfortunately I can only post one image. The source image has smooth alpha gradient.screenshot-20241218-160021|437x273 Im using cocos creator 3.8.3
My sprite doesnt look right after given a material, I wanted to achieve a addtive like effect. heres what it looks like now! Im a new user and unfortunately I can only post one image. The source image has smooth alpha gradient.screenshot-20241218-160021|437x273 Im using cocos creator 3.8.3
About shaders. For most game developers, shaders are this scary monster that presents itself with such a complexity that it seems out of reach. In reality, shaders are quite simple by default and just get more complex the more you add to them. Our sprite is 32x32 pixels in size, and it must be drawn at some position.
some issues… I see a lot of error when export shader: I am not familiar with shaders, but looks like there was a problem with imports: When I changed includes as in builtin spriteshader everything start to work Hi, thanks, now I can login. However, looks like in Cocos Creator 3.7.1
I have a sprite (a regular line) and I wanted to apply a wave effect to it. I tried to normalize by passing the dimensions of the sprite (line) to the shader like this mat.setProperty("iRsolutetion", new Vec2(1.0 / this.node.getComponent(UITransform).contentSize.width, this task tormented me. it doesn’t work properly.
One shader is used, only the sprite texture changes. On a smaller texture, the distortion is greater than on a larger texture. The HelloWorld texture has a size of 196 X 270. I scaled it up in the graphics editor to 400 x 554 and the distortion is barely noticeable. Do you need some tweaks or is this a bug?
Thank you so much for telling me how to find that component, but it’s too bad it’s not related to the original problem, which is the shader. ;-( It’s simply an error log caused by a missing asset in some component. Is there a difference between applying the material to the sprite and the label?
Hello, you may want to change the uv0 settings from the shader code. So 0 means the far left side of the sprite and 1 represents the far right side of the sprite. In the example they show on the manual, they made it so that the effect changes along the x-axis from the uv0.x It is important to know that the uv0.x
I am trying to create a 'CustomMaterial' to stack 2 shader effects. Maybe someone has a better way/idea to solve the problem of only having one CCEffect on one Node/Sprite/etc…? When I do effectAsset: new EffectAsset I get an error, because of the type mismatch. Thanks, tL.
I am trying to create a 'CustomMaterial' to stack 2 shader effects. Maybe someone has a better way/idea to solve the problem of only having one CCEffect on one Node/Sprite/etc…? When I do effectAsset: new EffectAsset I get an error, because of the type mismatch. Thanks, tL.
I am trying to create a 'CustomMaterial' to stack 2 shader effects. Maybe someone has a better way/idea to solve the problem of only having one CCEffect on one Node/Sprite/etc…? When I do effectAsset: new EffectAsset I get an error, because of the type mismatch. Thanks, tL.
I’m attempting to make a UI mask with a sprite stencil. I have a shader that I’ve made that essentially takes the sprite and adds a glitchy effect to it… (like a static glitch on a hologram display) It works great with sprites and does exactly what I want it to do.
We are currently using this shader to create dynamic light effect on 2d sprites, so we are updating it very often. Also every sprite has it’s own material. First of all declare your array on the shader. stringwizard5: Glad to hear it’s working for you!
I’m attempting to make a UI mask with a sprite stencil. I have a shader that I’ve made that essentially takes the sprite and adds a glitchy effect to it… (like a static glitch on a hologram display) It works great with sprites and does exactly what I want it to do.
Another thing is I noticed that the FPS dropped after the shader was applied to some sprites. So, is there way to cache the rendered texture (including the shader effect) rather than recalculating the same thing every frame. I will check and get back to you.
Original: [link] Author: BitByBit Outer Stroke Effect for 2D Sprites Continuing from the previous article Inner Stroke Effect for 2D Sprites Introduction In the last article, we introduced the method of inner stroke and also discussed its pros and cons. The above is the part of the custom post-processing shader.
I have written a thunder shader and attacked to my Sprite. Checkout: chunks.zip (1.9 KB) It shows in the editor. But it doesn’t show in preview in Browser. It shows some warnings: I use Cocos Creator 3.7.3.
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:
I am having an issue with creating shader. CCProgram sprite-vs %{. #if Hello Cocos Team. I couldn’t include the cc-local. No errors were shown at the editor, but when I previewed I got the following error at the browser console.
I am having an issue with creating shader. CCProgram sprite-vs %{. #if Hello Cocos Team. I couldn’t include the cc-local. No errors were shown at the editor, but when I previewed I got the following error at the browser console.
I am having an issue with creating shader. CCProgram sprite-vs %{. #if Hello Cocos Team. I couldn’t include the cc-local. No errors were shown at the editor, but when I previewed I got the following error at the browser console.
I am having an issue with creating shader. CCProgram sprite-vs %{. #if Hello Cocos Team. I couldn’t include the cc-local. No errors were shown at the editor, but when I previewed I got the following error at the browser console.
I am having an issue with creating shader. CCProgram sprite-vs %{. #if Hello Cocos Team. I couldn’t include the cc-local. No errors were shown at the editor, but when I previewed I got the following error at the browser console.
I am having an issue with creating shader. CCProgram sprite-vs %{. #if Hello Cocos Team. I couldn’t include the cc-local. No errors were shown at the editor, but when I previewed I got the following error at the browser console.
We organize all of the trending information in your field so you don't have to. Join 5,000+ users and stay up to date on the latest articles your peers are reading.
You know about us, now we want to get to know you!
Let's personalize your content
Let's get even more personalized
We recognize your account from another site in our network, please click 'Send Email' below to continue with verifying your account and setting a password.
Let's personalize your content