© 2006 - 2012 Hannes Wolfgang Moser

Kontain is ready for use

Finally, the Alpha state is ready for public. I have tested some features of the system and most of them are quite impressing. But as a WordPress user i still miss some things. Most important for me is to be different with my blog from others, not only in entries also in design and appearance. There should be a possibility to access the data threw an API (webservice). I would definitly swap from WordPress to kontain if i get a chance to switch back any time and/or import data from each service to the other.

I like the way f-i is building user-interfaces and the media-experience is great. So this is still an Alpha, but i am looking forward to the features coming.



PixelBender: Damped Sin Waves, Gauss Curve

On my search for the perfect “shockwave” i played a bit around with damped sin waves and a Gauss curve, but first some words about my first week with PixelBender.

With PixelBender toolkit it is possible to build shaders very fast and easily. It took me less then 10min till i compiled my first shader. One reason is, that in my opinion the code is very intuitional to write and even greater, the code is very compact, f.e. vector and scalar types are doing basic math operations together without a special cast or convertion.

This is great and gives you the motivation for doing more (like i do now). But after playing arount i am going to miss more and more features.

First, the UI is easy to use, but i want to split coding/preview window or at least rearrange it, it’s annoying, even on my 24 inch display, if you are using a test-image greater than 400px in height (windows are tiled horizontal).

Next thing, the FlashPlayer implementation of the filter-runtime is not able to interpret any flow-controls. The only one allowed is a simple if (condition) else condition. So that means, no loops (neither while nor for). I have seen a zoom-blur implementation written with a code redundancy count of 15!!! This definitly sucks.

There are a few more limitations but they will not care you as much as the one i mentioned above.

Biggest wish of mine is, i have read somewhere that this is on the roadmap already(i hope that’s true), to have a low-level tool for compiling PixelBender sources. I am looking forward to build a Eclipse-plugin for writing PB-code and have some elementary “curves” you can drag and drop into it. A standalone-viewer would also be great.

Some words about PixelBender-runtime performance. I have not done soooo much tests with FlashPlayer by now, but my first tests giving me very bad results on images that are a bit greater than your thumb (Ok, i have tried a bigger one with success, but f.e. 800x800px with a simple sin-wave is going mad). On my 2 workstations (very similiar hardware setup) i get strange differences on framerate count. Both are running in GPU mode, but on the first one i am getting a constant framerate of about 60fps, the other PC shows different framerates in a high frequency starting from 150 up to 1500. All this numbers i got with the preview-mode in PixelBender toolkit. If you are going to use a PB-shader with Flash, things get even worse. I got a dramatic drawdawn with my framerates and a high CPU-load one one of my machines.

I think that behaviour means, FlashPlayer is using CPU to calculate the shader instead of GPU? I don’t know by now, so it is very speculative to say something concrete. I hope that it will be possible to recognize a CPU fallback at runtime, so you have at least the chance to turn off your “stunning” effects. I am looking forward to publish more info on this issue soon.

So, enough said about the drawbacks, go on with the interesting part.

For those, which did not read my previous post, i am going to proof if it is possible to have some post-processing in realtime for games with PixelBender. I want to create something like a shockwave with a simple distortion of the image.

PixelBender sources (formula is not optimized)

 <languageVersion : 1.0;>
 kernel HorizontalAverage
 <
 namespace:          "com.impossiblearts";
 vendor:             "Hannes Moser";
 version:            1;
 description:        "damped sin-wave depending on time";
 >
 {
 input image4 source;
 output pixel4 result;

const float PI = 3.14159265358979323846264338327950288;

parameter float2 pos
 <
 minValue:float2(0.0, 0.0);
 maxValue:float2(2880.0, 2880.0);
 defaultValue:float2(400.0, 400.0);
 >;

parameter float amount
 <
 minValue:0.0;
 maxValue:10000.0;
 defaultValue:5000.0;
 >;
 parameter float wavelength
 <
 minValue:1.0;
 maxValue:2500.0;
 defaultValue:150.0;
 >;

parameter float t
 <
 minValue:0.0;
 maxValue:1000.0;
 defaultValue:0.0;
 >;

parameter float overlay
 <
 minValue:0.0;
 maxValue:100.0;
 defaultValue:10.0;
 >;

void evaluatePixel()
 {
 float2 coord = outCoord();

float dist = distance(pos, coord);
 float curve = (1.0 / sqrt(1000.0 * PI)) * exp((-1.0/wavelength) * pow(-t + dist, 2.0)) * sin(dist / overlay) * amount;
 float2 cw;
 cw = coord + curve;
 result = sample(source, cw);
 }
 }
 

Continue reading



PixelBender: May the force be with it!

The release of FP 10 has brought us some really big features. One of the greatest things, in my opinion, is the possibility of including custom native filters. I am currently doing some research on how they could be used for post-processing effects in Flash-based games.

First result here. Click on image in the demo to start effect (FP 10 needed).

Update

PixelBender Kernel

[as]
<languageVersion : 1.0;>
kernel HorizontalAverage
<
namespace:          “com.impossiblearts”;
vendor:             “Hannes Moser”;
version:            1;
description:        “damped sin-wave depending on time”;
>
{
input image4 source;
output pixel4 result;

const float pi = 3.14;

parameter float2 pos
<
minValue:float2(0.0, 0.0);
maxValue:float2(2880.0, 2880.0);
defaultValue:float2(225.0, 125.0);
>;

parameter float amount
<
minValue:0.001;
maxValue:0.1;
defaultValue:0.01;
>;

parameter float wavelength
<
minValue:0.0;
maxValue:1.0;
defaultValue:0.7;
>;

parameter float damping
<
minValue:0.0;
maxValue:1.0;
defaultValue:0.5;
>;

parameter float maxradius
<
minValue:0.1;
maxValue:2880.0;
defaultValue:200.0;
>;

parameter float t
<
minValue:0.0;
maxValue:10.0;
defaultValue:0.0;
>;

void evaluatePixel()
{
float2 coord = outCoord();

float wlength = 1.0 – wavelength;
float dist = distance(pos, coord);
float curve = sin(dist * wlength – t * pi) / (amount * dist * wlength);
float distDamping = max(dist / maxradius, 1.0);
float2 cw = coord + (curve * distDamping);

result = sampleNearest(source, cw);
}
}
[/as]

AS (extended from lee brimelow’s gotoandlearn example)

[as]
package
{
import caurina.transitions.Equations;
import caurina.transitions.Tweener;

import flash.display.Bitmap;
import flash.display.Shader;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.ShaderFilter;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;

// swf metadata
[SWF(width="450", height="250", backgroundColor="#000000", framerate="60")]

public class NativePostProcessing extends Sprite
{
[Embed(source="starwars_tfu.jpg")]
private var image:Class;

private var loader:URLLoader;
private var shader:Shader;
private var filter:ShaderFilter;
private var im:Bitmap;

public function NativePostProcessing()
{
im = new image() as Bitmap;
addChild(im);
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, onFilterLoad);
loader.load(new URLRequest(“filters/waves.pbj”));
}

private function onFilterLoad(ev:Event):void
{
shader = new Shader(loader.data);
shader.data.pos.value = [225, 85];
shader.data.amount.value = [0];
shader.data.wavelength.value = [0.2];
shader.data.damping.value = [0.5];

// start effect onclick
stage.addEventListener(MouseEvent.CLICK, this.startEffect);
}

private function startEffect(ev:MouseEvent):void
{
Tweener.addTween(this, { waveTime:6, time:1.5, transition:Equations.easeNone, onComplete:resetValues });

Tweener.addTween(this, { wavelength:0.9, time:1.3, transition:Equations.easeOutQuart });

Tweener.addTween(this, { amount:2, time:0.7, transition:Equations.easeNone });
Tweener.addTween(this, { amount:0, time:0.35, delay:0.9, transition:Equations.easeInOutQuint });

addEventListener(Event.ENTER_FRAME, this.update);
}

private function resetValues():void
{
waveTime = 0;
amount = 0.0;
wavelength = 0.2;
}

public var waveTime:Number = 0;
public var amount:Number = 0.0;
public var wavelength:Number = 0.2;

private function update(ev:Event):void
{
shader.data.t.value = [waveTime];
shader.data.amount.value = [amount];
shader.data.wavelength.value = [wavelength];

filter = new ShaderFilter(shader);
im.filters = [filter];
}
}
}
[/as]

Flex – ActionScript project

Attention: You need Tweener to compile this files.



Kontain Management System?

F-i has announced the upcoming release of kontain, formerly known as Propod. It seems that this application could may be a serious competitor for content management systems, designed for ease-of-use. The information provided on the product-website is not too much, but some screenshots are displaying media-features and there is a statement about a WYSWIG-editor.

I am planning a major retouch for this website and i am still collecting the requirements for the CMS behind it. I think i will give kontain at least a try (if F-i will release it early enough).



Star Wars TFU: Review

It happened only 1 hour ago. We (the devil himself, Wolfgang Teufl) have finally mastered the big boss of the game ;) . Approx. 12h of pure gaming-time with heavy use of “the force”. For me, the best Star Wars game ever, especially because of the story. I always liked games with a nice accompanying story and if the game is called “Star Wars” it is maybe one of the most important things.

If the story sucks, the complete game is useless. But, in TFU every fan of the series would love the attention to detail, discovering known characters and the total immersion into the Star Wars universe.

The game itself is well designed and for me the matte-paintings are one of the most beautiful ever seen. The graphics-engine makes heavy use of post-effects, especially distortion(waves, heat-waves, etc.) every time you use the force. The force is great to handle, HAVOC physic-engine allows you to put up nearly every piece from walls and floors. Breaking wood, glass and bend metal are features you will need very often if you want to go safe threw the levels.

One thing that is very annoying and some magazines and posts in different forums also have mentioned it, is the 3rd person camera. 3rd person is ok and in most cases i would prefer it, instead of a 1st person one, but for players it is much more difficult to play, if the camera is not perfectly balanced and intelligent enough to avoid crappy perspectives. F.e. Assasins Creed has a very similar way of looking at this problem. A lots of narrow lanes and corners and they have done their job much better than the guys from Star Wars TFU. Hopefully there will be an update on this issue, so i could enjoy the game 100% for the next time, when i will play it as a “Sith-Master” ;) .

For me, already now, one of the best games in 2008.



Google Toolbar overrules the world! S**KS!

I only want to contribute the following issue. If a user have a Google Toolbar installed (and those are many) and the Auto-Fill feature for form-input fields is activated (this is “on” by default) will overrule CSS-background-colors for input fields.

A practical solution is to use the !important statement (it works well for me).

#inputText {font-family: Verdana; background-color:#666666 !important; color:#ff....}

Overruling S**CKS!, this is no good practice and Google should restore the behaviour of the toolbar to what it should be, an unobtrusive addition to the browser.



Firefox 3.x Bookmark Sidebar


In earlier Firefox versions it was common for me to click on a bookmark and to open it in a new tab. This is also possible by now, but only if the current site has already started to render. If the site is not initialized you will get a “greyed menu”. I never had this issue before and i really hate it. Is there any possible tweak for the about:config to change this behaviour?




© 2006 - 2012 Hannes Wolfgang Moser