Outlinepass for animated character

Hi,

I’ve been searching the net far and wide and couldn’t find anything that would point me into the right direction.
Basically I’d like to use the post-processing OutlinePass together with an animated character. I’m able to get the OutlinePass working and it outlines the character BUT only while it is standing still during the animation the outline stays in the first (t-shape) pose.
The only thing I could find in regards to that is this ancient post: https://www.bountysource.com/issues/36349743-outline-pass-algorithm

It hints that animated characters are not working but as it is quite old I was wondering if anyone had the need to do the same and could point me in the right direction to do it.

Thank you

You can check Highlight component in my game engine, it works with animated characters without any problems.

1 Like

Thanks for sharing. Unfortunately, I don’t understand what that does :blush:. Maybe some more background. I would like to outline a 3D character when I select it with a click. Basically, the same as in this example three.js examples
but with an animated character.

Okay, a very long story short:

You can create an entity in the engine using an EntityBuilder like so:

new EntityBuilder().build(dataset);

you can add your character with an animation to that entity like so:

new EntityBuilder()
	.add(Transform.fromJSON({}))
	.add(Mesh.fromJSON({
		url: "path/to/my-awsome/model.gltf"
	}))
	.add(Animation.fromJSON({
		clips: [
			{
				name: "Idle"
			}
		]
	}))
	.build(dataset);

then if you wanted it to have, say, red outline, you could add it like so:

new EntityBuilder()
	.add(Highlight.fromJSON({r:1, g:0, b:0, a:1}))
	.add(Transform.fromJSON({}))
	.add(Mesh.fromJSON({
		url: "path/to/my-awsome/model.gltf"
	}))
	.add(Animation.fromJSON({
		clips: [
			{
				name: "Idle"
			}
		]
	}))
	.build(dataset);

relevant part there is the Highlight.fromJSON({r:1, g:0, b:0, a:1}), rgba parameters are just that, they are Red Green Blue and Alpha values in 0…1 range.

1 Like