Away3D and GLSL?

When targeting native, is it possible to write shaders for Away3D using GLSL directly instead of AGAL?
Never been a big fan of AGAL, and for native targets isnt AGAL being translated to GLSL behind the scenes anyway?

It doesn’t look like there’s a built-in way to do this. However, you might be able to set it up for yourself. Here are some important things to know:

The program is set here, but the program instance actually comes from here, so that’s what you’ll want to change.

The thing is, Away3D has a lot of code that’s based on AGAL, and you don’t want to break it…What I’d do is add an optional fourth argument to setProgram3D() named glsl, with a default value of false. That way, you can make GLSL programs while everything else defaults to AGAL.

setProgram3D() is called here, so that’s the other function you need to update. Again, you want to leave the default behavior unchanged, but this time you should use an instance variable rather than a function argument.

Finally, you’re going to need to make your own CompiledPass subclass. Maybe use SuperShaderPass as a reference, since that’s the one that’s used in the simplest cases.

If someone has a clean way to implement this, I’m sure we’d be open to considering additions to the API