Giter VIP home page Giter VIP logo

software-renderer's Introduction

Software Renderer

项目具体描述:1000行 JavaScript 实现的简易软件渲染器

时间:2018.5.1 - 2018.5.21(拖拖拉拉这么久)

部分截图:

  1. 线框渲染

    image-20180521192811947

  2. 开启深度测试,背面剔除,平行光的渲染结果 image-20180521192611977

  3. 开启深度测试,背面剔除,点光源的渲染结果

    image-20180521192953149

已实现:

  • 线框模式渲染
  • 纹理模式渲染
  • 二次渲染:render to texture
  • 背面剔除:cw + ccw
  • 基础光照:ambient + diffuse
  • 深度测试

留坑:

  • Tessellation
  • Deferred Rendering
  • PBR

项目文件结构:

  • asserts :资源部分
  • js :JavaScript 代码
    • math

      • color.js : Color 类 , RGBA 操作
      • matrix.js : Matrix 类 ,矩阵基本运算 ,三维中运算矩阵(投影,变换等。。。)
      • vector.js : Vector 类 ,向量基本运算 ,向量变换
    • camera.js :摄像机类,封装摄像机数据

    • device.js :核心类 Device ,三角形遍历,操作 Shader 渲染 ,设置渲染目标等

    • light.js :光照数据封装

    • model.js :模型数据封装,内置 cube , plane 模板数据生成,以及简单的模型文件读取

    • raster.js :核心类 Raster ,实现顶点插值 Interpolate ,画线算法 Bresenham ,三角形扫描线算法 ScanLine

    • shader.js : 模拟渲染管道可编程部分,支持顶点着色器(Vertex Shader) ,像素着色器 (Pixel Shader) ,内置定向光照着色器 (Direction Light Shader),点光源着色器(Point Light Shader)等。

    • texture.js :核心类 Texture ,实现纹理映射,WrapClamp 方式。

  • main.js :启动文件
  • index.html : html 文件

( 留坑待填 )。。。。。。。。。。。。。。。。。。。。。。

software-renderer's People

Contributors

ksgin 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.