Browse Source

Try to clarify :setSampler;

bjorn 1 year ago
parent
commit
64b4a0f078
2 changed files with 8 additions and 2 deletions
  1. 1 1
      api/init.lua
  2. 7 1
      api/lovr/graphics/Pass/setSampler.lua

+ 1 - 1
api/init.lua

@@ -21110,7 +21110,7 @@ return {
                   code = "function lovr.draw(pass)\n  pass:setSampler('nearest') -- activate minecraft mode\n  pass:setMaterial(rock)\n  pass:cube(x, y, z)\nend"
                   code = "function lovr.draw(pass)\n  pass:setSampler('nearest') -- activate minecraft mode\n  pass:setMaterial(rock)\n  pass:cube(x, y, z)\nend"
                 }
                 }
               },
               },
-              notes = "The `getPixel` shader helper function will use this sampler.",
+              notes = "The `getPixel` shader helper function will use this sampler.\n\nWhen a Pass is reset, its sampler will be reset to `linear`.\n\nThe sampler applies to all draws in the pass on submit, regardless of when the sampler is set.",
               variants = {
               variants = {
                 {
                 {
                   arguments = {
                   arguments = {

+ 7 - 1
api/lovr/graphics/Pass/setSampler.lua

@@ -30,7 +30,13 @@ return {
       returns = {}
       returns = {}
     }
     }
   },
   },
-  notes = 'The `getPixel` shader helper function will use this sampler.',
+  notes = [[
+    The `getPixel` shader helper function will use this sampler.
+
+    When a Pass is reset, its sampler will be reset to `linear`.
+
+    The sampler applies to all draws in the pass on submit, regardless of when the sampler is set.
+  ]],
   example = [[
   example = [[
     function lovr.draw(pass)
     function lovr.draw(pass)
       pass:setSampler('nearest') -- activate minecraft mode
       pass:setSampler('nearest') -- activate minecraft mode