Giter Site home page Giter Site logo

graphics-cl's Introduction

Graphics-CL

This is a triangle rasterizer that is based on OpenCL parallel algorithms.

Compilation and Installation

The library requires only CMake and OpenCL to compile, and the demo requires SDL2.

$ mkdir build
$ cmake ..
$ make
$ gcl/demo_draw_model ../models/teapot.obj # if there's any

Only have tested on Linux x64 at present.

Achievement

In the demo I implemented a program that can read a model from Wavefront OBJ format file, display them, and form rotation animation as below. Both scenes are built by Blender and exported as OBJ.

teapot

Meanwhile you are allowed to write your own shader (in OpenCL C Language syntax of course). In the demo I wrote a simple Lambertian shader.

cube

In this scene there is a box placed on the floor and two planes as the wall placed around. Primitives outside the CVV box are well clipped is well clipped as you may have seen.

Scene Box Teapot
Intel HD Graphics 4400 63 48
NVIDIA GeForce 740M 50 43

This table above is demo's FPS tested on my laptop, and on two different devices repectively. The NVIDIA driver is provided by bumblebee optirun.

graphics-cl's People

Contributors

shihira avatar

Stargazers

 avatar  avatar  avatar

Watchers

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