Commit Graph

62 Commits

Author SHA1 Message Date
bjorn fcf64cb6e4 Pass:send supports tables; 2022-08-23 19:25:45 -07:00
bjorn a4241db04f Add shorthand for procedural vertex rendering;
Instead of a vertex buffer, you can specify a vertex count.
2022-08-22 21:00:14 -07:00
bjorn 79cd7c10a1 Improve temporary buffers;
- They no longer live in temporary memory, but in a dedicated pool.
- There are error checks for using a temporary buffer after it's invalid
  - However, these are imperfect, and could be improved.  One idea is to
    avoid recycling a temporary buffer until its refcount decays (i.e.
    Lua finally decides to garbage collect it).  This would explode
    memory usage sometimes, so it could only be enabled when
    t.graphics.debug is true.
2022-08-22 20:30:09 -07:00
bjorn 460ae0f6a0 Fix Pass:send('bool', bool); 2022-08-19 22:26:20 -07:00
bjorn 7087cef57f Fix bug with Image -> Texture copies; 2022-08-17 18:09:12 -07:00
bjorn 3e8b1681df Pass:mesh supports baseVertex; 2022-08-17 18:09:04 -07:00
bjorn 081afc3140 No more special-cased orthographic projection; 2022-08-17 18:08:38 -07:00
bjorn 401ec05d00 Fix Pass:send with textures/samplers; 2022-08-12 22:44:24 -07:00
bjorn 8233c202ba Fix Pass:points / Pass:lines with vectors; 2022-08-12 18:11:45 -07:00
bjorn 2a3215fa05 Make indirect draws a :mesh variant; 2022-08-05 22:11:43 -07:00
bjorn 4ee092e81b Make Pass a regular object;
It uses newPass instead of getPass.  Temporary objects had lifetime
issues that were nearly impossible to solve.  And normal objects are
easier to understand because they behave like all other LÖVR objects.

However, Pass commands are not retained from frame to frame.  Pass
objects must be re-recorded before every submit, and must be reset
before being recorded again.

Pass objects now provide a natural place for render-pass-related info
like clears and texture handles.  They also allow more information to be
precomputed which should reduce overhead a bit.

It is now possible to request a stencil buffer and antialiasing on the
window and headset textures, via conf.lua.

lovr.graphics.setBackground should instead set the clear color on the
window pass.  Though we're still going to try to do spherical harmonics
in some capacity.

There are still major issues with OpenXR that are going to be ironed
out, and the desktop driver hasn't been converted over to the new
headset Pass system yet.  So lovr.headset integration is a bit WIP.
2022-08-02 22:06:44 -07:00
bjorn d9623a51a9 Pass:setFont; 2022-07-17 19:53:31 -07:00
bjorn d17131c421 Pass:cone; 2022-07-17 16:38:00 -07:00
bjorn e2bfff1b0a Tally/Readback fixes; 2022-07-14 19:23:02 -07:00
bjorn 45135899a1 Readback, mostly; 2022-07-14 00:05:58 -07:00
bjorn 1c571001e7 Finish Model API; 2022-07-12 19:35:23 -07:00
bjorn 698977c5be Better default torus segments; 2022-07-10 18:02:31 -07:00
bjorn dacd17066d luax_checkendpoints;
Allows drawing a sphere/capsule using 2 endpoints.
2022-07-10 13:11:47 -07:00
bjorn 40cbb18346 Ugly Pass:capsule; 2022-07-09 16:38:25 -07:00
bjorn b934fac1df Pass:skybox; 2022-07-04 00:18:38 -07:00
bjorn b2b6b14e3e Fix Pass:mesh error handling; 2022-07-03 22:40:19 -07:00
bjorn d088c5471d Model;
Does not include some of the fancier accessors yet.
2022-07-03 17:26:31 -07:00
bjorn d9d54ce348 Pass:copy(tally, buffer); 2022-06-30 18:51:03 -07:00
bjorn 7711fe8b65 Font:getWrap; Simplify Font internals; 2022-06-29 20:17:26 -07:00
bjorn 1752b220bf Pass:text supports multicolor strings; 2022-06-27 21:42:51 -07:00
bjorn 4021d4e893 Pass:monkey;
Questionable.
2022-06-24 23:05:09 -07:00
bjorn 75e8df58df Pass:cylinder; 2022-06-24 23:01:22 -07:00
bjorn 5c43ad0792 Pass:fill; 2022-06-24 19:59:48 -07:00
bjorn fbf2a039b7 setMaterial takes Texture in addition to Material; 2022-06-24 19:38:45 -07:00
bjorn dc9e93103f Pass:sphere; 2022-06-23 21:23:16 -07:00
bjorn dc73d2309a Pass:donut; 2022-06-23 19:52:37 -07:00
bjorn c1d8c64c45 Pass:copy can copy tables to buffers; 2022-06-22 00:39:56 -07:00
bjorn cb4275bff7 Add DrawStyle; 2022-06-22 00:05:26 -07:00
bjorn 362b389131 Pass:text;
Code is still messy, but it works okay.
2022-06-20 18:26:15 -07:00
bjorn ce58556372 Fix Pass:setBlendMode/setMaterial; 2022-06-20 18:25:05 -07:00
bjorn 86b2c934e8 Materials, mostly; 2022-06-16 23:49:09 -07:00
bjorn 3d83d0fcfe Pass:multimesh;
IT'S ALIVE
2022-06-09 23:38:33 -07:00
bjorn fc616f92c2 Pass:mesh; Pass:setMeshMode; 2022-06-09 23:05:32 -07:00
bjorn ef19a334a9 Pass:setSampler;
This is an experimental take on the "default filter" system.  Each
render Pass has its own "global sampler", initialized to trilinear.  The
global sampler will be used by default to sample textures/materials in
shaders.  You can set it to a filter mode or a full Sampler object.  You
can always send your own Sampler objects to Shaders if you want
per-texture sampler settings.  The global sampler is designed to be set a
small number of times per pass instead of on every draw.  Basically,
just do Pass:setSampler('nearest') and draw your minecraft world.
2022-06-07 20:42:10 -07:00
bjorn a26e732ab0 Cleanup; 2022-06-07 20:42:06 -07:00
bjorn 2b65b50ed9 Pass:setViewport; Pass:setScissor;
It pretends to be like a pipeline state even though it isn't.
Might be nice for nil to mean "the framebuffer size" which is the default.
2022-06-06 12:38:15 -07:00
bjorn a8b35074e0 Pass:send supports push constants; 2022-06-05 18:54:26 -07:00
bjorn 8effa7424f Pass:circle; 2022-06-05 13:12:49 -07:00
bjorn ea80936af7 Pass:compute; 2022-06-04 11:54:05 -07:00
bjorn d3a1a0ec22 Pass:cube; Pass:box; 2022-06-04 11:28:35 -07:00
bjorn 3013567e73 Fix Pass:translate; 2022-06-04 11:28:31 -07:00
bjorn e07a2691e0 Clean up plane; 2022-06-04 11:19:28 -07:00
bjorn e652ae67af Pass:plane; 2022-06-04 01:34:13 -07:00
bjorn ebc6d9d3a3 Pass:line; 2022-06-04 01:33:50 -07:00
bjorn 0104fe1910 Fancy compare mode aliases; 2022-05-31 21:33:06 -07:00