C3DEngine – A simple software renderer

using_diffuse-300x237 clip1-300x237
vertex_color-300x238 z-300x238

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

Key Z, show content of the depth buffer;
Key C, show content of the color buffer;
Key D, shader with diffuse texture;
Key V, shader with vertex color;
Key W, forward
Key S, backward
Key P, texture with nearest points sampling;
Key L, texture with linear sampling;

 

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

转载于:https://www.cnblogs.com/open-coder/archive/2012/08/24/2653570.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值