bjornbytes / lovr-docs

Documentation for LÖVR
45 stars 34 forks source link

Postprocessing example broken #15

Closed porglezomp closed 4 years ago

porglezomp commented 4 years ago

The postprocessing example fails with "bad argument #1 to 'fill' (Texture expected, got userdata)".

This part can be fixed with a two-line change.

 local function fullScreenDraw(source)
-  lovr.graphics.fill(source)
+  lovr.graphics.fill(source:getTexture())
 end

 -- ...

     screenShader:send("direction", {0, 4})
-    lovr.graphics.fill(tempCanvas[2]) -- On the final pass, render directly to the screen.
+    lovr.graphics.fill(tempCanvas[2]:getTexture()) -- On the final pass, render directly to the screen.
   end

Unfortunately (at least in the local viewer app on macOS) it renders completely incorrectly, flickering and horizontally duplicating the scene 16 or so times, presumably due to the double-wide texture rendering with the canvas.

• macOS 10.14.6 • LOVR 0.13.0 (Very Velociraptor) • Intel Iris Graphics 6100 1536 MB

image
bjornbytes commented 4 years ago

This should be working much better now and handle differences between platforms. Still testing on all the devices I can get access to.