Skip to content

Yi-Shi94/NPR_sketch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPR_sketch

Basic C++ OpenGL and python script for sketch generation from mesh.

It's a naive Non-Photorealistic Rendering algorithm which combines the edges of depth map and normal map. The procedure is described in the outline generation section at p.69 of https://www.mrl.nyu.edu/publications/npr-course1999/npr99.pdf. This project can be used as a beginner tutorial of OpenGL.

It contains three shaders that output normal map, depth map and wireframe mode of the rendered mesh. It has complete functions for entire rendering process that one can easily obtain a sketch from any angle. By default, a png image will be generated every 15 degrees around Y axis and 24 multi-view images in total. OFF and OBJ mesh files are supported. Multi-process processing script for Shapenet will be published.

Edge() U Edge() = ()

Execute run.sh in root directory of this repo. ./run.sh PATH_TO_DATA MESH_NAME MESH_FORMAT[OBJ/OFF] SCALE_COEFF[>0]