Commit Graph

77 Commits

Author SHA1 Message Date
bjorn bb46fa5745 Pass:line copies tables of vectors to vertices better;
Using vec3_init writes 4 floats which can, extremely rarely, go past the
end of the vertex buffer.
2022-12-04 18:00:24 -08:00
bjorn 7bd3546aa9 Fix Pass:line ignoring temporary vectors in tables; 2022-12-04 17:58:49 -08:00
bjorn 0c281bca50 Change default setProjection far plane to 0;
It was accidentally left at 100, which will cause problems.
2022-11-24 14:58:40 -08:00
bjorn e9776f98c6 Fix compatibility with Lua 5.2, 5.3, 5.4;
Part of this involved putting the Lua header back in api.h, since we
need to know the Lua version to define some macros properly.
2022-11-24 14:33:55 -08:00
bjorn 74218da271 Fix luax_checkendpoints when direction is not normalized; 2022-09-23 11:58:26 -07:00
bjorn 5be425ddbe Fix Pass:clear(Texture); 2022-09-14 20:53:42 -07:00
bjorn 931ffea17b Pass:getClear returns correct value for dontcare/load actions; 2022-09-10 10:28:54 -07:00
bjorn 48ec18573a Pass:getClear only includes depth when depth buffer exists; 2022-09-10 10:17:24 -07:00
bjorn ee809ec31a Pass:mipmap base mipmap index is 1-indexed; 2022-09-10 10:14:46 -07:00
bjorn 7851f49910 Make blit layers 1-indexed;
Annoying for 3D textures, but matches layer indices most elsewhere.
2022-09-10 10:13:34 -07:00
bjorn a796c92556 Buffer:clear and Pass:clear(Buffer) use the same units; 2022-09-03 10:49:25 -07:00
bjorn e57d76c6e9 Fix bug with base vertex in Pass:mesh; 2022-09-01 21:54:24 -07:00
bjorn e402f02918 Fix setColorWrite(bool) variant; 2022-08-26 22:23:13 -07:00
bjorn d655daf213 Better Pass:send('var', nil) error; 2022-08-25 23:54:11 -07:00
bjorn ede1036694 Temporary Passes;
Sigh, back to getPass.  I don't even know at this point.  Basically now
that we came up with a half-solution for temp buffers, it makes sense to
apply this to passes as well, since we aren't going with the workstream
idea and temp passes are more convenient than retained passes.
2022-08-25 21:57:15 -07:00
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