Commit Graph

102 Commits

Author SHA1 Message Date
760d9b6b9c Move shaders declaration to shaders.h 2024-08-18 22:18:12 +01:00
ec98a033eb Add macro for multiplying V3f with scalar 2024-08-18 22:17:27 +01:00
caa8c416a9 Remove extra intensity calculation 2024-08-18 21:08:59 +01:00
690eb3d317 Update shaders and ensure coordinates are within buffer bounds 2024-08-18 21:04:46 +01:00
6239be219a Ensure light is normalised 2024-08-18 17:09:13 +01:00
be7b577a0e Split obj loading and model rendering code 2024-08-18 17:04:41 +01:00
2e39780272 Add support for loading normals from a map 2024-08-18 16:47:30 +01:00
1adac24148 Remove seeding prng 2024-08-18 15:49:17 +01:00
50b8c6dd0a Implement shaders (#1)
Reviewed-on: #1

	* Start implementing shaders and move vector code to dedicated files
	* Extract shader into its own header
	* Ensure pixel coordinates are within bounds
	* Refactor shader code and implement fragment shaders
	* Create shaders
	* Reorganise code
Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com>
Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
2024-08-18 14:28:09 +00:00
3bbab3f624 Calculate projection matrix from eye and target 2024-08-17 22:04:33 +01:00
a3f0be461b Switch to calculating z buffer from viewport vertices 2024-08-17 20:27:58 +01:00
fdce10a85c Pass vertex as pointer 2024-08-17 20:21:30 +01:00
f77fa5694b Switch to using a viewport matrix 2024-08-17 16:27:45 +01:00
3e414881d9 Fix global light direction 2024-08-17 11:49:56 +01:00
2f126f95ff Implement camera movement 2024-08-12 00:24:12 +01:00
643da4e58d Implement shading based on vertex normals 2024-08-11 19:53:07 +01:00
d323c0ae14 Load vertex normals indices 2024-08-11 19:39:31 +01:00
e01c1397bc Load model normals 2024-08-11 19:33:32 +01:00
46ca6bfa10 Rename NULL_MODEL macro 2024-08-11 19:31:14 +01:00
91c4721c46 Make vector types public and remove unnecessary Vertex and TexCoord 2024-08-11 19:28:17 +01:00
b4210da399 Implement perspective projection 2024-08-11 17:58:38 +01:00
34d0d17b76 Add perspective projection support 2024-08-11 17:57:56 +01:00
fee04607a7 Add V4f, Mat4x4f and a basic static camera matrix 2024-08-11 17:56:31 +01:00
b6e7b9c213 Rename variable 2024-08-10 18:31:58 +01:00
e472b221c0 Remove unused varaible 2024-08-10 18:28:59 +01:00
1ad2ca1a47 Fix checking barycentric coordinates 2024-08-10 17:38:13 +01:00
b111058f31 Rename IS_NULL_MODEL macro 2024-08-09 23:39:56 +01:00
26c1f17a86 Correct obj name 2024-08-09 22:26:06 +00:00
1ab8c964bf Implement rendering model with texture 2024-08-04 20:05:45 +01:00
677627d8c9 Add utility to load P6 images 2024-08-04 20:05:30 +01:00
f024d51d85 Implement Z buffer 2024-08-04 17:53:52 +01:00
bd1326d83e Swap arg order for BUF_TYPE macro 2024-08-04 16:54:11 +01:00
4eb2ae06f1 Create generic buffer type 2024-08-04 16:52:02 +01:00
bce85c5c71 Prep for adding z buffer 2024-08-04 14:38:52 +01:00
5330e2e82c Remove unused wireframe render 2024-08-04 01:05:33 +01:00
c3c0dd732e Add shading 2024-07-31 23:05:39 +01:00
5f44936dcd Add support for randomising colours 2024-07-31 22:11:11 +01:00
dc09a45085 Fix filling triangles 2024-07-28 23:09:16 +01:00
5a24809935 Initial implementatin of barycentric coordinates 2024-07-28 22:43:00 +01:00
6537753a3a Start implementing filled rendering 2024-07-28 20:31:48 +01:00
3f04b7b5b0 Refactor to add render types 2024-07-28 20:10:59 +01:00
c2adf07a1d Load and render head.obj 2024-07-20 19:41:51 +01:00
e266879a4f Add model loading from OBJ and wireframe rendering 2024-07-20 19:41:21 +01:00
f88b74912b Add min, max and clamp utilities 2024-07-20 19:40:59 +01:00
458b32bf5f Fix include 2024-07-20 19:40:35 +01:00
fe5c116c17 Rename LIST_TYPE_NAME to LIST_TYPE 2024-07-20 18:11:45 +01:00
2095580409 Add typed_list 2024-07-20 18:07:56 +01:00
4baf837256 Move Image struct and add clear image, set pixel and draw_line functions 2024-07-20 17:23:24 +01:00
52d79817ad Add swap and absolute utilities 2024-07-20 17:21:50 +01:00
05fa3c70fa Add Image struct and initialise main arena 2024-07-20 01:14:30 +01:00
64ec6bfa59 Add util to write p7 image 2024-07-20 01:14:18 +01:00
2beb091a44 Add main file 2024-07-19 21:57:01 +01:00