renderEffect() parameters
-
You're right it is indeed called fx_posterize. The command will look like this:
renderEffect( image, frameBuffer, fx_posterize, [ levels ] )
Where levels is the number of intensity levels per colour channel. I found a really SNES looking palette at about 8, but I was using pixel art with this effect so there's already a limited palette going on there.
Experiment! You can make things look deliciously NES-like with it :)
-
So It's just one number for levels, rather than a vector or something?
Now let's do fx_outline! (This is fun,) Trying multiple params didn't seem to help. Does it only do red? Or am I doing it wrong?
-
Yeah it is just the one number.
Haha, alright! Outline would be the following:
renderEffect( image, frameBuffer, fx_outline, [ threshold, 0, 0, 0, r, g, b ] )
Currently you must put 0's in those slots. They are unused parameters but must be filled - this will change in future.
RGB are 0-1 range.
0.1
gives very interesting results! -
@Dave Trying to figure out how to make a color image look monochrome. I thought maybe fx_colourAdjust. Either that or maybe fx_toneMap.
Any help with parameters would be much appreciated.
-
@Zero-Division We could do with having these fully documented
I have had a play with fx_colourAdjust and have managed to display a colour image in black and white
The arguments are fx_colourAdjust [ biasR, biasG, biasB, unused, gainR, gainG, gainB, unused, curveR, curveG, curveB, saturation ]
image = loadImage("FUZE/Trains") renderEffect(image, framebuffer, fx_colouradjust, [ 0.5, 0.5, 0.5, 0, 0.5, 0.5, 0.5, 0, 5, 5, 5, 0 ]) update() sleep(3)
0.5 seems to be the value for unchanged on most of the parameters
a saturation of 0 is black and white
I am not really clear how the curve values work -
For anyone reading this thread, the parameters for the various effects are now documented under Help->Commands->renderEffect
-
Yes it tells you what the parameters are here: https://fuzearena.com/help/view/renderEffect
-
@Dave - Question, can we apply multiple render effects and layer them ?
Gonna have a play around tonight and was thinking how the scanlines and other effects may work together :)
-
Absolutely you can, there are a few ways to do it, and it depends on what you're going for. The basic form of daisy-chaining them is as follows:
gw = gwidth() gh = gheight() // first, you'll need separate draw target images for each effect img = createImage( gw, gh, false, image_rgba ) img_2 = createImage( gw, gh, false, image_rgba ) img_3 = createImage( gw, gh, false, image_rgba ) loop setDrawTarget( img ) clear() // all the things you want to draw setDrawTarget( frameBuffer) clear() // render the first image to the second with an effect: renderEffect( img, img_2, fx_crt, [ 180, 2, 0.01 ] ) // for example // now render the second image to the third with another effect renderEffect( img_2, img_3, fx_outline, [ 0.1, 0, 0, 0, 1, 1, 1 ] ) // finally, render the third image to the frame buffer, with another effect if you want! renderEffect( img_3, frameBuffer, fx_posterize, [ 1 ] ) update() repeat
So that's the daisy-chaining. You can do this with as many or as few effects as desired.
The second way to go about it is to render each effect separately, to different draw targets, then draw them all at once to the frame buffer, effectively "overlaying" the images. This would allow you to have a blur effect for example only applied to a portion of an image, with a crt filter applied to the rest.
img = createImage( gw, gh, false, image_rgba ) // The rgba part is especially important here as the transparency is necessary to overlay the images. img_2 = createImage( gw, gh, false, image_rgba ) img_3 = createImage( gw, gh, false, image_rgba ) loop setDrawTarget( img ) clear() // all the stuff for this image setDrawTarget( img_2 ) clear() // all the stuff for this image setDrawTarget( frameBuffer ) renderEffect( img, frameBuffer, fx_crt, [ 8, 3, 0.001 ] ) // render first image to frameBuffer with a crt shader renderEffect( img_2, frameBuffer, fx_blur, [ 1/50, 1/50, 1, 1 ] ) // render second image to frameBuffer with a blur effect update() repeat
Of course, all the examples there just use arbitrary values for the purposes of providing a working example - let me know how you get on!
-
@Dave Thanks mate, appreciate the detailed answer! I'll have a play and share some results :)
-
No worries at all mate, enjoy! I think I will copy and paste that info into hints and tips