Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local colourRemover = Shader()
- colourRemover:compileFromFile(nil,Misc.resolveFile("flip.frag"))
- local playerBuffer = Graphics.CaptureBuffer(800,600)
- local bgBuffer = Graphics.CaptureBuffer(800,600)
- function oag.onDraw()
- bgBuffer:captureAt(-100)
- Graphics.drawBox{x=0,y=0,width=800,height=800,priority=-100,color={1,0,0.8627,1}}
- player:render{
- x = 400-(player.width/2),y = 300-(player.height/2),
- sceneCoords = false,priority = -100,
- }
- playerBuffer:captureAt(-100)
- local x,y = 0,0
- Graphics.glDraw{
- texture = playerBuffer,
- vertexCoords = {
- x ,y+600,
- x+800,y+600,
- x ,y ,
- x+800,y ,
- },
- textureCoords = {
- (0),(0),
- (1),(0),
- (0),(1),
- (1),(1),
- },
- primitive = Graphics.GL_TRIANGLE_STRIP,
- priority = -25,shader = colourRemover,
- uniforms = {
- keyColor = {1,0,0.8627,1},
- threshold = 1.5/255,
- },
- }
- Graphics.glDraw{
- texture = bgBuffer,
- vertexCoords = {
- x ,y ,
- x+800,y ,
- x ,y+600,
- x+800,y+600,
- },
- textureCoords = {
- (0),(0),
- (1),(0),
- (0),(1),
- (1),(1),
- },
- primitive = Graphics.GL_TRIANGLE_STRIP,
- priority = -100,
- }
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement