All Projects → unclearness → currender

unclearness / currender

Licence: BSD-3-Clause License
Currender: A CPU renderer for computer vision

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to currender

Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+8138.46%)
Mutual labels:  renderer, raytracing
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (+200%)
Mutual labels:  renderer, raytracing
retro-ngon
A well-featured retro-oriented 3D software renderer for the HTML5 canvas.
Stars: ✭ 30 (+15.38%)
Mutual labels:  software-rendering, rasterizer
DuEngine
An efficient interactive C++ renderer for ShaderToy-alike demos with 2D/3D/CubeMap/Video/Camera/LightField/Volume textures. (Partially used in my I3D 2018 papers)
Stars: ✭ 62 (+138.46%)
Mutual labels:  renderer, raytracing
Photon-v2
A program that takes photographs of a virtual world.
Stars: ✭ 75 (+188.46%)
Mutual labels:  renderer, raytracing
Wisprenderer
RTX Ray Tracing Renderer, made by Y3 students at Breda University of Applied Science
Stars: ✭ 184 (+607.69%)
Mutual labels:  renderer, raytracing
Voxel Cone Tracing
A real-time global illumination implementation using voxel cone tracing. Implemented in C++ and GLSL.
Stars: ✭ 555 (+2034.62%)
Mutual labels:  renderer, raytracing
Tinyrenderer
A brief computer graphics / rendering course
Stars: ✭ 11,776 (+45192.31%)
Mutual labels:  software-rendering, rasterizer
SlimTracin
Software ray tracer written from scratch in C that can run on CPU or GPU with emphasis on ease of use and trivial setup
Stars: ✭ 49 (+88.46%)
Mutual labels:  software-rendering, raytracing
PicoRenderer
Low-Level, 8-bit Colored, 3D Software Renderer written in C99
Stars: ✭ 55 (+111.54%)
Mutual labels:  rasterizer, renderer
SHSoftwareRasterizer
软光栅器的简单实现
Stars: ✭ 31 (+19.23%)
Mutual labels:  rasterizer
SlimApp
A minimalist andf platform-agnostic application layer for writing graphical applications, with a strong emphasis on simplicity and ease of use.
Stars: ✭ 33 (+26.92%)
Mutual labels:  software-rendering
femio
FEM I/O tool
Stars: ✭ 15 (-42.31%)
Mutual labels:  mesh
Portal-Raycaster
A software portal rendering game engine
Stars: ✭ 41 (+57.69%)
Mutual labels:  software-rendering
Theatherflix
Theatherflix OpenSource Project - A visual tool for wiring digital movies, to sort and list the top latest movie trailers. We are constantly developing and making changes. Do you want to be part? Contact us!
Stars: ✭ 51 (+96.15%)
Mutual labels:  software-rendering
SkeletonBridgeRecon
The code for CVPR2019 Oral paper "A Skeleton-bridged Deep Learning Approach for Generating Meshes of Complex Topologies from Single RGB Images"
Stars: ✭ 72 (+176.92%)
Mutual labels:  mesh
netmaker
Netmaker makes networks with WireGuard. Netmaker automates fast, secure, and distributed virtual networks.
Stars: ✭ 4,147 (+15850%)
Mutual labels:  mesh
DxrLattice
Real-time raytracing fly through
Stars: ✭ 80 (+207.69%)
Mutual labels:  raytracing
Godot-Plugin-Particles-Renderer
A Godot plugin to render particles into a sprite sheet
Stars: ✭ 32 (+23.08%)
Mutual labels:  renderer
BBearEditor-2.0
My own 3D engine & editor in order to learn graphics algorithms and game engine architecture.
Stars: ✭ 32 (+23.08%)
Mutual labels:  renderer

Currender: A CPU renderer for computer vision

Currender is a CPU raytracing/rasterization based rendering library written in C++. With 3D triangular mesh and camera parameters, you can easily render color, depth, normal, mask and face id images.

color depth
normal mask face id

Currender is primarily designed for people who are involved in computer vision. Pros and cons against popular OpenGL based rendering are listed below.

Pros

  • Simple API, set mesh, set camera and render.
    • You do not waste time in complex OpenGL settings.
  • Less dependency.
    • Only you need is Eigen for minimal Rasterizer configration.
  • OpenCV compatible
    • Support cv::Mat_ for internal Image class (optional)
  • Standard coordinate system in computer vision community
    • Identical to OpenCV (right-handed, z:forward, y:down, x:right). You are not irritated by coordinate conversion for OpenGL.
  • Intrinsic parameters (principal point and focal length in pixel-scale) with pinhole camera model
    • Popular camera projection representation in computer vision. You are not annoyed with converting the intrinsics to perspective projection matrix for OpenGL.
  • Rendering depth, normal, mask and face id image is enabled as default.
    • Computer vision algorithms often process them besides color image.
  • Fast for lower resolution.
    • Enough speed with less than VGA (640 * 480). Such small image size is commonly used in computer vison algorithms.
  • Rendered images are directly stored in RAM.
    • Easy to pass them to other CPU based programs.
  • Easily port to any platform.
    • No hardware or OS specific code is included.

Cons

  • Slow for higher resolution due to the nature of CPU processing.
  • Showing images on window is not supported. You should use external libraries for visualization.
  • Not desgined to render beautiful and realistic color images. Only simple diffuse shading is implemented.

Renderer

You can choose Raytracer or Rasterizer as rendering algorithm.

  • Raytracer

    • Currently Raytracer is faster for rendering but it needs additional BVH construction time when you change mesh. Raytracer depends on NanoRT.
  • Rasterizer

    • Rasterizer is slower but more portable. The only third party library you need is Eigen.

Usage

This is the main function of minimum_example.cc to show simple usage of API.

int main() {
  // make an inclined cube mesh with vertex color
  auto mesh = MakeExampleCube();

  // initialize renderer enabling vertex color rendering and lambertian shading
  currender::RendererOption option;
  option.diffuse_color = currender::DiffuseColor::kVertex;
  option.diffuse_shading = currender::DiffuseShading::kLambertian;

  // select Rasterizer or Raytracer
#ifdef USE_RASTERIZER
  std::unique_ptr<currender::Renderer> renderer =
      std::make_unique<currender::Rasterizer>(option);
#else
  std::unique_ptr<currender::Renderer> renderer =
      std::make_unique<currender::Raytracer>(option);
#endif

  // set mesh
  renderer->set_mesh(mesh);

  // prepare mesh for rendering (e.g. make BVH)
  renderer->PrepareMesh();

  // make PinholeCamera (perspective camera) at origin.
  // its image size is 160 * 120 and its y (vertical) FoV is 50 deg.
  int width = 160;
  int height = 120;
  float fov_y_deg = 50.0f;
  Eigen ::Vector2f principal_point, focal_length;
  CalcIntrinsics(width, height, fov_y_deg, &principal_point, &focal_length);
  auto camera = std::make_shared<currender::PinholeCamera>(
      width, height, Eigen::Affine3d::Identity(), principal_point,
      focal_length);

  // set camera
  renderer->set_camera(camera);

  // render images
  currender::Image3b color;
  currender::Image1f depth;
  currender::Image3f normal;
  currender::Image1b mask;
  currender::Image1i face_id;
  renderer->Render(&color, &depth, &normal, &mask, &face_id);

  // save images
  SaveImages(color, depth, normal, mask, face_id);

  return 0;
}

examples.cc shows a varietiy of usage (Bunny image on the top of this document was rendered by examples.cc).

Use case

Expected use cases are the following but not limited to

  • Embedded in computer vision algortihm with rendering.
    • Especially in the case that OpenGL is used for visualization, so you hesitate to use OpenGL for algorithm with rendering simultaneously.
  • Debugging of computer vision algortihm.
  • Data augumentation for machine learning.

Dependencies

Mandatory

Optional

Build

  • git submodule update --init --recursive
    • To pull dependencies registered as git submodule.
  • Use CMake with CMakeLists.txt.
    • reconfigure.bat and rebuild.bat are command line CMake utilities for Windows 10 and Visual Studio 2017.

Platforms

Tested on

  • Windows 10 with Visual Studio 2017.
  • Ubuntu 18.04 LTS with gcc

Porting to the other platforms (Android, Mac and iOS) is under planning. Minor modifitation of code and CMakeLists.txt would be required.

To do

  • Porting to other platforms.
  • Real-time rendering visualization sample with external library (maybe OpenGL).
  • Support point cloud rendering.
  • Replace NanoRT with own ray intersection.
  • Introduce ambient and specular.

Data

Borrowed .obj from Zhou, Kun, et al. "TextureMontage." ACM Transactions on Graphics (TOG) 24.3 (2005): 1148-1155. for testing purposes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].