Commit Graph

478 Commits

Author SHA1 Message Date
Luke Benstead
963eeb54da Start work on spotlights 2018-08-28 15:55:50 +01:00
Luke Benstead
c191ced3f9 Fix issues with directional lights 2018-08-28 09:24:51 +01:00
Luke Benstead
acaecf49bc Add a missing header 2018-08-27 21:35:15 +01:00
Luke Benstead
8b3bf5a579 Fix lighting wrapping 2018-08-27 21:35:07 +01:00
Luke Benstead
8ef04be966 Try to fix directional lights 2018-08-27 20:54:20 +01:00
Luke Benstead
b29303fb6c Implement glColorMaterial 2018-08-22 09:24:49 +01:00
Luke Benstead
21f8f9d855 Properly restore state after glEnd 2018-08-21 16:15:43 +01:00
Luke Benstead
9b0322ce8a Properly restore enabled client state when using immediate mode 2018-08-21 16:08:06 +01:00
Luke Benstead
edae8a9166 Properly pop active client texture in immediate mode 2018-08-21 15:50:59 +01:00
Luke Benstead
25de48b3f6 Fix a bug where only one texture would bind 2018-08-21 15:50:41 +01:00
Luke Benstead
8b834ac3f1 Avoid an additional copy of every vertex. Fixes #22 2018-08-21 09:37:19 +01:00
Luke Benstead
bccd1aa788 Start refactoring the submission process 2018-08-20 21:19:12 +01:00
Luke Benstead
80c65d4aff Remove conditional header sending, it's slightly slower 2018-08-20 20:34:11 +01:00
Luke Benstead
da97483eee Switch to using 4-byte colours internally rather than floats
These are stored in BGRA format so they can be directly cast to a uint32_t to get the
correct format for the argb param in pvr_vertex_t (yay endianess)

This results in a performance improvement as it reduces the data requirements.
2018-08-20 09:28:30 +01:00
Luke Benstead
26bd8df37c Fix some bugs with mipmaps + compressed textures 2018-08-20 08:34:54 +01:00
Luke Benstead
25e4518501 Performance optimisations 2018-08-19 21:10:42 +01:00
Luke Benstead
348e09b4aa Further optimisations 2018-08-17 21:40:27 +01:00
Luke Benstead
37ba9bf3c3 Mark mipmap levels as complete when generated 2018-08-16 17:53:39 +01:00
Luke Benstead
ba66608a96 Add a basic profiler and optimise some code 2018-08-16 17:51:15 +01:00
Luke Benstead
7d1b57fb12 Handle GL_RED -> GL_RED 2018-08-14 15:55:03 +01:00
Luke Benstead
021237f258 Fix a number of issues with texture loading 2018-08-14 09:49:31 +01:00
Luke Benstead
dca991ffe3 Fix a number of minor issues with textures 2018-08-13 09:19:16 +01:00
Luke Benstead
e7cd91a91f Try to match GL filtering with PVR filtering 2018-08-09 09:32:29 +01:00
Luke Benstead
5c190c1095 Implement glGenerateMipmapEXT 2018-08-09 08:56:43 +01:00
Luke Benstead
c6ba127bc9 Always allocate room for mipmaps 2018-08-08 16:50:09 +01:00
Luke Benstead
4c99dd740a Add support for mipmapped compressed textures 2018-08-08 09:50:57 +01:00
Luke Benstead
b06f6116c8 Detect multiple mipmap levels being uploaded to glCompressedTexImage2D 2018-08-08 08:45:25 +01:00
Luke Benstead
86dd5dd2b2 glCompressedTexImage2D is an ARB extension in OpenGL 1.2.1 2018-08-07 20:49:10 +01:00
Luke Benstead
c40d3a007d Implement support for GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB and GL_COMPRESSED_TEXTURE_FORMATS_ARB 2018-08-07 20:46:26 +01:00
Luke Benstead
16d949bfbc Clean up compressed texture constants and code 2018-08-07 20:22:44 +01:00
Luke Benstead
0b91c20bbd Add support for getting the max texture size 2018-08-07 08:45:24 +01:00
Luke Benstead
85d4bb5ec3 Fix directional lighting bug 2018-08-05 14:38:04 +01:00
Luke Benstead
582a29d267 Add glMultiTexCoord2fARB 2018-08-05 09:09:38 +01:00
Luke Benstead
6942e597f4 Untested multitexture implementation 2018-08-04 21:00:26 +01:00
Luke Benstead
db0d39d487 Cleanup lighting code a bit 2018-08-04 19:34:07 +01:00
Luke Benstead
59002546e6 Fix lighting 2018-08-03 14:08:01 +01:00
Luke Benstead
0bf023b8df Fix a bug where headers weren't sent to a list 2018-08-02 19:56:50 +01:00
Luke Benstead
9371a8164f Don't send headers unnecessarily 2018-08-01 20:41:59 +01:00
Luke Benstead
4716a6a0c0 Cleanups and optimisations 2018-08-01 17:57:31 +01:00
Luke Benstead
39ac10af00 Simplify colour handling 2018-08-01 12:00:56 +01:00
Luke Benstead
bebca59796 Allow toggling z clipping 2018-08-01 11:32:07 +01:00
Luke Benstead
31e666c77a Implement support for GL_UNSIGNED_INT indices 2018-08-01 11:08:51 +01:00
Luke Benstead
47d3c0f478 Minor optimisations 2018-08-01 09:57:44 +01:00
Luke Benstead
02b4b2d438 Fix clipping errors when multiple strips submitted 2018-07-31 09:32:55 +01:00
Luke Benstead
720206810d Use a smaller near plane value (for now) 2018-07-16 09:01:11 +01:00
Luke Benstead
60c49f708e Clip using the w coordinate 2018-07-16 08:42:15 +01:00
Luke Benstead
0d921c3504 Tweaks to clipping 2018-07-15 21:27:15 +01:00
Luke Benstead
8ef63c75af 'Fix' compiling on platforms other than the DC 2018-07-15 20:44:43 +01:00
Luke Benstead
cdef5972f5 Fix bug when clipping triangle strips 2018-07-15 19:48:56 +01:00
Luke Benstead
81b52e7a18 Finish initial pass at a zclipping implementation 2018-07-14 21:54:43 +01:00
Luke Benstead
2067115385 Handle multiple triangle strips with single-vertices behind the plane 2018-07-10 20:27:15 +01:00
Luke Benstead
5387734e6c Implement z clipping for the single-vertex case 2018-07-10 19:48:25 +01:00
Luke Benstead
e90b5e424a Fix up triangle strip rendering 2018-07-09 19:00:50 +01:00
Luke Benstead
ae335eeff1 Large refactor of vertex submission
This should be much faster as matrix loading is now minimized. Also splits transform from perspective divisionn
to lay the groundwork for near-z clipping. This also fixes GL_POLYGON submission.

Lighting can be made faster, this doesn't change the lighting algorithm, but the matrix changes should speed things up.
2018-07-09 08:57:01 +01:00
Luke Benstead
e70922ebb7 Fix various problems with the lighting calculations 2018-06-06 21:23:17 +01:00
Luke Benstead
4a154d9c4e Add a near-z line clipping function in preparation for implementing near-z clipping 2018-05-31 09:38:34 +01:00
Luke Benstead
9167869633 Add gluOrtho2D, ortho2d example and fix glOrtho 2018-05-29 19:39:27 +01:00
Luke Benstead
101f260ce6 Add nehe06 2018-05-29 17:18:01 +01:00
Luke Benstead
a8d5d2f506 Add NeHe lesson 3, and a Vertex Array version of lesson 2 2018-05-29 17:02:57 +01:00
Luke Benstead
b6b1591010 Add the first nehe sample and make it work 2018-05-29 13:12:38 +01:00
Luke Benstead
0e48a3824b Fix Accumlation buffer error in lxdream 2018-05-28 08:52:35 +01:00
Luke Benstead
a08ce4a06c Fix crash if glTexParameter was called when no texture bound 2018-05-28 07:16:40 +01:00
Luke Benstead
c363a37e30 Fix the containers to compile on C89 and C99 2018-05-26 19:17:42 +01:00
Luke Benstead
51d02ae489 Stub out some of the ARB_framebuffer_object extension 2018-05-20 21:29:04 +01:00
Luke Benstead
f3339e1868 Implement gen/delete/bind framebuffers 2018-05-20 16:44:16 +01:00
Luke Benstead
8a4e53a9c7 Fix fog enable/disable 2018-05-20 16:37:45 +01:00
Luke Benstead
396ea82856 Drop all of the old libGL files 2018-05-20 16:16:53 +01:00
Luke Benstead
1421736733 Remove another old file 2018-05-19 13:43:22 +01:00
Luke Benstead
23e564269b Fix lighting bugs 2018-05-19 09:17:24 +01:00
Luke Benstead
2d9c439490 Implement normal matrix calculation 2018-05-16 21:30:11 +01:00
Luke Benstead
f9cdefcd81 Replace the entire matrix stack handling to work towards fixing lighting 2018-05-16 21:00:41 +01:00
Luke Benstead
4218111ab8 Make things C89 friendly 2018-05-14 17:10:53 +01:00
Luke Benstead
de1fb05ac1 Fix bugs in immediate mode 2018-05-14 16:58:58 +01:00
Luke Benstead
4106206562 Implement glMaterialfv 2018-05-13 19:48:55 +01:00
Luke Benstead
2cef0cb25e Implement glLightf 2018-05-13 09:34:44 +01:00
Luke Benstead
ab11a02056 Diffuse should be ignored if lighting is enabled 2018-05-13 09:00:38 +01:00
Luke Benstead
c76338b16f Add glNormalX, remove more dead code 2018-05-12 21:20:26 +01:00
Luke Benstead
97f4e020ad Rename experimental and update the Makefile 2018-05-12 21:06:22 +01:00