Commit Graph

152 Commits

Author SHA1 Message Date
bjorn 36e1471cf0 lovr.graphics.isInitialized;
Returns whether the graphics module is initialized.  Used by the default
error handler to know if it's safe to try to render the error screen.
2022-11-07 19:12:11 -08:00
bjorn 28869431fb Fix stereo mirror window; 2022-09-15 20:45:26 -07:00
bjorn 1dd737d8a4 Make the logo a default shader;
Improves build system, improves filesize, seemingly improves startup time
2022-09-13 17:36:10 -07:00
bjorn d8c6c47e00 Add normal DefaultShader;
It's a pretty normal shader.
2022-09-10 11:07:55 -07:00
bjorn 8697466009 Shader flag adjustments;
- glowTexture is on by default, but still requires the glow flag.
- occlusionTexture is named ambientOcclusion, and is on by default,
  but is still not used by any builtin shaders/helpers.
2022-09-02 15:33:18 -07:00
bjorn 5a2fe54c04 Improve Pass:fill;
It can now fill an array texture to a multiview pass, copying to
the corresponding layers.
2022-08-26 09:57:51 -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 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 f515346e20 Rename CoordinateSpace;
It's now OriginType, and global -> root and local -> parent.
2022-08-17 22:33:43 -07:00
bjorn 3e8b1681df Pass:mesh supports baseVertex; 2022-08-17 18:09:04 -07:00
bjorn 5799b0effb Rename setBackground back to setBackgroundColor;
The "fancy background" idea won't go here.
2022-08-13 21:10:58 -07:00
bjorn 7e5221492d rm pointSize from Material;
It's weird, and about as inconvenient as just putting it in the shader.
2022-08-09 19:54:54 -07:00
bjorn 642388709b Shader helper improvements; 2022-08-06 13:06:42 -07:00
bjorn 2a3215fa05 Make indirect draws a :mesh variant; 2022-08-05 22:11:43 -07:00
bjorn fcbeccdfb1 Fix background colors; 2022-08-05 21:05:02 -07:00
bjorn a23f0351cc WIP OpenXR layout transitions; 2022-08-05 18:36:51 -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 ac104e6f41 WIP stereo blit shader; 2022-07-31 13:26:35 -07:00
bjorn 4919daa93b Small fixes; 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 d9623a51a9 Pass:setFont; 2022-07-17 19:53:31 -07:00
bjorn d17131c421 Pass:cone; 2022-07-17 16:38:00 -07:00
bjorn 92201b87a1 Rename timer tally type to time; 2022-07-17 13:17:33 -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 430f687add Projection updates;
- Rename/reorder some projection matrix functions.
- Make perspective functions flip Y and use 0-1 NDC range.
- Flip winding and font vertices based on handedness.

This stuff is really confusing
2022-07-17 09:02:53 -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 bca10c9e98 Make info structs const; 2022-07-13 00:07:15 -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 4e8fe82f94 Font:getVertices; 2022-07-10 12:49:47 -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 8e89026678 Shader:getLocalWorkgroupSize; 2022-07-09 23:39:03 -07:00
bjorn 886bfe18c1 Shader "improvements"; 2022-07-09 23:09:02 -07:00
bjorn e8a5f02e7b Start stats; 2022-07-09 21:19:51 -07:00
bjorn 40cbb18346 Ugly Pass:capsule; 2022-07-09 16:38:25 -07:00
bjorn 5f19c2e1be Model:getBoundingBox; Model:getBoundingSphere; 2022-07-06 19:22:02 -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 8aa14ba42b Shader:hasAttribute; 2022-07-03 23:04:56 -07:00
bjorn 2c339dd944 Shader:hasStage; 2022-07-03 22:59:49 -07:00
bjorn d088c5471d Model;
Does not include some of the fancier accessors yet.
2022-07-03 17:26:31 -07:00
bjorn a521f11a44 lovrPassCopyTallyToBuffer; 2022-06-30 18:46:47 -07:00
bjorn c327eb103f Tally; 2022-06-30 17:34:29 -07:00