Commit Graph

152 Commits

Author SHA1 Message Date
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 408fcb8b37 Fix typo; 2022-06-27 21:43:23 -07:00
bjorn 1752b220bf Pass:text supports multicolor strings; 2022-06-27 21:42:51 -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 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 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 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 3df9aea3fd Add Font shader; 2022-06-20 18:17:37 -07:00
bjorn a654cec40f lovr.graphics.newFont; 2022-06-18 17:43:12 -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 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 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 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 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 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 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 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 bfa0d94f2d Pass pipeline API; 2022-05-11 12:50:26 -07:00
bjorn d9e5ba8b9f Slightly broken compileShader/newShader; 2022-05-09 11:47:06 -07:00
bjorn 5d078461a2 Rename copy texture usage to transfer; 2022-05-06 17:26:59 -07:00
bjorn 1fde5a36d0 Transform stack; 2022-05-06 17:26:38 -07:00
bjorn 22e15513f9 Sampler; 2022-05-01 15:47:17 -07:00
bjorn 77a32333e0 lovr.graphics.pass; 2022-04-30 18:56:38 -07:00
bjorn ebe77e5924 Sketch out Texture uploads; 2022-04-30 18:49:46 -07:00
bjorn 0772d8b4de newTexture; 2022-04-30 03:06:14 -07:00
bjorn e80d254dc6 Texture API;
Except newTexture because it's hard or something
2022-04-29 20:56:23 -07:00
bjorn 4be958195d Start Texture; 2022-04-29 20:38:34 -07:00
bjorn e53ddfa03b isFormatSupported; 2022-04-29 17:16:16 -07:00
bjorn 48e2509a3c lovr.graphics.wait; 2022-04-28 22:37:03 -07:00
bjorn 7aee0a4656 Add Pass; Buffer transfers; lovr.graphics.submit; Bugfixes; 2022-04-28 22:30:31 -07:00
bjorn e8c809a870 Temporary buffers; 2022-04-27 00:28:39 -07:00
bjorn a3438274b5 Add non-scratchpad Buffers;
This includes the memory allocator and the morgue.

You can't actually write any data to the buffer yet, since we don't have
commands or temp buffers.  Temp buffers (scratchpads) are coming soon.
2022-04-26 15:32:54 -07:00
bjorn 50ebed697e Update some features and limits;
- rm dynamicIndexing and nonUniformIndexing, for now (arrays aren't well
  supported)
- rename compressed texture features
- move clip/cull distance to limit instead of feature (limit can be 0)
2022-04-26 15:31:51 -07:00
bjorn 3ae0ff568f Rework device info; 2022-04-22 13:28:59 -07:00
bjorn f37c1824da lovr.graphics.getDevice/getFeatures/getLimits; 2022-04-21 17:39:59 -07:00
bjorn 40e9a4ab73 core/gpu; 2022-04-21 17:39:59 -07:00
bjorn 37221afbc6 rm graphics module; 2022-04-21 17:39:58 -07:00
bjorn d1dc2f3199 rm pico;
Notes:

- We can actually use a single Activity.java file for oculus/pico now
- We can unconditionally compile os_android.c on Android
- No need for including extra jars in build system
- Headset rendering is guaranteed synchronous now, no need to ref L
- Add an "android flavor" build setting to differentiate between oculus
  and pico devices, since they both use OpenXR.
- Update the pico manifest to reflect their OpenXR sample
- Remove some OpenGL hacks that aren't necessary anymore
2022-03-22 16:03:21 -07:00
bjorn 4f5adbc64c lovr.system; 2021-02-25 09:00:12 -07:00
bjorn 39a4d2c1d5 rm lovr.graphics.triangle; 2021-02-24 17:45:31 -07:00
bjorn fb1447503b Fix gcc warnings; 2021-02-19 23:44:23 -07:00
bjorn 8c714c45b0 Clean up some includes; 2021-02-08 11:16:00 -07:00
bjorn f1447fd69a lovr.graphics.get/setViewPose; lovr.graphics.get/setProjection; 2020-09-24 19:03:37 -07:00
bjorn c7ca7eaa38 Add compute dispatch limit; 2020-09-18 15:19:34 -07:00
bjorn e3aa4c7d5d t.graphics.debug flag; 2020-07-28 16:12:15 -06:00
bjorn ac58a1aeba Pico: Draw the rest of the owl;
Add entrypoints, headset backend code, fill in the Activity, and
add various special cases to account for the asynchronous render loop,
lack of sRGB support, and OpenGL state resets.
2020-07-27 14:56:21 -06:00
bjorn 67ba5f3a82 Add more graphics stats; 2020-01-31 03:43:52 -08:00
bjorn 4c1917f6ce Fix some prototypes; 2020-01-23 10:55:46 -08:00
bjorn e2d8f8c645 platform -> os;
The function names are staying the same for now.
2019-12-13 19:55:46 -08:00
bjorn e316e6156b lovr.graphics.get/setColorMask; 2019-12-10 13:44:51 -08:00
bjorn c87d6dec3d lovrPlatformGetProcAddress;
Seems nicer than a global and allows for logging/hooks;
2019-12-10 13:15:12 -08:00
bjorn 2f9400a5f7 Adjust includes; 2019-12-10 13:01:28 -08:00
bjorn d21911d010 Add core/map hash table; rm lib/map; 2019-10-30 00:07:05 -07:00
bjorn ac441ec15b lovrGraphicsGetCamera; 2019-10-12 12:45:11 -07:00
bjorn 1902787b1b Modify GPU timer API;
- lovr.graphics.tock returns the latest value of the timer, or 0.
- Timers are not in the stats table anymore.

This is to prepare for an upcoming internal change that affects timers.
2019-09-18 18:21:38 -07:00
bjorn 28344928c9 Simplify arr; 2019-08-21 23:16:58 -07:00
bjorn 2fb393306c rm skybox args;
They used to always be necessary, now they are almost never necessary.
2019-06-29 21:01:03 -07:00
bjorn fa6c4a6b39 Organization; 2019-06-27 21:04:15 -07:00
bjorn 370124c88d Batching cleanup;
- Rename drawMode to topology in some places.
- Batch uses DrawCommand internally to simplify stuff.
- Do less work while flushing.
- Store global head/tail cursors instead of unused per-batch cursors.
2019-06-27 20:58:42 -07:00
bjorn 7e067da8e7 Add defaultCanvas;
Having a normal Canvas object that represents the backbuffer reduces
some indirection where we have to last-minute check if a Canvas is
set.  It also means that all of the draw-related info that was _sometimes_
on the Canvas is now _always_ on the Canvas, which reduces the amount
of redundant information we need to provide for a draw call.

There may be some issues related to changing the width/height/stereo
of the default Canvas.
2019-06-27 15:36:51 -07:00
bjorn 551dea8c86 Adjust includes; 2019-06-27 13:44:09 -07:00
bjorn b8e63adcbf graphics: Cleanup;
Make batching structs and defines private.
2019-06-27 13:38:38 -07:00
bjorn fe21de403b lovrGraphicsDrawMesh; 2019-06-27 13:35:43 -07:00
bjorn 297208c205 Minor cleanup to stream buffer code; 2019-06-27 13:01:04 -07:00
bjorn 052990aa47 Make some graphics structs private; 2019-06-27 01:48:35 -07:00
bjorn 928ccee5f1 Multiview; 2019-06-25 01:21:59 -07:00
bjorn 5cd93b66c6 rm fence syncs;
They are too buggy and are not as efficient as orphaning.
2019-06-24 19:17:55 -07:00
bjorn eb1e257209 Add new array implementation; Upgrade filesystem;
Filesystem:

- Uses streaming file IO.
- Uses less memory when requiring files.
- Simplifies its require path implementation.
2019-06-16 13:30:30 -07:00
bjorn 98f4365474 Add astc and dxt GraphicsFeatures; 2019-06-09 23:59:57 -07:00
bjorn d2bff7d239 lovr.graphics.tick and tock;
Initial support for GPU timer queries.
2019-06-01 17:29:53 -07:00