Rendercam - Universal Camera Library


It does follow different shader rules that are inherent on different platforms.

You should begin to release versioned releases on Github for Rendercam as it becomes widely adopted.


Maybe @Sven can spot what’s wrong?


@Pkeod Good to know. I don’t suppose there’s convenient documentation on the differences? Yeah, I’ve planned to switch to versioned releases but haven’t gotten to it yet. It turns out, releasing a library for public use comes with some maintenance headaches! (Of course, this little demo doesn’t actually have much to do with Rendercam.)

@britzl OK, thanks for helping debug this. I did try a web build, and that turned up some slightly more informative errors, though I haven’t been able to track down the causes yet:

Regarding the second and third errors, my render targets are set to render.WRAP_CLAMP_TO_EDGE.

I will keep looking into it in a little while.


Well I’m stupid. My render targets were set up with the Clamp to Edge mode in the render script, but the samplers on the material were still set to Repeat. Fixing that solved the “active texture is ‘incomplete’” errors on web. Interestingly, if I only used one render target it was fine, but with two I got that error about each texture.

@britzl Can you try this version to see if it works on OSX? Thanks!
-link removed- (It didn’t. See below for a working version)

I’m still not sure what’s causing the “Error: WebGL warning: uniform4fv: Function used differs from uniform size: 16” on web, but I know it’s coming from one of my materials, and I can’t see that it breaks anything. I will look more tomorrow.


Crashed on macOS.
ERROR:GRAPHICS: gl error 1282: invalid operation
Assertion failed: (0), function SetConstantV4, file …/src/opengl/graphics_opengl.cpp, line 1346.


Thanks Dmitriy!

OK, hopefully the 3rd time’s the charm. I cleared up the other error I got on web, and it sounds like the same error as on MacOS (stupid again, I had extra stuff in my vertex shader). (432.1 KB)


Works on macOS & iOS. Nice example, btw.


Yess! Thanks again! Now I know to be much more careful with my shader code in the future (and test web builds for errors). If you didn’t figure it out already, you can move the “character” around with the arrow keys.


It worked :rofl:
This is so educational, thank you.


Hi Everyone,

@ross.grams, thanks for Rendercam, it works great!

Is anyone seeing the following issue when using the rendercam.pan() function with something like:
rendercam.pan(20, 0)

ERROR:SCRIPT: /rendercam/rendercam.lua:186: bad argument #1 to '__add' (vector3 expected, got nil)
stack traceback:
	[C]: in function '__add'
	/rendercam/rendercam.lua:186: in function 'pan'

All the other functions seem to work ok, eg:
rendercam.shake(2, 10)

all do what they’re supposed to when used at exactly the same code point. Apologies if I’m missing something.


Hmm, that’s strange. Argument #1 is the stored local position of the camera, I’m not sure how that would be nil. But obviously there’s something I didn’t anticipate going on. Can you share your project?


Thanks for the reply.

Sure, do you need to PM me you email address for me to share?

I can replicate this in the Rendercam example you provided with the addon also. Adding this to the end of the init() function in main_example.script creates the same error. The zoom, shake and recoil all work:

rendercam.pan(10, 0) -- Doesn't work
-- rendercam.zoom(-40) --Works
-- rendercam.shake(10, 10) --Works
-- rendercam.recoil(vmath.vector3(40, 0, 0), 2) --Works	

Defold prints a load more errors in the example after the same error I get though so scroll up! :slight_smile:

Best regards


Aha, OK, thanks. I just forgot to initialize a variable, so it wasn’t set until the first update. I just pushed a fix. Thanks for reporting!


Awesome :smile:

Can confirm this fixes the problem in my project. This library really is something special. I’ve used it in various collections and game objects during testing and it works a treat.

Thanks for the library AND the fix!