Skip to content

Non-photorealistic rendering sandbox to experiment with diferents shaders and params

License

Notifications You must be signed in to change notification settings

ehrlz/non-photorealistic-rendering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Non Photorealistic Rendering

Non-photorealistic rendering sandbox to experiment with diferents shaders and params.


InstallationShaders

MiniVideo.mp4

Goal

This project focuses on the implementation and exploration of non-photorealistic rendering (NPR) techniques for generating computer graphics. Unlike photorealistic rendering, which aims to replicate reality as closely as possible, NPR emphasizes more artistic and stylized visual styles. The goal is to provide a tool to experiment with a collection of npr algorithms and techniques that allow developers and graphic artists to create images and scenes with unique and stylized appearances.

Features

  • Different shaders and models to experiment
  • Postrender effects
  • Customizable shaders
    • Many params as light direction or pixelating size can be selected
  • Texture render switch
    • Color selector
  • .obj loader
    • Custom .obj parser with no external libraries
  • Cross platform
    • Windows and Linux ready.

How to use

To run this application you'll need Git and CMake (>=3.20):

# Clone this repo
git clone --recurse-submodules git@github.com:ehrlz/non-photorealistic-rendering.git

# Go into the repo
cd non-photorealistic-rendering

# Create the build folder
mkdir build

# Go inside and compile the project
cd build
cmake .. -DOpenGL_GL_PREFERENCE=GLVND
make -j4

# Run the app
./bin/gpo_proyecto_final

Tip

Ubuntu 20.04 CMake 3.2 version: sudo snap install cmake --classic

Warning

--recurse-submodules flag is needed for imgui external library

Shaders

Phong

Basic local ilumination shader.

cat

Blinn-Phong

Modification to the previous shader. Obtains an aproximation with less calculations.

Toon shading (cell shading)

Combination of an ilumination shader (blinn in this case), color discretization and silhoutte rendering.

toon

Gooch shading

2 colors in conjunction with the original model color. Warm color (such as yellow) and cool color (blue). The warm color indicates that are facing toward the light source while the cool color indicates surfaces facing away.

gooch

Pixel shading

Postprocessing effect that discretizates the render in pixels with customizable size.

pixel

Pixel texture rendering

Shader that pixelates the texture that is applied to a model.

texture_pixel

Credits

This software uses imgui to handle user interactions with the scenes params.