SHAD3S: A model to Sketch, Shade and Shadow

Raghav Brahmadesam Venkataramaiyer, Abhishek Joshi, Saisha Narang, Vinay P. Namboodiri

Introduction

In the world of 2D art and design, "hatching"—the technique of using fine parallel lines to create tonal effects—is a fundamental yet laborious task. It serves as a primary tool for conveying 3D volume, texture, and lighting within a flat sketch. However, mastering hatching requires a deep understanding of geometry and light behavior, often making it a bottleneck in the creative process.

Existing digital solutions typically require a complete 3D model to generate shadows or attempt the complex "inverse problem" of reconstructing 3D meshes from 2D lines. SHAD3S introduces a more direct approach: a deep learning framework that generates high-quality, stylistically consistent hatching directly in the 2D domain, without requiring 3D metadata from the artist.

Methodology: Contextual Scene Completion

The researchers behind SHAD3S frame hatching as a contextual scene completion problem. They employ a Conditional Generative Adversarial Network (CGAN) based on a U-Net architecture. Unlike traditional models that might rely on abstract lighting vectors, SHAD3S uses a multi-modal input system designed for intuitive artistic control.

The system takes three primary inputs:

  1. The Sketch: A sparse 2D outline of the target object.
  2. The Illumination Analogy: A visual "hint" provided by a "gnomon" (a simple 3D sundial shape) rendered under the desired lighting conditions.
  3. Texture Samples: Tonal art maps that define the specific style of the hatching lines.
The SHAD3S pipeline: Input illumination analogies (top) and sketches (middle) are transformed into fully shaded and hatched drawings (bottom).

By using the gnomon as an illumination analogy, the network avoids the need for explicit 3D coordinate math. Instead, it learns to relate the light patterns on the simple sundial to the geometry of the artist's sketch, allowing for a more natural "form exploration" exercise.

The SHAD3S Dataset

To train the model, the authors developed the SHAD3S dataset, consisting of approximately 393,000 data points. These were created using Constructive Solid Geometry (CSG) to procedurally generate random 3D shapes from basic primitives like cubes and cylinders. Each entry in the dataset includes the object's contour, the illumination analogy, various light masks, and the final "ground truth" hatched render. To test generalization, the model was also evaluated on the ShapeNet dataset, which contains significantly more complex geometry than the training set.

Results and Generalization

One of the most significant findings is the model's ability to generalize. Despite being trained on simple geometric primitives, SHAD3S performs remarkably well on complex, organic shapes. This suggests the network has learned a generalized relationship between surface curvature and light, rather than just memorizing specific object categories.

The model generalizes effectively to organic forms, such as this animal sketch, despite training on geometric primitives.

The model is also highly efficient. The "Direct Model" variant achieves an inference time of just 13ms, enabling real-time interaction. In user studies involving a GIMP plugin, participants (ranging from ages 12 to 57) found the tool highly effective for quickly visualizing how 2D shapes would appear as 3D objects under varying light sources.

Conclusion and Future Work

SHAD3S represents a significant step forward in AI-assisted artistry. By bypassing complex 3D reconstruction in favor of a 2D-to-2D generative approach guided by visual analogies, it provides artists with a powerful tool for rapid visualization.

While the model handles simple occlusion well, challenges remain in handling complex self-shadowing and preventing occasional "hallucinations" where the model slightly modifies original contour lines. Future work may explore sketch simplification for messier drawings and higher-fidelity stroke generation to mimic specific artistic mediums like charcoal or cross-hatching.

Summary updated

BibTeX
@inproceedings{venkataramaiyer2021shad,
  author = {Raghav Brahmadesam Venkataramaiyer and Abhishek Joshi and Saisha Narang and Vinay P. Namboodiri},
  title = {{SHAD3S: A model to Sketch, Shade and Shadow}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2021},
  url = {https://openreview.net/forum?id=CTpiHRIX2Yw},
}
Figure