Commit Graph

21 Commits

Author SHA1 Message Date
Bill Currie 3669e3aa2e Make alias model caching optional.
For now, only the glsl loader disables caching, but it stores the frame
vertices in GL memory, so its hunk usage is relatively lower (and will be
lower still when I get skins sorted out).
2012-01-17 19:31:50 +09:00
Bill Currie c884ef5f80 Convert the colormap to a 2D palette.
This skips one level of indirection in the alias model and brush shaders.
Hopefully, this will improve performance on my eeepc.
2012-01-14 21:42:42 +09:00
Bill Currie ea377b80c5 Remove some redundate statements. 2012-01-08 20:38:56 +09:00
Bill Currie 6f18035c12 Fix up alias-16 support.
After getting in contact with serplord, I now know that the sw alias
loading was correct. Turns out the gl loaders was mostly correct, just a
mistaken subtract rather than add. And with that, I can implement alias-16
support in glsl. better yet, since all the work is done in the loader, the
renderer doesn't know anything about it :) However, I need to create some
16-bit models for testing.
2012-01-05 12:52:12 +09:00
Bill Currie c6bcd7aedb Normalize the vertex normals.
I was wondering why the lighting looked a little extreme in overkill.
2012-01-05 12:45:43 +09:00
Bill Currie 836209e5c6 Enable lerping of alias models.
Done in hardware }:>
2012-01-04 16:36:43 +09:00
Bill Currie 99381b8b8c Rework the alias vertex shader and rendering code for lerping.
Lerping isn't actually done yet (need to get both poses and blend), but
this still renders correctly with blend forced to 0.0.
2012-01-04 14:35:34 +09:00
Bill Currie add5440ad1 Upload the normals with the vertex data.
Not all hardware can access a texture sampler from the vertex shader, and I
don't want multiple paths this early in the game. Now, vertex normals are
uploaded as shorts. Should be 14 bytes per vertex (was 10, could have been
8 if I had put the normal index with the vertex rather than st).
2012-01-04 09:42:00 +09:00
Bill Currie 091b714e4c Implement dynamic lighting.
This uses the same calculations as the software renderer. However, as the
lightmap calculations are not done yet, if there is no dlight in the
vicinity, there will be no light. demo1 is pretty cool to watch :)
2012-01-03 20:36:07 +09:00
Bill Currie e8f863c76f Remove the hedgehogs from the garden.
While the first frame was fine, any subsequent ones were not. I had
forgotten that hdr->poseverts held the edited vertex count rather than
hdr->mdl.numverts.
2012-01-03 18:11:39 +09:00
Bill Currie d7bc437e2c Fix the borked texture coordinates.
Silly me, doing byte based pointer math on a non-byte pointer :P
2012-01-03 18:10:35 +09:00
Bill Currie 185fded944 Re-enable the matrix optimizations.
Turns out my concatenations were correct.
2012-01-03 18:09:33 +09:00
Bill Currie 62e564c5cd Send ALL of the model's verts to GL.
Triangles have 3 vertices, not one :P
2012-01-03 11:47:40 +09:00
Bill Currie ba04cf73d0 Add my test tetrahedrons. 2012-01-03 09:34:17 +09:00
Bill Currie baab15279f Correct the alias vertex data types.
Vertex locations need to be unsigned byte rather than byte (GL is funy
with that). s and t need to be at least short, and since the normal index
is embedded in the st vector, it needs to be the same type. With this, my
test tetrahedrons seem to be working.
2012-01-03 09:34:17 +09:00
Bill Currie c378acab6b Actually load up the mvp and normal matrices.
Rather critical. I thought I'd done that :/
2012-01-03 09:34:17 +09:00
Bill Currie 2a3151cecd Hook in alias model drawing.
Nothing is visible yet.
2012-01-02 20:28:40 +09:00
Bill Currie 540bccbc27 Load all the alias vertex data as bytes.
I had forgotten I wanted to do it this way.
2012-01-02 13:41:12 +09:00
Bill Currie a57835866a Build the vertex normals texture. 2012-01-02 13:40:48 +09:00
Bill Currie fd67f3500b Load the alias model shaders. 2012-01-02 11:18:34 +09:00
Bill Currie d1419c30db Make a start on alias model rendering.
The vertex and fragment shaders are written, and R_InitAlias is stubbed,
but that's it so far.
2012-01-01 23:58:12 +09:00