Commit Graph

29 Commits

Author SHA1 Message Date
Alex Szpakowski f30a0d72f0 Added Shader:getExternVariable(name).
Returns the base type name ('float', 'image', etc.), the number of components (2 for a vec2), and number of array elements (1 for a non-array variable) for the extern variable with the specified name in the shader.

Returns nil if the variable either doesn't exist or was optimized out by the driver's shader compiler.
2014-04-25 20:32:42 -03:00
Alex Szpakowski af88423285 Fixed an attempted creation of an array with a constant size of 0 2014-04-23 19:43:54 -03:00
Alex Szpakowski 8b90f64440 Don't try to bind the love_PseudoInstanceID vertex shader attribute (it's disabled for now) 2014-04-17 19:48:16 -03:00
Alex Szpakowski c5c788e976 Added a built-in variable readable in shaders: ‘love_ScreenSize’. Its x and y components contain the width and height of the current viewport. Resolves issue #841. 2014-01-27 02:58:34 -04:00
Alex Szpakowski 7556fde5e6 Added antialiasing (MSAA) support to Canvases via a new optional parameter. Added Canvas:getFSAA. 2014-01-27 01:31:41 -04:00
Alex Szpakowski 73f1ce0d40 Added instancing support to Meshes via Mesh:setInstanceCount. Added a new built-in variable to vertex shaders: int love_InstanceID.
love.graphics.draw(mesh) will draw the mesh instancecount times, using hardware instancing when available. The only way to draw individual instances differently from each other is to use the love_InstanceID variable in a vertex shader.

Added love.graphics.isSupported(“instancing”). Hardware instancing is supported if true, otherwise a (slower) pseudo-instancing fallback is used internally when drawing instanced meshes.
2014-01-21 06:01:50 -04:00
Alex Szpakowski 3120a0e650 Goodbye 2013, hello 2014! 2014-01-03 17:28:58 -04:00
Alex Szpakowski aa69a695d3 Canvases can now be used in SpriteBatches, ParticleSystems, and Meshes (resolves issue #782).
Canvases and Images are now subclasses of the new Texture class.
Added setTexture and getTexture methods for Meshes, ParticleSystems, and SpriteBatches (the old set/getImage methods are deprecated but not removed.)
Canvas texture coordinates are no longer flipped.
2014-01-03 17:07:12 -04:00
Alex Szpakowski c1b4f31578 Fixed detection for shader support 2013-11-06 01:50:54 -04:00
vrld 3b04eeeec8 Fix #756: Sending an Image to a shader does not retain it
Each shader contains a map of uniform name -> bound retainable Object. After
setting the uniform, sendImage() and sendCanvas() release() the Object with
the requested name (if present) and record the new Image/Canvas.

Related bugfix: Shader::attach() calls retain()/release() on the shader.
2013-11-03 18:27:36 +01:00
Alex Szpakowski 95eedcd1be Using auto for some iterators for less dense-looking code 2013-09-30 02:35:10 -03:00
Alex Szpakowski f41a2ed910 Reverted commit 8c64a0c (love.graphics.setCanvas(nil) erroring) 2013-07-19 19:53:39 -03:00
Alex Szpakowski 2ccbbe1c64 Fixed love.graphics.newShader crashing when extern variables with very short names are used 2013-07-11 19:26:50 -03:00
Alex Szpakowski 267d901cd6 Fixed Geometry:flip when the Geometry was created with newQuad (resolves issue #671) 2013-07-11 16:09:41 -03:00
Alex Szpakowski c7ebb50b70 love.graphics.newParticleSystem now uses a default buffer size of 1000 (issue #598) 2013-05-08 17:19:25 -03:00
Alex Szpakowski 7ab3809165 Fixed Object:typeOf for love.physics objects new to 0.8.0, removed vestigial ColorMode code 2013-05-07 15:23:26 -03:00
Alex Szpakowski b44c083894 Added Shader:sendInt 2013-04-27 19:26:32 -07:00
Alex Szpakowski 97f7ad1a54 Fixed extern matrices 2013-04-25 11:16:43 -07:00
Alex Szpakowski 0130b726de Improved error messages when sending bad values to a shader (also issue #587) 2013-04-24 23:19:37 -07:00
Alex Szpakowski 6fd3038405 Improved clarity/readability of internal OpenGL state shadowing functions 2013-04-17 01:06:33 -03:00
Alex Szpakowski 1c720afaf8 Cleaned up some shader code internals 2013-04-06 14:14:11 -03:00
Alex Szpakowski cfe6014b68 Improved shader:getWarnings() to return shader compiler warnings as well as shader program linker and usage warnings 2013-04-06 14:02:24 -03:00
Alex Szpakowski d5aa807747 More internal code cleanup 2013-03-31 19:02:27 -03:00
Alex Szpakowski 07ba81f060 Renamed all cases of "fragment shader" to "pixel shader" 2013-03-17 18:11:41 -03:00
Alex Szpakowski 96161c66f6 Updated copyright text for the new year 2013-02-05 05:32:49 -04:00
Alex Szpakowski 7a16e4cb49 Made Visual Studio play nice with the C++ STL min/max functions in the new shader code 2013-01-29 13:01:34 -04:00
Alex Szpakowski 02d2a872ab Improved shader member variable names, fixed up XCode project file 2013-01-29 04:34:36 -04:00
Alex Szpakowski 5cae5ea37e Removed code for tesselation and geometry shader detection 2013-01-24 18:26:40 -04:00
Alexander Szpakowski e24d721381 Renamed all instances of 'ShaderEffect' (previously 'PixelEffect') to 'Shader'. 2013-01-16 07:21:41 -04:00