Commit Graph

692 Commits

Author SHA1 Message Date
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 fea7acd871 Enable vis calculation.
One nice thing about this project: I now KNOW that efrags works the way I
wanted it to: all those torches are now toggleable via r_novis :)
2012-01-03 23:20:01 +09:00
Bill Currie d0a0440056 Make R_SplitEntityOnNode easier to read. 2012-01-03 23:19:21 +09:00
Bill Currie 454047ab92 Make r_novis 0 take effect immediately. 2012-01-03 23:17:49 +09:00
Bill Currie 0797183201 Merge R_MarkLeaves from gl, sw, and sw32.
Other than novis, they're functionally identical. Now sw and sw32 have
novis as well.
2012-01-03 21:09:13 +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 209c4cda8b Scale the light level index correctly before colormap lookup.
With this, lighting seems to be working. I'm not certain the normals are
100% correct, but I can see something happening on rotating models.
2012-01-03 19:57:47 +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 21c7b84379 Enable face culling and depth testing.
I spent way too long trying to figure out why triangle order wasn't making
any difference... :P
2012-01-03 18:08:01 +09:00
Bill Currie 1437cbec91 Make the face culling a little more sensible.
GL Quake was weird, culling front faces. Partly understandable, since
Quake's front order is clockwise and GL's default order is
counter-clockwise. However, since the order can be specified, that should
be done instead. Thus, specify the winding order as clockwise (for quake's
data), set culling for back-face removal, and then mess with the winding
direction in the mirror and fish-eye code.
2012-01-03 18:06:26 +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
Jeff Teunissen 86edf54c40 Build and ignore cleanups
GLSL renderer build was checking for BUILD_GL instead of BUILD_GLSL in a
few places. Also, ignore the GLSL .fc and .vc files and the binaries.
2012-01-02 14:16:19 -05:00
Bill Currie 2a3151cecd Hook in alias model drawing.
Nothing is visible yet.
2012-01-02 20:28:40 +09:00
Bill Currie 72e3a8d507 Merge sw and sw32 alias frame selection.
I'm leaving GL for later because lerping complicates things. I'll sort it
out when I implement lerping in GLSL.
2012-01-02 17:47:22 +09:00
Bill Currie 1c480bf75e Merge the alias skin selection code.
We really don't need 4 copies of identical code when 1 will do :P
2012-01-02 15:57:43 +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 6b4a10819a Add an RGB texture loader. 2012-01-02 13:15:19 +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
Bill Currie f18cd65526 Implement the "cache" in Draw_CachePic. 2011-12-31 20:36:24 +09:00
Bill Currie 3eae8426e6 Implement in-game screenshots. 2011-12-31 17:24:20 +09:00
Bill Currie 718595db45 Implement sprite rendering.
Sprite interpolation seems to work, even :) (maybe)
2011-12-31 14:39:33 +09:00
Bill Currie 091e16f9d2 Bring in GL's R_RecursiveWorldNode as R_VisiteWorldNodes.
No surface queuing is done, but entities get queued.
2011-12-31 14:33:20 +09:00
Bill Currie 55e53b796d Make a start on getting sprites rendering.
The plan is to do interpolated sprites based on a discussion I had with
LordHavoc about them: blending between the two sprite frames. He didn't
mention it, but it looks like blending between the sprite frames' verts is
necessary too.
2011-12-30 21:11:59 +09:00
Bill Currie 16f84cd496 Hopefully get the 3d view and projection transforms setup. 2011-12-30 21:10:24 +09:00
Bill Currie 20d93466c7 Frag some magic numbers.
More annoying than hipnotic's gremlins.
2011-12-30 21:07:35 +09:00
Bill Currie a87a60a6fd Flush the text buffer before drawing conback or menus.
Ok, now really done until I notice something else (I forgot this one
momentarily).
2011-12-29 18:23:09 +09:00
Bill Currie 047b7bcc32 Implement Draw_TileClear.
With this, 2d seems to be finished. YAY.
2011-12-29 18:15:15 +09:00
Bill Currie a1035aafe9 Implement Draw_TextBox. 2011-12-29 17:51:31 +09:00
Bill Currie 2b44a25c6b Flush console text after each screen function.
This on its own doesn't fix menus being overwritten with console text, but
it's an important step.
2011-12-29 11:26:14 +09:00
Bill Currie 9fec4d5be0 Implement Draw_Fill.
Almost there with 2d.
2011-12-29 11:25:27 +09:00
Bill Currie 9d0ed6b885 Fix the missing text.
Silly case and paste error cleared out my text vertex array prematurely.
2011-12-29 08:47:32 +09:00
Bill Currie bece72e746 Use a quick hack to get colored crosshairs working. 2011-12-28 21:45:20 +09:00
Bill Currie e69a583f1b Work around a bug in mesa.
Since I'm not specifying the api when creating my context, mesa is giving
me GL2. This is fair enough, but in GL2, vertex attribute 0 is the vertex
position. This too, is fair enough. The problem is, mesa is assigning 0 to
my vcolor attribute and thus I can't set it. The work around is simply to
swap the declaration order of vcolor and vertex (this really shouldn't work
eiter, I suspect).
2011-12-28 20:43:56 +09:00
Bill Currie b657905c83 Bring in Despair's gl error checking from the gl renderer. 2011-12-28 09:05:36 +09:00
Bill Currie 151cc05882 Add support for vertex colors.
As I need to control the alpha, they're sent as rgba rather than quake
palette indices. Text works well. All other 2d stuff does not :(.
2011-12-28 09:04:26 +09:00
Bill Currie b943b6d6e8 Implement crosshairs, mostly.
Colored crosshairs aren't supported yet (next).
2011-12-27 17:59:58 +09:00
Bill Currie db8573b774 Make the cross-hair data sharable between renderers. 2011-12-26 21:43:15 +09:00
Bill Currie 705d07fa39 Implement most of the 2d rendering functions.
textbox, crosshair, tileclear, fill and fadescreen are the remaining
functions.

There's a problem with 2d icons being drawn over the text (instead of
under), but I'll leave that for later.
2011-12-26 20:33:40 +09:00
Bill Currie e2a8de33cc First real texture support function for glsl. 2011-12-26 18:34:51 +09:00
Bill Currie 42034acc03 Organize the text program data.
Also, rename the charmap uniform in quake2d.frag as it's more generic than
that.
2011-12-26 18:00:55 +09:00
Bill Currie 2ccfbb0c1c Move the shader program code into vid_common_glsl.
Much more useful in the long run.
2011-12-26 17:17:29 +09:00
Bill Currie 5bed38dcd9 Rename quaketxt.frag to quake2d.frag.
It's actually fairly generic for 2d rendering (no lighting, palette lookup)
2011-12-26 17:11:31 +09:00