NPR (Non-Photorealistic Rendering), also known as expressive or hand-drawn rendering, is a technique that simulates hand-drawn or cartoonish effects in two-dimensional or three-dimensional scenes rather than creating realistic photographic effects like traditional rendering techniques. For example, NPR technology was used in "The Legend of Zelda: Breath of the Wild" to create a dreamlike visual experience. Due to the unique style created by NPR, some artists intentionally pursue and emulate NPR effects in their works, appreciating the non-photorealistic and artistic expression it offers. Therefore, NPR technology is also considered a means of creation and expression, providing artists with more creative space and inspiration.
However, implementing NPR requires specific rendering algorithms, which often necessitate the creation of custom shaders. Developing shaders requires a certain degree of computer graphics and programming knowledge, which may be daunting for artists who need more relevant backgrounds. Moreover, writing shaders requires a solid mathematical foundation in linear algebra, calculus, and other mathematical concepts, specific hardware and software support, and repeated experimentation and debugging, all of which make shader development quite challenging.
In light of these challenges, this paper proposes using deep learning to train an NPR-style model as a feasible solution for NPR rendering. Taking the typical three-to-two technique in NPR as an example, we prepare a complete dataset, train the LoRA model, evaluate its performance, and optimize it through various steps to obtain a model that can simulate the three-to-two style effectively. The results show that the model has a good fit and high robustness. This research provides a new perspective for achieving NPR style and may inspire further research.
NPR(Non-Photorealistic Rendering),即非真实感渲染,也被称为表现性渲染或手绘渲染。与传统的渲染技术不同,NPR不试图创造真实的照片效果,而是尝试在二维或三维场景中模拟出手绘或卡通的效果。比如,《塞尔达传说 旷野之息》中的游戏画面就采用了NPR技术,使得游戏画面呈现出一种梦幻般的演出效果。由于NPR所营造的独特画面风格,有些艺术家甚至在其作品中刻意追求、还原NPR所创造出的非真实感和艺术表现力。因此,NPR技术也被认为是一种创作和表现的手段,为艺术家们提供更多的创作空间和灵感。
然而,实现NPR通常需要特定渲染算法,而这些算法往往需要编写自定义着色器(Shader)来实现。编写着色器需要具备一定的计算机图形学和编程技能,对普遍缺乏相关背景的艺术家们而言,学习成本较高。同时,编写着色器也要求一定的数学基础,如线性代数、微积分等,还需要一定的硬件和软件支持,及反复的实验和调试,这些都使得编写着色器的难度大大提高。
基于此,本文提出使用深度学习训练NPR风格的模型作为实现NPR渲染的一种可行方案。以NPR中典型的三渲二技术为例,通过完整的数据集准备、模型训练、模型评估及模型优化等步骤,训练出仿三渲二风格的LoRA模型。结果显示,模型拟合程度较好,鲁棒性较高。研究结果可为实现NPR风格提供新的思路。
注:由于Civitai展示页所记录的图像生成参数并不完整,固将模型展示所使用的13张图片(含生成数据)的图像链接单独列于此处:
链接:https://pan.baidu.com/s/1sAAtLDINX_Tatp9WrL1-Cg?pwd=ak97
提取码:ak97