Skip to content

litzendraht/tiny_renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Rust practice project, implementing a renderer, based on the Dmitry V. Sokolov's course.

Supports several shading pipelines at the same time at a cost of slight bloat, examples below.

Usage

Pressing q, e rotates the light, pressing a, d rotates the camera.

Binary can be launched as is to do a render of diablo with default pipeline but also very crudely supports passing of 2 arguments:

-p Path to the asset folder, e.g -p assets/african_head.

-s Choice of the shader pipeline, e.g -s default. All possible options:

  • default
  • phong
  • true_normal
  • darboux
  • specular
  • shadow
  • occlusion

For now asset folder is required to contain 5 files:

  • model.obj
  • normal_map_tangent.tga
  • normal_map.tga
  • specular_map.tga
  • texture.tga (diffuse texture)

Shading with face normals

image

Phong shading

image

Shading using normal map

image

Shading using specular map

Doesn't work too well for the diablo model for some reason, so here is the african head model. image

Shading by using normals in tangent basis

Notice how tail and right hand are correctly shaded in comparison to normal map based shading. image

Hard shadows + Phong shading

image

Ambient occlusion

image

About

Smallish renderer done in Rust based on https://github.com/ssloy/tinyrenderer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages