ShaderBlow ToonEdge on terrain not showing

Not sure if it’s possible or not, but I want to have toon shading on terrain.

The terrain was created in the scene composer and lives in a j3o file. But I can’t seem to get the cartoon edges to show on the terrain. I can use the inbuilt filter for that, however I need to only have toon shading on certain spatials which is why I ended up trying to use the ShaderBlow toon effect stuff.

I’ve got the TestLightBlowToonPostEdges file from the ShaderBlow project, and I can see the edges on the fox models, and if I add for example a cube, I can see the edges on that also. But terrain seems to not want to show the cartoon edges. I add the terrain in exactly the same way as the models are loaded, and the material is the same (I can see the diffuse map on the terrain, but not the edges).

Is it possible to show them on terrain? Is there anything specific to terrain I need to do that is different?


Ok, so after a bit of fiddling around I found what I think is the solution, in case anyone else has this problem.

  1. The terrain should be in the Transparent render bucket.
  2. Add the shaderblow cartoon edge filter to the FilterPostProcessor.
  3. at the end of the filter post processors add a TranslucentBucketFilter.

This seems to work ok. So far, although it seems a bit strange to have the terrain in the transparent bucket…

The link below was fairly helpful in pointing to the render buckets and filter stack being the solution rather than the material or lighting.

If I have time I’ll update with some more details/code.

Does your terrain contain transparent textures ? if not, although you have got the filter to work, you are going to end up in a world of hurt later down the track. Trust me, hacking around that specific problem by abusing the render buckets is a bad idea.

If I were in your shoes right now, I would just ignore this problem for now, and revisit it later, filters generally add polish, so don’t waste too much time on them until your game is nearing completion.

There are a handful of other ways to achieve ToonEdges, perhaps ShaderBlow’s approach isn’t the best fit for your situation.