Browse Source

Pass:setViewport/Scissor are global now;

bjorn 1 year ago
parent
commit
3562686c64
3 changed files with 8 additions and 2 deletions
  1. 2 2
      api/init.lua
  2. 3 0
      api/lovr/graphics/Pass/setScissor.lua
  3. 3 0
      api/lovr/graphics/Pass/setViewport.lua

+ 2 - 2
api/init.lua

@@ -19920,7 +19920,7 @@ return {
               description = "Sets the scissor rectangle.  Any pixels outside the scissor rectangle will not be drawn.",
               description = "Sets the scissor rectangle.  Any pixels outside the scissor rectangle will not be drawn.",
               key = "Pass:setScissor",
               key = "Pass:setScissor",
               module = "lovr.graphics",
               module = "lovr.graphics",
-              notes = "`x` and `y` can not be negative.\n\nThe default scissor rectangle covers the entire dimensions of the render pass textures.",
+              notes = "The scissor will apply to all draws in a Pass, even if this function is called after adding the draws.\n\n`x` and `y` can not be negative.\n\nThe default scissor rectangle covers the entire dimensions of the render pass textures.",
               related = {
               related = {
                 "Pass:setViewport"
                 "Pass:setViewport"
               },
               },
@@ -20237,7 +20237,7 @@ return {
               description = "Sets the viewport.  Everything rendered will get mapped to the rectangle defined by the viewport.  More specifically, this defines the transformation from normalized device coordinates to pixel coordinates.",
               description = "Sets the viewport.  Everything rendered will get mapped to the rectangle defined by the viewport.  More specifically, this defines the transformation from normalized device coordinates to pixel coordinates.",
               key = "Pass:setViewport",
               key = "Pass:setViewport",
               module = "lovr.graphics",
               module = "lovr.graphics",
-              notes = "The viewport rectangle can use floating point numbers.\n\nA negative viewport height (with a y coordinate equal to the bottom of the viewport) can be used to flip the rendering vertically.\n\nThe default viewport extends from `(0, 0)` to the dimensions of the target textures, with min depth and max depth respectively set to 0 and 1.",
+              notes = "The viewport will apply to all draws in a Pass, even if this function is called after adding the draws.\n\nThe viewport rectangle can use floating point numbers.\n\nA negative viewport height (with a y coordinate equal to the bottom of the viewport) can be used to flip the rendering vertically.\n\nThe default viewport extends from `(0, 0)` to the dimensions of the target textures, with min depth and max depth respectively set to 0 and 1.",
               related = {
               related = {
                 "Pass:setScissor",
                 "Pass:setScissor",
                 "Pass:getDimensions"
                 "Pass:getDimensions"

+ 3 - 0
api/lovr/graphics/Pass/setScissor.lua

@@ -30,6 +30,9 @@ return {
     }
     }
   },
   },
   notes = [[
   notes = [[
+    The scissor will apply to all draws in a Pass, even if this function is called after adding the
+    draws.
+
     `x` and `y` can not be negative.
     `x` and `y` can not be negative.
 
 
     The default scissor rectangle covers the entire dimensions of the render pass textures.
     The default scissor rectangle covers the entire dimensions of the render pass textures.

+ 3 - 0
api/lovr/graphics/Pass/setViewport.lua

@@ -42,6 +42,9 @@ return {
     }
     }
   },
   },
   notes = [[
   notes = [[
+    The viewport will apply to all draws in a Pass, even if this function is called after adding the
+    draws.
+
     The viewport rectangle can use floating point numbers.
     The viewport rectangle can use floating point numbers.
 
 
     A negative viewport height (with a y coordinate equal to the bottom of the viewport) can be used
     A negative viewport height (with a y coordinate equal to the bottom of the viewport) can be used