Adjusting brightness of a texture

Weston Jones's icon

I am trying to adjust the brightness of video playing in open GL. I have it working using the info in cc.brightness.ip.jxs-help.maxpat. However the problem I'm having is my video only plays when I have the help file open. There's something I'm not connecting properly in my patch, but I can't figure it out. Any help is greatly appreciated!

Max Patch
Copy patch and select New From Clipboard in Max.

Pedro Santos's icon

Hi, Weston. Several things:
You should not be using 2 different render contexts ("jit.world" and "jit.gl.render fa"). Just use jit.world (erase jit.gl.render fa and associate the jit.gl.slab with the main render (not "fa"))
You have to send the "start" message for the movie to begin playback. I didn't see it.

Max Patch
Copy patch and select New From Clipboard in Max.

Weston Jones's icon

That works, thanks Pedro!

However, one thing I'm now noticing, is I think with the added computations, there are some dropped frames. Nothing crazy, just not super smooth.

Is there a way to buffer video before sending to Syphon, so that no frames are dropped? I don't need the playback to be 100% live. If it it were a few seconds behind, that would be fine.

Or are there other ways you would recommend escaping dropped frames?

My current patch below:

Max Patch
Copy patch and select New From Clipboard in Max.

Thank you!

Weston Jones's icon

I followed the below instructions (namely changing the Scheduler refresh rate and opening in low-rez mode and @displaylink 0) and it mostly has solved the issue.

Would still be interested in knowing if there's a way to buffer before sending to Syphon though!

*************
hi guys. after looking at this issue in detail, i've come to a few conclusions.

1 - running under Yosemite vs Mavericks incurs a slight performance hit for rapidly updating GUI objects. this affects Max 6 and Max 7 the same.

2 - if using jit.world with the default of @displaylink 1, there will be a fps drop when running a patch with rapidly updating GUI objects. (Max 7 only, jit.world doesn't exist in Max 6)

3 - if running on a Retina machine in hi-res mode vs lo-res, there is a significant FPS drop for any GUI activity. so anytime the patch is unlocked, window resized or scrolled, GUI object updated. affects Max 6 and Max 7 the same.

As always, if you want consistent, stable FPS from your Jitter patch, you should minimize GUI activity. if your project requires significant GUI activity (opening windows, updating GUI objects every frame, unlocking the patch during performance(?)), then you have a few options. The best is to separate your GUI patches entirely from your engine patches, and run 2 instances of Max, passing messages using udpsend/receive. a second, much simpler option is to run Max in lo-res mode (get info on the app icon, check the box next to Open in Low Resolution). a third option is to change the Max App preference for Scheduler -> Refresh Rate, to something like 200ms.

last, if using jit.world with lots of GUI activity, try disabling displaylink (@displaylink 0).

hope this helps.

^^^ from: https://cycling74.com/forums/drastic-frame-drop-max-7