Skip to content

Commit

Permalink
Merge pull request #47 from Yoshubs/revert-46-master
Browse files Browse the repository at this point in the history
revert hayas thingies 1
  • Loading branch information
Yoshubs authored Sep 25, 2021
2 parents 47739a0 + 087d0c2 commit a0d3301
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
26 changes: 12 additions & 14 deletions source/gameFolder/meta/shaders/PerspectiveShader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package gameFolder.meta.shaders;

import flixel.math.FlxAngle;
import flixel.system.FlxAssets.FlxShader;
import openfl.display.GraphicsShader;

class PerspectiveHelper
{
Expand All @@ -14,48 +13,48 @@ class PerspectiveHelper

public function new()
{
shader.data.rotX.value = [0];
shader.data.rotY.value = [0];
shader.data.skewX.value = [0];
shader.data.skewY.value = [0];
shader.rotX.value = [0];
shader.rotY.value = [0];
shader.skewX.value = [0];
shader.skewY.value = [0];
}

function set_rotX(value:Float):Float
{
rotX = value;
shader.data.rotX.value = [value * FlxAngle.TO_RAD];
shader.rotX.value = [value * FlxAngle.TO_RAD];

return value;
}

function set_rotY(value:Float):Float
{
rotY = value;
shader.data.rotY.value = [value * FlxAngle.TO_RAD];
shader.rotY.value = [value * FlxAngle.TO_RAD];

return value;
}

function set_skewX(value:Float):Float
{
skewX = value;
shader.data.skewX.value = [value * FlxAngle.TO_RAD];
shader.skewX.value = [value * FlxAngle.TO_RAD];

return value;
}

function set_skewY(value:Float):Float
{
skewY = value;
shader.data.skewY.value = [value * FlxAngle.TO_RAD];
shader.skewY.value = [value * FlxAngle.TO_RAD];

return value;
}
}

class PerspectiveShader extends GraphicsShader
class PerspectiveShader extends FlxShader
{
var frag = '
@:glFragmentSource('
#pragma header

uniform float rotX;
Expand Down Expand Up @@ -125,10 +124,9 @@ class PerspectiveShader extends GraphicsShader
gl_FragColor = vec4(texture(bitmap, uv) + vec4(uv.x, uv.y, 0.0, 0.1) * 0.0);
//gl_FragColor = vec4(uv.x, uv.y, 0.0, 1.0);
}
}';

}')
public function new()
{
super("", frag);
super();
}
}
6 changes: 3 additions & 3 deletions source/gameFolder/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ class PlayState extends MusicBeatState
// Uncomment the code below to apply the effect

/*
var shader:GraphicsShader = new GraphicsShader("", File.getContent("./assets/shaders/vhs.frag"));
FlxG.camera.setFilters([new ShaderFilter(shader)]);
*/
var shader:GraphicsShader = new GraphicsShader("", File.getContent("./assets/shaders/vhs.frag"));
FlxG.camera.setFilters([new ShaderFilter(shader)]);
*/
}

var staticDisplace:Int = 0;
Expand Down

0 comments on commit a0d3301

Please sign in to comment.