Commit Graph

181 Commits

Author SHA1 Message Date
Alex Szpakowski f848b201ae Merge branch 'master' into 12.0-development 2020-07-18 21:29:36 -03:00
Alex Szpakowski dde3db3006 Apply Image:replacePixels/missing text workaround to more ATI drivers
issue #1563
2020-07-12 18:25:55 -03:00
Alex Szpakowski d13e97fd83 Merge branch 'master' into 12.0-development 2020-03-15 19:25:48 -03:00
Alex Szpakowski 8fac08809a Eliminate redundant glActiveTexture calls when shaders are used.
The redundant calls were introduced with the previous commit.
2020-03-15 19:24:49 -03:00
Alex Szpakowski c5b6cc3228 Merge branch 'master' into 12.0-development 2020-03-15 19:17:04 -03:00
Alex Szpakowski 9c2454816f Fix the active GL texture unit not always being set properly.
Fixes issues where texture methods wouldn't have any effect, depending on the current internal opengl state.
2020-03-15 01:29:33 -03:00
Alex Szpakowski aa636381d0 Fix MSAA texture creation logic 2020-02-09 12:46:52 -04:00
Alex Szpakowski 694bc9c5b7 rename love_Canvases to love_RenderTargets in shaders.
More misc. renaming
2020-02-09 12:11:19 -04:00
Alex Szpakowski 453322678c Rename internal uses of canvas to texture/render target 2020-02-08 20:40:10 -04:00
Alex Szpakowski 12c90b3dca Merge Image and Canvas GL backend classes into new common Texture class. 2020-02-07 20:29:21 -04:00
Alex Szpakowski 63c5df6aa7 Begin unification of Canvases and Images. 2020-02-03 23:05:46 -04:00
Alex Szpakowski b46b3ed552 Move some Canvas code to Texture, devirtualize Texture::draw. 2020-02-03 19:02:58 -04:00
Alex Szpakowski f9248d478c Refactor sampler state parameters for textures. 2020-02-02 22:26:28 -04:00
Alex Szpakowski 23bc1a7aae Add new mesh data formats: int32, uint32, [u]int8, [u]int16, snorm8, and snorm16.
Integer formats for vertex attributes are only supported in glsl3 shaders. They use ivec/uvec types in glsl.

--HG--
branch : minor
2020-01-11 22:24:38 -04:00
Alex Szpakowski 5f9b5a21d0 Merge default into minor
--HG--
branch : minor
2020-01-03 22:45:36 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski 361cefbb05 Add new wrap mode "clampone". Pixels sampled outside of [0, 1] are white (1, 1, 1, 1).
--HG--
branch : minor
2019-12-27 13:57:20 -05:00
Alex Szpakowski 6c662ade41 Fix disabling blending,
--HG--
branch : minor
2019-12-27 13:28:15 -05:00
Alex Szpakowski f3b52f66fe Update the internal naming convention for pixel formats.
--HG--
branch : minor
2019-12-23 23:38:04 -04:00
Alex Szpakowski 3a227cea37 Merge default into minor
--HG--
branch : minor
2019-11-19 21:47:48 -04:00
Alex Szpakowski 6a552d5a6f Allow Canvases to use the r16, rg16, and rgba16 pixel formats. 2019-11-18 22:45:54 -04:00
Alex Szpakowski 3435a6bcbf Change the internal constant color from a (per-draw) vertex attribute to a uniform. Pack most built-in uniforms into a single vec4 array and update them all with a single glUniform call.
--HG--
branch : minor
2019-11-18 21:13:54 -04:00
Alex Szpakowski 1e0a7cad67 Fix instanced vertex attributes. 2019-10-04 19:28:55 -03:00
Alex Szpakowski 157282ec7e Fix a typo causing mesh attribute instancing to behave weirdly. 2019-09-28 00:31:44 -03:00
Alex Szpakowski 58e26280c2 Fix detection for support of r16 and rg16 image formats on desktops. 2019-09-18 19:36:08 -03:00
Alex Szpakowski 55d4dc0f9e Restructure some internal vertex buffer binding code to be closer to how graphics APIs actually behave. 2019-08-25 16:50:15 -03:00
Alex Szpakowski 51d0733943 Apply workaround for font texture loading on Radeon 3000/4000-era graphics cards to mobile GPUs as well as desktop ones. 2019-05-30 20:36:19 -03:00
Alex Szpakowski 0c2153e0ca Fix a potentially uninitialized value in love.graphics code. Minor cleanup. 2019-04-02 20:20:18 -03:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Alex Szpakowski 364718fa46 Android: potentially work around a Qualcomm Adreno driver bug which prevented videos from being loaded into vram. 2018-12-31 21:02:02 -04:00
Alex Szpakowski 1c853cbcc3 Fall back to glTexImage instead of glTexStorage on Radeon 3xxx drivers on Windows. Potentially works around a graphics driver bug which prevented text from showing up. 2018-12-25 18:33:26 -04:00
Bart van Strien 571503c02e Don't use deprecated isFile in love.joystick.loadGamepadMappings (fixes #1391) 2018-04-04 17:49:51 +02:00
Alex Szpakowski 3857d09132 Don't use persistently mapped buffers on Intel Ivy Bridge GPUs on Windows. glClientWaitSync can hang with those drivers, apparently. 2018-01-06 00:42:16 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Alex Szpakowski a31b500b03 Simplify quad drawing code, and use glDrawElementsBaseVertex when available. 2017-12-24 22:05:10 -04:00
Alex Szpakowski 7354de2059 Add (low level) functionality to allow rendering 3D Meshes.
- Add love.graphics.setDepthMode(testcomparison, enablewrites).
- Add love.graphics.setMeshCullMode.
- Add love.graphics.setFrontFaceWinding.

Depth testing and depth writes require a depth buffer to work. The mesh cull mode controls whether front/back faces of a mesh are culled. The front face winding determines whether a clockwise or counterclockwise-oriented face in a mesh is considered front facing.

--HG--
branch : minor
2017-12-09 23:34:08 -04:00
Alex Szpakowski e099e57052 Cleaned up some internal love.graphics code.
--HG--
branch : minor
2017-12-03 23:04:40 -04:00
Alex Szpakowski 15cc540e4c Make internal vertex attribute code less OpenGL-specific.
--HG--
branch : minor
2017-10-25 23:12:39 -03:00
Alex Szpakowski 7a2e52b12d Cleaned up some vertex data-related code.
--HG--
branch : minor
2017-10-22 12:33:47 -03:00
Alex Szpakowski 68f1ab5f47 Check a couple more vendor strings to determine if an AMD driver is being used.
--HG--
branch : minor
2017-07-29 02:06:32 -03:00
Alex Szpakowski 30a63b6642 Fix crashes on OpenGL ES (thanks xenthral!)
--HG--
branch : minor
2017-06-08 21:10:17 -03:00
Alex Szpakowski 7694edfd52 Auto-batched draws (except for love.graphics.print, for now) are affected by 3D transforms.
--HG--
branch : minor
2017-05-17 22:03:09 -03:00
Alex Szpakowski b019a4a64c Cleaned up texture VRAM usage tracking.
--HG--
branch : minor
2017-05-06 23:56:10 -03:00
Alex Szpakowski 7161d600b7 Add mipmapping support to Canvases.
- Added an optional mipmap index argument to the non-table variant of love.graphics.setCanvas, and an optional ‘mipmap’ field to the table variant.
- Canvas:setMipmapFilter now works.
- Added Canvas:generateMipmaps.
- Added Canvas:getMipmapMode.
- Added a new ‘mipmaps’ enum field to the table passed into love.graphics.newCanvas. Accepted values are “none” (default), “manual”, and “auto”.

If a Canvas has the manual mipmap mode, you will either need to render to a mipmap level or call Canvas:generateMipmaps. If it has the auto mode, mipmaps will be automatically generated after rendering to that Canvas. Generating mipmaps is not free.

--HG--
branch : minor
2017-04-15 01:58:03 -03:00
Alex Szpakowski a0ef2ac28b Add Depth compare / shadow sampler support. Officially this is only supported in glsl3 shaders.
- Add Texture:setDepthSampleMode(comparemode). Only works on textures with depth pixel formats. A texture with the depth sample mode set will only work with a depth sampler.
- Add DepthImage, DepthArrayImage, and DepthCubeImage sampler keywords to glsl3.

--HG--
branch : minor
2017-04-12 20:26:06 -03:00
Alex Szpakowski 43172bd3f6 Add optional ‘readable’ boolean field to the table passed into love.graphics.newCanvas. Added new variant of love.graphics.getCanvasFormats which takes a ‘readable’ boolean.
--HG--
branch : minor
2017-04-11 19:03:13 -03:00
Alex Szpakowski c36a53fdcb Add new non-readable Canvas formats: depth16, depth24, depth32f, depth24stencil8, and depth32fstencil8.
--HG--
branch : minor
2017-04-11 18:34:04 -03:00
Alex Szpakowski 018a3831cb Add a new “stencil8” pixel format for Canvases (resolves issue #1003).
Also fixed Canvas MSAA (resolves issue #1271).

stencil-formatted Canvases can’t be drawn, and can only be used as the value for a new ‘depthstencil’ field to the table-argument variant of love.graphics.setCanvas.

--HG--
branch : minor
2017-04-11 00:00:22 -03:00
Alex Szpakowski 1a9262dda9 Fix compilation on iOS. Fix shader compilation on OpenGL ES. Fix (harmless) GL errors on OpenGL ES 2. Resolves issue #1266.
--HG--
branch : minor
2017-03-09 20:46:26 -04:00
Alex Szpakowski 66b299822a Array textures can be easily drawn without a shader (resolves issue #1111).
Added love.graphics.drawLayer(texture, layerindex, …). ‘texture’ must be an array texture.
Added SpriteBatch:add/setLayer.

Added Quad:get/setLayer. This applies to array textures that are drawn without specifying an explicit layer index in the draw call.

Added love.graphics.newQuad variants which have layer arguments.

--HG--
branch : minor
2017-02-26 17:11:22 -04:00