Nico de Poel
7232e061d7
Added a fast face drawing routine, which is basically what we had before:
- Faces directly point to vertices using the face vertex buffer
- Draw faces as quad strips from the original face data, without tessellation
3 years ago
Nico de Poel
8b34fb1950
Small tweaks: made background black to cover up seams, defined a few flags
3 years ago
Nico de Poel
3b5a59dae6
Geometry, textures and lighting now all working correctly.
Ditched the concept of surface vertices, as UVs cannot be shared between polygons.
3 years ago
Nico de Poel
ebbc01c672
Overhaul of geometry representation, with correct UV'ing and more finely tesselated surfaces.
3 years ago
Nico de Poel
b43767ebb8
Realized we can include the UV offsets into the UVs stored in the preprocessed map file, so we don't need to add those at runtime. Easy performance win.
3 years ago
Nico de Poel
35d91b1de2
Switched to map atlas image file generated directly by the preprocessing tool, rather than a .pcx converted by img2tim.
This one fixes the holes in the textures on pure black pixels.
3 years ago
Nico de Poel
5549e3f126
Textures are now showing up somewhat correctly!
Most of the actual changes are on the data conversion side.
3 years ago
Nico de Poel
297ae187f6
Fixed some issues with texture atlas generation.
The image is at least stable now, but textures are still not drawing properly.
3 years ago
Nico de Poel
76a6dc92d5
First pass at implementing texturing of face polygons.
Not quite right yet but things are starting to work.
3 years ago
Nico de Poel
c8c44b352f
A bit of cleanup ahead of attempting to make textures work
3 years ago
Nico de Poel
36c409115a
Use per-face vertex lighting for improved geometry definition and less light leaking between sharp-angled surfaces.
3 years ago
Nico de Poel
b0d36ab11b
Sped up plane calculations by making use of axis-aligned properties
3 years ago
Nico de Poel
bbf87bbf58
Implemented backface culling per face, by adding plane and center point fields to the face struct and checking the plane's normal against the camera vector to the center point.
This eliminates the need for per-polygon normal clipping and reduces the amount of redundant vertex copying, for a measurable speed boost.
3 years ago
Nico de Poel
ddffc8860e
Fixes to make things work on real hardware again:
- Struct pointers need to be 32-bit aligned, otherwise the PS1 will crash
- For this purpose, some structs have been padded to make them a multiple of 4 bytes in size
- Vector data needs to be copied into scratch RAM at a 32-bit aligned address
3 years ago
Nico de Poel
a05a800da0
Implemented PVS decompression, leaf visibility check using PVS data, and front-to-back traversal of the BSP tree.
3 years ago
Nico de Poel
337406c03f
Use the node and leaf data to traverse the entire BSP tree and draw all attached faces.
This already gets rid of all the collision volumes that were being drawn before.
3 years ago
Nico de Poel
37f619dc94
Load plane, node and leaf data, and iterate through leaves to draw faces.
3 years ago
Nico de Poel
0e1bb7a5bf
Reworked PS1BSP format to use dentry-style header info
3 years ago
Nico de Poel
7606d89998
Implemented triangle strip topology for drawing faces
3 years ago
Nico de Poel
3167f1474e
Faces can now carry their own per-vertex lighting data, instead of sharing all vertex data with adjacent faces.
3 years ago
Nico de Poel
08008af2a0
Implemented rudimentary baked lighting through vertex colors and gouraud shading.
3 years ago
Nico de Poel
f8a4d171a3
Faces now have a vertex index list, which is more space-efficient and allows easy rewrites of polygon topology.
Also works quite well with the scratchpad RAM setup.
3 years ago
Nico de Poel
5a3b6aac46
First implementation of world loading and rendering. No BSP logic or optimizations in here yet, but something is being displayed!
3 years ago