mirror of https://github.com/bjornbytes/lovr.git
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:
parent
db57592646
commit
06fb8b2503
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
"}";
|
||||
|
||||
|
|
Loading…
Reference in New Issue