☑ 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.



Any advice ?

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

Thanks by advance


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