# Cartoon shader and texture?

**URL:** https://forum.highend3d.com/t/cartoon-shader-and-texture/60966
**Category:** Xsi
**Tags:** rendering
**Created:** [February 21, 2001, 5:15pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966 "2001-02-21T17:15:34Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![vic3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/v/e95f7d/32.png) [@vic3d](https://forum.highend3d.com/u/vic3d)
#### Post date: [February 21, 2001, 5:15pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966/1 "2001-02-21T17:15:34Z")

</div>

how I can use cartoon material with textured object ?

when i using cartoon mat. and try to gettextureimage it says “The preset could not be applied to this selection” …

I tryin to mix it in ‘render tree’, but it not work correctly…

---

<div class="post-metadata">

### Author: ![denis3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/898d66/32.png) [@denis3d](https://forum.highend3d.com/u/denis3d)
#### Post date: [February 24, 2001, 6:33pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966/2 "2001-02-24T18:33:48Z")

</div>

H-E-E-E-E-E-E-E-LP us!!!

---

<div class="post-metadata">

### Author: ![denis3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/898d66/32.png) [@denis3d](https://forum.highend3d.com/u/denis3d)
#### Post date: [February 24, 2001, 6:50pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966/3 "2001-02-24T18:50:12Z")

</div>

Use Mix\_2colors in Render Tree!!! ;-))))

---

<div class="post-metadata">

### Author: ![vic3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/v/e95f7d/32.png) [@vic3d](https://forum.highend3d.com/u/vic3d)
#### Post date: [February 24, 2001, 9:39pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966/4 "2001-02-24T21:39:21Z")

</div>

I need real cartoon! with ink on texture!

/vic/

---

<div class="post-metadata">

### Author: ![denis3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/898d66/32.png) [@denis3d](https://forum.highend3d.com/u/denis3d)
#### Post date: [February 25, 2001, 5:19pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966/5 "2001-02-25T17:19:59Z")

</div>

Texture map must be paint with ink lines.

---

<div class="post-metadata">

### Author: ![vic3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/v/e95f7d/32.png) [@vic3d](https://forum.highend3d.com/u/vic3d)
#### Post date: [February 25, 2001, 8:20pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966/6 "2001-02-25T20:20:47Z")

</div>

already, I used this method many time ago ! ![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/wink.gif)  
but I still search a right way.

/vic/

---

<div class="post-metadata">

### Author: ![devdoka](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@devdoka](https://forum.highend3d.com/u/devdoka)
#### Post date: [February 26, 2001, 11:46pm UTC](https://forum.highend3d.com/t/cartoon-shader-and-texture/60966/7 "2001-02-26T23:46:31Z")

</div>

OK, here’s the magic formula to apply within the rendertree:

1. Select object and get a flat light shader (Rendertree \> nodes \> illumination \> flat light). This is the same as the toon shader, but without the ink parameters.

2. connect a texture (bitmap or procedural) to the diffuse and ambient components of the “flat light” shader.

3. Nodes \> mixers \> mix2colors. Connect the output to the surface, shadow, and photon inputs of the material shader. Connect the output of ‘flat light’ to the ‘color1’ input of the mixer.

4. Nodes \> illumination \> more… Navigate to the “soft3d” folder and select the “toon\_material” shader. This is required for ink lines to appear on your object.

5. Connect output of toon\_material to ‘base\_color’ of the mixer node.

6. Open a PPG for the mixer node. Adjust the ‘weight’ towards the color1 value (blast RGB to 1.0). This forces the object’s surface to display only the color and texture coming from the ‘flat light’ branch of the tree while accepting only the toon\_material’s ink parameters for the inking (via the lens shader)

7. MCP \> Explore \> Current Pass \> [Camera\_name]. From the 2nd ‘camera’ tab (assuming you didn’t rename the camera) click the “lens shaders” tab. Press the “add” button then navigate to the “lens shaders” folder and select the “cartoon” shader. This is the shader that actually applies the ink to your scene. Default settings will be fine for now but you can adjust them if you need.

8. draw a render region and tweak the effect.

quick schematic of what your rendertree should look like:

```
      toon\_material--
                      -->mix2color--->material

```

pic–\>image–\>flatlight–/

Hope this helps,

speye
