Previous topicNext topic

Null Module?

Suggestions for new features for Magic.
Post Reply
kid.danger
Posts: 16
Joined: Wed May 17, 2017 6:17 pm

Null Module?

Post by kid.danger »

Hi! I'm currently using Transparency modules set to 0.0 to route my "roups of modules through and though I don't believe it adds too much additional processing power, something like this may be helpful for grouping modules together by routing them through a module that does nothing other than tidy up the workspace a bit. Cheers!
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Null Module?

Post by Magic »

Sure, but don't use the Transparency module for that. It does require some processing power even when set to 0.

The Transform modules would be better. Scale set to 1, or Translate set to 0, would do nothing to your input. Actually the "lightest" one would be the RotateVector module with the Angle param set to 0.
kid.danger
Posts: 16
Joined: Wed May 17, 2017 6:17 pm

Re: Null Module?

Post by kid.danger »

Awesome! Thanks for pointing that out, Eric.
synthmusic
Posts: 16
Joined: Wed Sep 02, 2020 6:45 am

Re: Null Module?

Post by synthmusic »

Another thing you can do is make an ISF module called Annotation (or some such) that just passes through the input. The cool thing is you can disable the Show Param For both Bypass and Power, and just have a block with some text:
annotationblock.png
annotationblock.png (8.73 KiB) Viewed 8899 times
I've made a file called :
Annotation.fx

and added the code to just pass through:

Code: Select all

/*{
	"INPUTS": [
		{
			"NAME": "inputImage",
			"TYPE": "image"
		}
	]
}*/
void main() {
	gl_FragColor = IMG_THIS_PIXEL(inputImage);
}
That goes in your documents in magic > modules or some folder therein. It's attached as well.

EDIT: After discussion with Eric below, if you go this route you should leave bypass showing and check it to minimize processor usage.
Attachments
Annotation.fs
Block for adding annotations, just passes through input
(250 Bytes) Downloaded 267 times
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Null Module?

Post by Magic »

Using an ISF module for that is a waste of processing and memory. Even if the image isn’t being modified, it’s still being copied.
synthmusic
Posts: 16
Joined: Wed Sep 02, 2020 6:45 am

Re: Null Module?

Post by synthmusic »

Eric wrote:Using an ISF module for that is a waste of processing and memory. Even if the image isn’t being modified, it’s still being copied.
Hmmm, seen several of these over time, trying to collect all the info. Is this as opposed to the RotateVector module? When seen previously I took away the processing would be minimal for this ISF, perhaps only if bypassed?

Out of curiosity, do the internal modules take very much less resources than the ISFs? Also think in the past you suggested the InputSelector was doing the absolute least amount of work, is that true over the RotateVector? Thanks!
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Null Module?

Post by Magic »

Bypassing will definitely avoid all processing, no matter the module.

The RotateVector module has minimum processing when it's *not* bypassed, as long as the angle is 0.

The InputSelector also has minimum processing when not bypassed, but it can only pass one input at a time.

Some of Magic's internal modules are ISF, so it isn't about internal vs ISF.
Post Reply