Questions about renderEffect() and fx_colouradjust.
-
Sorry that no one has replied to this yet. I wanted to try it for myself first. I don't think that anyone has tried using renderEffect on a sprite before (correct me if I am wrong people)
OK firstly the documentation on the renderEffect options needs expanding as there is very little detail on what all of the options do.
I did a bit of research on colo(u)r correction and I found this: https://www.sidefx.com/docs/houdini/nodes/vop/colorcorrection.html which I think covers the gain, bias and saturation but I am not sure about the "curve"
I also found this: "Gain affects color in the bright parts of the picture and Bias affects color in the dark parts of the picture"
Anyway it seems like this is not respecting the image transparency as you have noticed. I will raise an issue for this.
As for the British spelling, well we are British! Actually there are US spelling aliases for a lot of the built in colour functions though not it seems for the renderEffect constants.
-
Thanks!
Yeah, the loss of transparency feels a lot like a bug... I hope it gets fixed, even though I do understand that it might not have top priority.
-
Just out of curiosity, what is the basis of these RenderEffect functions? Are they built into the hardware or something?
Since you guys don’t seem to have 100% grasp on parameters and stuff, I am guessing you did not originally write them?
-
Well I didn't write them - I just did the help files. I will try to get some more information from the actual developers!
-
Bias - A value added to the given colour channel
Gain - A multiplier on the given colour channel, applied in order that it appears in the parameters, so this takes into account the bias
Curve - Gamma curve, increases or decreases the perceived contrast, applied separately to each colour channel. As if each colour channel were greyscale. 0 - inf
I hope this helps. Experimentation will likely lead to the best understanding of these parameters. Thanks for pointing out the transparency, and this post also highlights the fact that we need a better explanation of the individual parameters in the help that simply the names. I will raise an issue for this!
-
@Dave Beat you to it!
-
Thanks a lot, both of you! I really appreciate you taking the time to answer.
-
I too, am curious about the
renderEffect()
function and it's parameters. I have been playing with your example and have found that it is possible to restore the transparency using thefx_threshold
effect with a threshold of0.035
. This value I determined experimentally.newShipImage2 = createImage(imageSize(shipImage).x, imageSize(shipImage).y, false, image_rgba) renderEffect(newShipImage, newShipImage2, fx_threshold, [ 0.035 ])
It is also possible to generate a mask image from a source image to represent transparent regions. Applying a mask requires some extra work changing blend modes (with the
setBlend()
function) while drawing the image however, so it may not be compatible withdrawSprites()
-
@Gothon, that’s very interesting findings. I will do some more experimenting myself. Thanks!
-
@vinicity ...and there was a post https://fuzearena.com/forum/topic/470/using-multiple-render-effects about combining the effects.