Page 1 of 1

Using the Toon shader for a terrain object

PostPosted: Fri Mar 08, 2019 3:45 pm
by jojue
Hi everyone,

I'm trying to use a toon shader, which is basically the CustomOutlineToon from the examples folder, on a terrain.

To prepare the shader I was following the tutorial posted here:
http://wiki.amplify.pt/index.php?title= ... in_Shaders

Sadly this was not working, as I could not paint any textures using the brush tool on the terrain. Even when plugging the "Four Splats First Pass Terrain" directly in the Albedo Output it was not working.

However when changing the Light model of the output node to 'standard' instead of 'custom lighting' you could paint textures right away, but loose the toon effect, which is not desired.

I hope somebody on this forum can point me in the right direction :)

Re: Using the Toon shader for a terrain object

PostPosted: Fri Mar 08, 2019 5:38 pm
by Amplify_Borba
Hello, thank you for getting in touch and for your support!

Could you share a sample of what you've build so far, along with an example or reference of the final effect that you're looking for?

Re: Using the Toon shader for a terrain object

PostPosted: Fri Mar 08, 2019 8:00 pm
by jojue
Hi, thanks for the fast response. So I basically took the CustomOutlineToon and tweaked some minor inputs.
I want to use that shader for the unity terrain object so that i can paint splatmaps on the toon shader.

If I add the shader to the custom material slot of the terrain I can see the shader working, but the texture painting is not working. Here are two examples of how i want it to look like, with the possibility of using the texture brush on the terrain

terrain2.jpg
terrain2.jpg (179.06 KiB) Viewed 3762 times



like I said if I switch the Light model of the output node to 'standard' instead of 'custom lighting' it seems to be working, but it looses the toon look. In the attached files you find my modified shader

Re: Using the Toon shader for a terrain object

PostPosted: Sat Mar 09, 2019 9:39 pm
by jojue
Hi,

after hooking up the 'four splats first pass terrain' node to the custom lighting slot of the output node the shader now is working like intended. Seems pretty obvious now in retrospect :roll:

I also inserted the normals through the 'four splats first pass terrain' node, but now I have the problem that I can't control the intensity scale of the normal map through the terrain layer options.

Is there a way to control the normal scale through the terrain layers menu? I tried lookin it up in the SimpeTerrain Example, but it didn't seem to work there either.

terrainNormal.jpg
terrainNormal.jpg (235.04 KiB) Viewed 3753 times

Re: Using the Toon shader for a terrain object

PostPosted: Tue Mar 12, 2019 11:25 am
by Amplify_Borba
I don't think that this is possible, you'll likely have to do so through the material as in the SimpleWater shader of the SimpleTerrain sample.