Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

OS Engine Lua Script API: Shaders

notweuz edited this page Apr 28, 2022 · 1 revision

Shaders.

We brought back shaders from older versions of Psych Engine. So you can add some shaders to sprites by using luas. If you can't understand this, check source code. NOTE: I'm lazy to write actually good wiki, so it'll be better if you'll check source code for functions instead of browsing wikis.

Shaders Functions

makeLuaShaderSprite(tag:String, shader:String, x:Float, y:Float, optimize:Bool=false)

Spawns lua shader sprite with selected shader and tag.

  • tag can be camera object (camHUD, camGame) or other objects.

addChromaticAbberationEffect(tag:String,chromeOffset:Float = 0.005)

Adds chromatic abberation effect to selected object (tag) with selected offset

  • tag can be camera object (camHUD, camGame) or other objects.

addScanlineEffect(tag:String,lockAlpha:Bool=false)

Adds scanline effect to selected object (tag) with locked alpha (or no)

  • tag can be camera object (camHUD, camGame) or other objects.

addGrainEffect(tag:String,grainSize:Float,lumAmount:Float,lockAlpha:Bool=false)

  • tag can be camera object (camHUD, camGame) or other objects.

addTiltshiftEffect(tag:String,blurAmount:Float,center:Float)

Adds tiltshift effect on selected object with selecter blur amount and center.

  • tag can be camera object (camHUD, camGame) or other objects.

addVCREffect(tag:String,glitchFactor:Float = 0.0,distortion:Bool=true,perspectiveOn:Bool=true,vignetteMoving:Bool=true)

Adds VCR effect to selected object (old TVs vibes.)

  • tag can be camera object (camHUD, camGame) or other objects.

createShaders(shaderName:String, ?optimize:Bool = false)

Creates shader with selected name.

setShadersToCamera(shaderName:Array, cameraName:String)

Sets selected shaders to camera.

clearShadersFromCamera(cameraName:String)

Clears shaders from selected camera.

addGlitchEffect(tag:String,waveSpeed:Float = 0.1,waveFrq:Float = 0.1,waveAmp:Float = 0.1)

Adds Glitch effect to selected tag with selected speed and other args.

  • tag can be camera object (camHUD, camGame) or other objects.

addPulseEffect(tag:String,waveSpeed:Float = 0.1,waveFrq:Float = 0.1,waveAmp:Float = 0.1)

Adds Pulse effect to selected tag with selected speed and other args.

  • tag can be camera object (camHUD, camGame) or other objects.

addDistortionEffect(tag:String,waveSpeed:Float = 0.1,waveFrq:Float = 0.1,waveAmp:Float = 0.1)

Adds Distortion effect to selected tag with selected speed and other args.

  • tag can be camera object (camHUD, camGame) or other objects.

addInvertEffect(tag:String,lockAlpha:Bool=false)

Adds Color invert effect to selected tag.

  • tag can be camera object (camHUD, camGame) or other objects.

addGreyscaleEffect(tag:String)

Adds Greyscale effect to selected tag.

  • tag can be camera object (camHUD, camGame) or other objects.

addGrayscaleEffect(tag:String)

Adds Grayscale effect to selected tag.

  • tag can be camera object (camHUD, camGame) or other objects.

add3DEffect(tag:String,xrotation:Float=0,yrotation:Float=0,zrotation:Float=0,depth:Float=0)

Adds 3D effect to selected tag with selected args.

  • tag can be camera object (camHUD, camGame) or other objects.

addBloomEffect(tag:String,intensity:Float = 0.35,blurSize:Float=1.0)

Adds Bloom effect to selected tag with selected blur size and intensity.

  • tag can be camera object (camHUD, camGame) or other objects.

clearEffects(tag:String)

Clears effects from selecter object

  • tag can be camera object (camHUD, camGame) or other objects.
Clone this wiki locally