Monday, June 15, 2015

New blog here:
https://makegameshappen.wordpress.com
Just got sick of google trying to control all my stuff with one global account.
Leaves me spending half my day logging into and out of accounts. Very annoying.
Using word press will be less disruptive to my work flow.
-John Mark

Here:
https://makegameshappen.wordpress.com/
I've finally had it with google disrupting my workflow.
I log into Youtube, get logged out of the Gmail account I was using.
I log into Blogspot, have to log out of Gmail and then into a different Gmail.
Then end up having to re-type blogspot.com to get back where I was.
I am not a fan of this unification of accounts that Google is up to.
It is a pain and severely disrupts my workflow.
If there is a decent non-google option that doesn't make my life a pain, I will go for it.
I've been dealing with this problem for at least a year.
And I've probably lost a lot of productivity.
-John Mark

I used HaxeLib Install TileLayer... And it installed.
But FlashDevelop cannot find the library when I include
in my application.xml file.
I need to focus on making a game rather than pipeline issues...
So I think I am going to go ahead and ignore learning openGL, drawTiles,
or whatever TileLayer is and just work on making a game targeting HTML5 and ActionScript.
If the game is good enough, then I will worry about porting to mobile.
For now, I am just going to design for mobile but release to web.
I don't see myself being productive if I am pulled in so many directions at once.
-John Mark

Looks like I need to understand OPENGL before I can figure out haxe's implimentation of
openGL. Doesn't appear to be enough documentation to figure it out otherwise.
-John Mark
//http://stackoverflow.com/questions/16559095/opengl-with-haxe-c
@MichaelIV, actually NME's implementation targets OpenGL ES 2.0, which means that it supports shader pipelines (see github.com/haxenme/NME/blob/master/native/gl/GL.hx#L538). Can you edit your answer? – Waneck May 15 '13 at 13:32

Apparently this shader code: https://github.com/bmfs/glslTest_openfl
from this thread:http://www.openfl.org/archive/community/feature-requests/custom-glsl-shaders-drawtiles/
Is the answer to my problems.
graphics.drawTiles()
http://www.openfl.org/archive/
community/programming-haxe/blending-modes/
pixel bender:
http://www.flashmagazine.com/tutorials/detail/using_pixel_bender_to_calculate_information/
http://www.openfl.org/archive/community/
feature-requests
/custom-glsl-shaders-drawtiles/
OpenGLSimpleView or HerokuShader
i want to write my version of drawTiles()
using openfl-stage3d, so it would be possible
to use custom shade
heardtheword:
In looking at how NME is structured it seems plausible
that there could be a GPUProg object stored in
GraphicsJob and then passed to HardwareContext.
This would give the ability to use shaders on points,
lines, and fill objects as well as Tilesheet. I think
this would be abstract enough to use for HLSL as well.
Here is my concept of how it could work in Haxe.
There should probably be some type of caching for
duplicate shaders although Haxe will only see the
final linked program.
// static function, returns a GPUProg object?
var program = Graphics.compileShader(vertexShader, pixelShader);
// in rendering code
graphics.attachShader(program);
tilesheet.drawTiles...
// is this needed or could it be automatically detached at endFill?
graphics.detachShader();
I'm willing to take a shot at this but would love
feedback if you feel this isn't heading in the right direction.
EDIT: Any reason OGLProg::createShader
adds the precision information for OpenGL ES2?
You can do that directly in the shader using the #ifdef directive.
#ifdef GL_ES
precision highp float;
#endif
EDIT2: Okay, I created a branch in GitHub
and edited sample 20-Tile with custom shaders.
It works as expected as long as you use the
attribute/uniform variables defined in OGLProg.
Might be fun to allow custom variables in the future.
http://github.com/MattTuttle/NME/tree/glsl...
1 year later: Updates:
https://github.com/bmfs/glslTest_openfl

This explains why I thought a Hollywood movie was a cheap straight to tv drama:
http://www.tested.com/art/movies/452387-48-fps-and-beyond-how-high-frame-rates-affect-perception/
I thought it was the bad cinematography or lighting or cuts..
But it may have been the frame rate.
How to do a simple frame rate and memory profile in haxe:
http://haxecoder.com/post.php?id=24
Expanded upon with colors and stuff:
https://github.com/yupswing/plik/tree/master/com/akifox/plik/debug

Saturday, June 13, 2015

You need to use tilesheets which abstract the sprite.graphics.beginBitmapfill()
command if trying to render on android.
This is what I have found from my research into why the awesome rendering system
I made sucks when I try it out on my phone.
More info on tile sheets here:
http://haxecoder.com/post.php?id=21
From looking at source code,
haxe-flixel uses tile sheets.
Reading into haxe-flixel source code:
#if FLX_RENDER_BLIT is using COPYPIXELS()
FLX_RENDER_TILE is using TileSheets.
So: FLX_RENDER_BLIT is used for non-hardware targets like flash and HMTL5.
And FLX_RENDER_TILE is used for hardware targets like android and neko.
This is my understanding.
Will look more into this later.

Doing some reasearch on this:
http://www.openfl.org/archive/community/programming-haxe/android-fps-drops/
You might consider what rendering you are using. If you are still using copyPixels or draw, which perform well in Flash's software renderer, its about the slowest you can go on hardware. The display list is faster, or drawTiles/drawTriangles
If you are using one of these fps drop is inevitable, because these are using cpu and expensive processes.
- Masking
- Bitmap drawing or creating bitmap
- Gradient line drawing
- Filters
- Color transform
You should also check that you aren't using debug mode also. This may lead fps drop also.
I apologize for dropping into an older thread, but I wanted to mention I just created a logical error in our stage rendering code.
It was rendering on "lastRender + framePeriod", which, if the application was allowed to sleep, could result in a drop of several frames per second if the "lastRender" was not exactly at the desired time, but later due to an idle wakeup. The system was not under stress, it just wouldn't try to do enough frames. This is the cause of the behavior where more stress on the device would result in better frame rates, much to the confusion of most people.
This logic fix will go out in the next version of openfl-native. Have a great day!

SO... Either I have a really slow phone...
Or my "optimized" tilemap rendering code is not that optimized...
Going to download
http://haxeflixel.com/demos/FlxBunnymark/
And run it to see how it works...
Tried using downloadSVN to download the demo from the Git Repo.
No luck. Instead used:
haxelib install flixel-demos
on the command line.
UPDATE#1: Looks like bunny benchmark is dependant on bitFive... Hmm...
Better look into what bitFive is doing. As I know it had
something to do with drawing optimizations.
On command line:
haxelib install openfl-bitfive
UPDATE#2: Running the demo from the flixel project failed.
Did not recognized bitFive was installed.
Actually, the entire libraries folder was EMPTY...
Like the project XML wasn't valid or anything..
SO now:
On command line:
haxelib install flixel-tools
Trying to build a fresh bunnyMark example using flixel-tools.
If this doesn't work... I don't know.. I feel kind of stupid having
to try this hard just to get something running that I should be able
to easily download.
UPDATE#3:
Error: ///////////////////////
Error: Could not find haxelib "openfl-bitfive", does it need to be installed?
Build halted with errors (haxelib.exe)."
//////////////////////////////
Using the command line, it installed openfl-bitfive version 3.0.
My guess is I need to take out the version requirements somewhere in
a config file.
Because: When I do "haxelib install openfl-bitfive"
on command line, it tells me:
"You already have openfl-bitfive version 3.0.0 installed.
UPDATE#4:
Went to "C:\DEV\Programs\Haxe\haxe\lib\openfl-bitfive\3,0,0"
And stripped the version number out of haxelib.json in that folder.
I kept the version variable, but it is now set to an empty string.
Hmm... The
""
Within my Project.xml is still causing my "References" folder in my
FlashDevelop project to become blank. I know this happens whenever you
put a library path that cannot be found. When I comment out
from my Project.xml, the "References" folder
directories show up again in the project explorer...
So I guess stripping the version number out did not work...
Maybe the library is identified differently? I am typing something wrong?
UPDATE#5: Read some read-me files:: Trying this in
Project.xml (Which read me refers to application.xml)