Commit Graph

1692 Commits

Author SHA1 Message Date
bjorn 8fa46fe236 Reading arrays of vectors works with temp vectors; 2023-03-20 13:54:38 -07:00
bjorn 92e9efd882 More flexible Buffer formats; Deprecate temp buffers;
- Pass:mesh accepts tables for vertices/indices
- Add Pass:setVertexFormat to set format used for table-based meshes
- Pass:send accepts tables for buffers
- Pass:send supports arbitrarily nested structs/arrays for push constants
- Buffer formats support arbitrarily nested structs/arrays
  - Zero-length buffers are valid and represent structs
  - Fields can have names using 'name'
  - Field types can be tables of other fields (structs)
  - Fields can have 'length' key
- newBuffer syntax has been changed to put format first (old version
  still works)
- Buffers can be created from shader variables, avoiding need to declare
  matching format.
- Pass:clear/Pass:read use byte offsets instead of indices
- Pass:copy uses byte offsets when copying a Buffer to a Buffer
- Deprecate lovr.graphics.getBuffer (tables can be used instead)
2023-03-20 13:54:37 -07:00
Bjorn d8e856e6e0
Merge pull request #645 from mcclure/size-t-narrow
Address various MSVC warnings (casts, comparisons, function pointers)
2023-03-03 17:25:48 -08:00
Bjorn 5fa53b3812
Update error message; 2023-03-03 17:17:49 -08:00
mcc e4e8c5476b Warning fixes (fix style) 2023-03-03 15:48:41 -05:00
bjorn ccffd3c1b2 Merge branch 'master' into dev 2023-03-02 18:31:20 -08:00
bjorn 6d382c2f0c Ensure blank images are cleared to zero;
This was an unintended change in v0.16.0.
2023-03-02 18:31:06 -08:00
mcc a5216347a0 Address size_t narrowing warnings in MSVC by adding casts. Add some asserts to make sure the casts are safe. 2023-03-01 18:15:04 -05:00
bjorn 4afb0ae2bf Fix Pass:clear(buffer); 2023-02-25 00:01:31 -08:00
bjorn 41dd24edc4 Organize math module files; 2023-02-07 21:44:43 -08:00
bjorn 89edccbf4c Add lovr.headset.isPassthroughEnabled and lovr.headset.setPassthroughEnabled; 2023-02-05 19:51:12 -08:00
bjorn b76d9bbfe5 Ensure mipmap count is consistently 1 for render targets;
Currently if you create a texture from dimensions (assumed to be a
render target), its mipmap count differs depending on whether you
provide an options table.  Now it will consistently be 1.
2023-02-05 16:02:58 -08:00
bjorn 495fca5f23 Add a variant of Texture:newView for single slices/mipmaps;
This is a more convenient syntax for the common case of creating a 2D
view of a single slice/level of an array/cubemap/3D texture.
2023-02-05 15:15:11 -08:00
bjorn 06c150ce4e Pass:setBlendMode/Pass:setColorWrite take optional target index;
If the target index is missing, the state will apply to all targets.
Fixes undefined behavior when setting color state in a pass with
multiple color attachments.
2023-02-05 15:07:33 -08:00
bjorn b0c3bd6e4c Lightuserdata can be pushed to channels; 2023-02-04 14:08:22 -08:00
bjorn 8337dd9caf Vectors work with channels;
They are copied by value.  Upon popping, they are pushed as temporary
vectors.  Matrices are allocated on the heap, everything else is stored
in the Variant itself.
2023-02-04 14:03:12 -08:00
bjorn 2144b5f81d Backport Lua utf8 library; 2023-02-03 23:17:43 -08:00
bjorn bf98c066b4 t.math.globals also adds capitalized constructors; 2023-02-01 17:57:37 -08:00
bjorn 132b8d6003 Pass:roundrect; 2023-01-26 21:24:37 -08:00
bjorn d08cc539e8 Add vector constants;
They are implemented in the __index metamethod and return temporaries.
2023-01-24 18:37:04 -08:00
bjorn 017c2136fd Merge branch 'master' into dev 2023-01-24 18:36:27 -08:00
bjorn 4b0931a814 Change temp vector constructors to metatable __calls;
This enables a few things:

- Custom vector methods can be added/replaced.
- Vector methods can be called as non-methods e.g. vec3.normalize(v)
- Possibility for vector constants in an __index metamethod.

This was measured as increasing overhead by 3.5% when creating temporary
vectors (2ns), which is arbitrarily deemed acceptable.
2023-01-24 18:01:31 -08:00
bjorn 4e01f84070 Depth resolves;
- Allow multisampled render pass to have a single-sample depth attachment
- Add a new depthResolve feature, indicating whether it's supported
- Fix stencil load/save
- Minor changes to render pass caching
- Currently the depth resolve is done using the first sample.  A future
  improvement would be to expose/use the min/max/average resolve modes.
2023-01-22 23:30:57 -08:00
bjorn b6d8546a6f Merge branch 'master' into dev 2023-01-02 16:46:55 -08:00
Josip Miskovic 9e06c72b37 A getter for World list of tags 2022-12-26 09:50:14 +01:00
bjorn 886e3bb42f Fix some windows warnings; 2022-12-19 14:01:30 -08:00
bjorn e12563ad25 Merge branch 'master' into dev 2022-12-16 21:21:05 -08:00
bjorn a79b3af7e5 Fix issue where temp vectors sometimes don't work as colors; 2022-12-11 00:41:12 -08:00
bjorn f013831b73 Reorganize thread code;
- Put channel into thread module file.
- Make thread internals private.
- Handle more thread bookkeeping in thread module instead of Lua API.
- Fix a few race conditions/leaks nobody was probably ever going to hit.
2022-12-10 20:13:39 -08:00
bjorn 5edbfdbffb Pass:cone supports 2-endpoint variant; 2022-12-10 13:51:16 -08:00
bjorn e63d142009 Fix refcounting when creating Font from Rasterizer; 2022-12-10 13:35:03 -08:00
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 78a70670bb
Merge branch 'dev' into MSFT_controller_model 2022-12-03 19:34:49 -08:00
bjorn efc81e4cec Fix some gcc warnings; 2022-12-03 01:20:02 -08:00
Josip Miskovic cbe3c45548 Trim whitespace in Texture:hasUsage name 2022-11-26 17:41:48 -08:00
bjorn cad98d8b2b Mat4:reflect;
Creates a matrix that reflects across a plane given as a position and
normal vector.
2022-11-26 15:34:58 -08:00
bjorn f9d7742dfd Add support for headless headset rendering;
Although the name is unfortunate, this allows access to lovr.headset
when no window is opened or when the graphics module is disabled.  This
requires the XR_MND_headless extension to be supported by the runtime.
2022-11-26 14:40:39 -08:00
bjorn 4422df2a47 Variant small string optimization; 2022-11-24 15:40:43 -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 e426520144 Blob:getString takes an optional byte range; 2022-11-23 12:21:32 -08:00
s-ol 043f9c7920 store headset model metadata for animations 2022-11-22 12:24:57 +01:00
bjorn 7b3e1a02eb Fix newShader when nil is used as a stage's code; 2022-11-16 18:12:06 -08:00
bjorn b61dbab21b newTexture resets usage when table is provided; 2022-11-14 20:03:58 -08:00
bjorn d5ebb796b3 Mat4:set uses TRS order when scale is present; 2022-11-14 19:19:23 -08:00
bjorn c61d6b059b Merge branch 'master' into dev 2022-11-14 19:19:17 -08:00
s-ol c3494d3d30 Fix Model:getNodeScale() 2022-11-14 08:02:13 -08:00
s-ol 773d22f40d Check bounds in luax_checkanimation / luax_checknodeindex 2022-11-14 08:02:13 -08:00
bjorn f8f748320e Minor Shape improvements;
- Add helper functions for creating shapes to avoid duplication between
  newShape and newShapeCollider.
- Add lovr.physics.newMeshShape and lovr.physics.newTerrainShape
- Register TerrainShape so it has all the base Shape methods
- Smooth out a few TerrainShape warnings
2022-11-09 20:53:42 -08:00
bjorn 29f2a66bf0 Merge branch 'master' into dev 2022-11-09 19:06:02 -08:00
bjorn 9783140725 Fix window resize; 2022-11-09 19:05:01 -08:00
s-ol 22ff6dab94 Fix wrong loop limit in lovr.graphics.newShader; 2022-11-09 17:00:08 -08:00
Josip Miskovic 34611f2069 Add physics heightfield shape 2022-11-08 18:46:49 -08:00
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 3b3d2d4e77 Fix newBoxShape dimensions; 2022-10-16 19:53:44 -07:00
bjorn c59c242b7b Fix newTexture; 2022-10-12 00:46:48 -07:00
bjorn 74218da271 Fix luax_checkendpoints when direction is not normalized; 2022-09-23 11:58:26 -07:00
bjorn dd336b7473 Render target textures don't have mipmaps by default; 2022-09-21 21:18:32 -07:00
Josip Miskovic da9328e72c Fix sending strings with \0 through channels
A null-char is valid part of Lua string. When such a string is sent
through the channel, its length should be stored as well to be able to
correctly reconstruct it on the other thread.

The bug was triggered with this code:

    s1 = 'a \0 b'
    print(#s1) -- 5
    ch:push(s1)
    s2 = ch:pop()
    print(#s2) -- 2
2022-09-21 09:15:20 -07:00
bjorn 28869431fb Fix stereo mirror window; 2022-09-15 20:45:26 -07:00
bjorn 5be425ddbe Fix Pass:clear(Texture); 2022-09-14 20:53:42 -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 a31ae6a68f Fix compileShader; 2022-09-13 17:22:48 -07:00
bjorn d8c23bacec Source:setPitch;
Co-authored-by: Nevyn Bengtsson <nevyn@alloverse.com>
2022-09-11 20:41:58 -07:00
bjorn 76557eb6ed Add hand joint radius to getSkeleton; 2022-09-10 23:44:14 -07:00
bjorn 7636a3c5e9 Default window size matches conf.lua; 2022-09-10 21:10:01 -07:00
bjorn 860651e80c rm falsy variant of lovr.system.openWindow;
Probably vestigial from conf invocation.
2022-09-10 20:53:55 -07:00
bjorn d8c6c47e00 Add normal DefaultShader;
It's a pretty normal shader.
2022-09-10 11:07:55 -07:00
bjorn 931ffea17b Pass:getClear returns correct value for dontcare/load actions; 2022-09-10 10:28:54 -07:00
bjorn 5c4fc79242 mv lovr.graphics.init lovr.graphics.initialize;
init is undocumentable due to Lua conventions.
2022-09-10 10:22:52 -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 08f0ca7434 Font:getVertices wrap is optional; 2022-09-02 19:21:55 -07:00
bjorn ed035f9e81 Adjust; 2022-09-02 18:53:50 -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 ea30100c31 rm texture variant of newMaterial;
Does not make sense anymore now that Pass:setMaterial(Texture) exists.
2022-09-02 15:05:01 -07:00
bjorn ce9662fa7e Make Model draw start vertex 1-indexed;
That way it matches Pass:mesh.
2022-09-01 21:54:34 -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 7aebde2f92 Fix StencilAction; 2022-08-26 22:23:04 -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 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 f45706f875 Change Buffer format 'name' to 'location' string;
Name is confusing because it seems like it supports key/value setting.
2022-08-23 19:17:54 -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 ebf049e9d1 Model:resetNodeTransforms; 2022-08-22 20:44:01 -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 f914b6fcf1 Fix memory leak with shader cache; 2022-08-22 20:18:34 -07:00
bjorn 460ae0f6a0 Fix Pass:send('bool', bool); 2022-08-19 22:26:20 -07:00
bjorn ba7bdd11c3 Fix index FieldType shorthand; 2022-08-19 20:51:50 -07:00
Josip Miskovic 0cea42fb08 Fix default Image format 2022-08-18 09:04:42 -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 f570ee980c Add Model:getMaterialName; 2022-08-17 22:05:05 -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 817ed9f4e9 ModelData:getMeshIndex is 1-based; 2022-08-17 18:08:26 -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 6052ed7a95 Rename ModelData enums;
To better match graphics.
2022-08-13 21:10:03 -07:00
bjorn 2c4f5a13df luax_readmesh supports Model again; 2022-08-13 21:09:33 -07:00
bjorn 401ec05d00 Fix Pass:send with textures/samplers; 2022-08-12 22:44:24 -07:00
bjorn ad6360d2fd Clean up boot.lua;
A lot of clean up can happen now that C doesn't push delayed errors to
Lua.  This was happening for Pico and WebVR, neither of which are used
anymore.

Also default vsync to true but force it off if VR is active.
2022-08-12 20:18:55 -07:00
bjorn 143b0ba664 Fix DefaultShader initialization; 2022-08-12 18:26:47 -07:00
bjorn 8233c202ba Fix Pass:points / Pass:lines with vectors; 2022-08-12 18:11:45 -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 3c71828afa Revert "Change the way modules are destroyed;"
This reverts commit 019814e2c1.
2022-08-08 23:16:34 -07:00
bjorn 8aa1cf91b2 Submit depth buffer to OpenXR; 2022-08-06 22:52:18 -07:00
bjorn eba71d5921 Fix more warnings; 2022-08-06 19:23:41 -07:00
bjorn a2ee485d41 Fix most windows warnings in graphics code;
Co-authored-by: mcc <andi.m.mcclure@gmail.com>
2022-08-06 18:05:30 -07:00
bjorn 642388709b Shader helper improvements; 2022-08-06 13:06:42 -07:00
bjorn c41188c4b4 Merge branch 'master' into dev 2022-08-06 11:08:02 -07:00
bjorn 6011e61d52 Fix lovr.headset.newModel and lovr.headset.animate; 2022-08-06 00:29:46 -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 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 aa4fce2842 Rename luax_atexit internals; 2022-08-04 21:33:37 -07:00
bjorn 16860e8ef5 rm stats;
These stats don't make sense right now.
2022-08-04 07:59:07 -07:00
bjorn eac3299bd0 ModelData:getMetadata; 2022-08-04 00:27:20 -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 d42cac288f Use anonymous union for ModelNode transform; 2022-08-02 23:03:52 -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 8952476e35 Adjust; 2022-08-01 22:14:49 -07:00
Josip Miskovic 31ca502034 Add isKeyDown 2022-08-01 22:13:30 -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 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 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 5d3e1f93cd Add d32fs8; 2022-07-17 11:03:00 -07:00
bjorn 32346796ef Tally/Readback cleanup; 2022-07-17 09:50:15 -07:00
bjorn faa690b7f0 Material API;
Just returns everything as a table.  Some sort of key-value thing would
be nice but complicates the implementation.
2022-07-17 09:29:13 -07:00
bjorn 35d8a4c49c Tally API; 2022-07-17 09:05:39 -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 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 a4e4181489 Error screen; 2022-07-10 21:37:52 -07:00
bjorn 698977c5be Better default torus segments; 2022-07-10 18:02:31 -07:00
bjorn e8ebb17796 Fix hexcode render pass clear; 2022-07-10 17:07:04 -07:00
bjorn dacd17066d luax_checkendpoints;
Allows drawing a sphere/capsule using 2 endpoints.
2022-07-10 13:11:47 -07:00
bjorn 4e8fe82f94 Font:getVertices; 2022-07-10 12:49:47 -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 8e89026678 Shader:getLocalWorkgroupSize; 2022-07-09 23:39:03 -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 40cbb18346 Ugly Pass:capsule; 2022-07-09 16:38:25 -07:00
bjorn b0c1dd5f12 Put nogame in its own file; 2022-07-06 23:50:43 -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 b2b6b14e3e Fix Pass:mesh error handling; 2022-07-03 22:40:19 -07:00
bjorn 917b97ca2d Adjust; 2022-07-03 21:48:43 -07:00
mcc 9a7eedbf4d Remove 'check on egress' behaviors where an error for a sound being too large is emitted only when a getter is called (left harder-to-remove checks that occur when a sound is loaded) 2022-07-03 21:34:16 -07:00
mcc 15aa08bbe7 Adjustments to MSVC warnings PR based on github comments 2022-07-03 21:34:16 -07:00
mcc 28d64b6ced Fix various compiler warnings in MSVC (non graphics edition)
- Put in casts/checks in audio code when assigning size_t to 32 bit
- () is different from (void)
- Turned off warnings for anonymous unions and negating unsigned integers which were technically accurate but unhelpful (and interfered with bit conversion and a weird bit math construct in audio.c) (CMakeLists only)
2022-07-03 21:34:16 -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 d9d54ce348 Pass:copy(tally, buffer); 2022-06-30 18:51:03 -07:00
bjorn 9e7bd34ab1 Font:getWidth; 2022-06-30 17:25:47 -07:00
bjorn 4125b1dc7e mv getWrap getLines; Include bearing/advance in width; 2022-06-30 17:07:47 -07:00
bjorn 1f8d37a160 Font:getKerning; 2022-06-29 21:49:55 -07:00
bjorn 078b54a7a5 Font:getWrap doesn't return width; 2022-06-29 21:33:39 -07:00
bjorn 7711fe8b65 Font:getWrap; Simplify Font internals; 2022-06-29 20:17:26 -07:00
bjorn fa2bd2b05c Shuffle around Rasterizer;
Shorter names, ditch linegap
2022-06-28 20:18:45 -07:00
bjorn 1752b220bf Pass:text supports multicolor strings; 2022-06-27 21:42:51 -07:00
bjorn af2c53a762 Fix luax_optcolor; 2022-06-27 21:38:40 -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 756b184306 Some font cleanup; 2022-06-25 19:54:13 -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 f729320793 Fix creating Material from Texture; 2022-06-24 19:38:23 -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 173c9a258e Sketch render pass automipmap; 2022-06-22 19:05:36 -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 499cf9c0dc More Font APIs; 2022-06-21 15:28:03 -07:00
bjorn 71f6a88a62 Font uses padding; 2022-06-20 19:24:41 -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 ce58556372 Fix Pass:setBlendMode/setMaterial; 2022-06-20 18:25:05 -07:00
bjorn 7625ef9bd8 Rasterizer:getGlyphImage; 2022-06-20 18:24:12 -07:00
bjorn 0306096577 luax_optu32 doesn't evaluate index twice; 2022-06-20 18:17:51 -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 0d7fed1fa7 Rasterizer:getBoundingBox;
For the global bounding box
2022-06-18 17:40:14 -07:00
bjorn 717f95f6bd Start updating Rasterizer; 2022-06-17 17:43:58 -07:00
bjorn c1bb47d737 Merge branch 'master' into dev 2022-06-16 23:50:11 -07:00
bjorn 86b2c934e8 Materials, mostly; 2022-06-16 23:49:09 -07:00
bjorn fb42bf3fbb Rearrange some ModelData stuff; 2022-06-15 23:17:11 -07:00
bjorn 7de6bdf242 Shaders; Rework vertex formats; 2022-06-15 20:46:43 -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 2abf1a4a0c Fix luax_optu32; 2022-06-09 23:05:02 -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 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 2ee1a8d014 Image:getPointer; 2022-06-06 07:32:01 -07:00
bjorn d5325b87b4 Headset support; 2022-06-05 20:38:14 -07:00
bjorn e36cc6482d rename pass/buffer to getPass/getBuffer; 2022-06-05 18:56:03 -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
bjorn 99e45c22ad Add some descriptor set limits; 2022-05-31 20:16:16 -07:00
bjorn 42a924b0ee lovrPassDraw; Pass:points; 2022-05-30 15:36:31 -07:00
bjorn 6a531c04a8 luax_tofloat; 2022-05-30 13:32:40 -07:00
bjorn e59a75fce8 Pass camera functions; 2022-05-30 12:29:52 -07:00
bjorn ff77a30f01 Default shaders; 2022-05-27 20:47:20 -07:00
bjorn 03a53bcae2 Fix Buffer copy range calculation; 2022-05-26 00:11:02 -07:00
bjorn 6440bc68f3 Pass:mipmap; 2022-05-26 00:07:10 -07:00
bjorn af0e388e91 Pass:copy; Pass:blit; 2022-05-25 23:52:24 -07:00
bjorn 885e335f8c Image dimension accessors take mip level; 2022-05-25 23:51:51 -07:00
bjorn 6771ff64b5 Pass:clear; 2022-05-25 19:45:01 -07:00
bjorn 99ecd04e27 Pass:send; 2022-05-23 23:10:11 -07:00
bjorn a0db01959d Shader:clone; 2022-05-22 15:10:07 -07:00
bjorn 4f568ed84d s/setColorMask/setColorWrite; Pass:setColor; 2022-05-11 17:30:08 -07:00
bjorn 070e4f304d lovr.graphics.get/setBackground; 2022-05-11 15:38:05 -07:00
bjorn 970a84a514 Surface, swapchain, window texture, vsync; 2022-05-11 15:28:04 -07:00
bjorn f7b4ec725f Render passes; 2022-05-11 12:51:13 -07:00
bjorn 24f09ea608 lovr.graphics.submit works; 2022-05-11 12:50:49 -07:00
bjorn bfa0d94f2d Pass pipeline API; 2022-05-11 12:50:26 -07:00
bjorn e820e40e08 Move window opening to lovr.system; 2022-05-09 12:43:19 -07:00