March 2017
Mo Tu We Th Fr Sa Su
<< >>


HxSL Studio Demo

Posted on Jul 09 2011

A few months ago I worked on HxSL which is a 3D shader language. I wanted people to be able to see how HxSL works and give it a try without installing Haxe and writing code.

So I came up with the idea of HxSL Studio which is an online tool (entirely written in Haxe) using both Flash and Javascript.

With HxSL studio, you can modify both vertex and fragment shaders in an HTML page. The shader text get sent to flash component using Haxe Remoting on each change. Then I'm using HScript to parse the text before using HxSL compiler to generate on-the-fly AGAL bytecode.

Thanks to Haxe being very fast you can get realtime feedback on errors. Works very nice.

Try HxSL Studio Demo

If you have an error, it will be sent back from Flash to JS so it can be displayed. If you click on the error you will select the HxSL part that is causing the error.

You can also see the AGAL output that you can paste in your AS3 code in case you're not lucky enough to use Haxe for your daily job ;)

This is actually not a fulled feature Studio as I wanted to built it. You have only one primitive which is a simple axis-aligned-cube and only 4 possible shader variables :

  • mpos : position matrix, rotate over time
  • mproj : camera projection matrix
  • time : time scalar
  • tex : perlin noise texture

I wanted to add an additional tab where you could define your own variables and modify them, then change the primitive among cube/sphere/etc..., and also upload you custom textures, but I'm lacking time to work on it so I wanted to release this working demo instead of waiting it to be complete.

If anybody else want to simply read the source code or is willing to implement the missing features, don't hesitate, it's pretty small so far ( 3 KB Haxe/JS + 9 KB Haxe/Flash - excluding libs) and available here :

Enjoy !

  • ryzed
    Jul 09, 2011 at 22:09

    Thanks for sharing source.

  • Jul 11, 2011 at 10:18

    It would be very nice such an application to be able to import models or primitives and switch between materials (something like nvidia fx composer I mean)

    Also, I see the agal tab shows invalid agal register names (t, c, out). I think the problem is that converted register names are shown instead of native ones.

    wonderful job,

  • Jul 19, 2011 at 01:33

    All my games are written in Haxe, and for sure all my new 3D games! THANKS!!

  • pixnlove
    Aug 06, 2011 at 00:12

    This is absolutly fantastic you are a genious Man!!!
    But I have been thinking that Haxe really need an editor just like unity were you can drop and assign your code on an object easily.
    It is a wonderfull language but when you have tried Unity3D were you have Joystick input, environment map, compile for mac, window, the web and so on it is hard to come back to Haxe and do everything by hand.

    I do admire your work but I think it time to go a step further specially now when Unity3.5 is planning to export for the new Flash Player.
    Think will be easier for people to model in blender texture in gimp/inkscape bring it all to unity and publish in a matter of weeks!!!

    less wait and see what surprise nice Haxe will bring ..
    Long life to Haxe.

  • Aug 06, 2011 at 09:28

    @pixnlove : once we have the Unity Flash API, I guess it will be possible to access it from Haxe as well. Another option in the works (not by me but by @cwaneck) is to compile Haxe to C#

    Aug 07, 2011 at 02:09

    its great, all this tools are necesary, adobe had launched adobe edge, a tool that generate animations web based in html5, css, javascript from a design, its useful. Would be great something like that haxe based, would be the final product, server side haxe, desktop in haxe, 3d in haxe and web client side only haxe, 100% pure haxe, no html, no css, do not need more than a single language for everything, it would be a global event, a dream of many come true.

    thank, and sorry for my english

  • ryzed
    Oct 15, 2011 at 10:24

    @Nicolas Cannasse
    Have you plans to continue support HxSL and Studio?
    Main trouble - indexed access.
    Patch by sledorze - not works.

  • Oct 15, 2011 at 13:06

    Yes I need to find time to add indexed access to HxSL, I will review the patch once I'm back working with 3D (hopefuly in a few weeks)

  • deep
    Feb 22, 2012 at 13:19

    Studio open error - 404 not found

  • Feb 22, 2012 at 21:18

    Oops, looks like I lost the directory while changing hosting. Will try to put it back with an updated version.

  • deep
    Aug 10, 2012 at 15:33

    Studio still offline (404)

  • Franky
    Aug 22, 2012 at 08:01

    Still offline.

Name : Email : Website : Message :