Simplify fill;

lovr.graphics.fill renders a fullscreen quad, it's convenient because
you don't need to set up a mesh and toggle all the pipeline states.

However, if you are dealing with copying/rendering between stereo
textures, you have to write your own shader for that.  For now.
This commit is contained in:
bjorn 2019-08-03 16:03:13 -07:00
parent db57592646
commit 06fb8b2503
2 changed files with 1 additions and 10 deletions

View File

@ -954,15 +954,7 @@ static int l_lovrGraphicsStencil(lua_State* L) {
}
static int l_lovrGraphicsFill(lua_State* L) {
Texture* texture = NULL;
if (!lua_isnoneornil(L, 1)) {
Canvas* canvas = luax_totype(L, 1, Canvas);
if (canvas) {
texture = lovrCanvasGetAttachments(canvas, NULL)->texture;
} else {
texture = luax_checktype(L, 1, Texture);
}
}
Texture* texture = lua_isnoneornil(L, 1) ? NULL : luax_checktype(L, 1, Texture);
float u = luax_optfloat(L, 2, 0.f);
float v = luax_optfloat(L, 3, 0.f);
float w = luax_optfloat(L, 4, 1.f - u);

View File

@ -247,7 +247,6 @@ const char* lovrFontFragmentShader = ""
const char* lovrFillVertexShader = ""
"vec4 position(mat4 projection, mat4 transform, vec4 vertex) { \n"
" texCoord.x = texCoord.x * (1. / lovrViewportCount) + (lovrViewID * 1. / float(lovrViewportCount)); \n"
" return vertex; \n"
"}";