C3DEngine-A simple software renderer

Source: Internet
Author: User

I write this demo just to go though some key concepts of computer graphics.
The following features are implemented in this demo:
1) transform mesh from local space to world space, then to the camera space;
2) Do projection to convert 3d triangles to 2d triangles.
3) Do clip in the clip window space, and split into two triangles if need;
4) Shader 2D triangle with diffuse texture or vertex color;
5) A float array used fo depth buffer;
6) Back surface culling in world space or camera space;
6) Texture Address mode (Clamp, Wrap & Mirror) and sampling (Point and Linear ).

 

Operation

KeyZ, Show content of the depth buffer;
KeyC, Show content of the color buffer;
KeyD, Shader with diffuse texture;
KeyV, Shader with vertex color;
KeyW, Forward
KeyS, Backward
KeyP, Texture with nearest points sampling;
KeyL, Texture with linear sampling;

 

You cocould download the source code from here. SDL1.2 library used here to display the frame buffer content & depth buffer.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.