Commit Graph

158 Commits

Author SHA1 Message Date
bjorn fcbeccdfb1 Fix background colors; 2022-08-05 21:05:02 -07:00
bjorn 019814e2c1 Change the way modules are destroyed;
They are now destroyed explicitly after tearing down the Lua state
instead of relying on finalizers.  It's definitely annoying to make it
coordinated in a centralized way like this instead of being distributed,
but there's not really any reliabel way to ensure that graphics objects
are destroyed before the graphics module/device is destroyed, which is a
problem.
2022-08-04 21:44:34 -07:00
bjorn 16860e8ef5 rm stats;
These stats don't make sense right now.
2022-08-04 07:59:07 -07:00
bjorn acd87a5e5c lovr.graphics.present;
It's nice to have an explicit action for presentation.
2022-08-04 00:06:54 -07:00
bjorn 89312c1c4b Add on-disk shader cache;
Set t.graphics.shadercache to true (the default) and lovr will
read/write a shader cache file from/to disk.
2022-08-02 22:06:44 -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 c0dfb414d6 Per-stage default shaders; 2022-08-01 22:10:06 -07:00
bjorn 2414f5f269 Material uvShift can be a single number too; 2022-07-31 10:39:49 -07:00
bjorn 9e4765818a Rename texture depth to layer count; 2022-07-31 10:39:49 -07:00
bjorn 571c71b76e Rename pipeline stack to state; 2022-07-31 10:39:49 -07:00
bjorn 92201b87a1 Rename timer tally type to time; 2022-07-17 13:17:33 -07:00
bjorn 83fa750a4d Support and default to reverse-z with infinite far plane; 2022-07-17 12:37:59 -07:00
bjorn c2dd7281cc mv stage tally -> shader tally; 2022-07-17 11:38:55 -07:00
bjorn 32346796ef Tally/Readback cleanup; 2022-07-17 09:50:15 -07:00
bjorn 45135899a1 Readback, mostly; 2022-07-14 00:05:58 -07:00
bjorn 0b76ab7e96 Add a few Tally things; 2022-07-12 19:59:12 -07:00
bjorn 1c571001e7 Finish Model API; 2022-07-12 19:35:23 -07:00
bjorn e8ebb17796 Fix hexcode render pass clear; 2022-07-10 17:07:04 -07:00
bjorn 889b1d8271 Improve Buffer length estimation; 2022-07-10 12:49:11 -07:00
bjorn f89b1811aa Adjust default Buffer field locations;
I guess it's better to match them up with the default attributes.
In most cases you're going to want to manually specify them with names
or numbers anyway.
2022-07-10 12:35:02 -07:00
bjorn f7d7281e70 Add index16/index32 FieldTypes;
Similar to u16/u32 but are 1-indexed when written using tables.
2022-07-10 12:18:31 -07:00
bjorn 886bfe18c1 Shader "improvements"; 2022-07-09 23:09:02 -07:00
bjorn c7f4e11b0b Improve shader errors; 2022-07-09 21:39:31 -07:00
bjorn e8a5f02e7b Start stats; 2022-07-09 21:19:51 -07:00
bjorn 159352770f Model:getTriangles;
Doesn't 100% work, Buffers are kind of a mess, ugh.
2022-07-09 18:30:36 -07:00
bjorn b0c1dd5f12 Put nogame in its own file; 2022-07-06 23:50:43 -07:00
bjorn dd8d8fe67e Adjust; 2022-07-04 15:22:54 -07:00
bjorn b934fac1df Pass:skybox; 2022-07-04 00:18:38 -07:00
bjorn cdf6b2017e Fix segfault on shader compilation failure; 2022-07-03 20:19:17 -07:00
bjorn d088c5471d Model;
Does not include some of the fancier accessors yet.
2022-07-03 17:26:31 -07:00
bjorn cbe24f482f Adjust font uvs;
- Padding is automatically computed from spread.
  - Spread increases detail at small sizes.
  - Remove failure cases where padding < spread/2
- UVs are un16x2, making room for color
- Don't center glyphs inside their atlas bounding box
- Cache normalized UVs and update them (for glyphs and vertices) when
  the atlas changes size.
  - Updating the UVs is UGLY and duplicates a lot of code.  It may be
    better to normalize the UVs on the fly, or just re-render the entire
    string if the atlas is updated.
2022-06-26 20:28:30 -07:00
bjorn ae4d7156fd lovr.graphics.submit ignores falsy values; 2022-06-26 00:45:49 -07:00
bjorn 7f22e18533 Error better when Buffer field is missing type; 2022-06-25 23:43:24 -07:00
bjorn f729320793 Fix creating Material from Texture; 2022-06-24 19:38:23 -07:00
bjorn 173c9a258e Sketch render pass automipmap; 2022-06-22 19:05:36 -07:00
bjorn cb4275bff7 Add DrawStyle; 2022-06-22 00:05:26 -07:00
bjorn ad0595ff35 lovr.graphics.getDefaultFont; 2022-06-20 18:58:12 -07:00
bjorn 362b389131 Pass:text;
Code is still messy, but it works okay.
2022-06-20 18:26:15 -07:00
bjorn a654cec40f lovr.graphics.newFont; 2022-06-18 17:43:12 -07:00
bjorn b89c61a8f4 HorizontalAlign and VerticalAlign enums; 2022-06-18 17:41:10 -07:00
bjorn 86b2c934e8 Materials, mostly; 2022-06-16 23:49:09 -07:00
bjorn 7de6bdf242 Shaders; Rework vertex formats; 2022-06-15 20:46:43 -07:00
bjorn fc616f92c2 Pass:mesh; Pass:setMeshMode; 2022-06-09 23:05:32 -07:00
bjorn b2e681ddfd Allow hexcode for render pass clear; 2022-06-09 17:37:06 -07:00
bjorn c2dab3cf2c Update lovr.draw signature;
- If you return a truthy value from lovr.draw, the pass won't be
  submitted.  A falsy value will submit the input pass.
- For convenience, lovr.graphics.submit returns true.
2022-06-08 23:59:48 -07:00
bjorn e36cc6482d rename pass/buffer to getPass/getBuffer; 2022-06-05 18:56:03 -07:00
bjorn 0104fe1910 Fancy compare mode aliases; 2022-05-31 21:33:06 -07:00
bjorn 99e45c22ad Add some descriptor set limits; 2022-05-31 20:16:16 -07:00
bjorn ff77a30f01 Default shaders; 2022-05-27 20:47:20 -07:00
bjorn 885e335f8c Image dimension accessors take mip level; 2022-05-25 23:51:51 -07:00