Starling DisplacementMap Labs

Talking about flash displacementMaps in starling tomorrow evening at Danish Flash Usergroup, and I just wanted to gather some links…

related links:

pic1
http://thonbo.com/starling/DisplacementTest.html

mobile android lab app : http://thonbo.com/apks/DisplacementMobile.apk

pic2
http://thonbo.com/starling/DisplacementTestRain.html

pic3
http://thonbo.com/starling/DisplacementTestGameBg.html

http://www.youtube.com/watch?v=ZD-LxUS7UEY

Untitled-2dd

this lab is not just a mosaic effect lab with some dots overlayed – all lego pixels are represented in actual lego color values – where images colors are snapped to nearest lego color using 3D pythagoras + color perception offset
http://thonbo.com/brickster/legofier.html (classic scalable/zoomable  flash)
http://thonbo.com/brickster/ (starling version max 2048 px output) /

– to be continued with explanation

Advertisements

2 thoughts on “Starling DisplacementMap Labs

  1. This is a Starling DisplacementMapFilter? What DisplayObject is this filter applied to, the stage? Or some other high-level container?

    My (quite limited) experience to date with Starling filters is that they are slow on devices, but it seems that this works well on Android?

    I don’t see any demo source — could you separate out a small example to provide?


    1. private var dTexture:RenderTexture;
      private var dFilter:DisplacementMapFilter;

      // init
      mapQuad = new Quad(256, 256, 0x808080, false);
      dTexture.draw(mapQuad);

      // set content ready

      content.addChild(_bg)
      content.addChild(heroArm.display as Sprite)
      addChild(content)

      // init filter
      dFilter = new DisplacementMapFilter(dTexture, null, BitmapDataChannel.RED, BitmapDataChannel.GREEN, 100, 100, false);
      //add filter
      content.filter = dFilter;

      // if update map
      //draw displayobject (starling sprite)
      dTexture.draw(mapsContainer)

      // reset map
      dFilter.mapTexture = dTexture

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s