shader test project

This commit is contained in:
2024-01-14 14:19:35 -07:00
parent 0d8c821be9
commit 33796f0ed9
34 changed files with 303 additions and 0 deletions

1
shader-test/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
export/

4
shader-test/.haxerc Normal file
View File

@@ -0,0 +1,4 @@
{
"version": "4.3.1",
"resolveLibs": "scoped"
}

6
shader-test/.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"recommendations": [
"openfl.lime-vscode-extension",
"redhat.vscode-xml"
]
}

21
shader-test/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,21 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Build + Debug",
"type": "lime",
"request": "launch"
},
{
"name": "Debug",
"type": "lime",
"request": "launch",
"preLaunchTask": null
},
{
"name": "Macro",
"type": "haxe-eval",
"request": "launch"
}
]
}

13
shader-test/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"search.exclude": {
"export/**/*.hx": true
},
"[haxe]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.codeActionsOnSave": {
"source.sortImports": true
}
},
"haxe.enableExtendedIndentation": true
}

13
shader-test/.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "lime",
"command": "test",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

90
shader-test/Project.xml Normal file
View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://lime.software/project/1.0.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://lime.software/project/1.0.2 http://lime.software/xsd/project-1.0.2.xsd">
<!-- _________________________ Application Settings _________________________ -->
<app title="FlxProject" file="FlxProject" main="Main" version="0.0.1" company="HaxeFlixel" />
<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"-->
<app preloader="flixel.system.FlxPreloader" />
<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2-->
<set name="SWF_VERSION" value="11.8" />
<!-- ____________________________ Window Settings ___________________________ -->
<!--These window settings apply to all targets-->
<window width="640" height="480" fps="60" background="#000000" hardware="true" vsync="false" />
<!--HTML5-specific-->
<window if="html5" resizable="false" />
<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" />
<!--Mobile-specific-->
<window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" />
<!-- _____________________________ Path Settings ____________________________ -->
<set name="BUILD_DIR" value="export" />
<source path="source" />
<assets path="assets" />
<!-- _______________________________ Libraries ______________________________ -->
<haxelib name="flixel" />
<haxelib name="kiss" />
<haxelib name="kiss-flixel" />
<haxelib name="kiss-tools" />
<!--In case you want to use the addons package-->
<!--<haxelib name="flixel-addons" />-->
<!--In case you want to use the ui package-->
<!--<haxelib name="flixel-ui" />-->
<!--In case you want to use nape with flixel-->
<!--<haxelib name="nape-haxe4" />-->
<!-- ______________________________ Haxedefines _____________________________ -->
<haxeflag name="-w" value="-WDeprecated" />
<!--Enable the Flixel core recording system-->
<!--<haxedef name="FLX_RECORD" />-->
<!--Disable the right and middle mouse buttons-->
<!--<haxedef name="FLX_NO_MOUSE_ADVANCED" />-->
<!--Disable the native cursor API on Flash-->
<!--<haxedef name="FLX_NO_NATIVE_CURSOR" />-->
<!--Optimise inputs, be careful you will get null errors if you don't use conditionals in your game-->
<haxedef name="FLX_NO_MOUSE" if="mobile" />
<haxedef name="FLX_NO_KEYBOARD" if="mobile" />
<haxedef name="FLX_NO_TOUCH" if="desktop" />
<!--<haxedef name="FLX_NO_GAMEPAD" />-->
<!--Disable the Flixel core sound tray-->
<!--<haxedef name="FLX_NO_SOUND_TRAY" />-->
<!--Disable the Flixel sound management code-->
<!--<haxedef name="FLX_NO_SOUND_SYSTEM" />-->
<!--Disable the Flixel core focus lost screen-->
<!--<haxedef name="FLX_NO_FOCUS_LOST_SCREEN" />-->
<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<haxedef name="FLX_NO_DEBUG" unless="debug" />
<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
<!-- _________________________________ Custom _______________________________ -->
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
</project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@@ -0,0 +1,3 @@
# @install: lix --silent download "haxelib:/flixel-addons#3.1.0" into flixel-addons/3.1.0/haxelib
-cp ${HAXE_LIBCACHE}/flixel-addons/3.1.0/haxelib/
-D flixel-addons=3.1.0

View File

@@ -0,0 +1,3 @@
# @install: lix --silent download "haxelib:/flixel-ui#2.5.0" into flixel-ui/2.5.0/haxelib
-cp ${HAXE_LIBCACHE}/flixel-ui/2.5.0/haxelib/
-D flixel-ui=2.5.0

View File

@@ -0,0 +1,4 @@
# @install: lix --silent download "haxelib:/flixel#5.3.0" into flixel/5.3.0/haxelib
# @run: haxelib run-dir flixel "${HAXE_LIBCACHE}/flixel/5.3.0/haxelib"
-cp ${HAXE_LIBCACHE}/flixel/5.3.0/haxelib/
-D flixel=5.3.0

View File

@@ -0,0 +1,5 @@
# @install: lix --silent download "haxelib:/haxe-strings#7.0.3" into haxe-strings/7.0.3/haxelib
-cp ${HAXE_LIBCACHE}/haxe-strings/7.0.3/haxelib/src/
-D haxe-strings=7.0.3
--macro hx.strings.internal.Macros.addDefines()
--macro hx.strings.internal.Macros.configureNullSafety()

View File

@@ -0,0 +1,5 @@
# @install: lix --silent download "haxelib:/hscript#2.5.0" into hscript/2.5.0/haxelib
# @run: haxelib run-dir hscript "${HAXE_LIBCACHE}/hscript/2.5.0/haxelib"
-cp ${HAXE_LIBCACHE}/hscript/2.5.0/haxelib/
-D hscript=2.5.0
--macro keep('IntIterator')

View File

@@ -0,0 +1,10 @@
-lib kiss
-lib kiss-tools
-lib flixel
-lib flixel-addons
-lib flixel-ui
-lib lime
-lib openfl
-cp ${SCOPE_DIR}/..//src/
-D kiss-flixel=0.0.0
--macro Sys.println("haxe_libraries/kiss-flixel.hxml:9: [Warning] Using dev version of library kiss-flixel")

View File

@@ -0,0 +1,4 @@
# @install: lix --silent download "gh://github.com/kiss-lang/kiss-tools#df38b28e32e05d7940041192c36d73924844d9cc" into kiss-tools/0.0.0/github/df38b28e32e05d7940041192c36d73924844d9cc
-lib kiss
-cp ${HAXE_LIBCACHE}/kiss-tools/0.0.0/github/df38b28e32e05d7940041192c36d73924844d9cc/src/
-D kiss-tools=0.0.0

View File

@@ -0,0 +1,12 @@
# @install: lix --silent download "gh://github.com/kiss-lang/kiss#62964ccb83d074ad57975183d4224838b0ec5e50" into kiss/0.0.1/github/62964ccb83d074ad57975183d4224838b0ec5e50
# @run: haxelib run-dir kiss "${HAXE_LIBCACHE}/kiss/0.0.1/github/62964ccb83d074ad57975183d4224838b0ec5e50"
-lib haxe-strings
-lib hscript
-lib tink_json
-lib tink_macro
-lib tink_syntaxhub
-lib uuid
-cp ${HAXE_LIBCACHE}/kiss/0.0.1/github/62964ccb83d074ad57975183d4224838b0ec5e50/src
-D kiss=0.0.1
-w -WUnusedPattern
--macro kiss.KissFrontend.use()

View File

@@ -0,0 +1,6 @@
# @install: lix --silent download "haxelib:/lime#8.0.1" into lime/8.0.1/haxelib
# @run: haxelib run-dir lime "${HAXE_LIBCACHE}/lime/8.0.1/haxelib"
-cp ${HAXE_LIBCACHE}/lime/8.0.1/haxelib/src
-D lime=8.0.1
--macro lime._internal.macros.DefineMacro.run()
-lib ndll:${HAXE_LIBCACHE}/lime/8.0.1/haxelib/ndll/

View File

@@ -0,0 +1,5 @@
# @install: lix --silent download "haxelib:/openfl#9.2.1" into openfl/9.2.1/haxelib
# @run: haxelib run-dir openfl "${HAXE_LIBCACHE}/openfl/9.2.1/haxelib"
-cp ${HAXE_LIBCACHE}/openfl/9.2.1/haxelib/src
-D openfl=9.2.1
--macro openfl.utils._internal.ExtraParamsMacro.include()

View File

@@ -0,0 +1,3 @@
# @install: lix --silent download "haxelib:/tink_core#2.1.0" into tink_core/2.1.0/haxelib
-cp ${HAXE_LIBCACHE}/tink_core/2.1.0/haxelib/src
-D tink_core=2.1.0

View File

@@ -0,0 +1,4 @@
# @install: lix --silent download "haxelib:/tink_json#0.11.0" into tink_json/0.11.0/haxelib
-lib tink_typecrawler
-cp ${HAXE_LIBCACHE}/tink_json/0.11.0/haxelib/src
-D tink_json=0.11.0

View File

@@ -0,0 +1,4 @@
# @install: lix --silent download "haxelib:/tink_macro#1.0.1" into tink_macro/1.0.1/haxelib
-lib tink_core
-cp ${HAXE_LIBCACHE}/tink_macro/1.0.1/haxelib/src
-D tink_macro=1.0.1

View File

@@ -0,0 +1,3 @@
-D tink_priority=0.1.3
# @install: lix --silent download "gh://github.com/haxetink/tink_priority#ea736d31dc788aae703a2aa415c25d5b80d0e7d1" into tink_priority/0.1.3/github/ea736d31dc788aae703a2aa415c25d5b80d0e7d1
-cp ${HAXE_LIBCACHE}/tink_priority/0.1.3/github/ea736d31dc788aae703a2aa415c25d5b80d0e7d1/src

View File

@@ -0,0 +1,6 @@
# @install: lix --silent download "gh://github.com/haxetink/tink_syntaxhub#b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86" into tink_syntaxhub/0.6.0/github/b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86
-lib tink_macro
-lib tink_priority
-cp ${HAXE_LIBCACHE}/tink_syntaxhub/0.6.0/github/b6ea4966bbdee4d176ac8dd5d2d8ae3b362b2f86/src
-D tink_syntaxhub=0.6.0
--macro tink.SyntaxHub.use()

View File

@@ -0,0 +1,4 @@
# @install: lix --silent download "haxelib:/tink_typecrawler#0.7.0" into tink_typecrawler/0.7.0/haxelib
-lib tink_macro
-cp ${HAXE_LIBCACHE}/tink_typecrawler/0.7.0/haxelib/src
-D tink_typecrawler=0.7.0

View File

@@ -0,0 +1,3 @@
# @install: lix --silent download "haxelib:/uuid#2.4.1" into uuid/2.4.1/haxelib
-cp ${HAXE_LIBCACHE}/uuid/2.4.1/haxelib/src
-D uuid=2.4.1

15
shader-test/hxformat.json Normal file
View File

@@ -0,0 +1,15 @@
{
"lineEnds": {
"leftCurly": "both",
"rightCurly": "both",
"objectLiteralCurly": {
"leftCurly": "after"
}
},
"sameLine": {
"ifElse": "next",
"doWhile": "next",
"tryBody": "next",
"tryCatch": "next"
}
}

View File

@@ -0,0 +1,4 @@
package;
@:build(flixel.system.FlxAssets.buildFileReferences("assets", true))
class AssetPaths {}

View File

@@ -0,0 +1,19 @@
import flixel.system.FlxAssets.FlxShader;
class CShader extends FlxShader {
@:glFragmentSource('
#pragma header
void main()
{
vec4 color = flixel_texture2D(bitmap, openfl_TextureCoordv);
gl_FragColor = vec4((1.0 - color.r) * color.a, (1.0 - color.g) * color.a, (1.0 - color.b) * color.a, color.a);
}'
)
public function new() {
super();
}
}

View File

@@ -0,0 +1,13 @@
package;
import flixel.FlxGame;
import openfl.display.Sprite;
class Main extends Sprite
{
public function new()
{
super();
addChild(new FlxGame(0, 0, PlayState));
}
}

View File

@@ -0,0 +1,20 @@
(import flixel.FlxState)
(import flixel.FlxG)
(import flixel.FlxSprite)
(import openfl.filters.BitmapFilter)
(import openfl.filters.ShaderFilter)
(extends FlxState)
(method &override :Void create []
(super.create)
(let [bg (new FlxSprite 0 0 "assets/images/apTestRoomEdited.jpg")]
(bg.setGraphicSize FlxG.width FlxG.height)
(bg.screenCenter)
(add bg))
(let [:BitmapFilter filter (new ShaderFilter (new CShader))
:Array<BitmapFilter> filters [filter]]
(FlxG.camera.setFilters filters)))
(method &override :Void update [:Float elapsed]
(super.update elapsed))