+2 votes

Hi !

I want to apply an outline shader to a character that I'll animate using cutout animation.
The problem here is that I have an outline for each body part where I'd like only 1 outline for the whole character :


I tried having the shader on the parent node / putting the body parts in a "character" scene, but it's not working...

(it's Godot 3.1 alpha 2)
Thanks !

in Engine by (246 points)
edited by

2 Answers

+1 vote
Best answer

epilogue :

Ok, so I did my best to understand how backbuffer copies and viewports work and while I was (reaally) struggling, I came across a way to solve this that is pretty easy (not sure if it's efficient though) :

  • I have my character with separate parts in a scene called "character". On each part I checked the Material setting "use parent material".

  • Then in the main scene, I have 2 instances of the "character" scene, one below with only the outline shader assigned, one on top without any shader. VoilĂ  ! :)

by (246 points)
0 votes

You do not apply a shader to a node, you assign a shader to a material, simply create a material resource that uses your shader, one material for each different shader parameters (because resources are shared, you can also mark as local in the scene files).

Then just use that material on the elements that need it.

by (7,898 points)

thanks for your answer Eons.

My formulation was wrong and I'm not sure you understood my question. Even if I assign the outline shader to a material used by every parts of the body, they still would be outlined individually and not as a whole.

Please have a look at the screenshot link I posted to have a clear idea of my problem (and sorry if you did answer this question but I didn't understand)

Oh, right, I have missed that part.

in that case you may have to draw a viewport (ViewportTexture needs to be set as local or will fail).
Or use a BackbufferCopy node and apply the shader over there (this may need to use a screen uv and texture in the shader).

thanks, knowing where to dig is a great timesaver, I'll look into viewports ! :D

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.