Git Product home page Git Product logo

renderer's Introduction

Renderer

By zhangpiu

--- 一个C++实现的简单光线追踪渲染引擎,实现了局部光照(Local illumination),全局光照(Global illumination)。主要包括: 1. RayTrace: 一个简单的光线追踪渲染器,实现了局部光照 2. PathTrace: 一个简单的光线追踪渲染器,实现全局光照(via unbiased Monte Carlo path tracing); 3. PXM tools: 一个简单读写 PPM / PGM / PBM 图像格式的工具; 4. Image processing: 有关图像处理的工具,如 box blur, median blur, biliteral blur, etc.

一、Ray tracer

icm

1. Local Illumination

    这里参考了Milo大神的两篇博文:《用JavaScript玩转计算机图形学(一)光线追踪入门》《用JavaScript玩转计算机图形学(二)基本光源》。在原来的基础上加了一些改进,并用C++予以实现。以下展示一些渲染效果:

灯光渲染

  • 平行光光源

directionalLight

  • 点光源

pointLight

还可以添加多个光源

36lights

  • 聚光灯光源

spotLight

可以用聚光灯的效果渲染一个调色板

spotLightRGB

场景渲染

spheres

2. Global Illumination

    这里的全局光照算法是基于Mento Carlo的路径追踪算法,参考了Kevin Beason大神的经典之作《smallpt: Global Illumination in 99 lines of C++》,并作了一些改进。但由于加了一些类的封装等,有些对象的拷贝会增加额外的开销,本实现版本的速度其实不及原来的99行的实现,这里不准备再用牺牲可读性来换取时间的优化。

room

icm

renderer's People

Contributors

zhangpiu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.