Questions tagged [agal]

The Adobe Graphics Assembly Language (AGAL) is an assembly language used to create vertex and fragment shaders for use in Adobe Flash and Adobe AIR applications.

The Adobe Graphics Assembly Language (AGAL) is an assembly language used to create vertex and fragment shaders for use in Adobe Flash and Adobe AIR applications.

54 questions
4
votes
1 answer

Why do AGAL shaders need to be compiled just-in-time?

Flash Player 11 introduced the AGAL unified shader assembly language, which is able to compile into OpenGL GLSL shaders and DirectX HLSL shaders transparently to the Flash developer. Pretty much every program that uses AGAL is packaged with the…
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
3
votes
1 answer

Molehill Shader

I'm trying to understand molehill and would like to multiple a vertex by two matrices, say: output = theVertex * scaleMatrix * rotationMatrix Im guessing my vertex shader would look something like: "m44 vt0, va0, vc0\n" + "mul op, vt0, vc1\n"; And…
user346443
  • 4,672
  • 15
  • 57
  • 80
3
votes
1 answer

AGAL seq opcode works on hardware, but doesn't on software emulation (float number comparison is different on both?)

From docs: seq set-if-equal destination = source1 == source2 ? 1 : 0, component-wise I haven't yet tested it thoroughly, but so far my fragment shader worked on both machines (desktop pcs), where context3D initialization succeeded as DirectX, but…
3
votes
1 answer

Shadow-casting shaders in Stage3D

I've been working a lot with AGAL vertex and fragment shaders. I've got individual objects lit correctly (including specular shading) but I'd like to have objects cast shadows on OTHER objects. I have looked online, but I think most people working…
moosefetcher
  • 1,841
  • 2
  • 23
  • 39
2
votes
2 answers

Problems with photoshop-like "lighten" fragment shader

I'm tagging this in OpenGL because I think it's relevant to that space (albeit a different naming). I'm trying to get photoshop-like blending to work in Flash 11 which uses OpenGL (ES2?). I'm having particular issues with lighten, which I believe…
ansiart
  • 2,563
  • 2
  • 23
  • 41
2
votes
1 answer

AGAL undocumented ops

While glancing at the source for the AGALMiniAssembler class, I noticed a handful of op codes that don't seem to be documented anywhere - ifz, eif, brk, and a bunch of others - and what look like undocumented texture-sampling flags - 3d, centroid,…
Conduit
  • 2,675
  • 1
  • 26
  • 39
2
votes
1 answer

AGAL: Calculating screen space position in fragment shader

Before I define my problem in more detail, I think I should begin by explaining how I've set everything up. Basically I have a simple plane mesh, defined as such (x, y, z, u, v): _vertices = Vector.([ -1, -1, 0, 0, 0, 1, -1, 0, 1,…
stalem
  • 219
  • 1
  • 13
2
votes
1 answer

Adding glows to Stage3D objects

I'm making a Stage3D space game: www.sugarspook.com/darkmatters/demo.html, and I'd like to add 'glows' to some objects. Is there a way to do this solely in the AGAL shaders, or do I need to pre-render the glowing objects and 'blur' them?
moosefetcher
  • 1,841
  • 2
  • 23
  • 39
2
votes
2 answers

How do I pass barycentric coordinates to an AGAL shader? (AGAL wireframe shader)

I would like to create a wire frame effect using a shader program written in AGAL for Stage3D. I have been Googling and I understand that I can determine how close a pixel is to the edge of a triangle using barycentric coordinates (BC) passed into…
JimmyDeemo
  • 313
  • 1
  • 15
1
vote
2 answers

Can Matrices exist on vertex registers other than vertex constants in AGAL?

I've mostly seen examples where a Matrix3D object is passed as a vertex constant register in AS3 to the Context3D object. But never seen a matrix in any other types of registers (temporary or attribute). Would there be any way to copy a Matrix…
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
1
vote
2 answers

Is there a way to do bitwise-shift operations in AGAL?

If I encode all colors into one single float value (RGB) as: //Each Channels are from 0 - 255 red << 16 | green << 8 | blue; How can I retrieve those color channels back in AGAL? There doesn't seem to be any bitwise operators.
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
1
vote
1 answer

In an AGAL Vertex Shader, what is the 'w' component used for in the output shader?

I understand the 'xyz' components of a vertex's position, but what does 'w' do? Could it be left as the same constant value all the time? Example: mov op.xyz, va0.xyz mov op.w vc0.w
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
1
vote
1 answer

Can numbers be hardcoded in an AGAL operation?

If I try to simply add 1.0 to one color-channel of a register, can I: Write it directly with some float-number syntax I'm not aware of, or... Do I have to pass in the number to a constant first, and use that constant register there? Example of…
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
1
vote
0 answers

How to draw a single-pixel width line in Stage3D

I'm working on a 3D game set in space. I'm currently adding orbit-lines of the planets. Ideally I'd like to draw the orbit lines at 1 pixel width, irrespective of the line's distance from the camera. Does anyone know of the way to do that? Currently…
moosefetcher
  • 1,841
  • 2
  • 23
  • 39
1
vote
1 answer

Render to texture not functioning

I'm trying to test Stage3D's setRenderToTexture function, but my test code is not providing any output. I was hoping someone could tell me why - I've tried practically everything to get this working. The code I've created is below: import…
Conduit
  • 2,675
  • 1
  • 26
  • 39
1
2 3 4