Suggestion: Refactor MeshToonMaterial
See original GitHub issueAs suggested in https://github.com/mrdoob/three.js/pull/15105#issuecomment-453540970.
I have never seen a toon shader that supports hotspots, environment maps, or even maps for that matter… Or multiple lights.
A toon shader can be written in a few lines of code, and should not have extended Phong, which is way too flexible. I would have implemented it like MeshMatcapMaterial.
Alternative opinions, welcome.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:16 (1 by maintainers)
Top Results From Across the Web
MeshToonMaterial – three.js docs
MeshToonMaterial. A material implementing toon shading. Open in New Window. Controls. Scene. ambient light ... MeshToonMaterial( parameters : Object ).
Read more >MeshToonMaterial - Three.js Tutorials - sbcode.net
Toon shading or Cel shading is a type of non-photorealistic rendering technique designed to make 3D computer graphics appear more cartoonish by using...
Read more >three.js - JavaScript 3D library. - JsRepos
This code creates a scene, a camera, and a geometric cube, and it adds the cube to the scene. It then creates a...
Read more >The three-ts-types from three-types - Giter Site
This repository is the home for the TypeScript types for three.js. Periodically the updates from this repository are pushed to DefinitelyTyped and released ......
Read more >three.js JavaScript 3D library
The aim of the project is to create an easy to use, lightweight, 3D library with a default WebGL renderer. The library also...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

As #19609 I am going to implement MMD specific material in
MMDLoader, so we no longer need to take care MMD for refactoring Toon material.I’m all for rethinking the toon shader but can you elaborate on this a bit more?
My understanding is that a toon shader is basically just mapping a color ramp to light intensity so it would seem that that should enable support for specular highlights through the stepped shading (though maybe not in the way they’re represented right now). The Octane and Arnold toon material docs both reference rendering specular highlights with the toon material, for example. Regarding maps the Octane docs give examples of using a roughness map to augment the shape of the color bands and something like a normal map should have the same effect.
I can’t find anything explicitly showing a toon material rendering with multiple lights (other than the final image in the Octane docs that shows two highlights) but this seems like a stylistic choice. I’m not sure if THREE allows a way to limit or choose which lights a material renders with but that would be a nice option. This write up on Zelda Wind Waker discusses how lighting changes dynamically based on closest light source, but maybe that’s considered to use case specific.