☑ Toon shader on simple box

I tried to extend the monkey general demo with toon shader for a simple entity lke a box, but it doesn’t render anything.

https://playcanvas.com/project/363652/overview/toon-simple-borders

https://playcanvas.com/editor/scene/381137/launch

Any advice ?

Did i need to create the box using a 3D software ?

Thanks by advance

https://playcanvas.com/editor/scene/480580/launch

Your problem is here:

// Create a new entity with the same model
// Assign the edge material to it
var backfaces = new pc.Entity();
backfaces.addComponent("model", {
     asset: this.entity.model.asset
});

Your box hasn’t asset, so you have to create another one box in order to backface it.

 backfaces.addComponent("model", {
      type: "box"
});

Thanks, it works fine !

I will do more tests with complex models.

1 Like