Pixel Bender 3D, AGAL, custom shaders

Software: Away3D 4.x

Ascanio, Newbie
Posted: 21 April 2013 01:39 PM   Total Posts: 29

Hi fellas,

this yet another effort of mine to actually get some feedback on this forum. It appears nobody is answering around here.

I am in the process of building a 3D feature to be showcased later this year, based on Away3D.
The near-total lack of documentation and support around this framework is making the process quite frustrating.

I am trying to figure how to come up with custom shaders quickly enough, without previous experience in GPU programming. Pixel Bender 3D seems to have disappeared. The Flare3D team has developed their own shading language and IDE… but that framework is commercial and I can’t get my employer to spend money to purchase a license. So I am stuck with open source.

I’d love to get up to speed and contribute to the Away3D framework, but with such a dead-looking community, it doesn’t look like such an appealing chance.

   

Avatar
theMightyAtom, Sr. Member
Posted: 22 April 2013 05:52 AM   Total Posts: 669   [ # 1 ]

Hi Ascanio, can you elaborate on these “custom shaders”?

Away3D includes many shaders and material parameters. Maybe you don’t need to write shaders, especially if you have no experience in that area.

If you have a particular effect you want to achieve, try and describe it. There’s a good chance someone else here has wanted the same thing.
The more specific the question, the easier it is to help, and the more likely you are to get a useful reply.

Cheers!

   

Ascanio, Newbie
Posted: 22 April 2013 07:27 AM   Total Posts: 29   [ # 2 ]

Hi MightyAtom!

There is life! Thank you very much for your reply!

For my current project I need just one advanced shader to achieve the effect that can be seen on Nissan juke 3d: the color switching ( which involves color changing and vertex displacement being animated as a wave rippling through the geometry.

From what I can see on the Nissan micro site they have used multiple geometries and the result is not 100% clean.
I’ve seen someone reengineered something like it for flare3d, using flsl shading language.

I need to achieve a similar effect to animate state changes of part of a HUD display.

Any help will be greatly appreciated!!

   

SuperSam, Sr. Member
Posted: 22 April 2013 10:51 AM   Total Posts: 102   [ # 3 ]

I’m curious about this as well smile

Also, to whoever is able to reply (I’m sorry I can’t), it would be nice if you added a quick sentence about the drawbacks of adding custom shaders regarding performance.

For instance in Starling, I think custom shaders lead to more draw calls and more uploads because they don’t go through the optimized pipeline. Is there something similar in Away3D 4 ?


Thanks smile

   

Ascanio, Newbie
Posted: 02 May 2013 11:27 AM   Total Posts: 29   [ # 4 ]

bump…. it looks like this thread will remain unanswered.

I’m sorry to brag, but why is it just so difficult to find any kind of support or documentation on Away3D?
The only real way to learn it is to reverse engineer it.
Kind of tramps on the whole idea of having a framework make your life easier!

   

Avatar
Fabrice Closier, Administrator
Posted: 02 May 2013 11:41 AM   Total Posts: 1265   [ # 5 ]

yeah, very hard…  http://www.away3d.com/documentation

https://github.com/away3d/away3d-examples-fp11

   

Ascanio, Newbie
Posted: 02 May 2013 11:51 AM   Total Posts: 29   [ # 6 ]

I’ve been through both. The documentation is practically nonexistent. Methods missing, no examples and descriptions are very poor.

The examples are very basic.

I have to admit even Adobe hasn’t done a good job at documenting their Stage3D API’s. it’s all very dark.

I am not a coder anymore, but I have been for over a decade and this is the single most frustrating task I’ve ever encountered. Google searches yield little or no help whatsoever.

   

Ascanio, Newbie
Posted: 03 May 2013 08:52 AM   Total Posts: 29   [ # 7 ]

Ok, looks like I finally found Adobe’s lost documentation. They have messed up the official one, but the beta livedocs are complete:

http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/display3D/Context3D.html

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 03 May 2013 10:23 AM   Total Posts: 166   [ # 8 ]

@Ascanio
Let’s talk little more calmly please : )

So, here are 2 example of the Nissan Juke3d effect.
But these are Flare and Alternativa3d.
http://davidejones.com/blog/1599-switching-colour-alternativa3d/
http://blog.volger.org/switchingcolor-shader/
If you need the effect, you can choose the framework of either.

And also, you can learn principles of the effect from above sources,
and you can learn how to implement a shader on Away3D by reverse engineering.
But a main part of the effect seems a vertex shading.
And Away3D don’t have vertex shader yet.(coming soon with next beta???)
So you can’t learn about vertex shading directly from reverse engineering.

But I think that you can implement a vertex shader.
There is a way of passing vertex shader code as “getVertexCode()” in ShadingMethodBase class and a few classes have that method also.
Yeah, this way is not so easy…

Good luck and Cheers.

   

Ascanio, Newbie
Posted: 03 May 2013 10:38 AM   Total Posts: 29   [ # 9 ]

@Goro

Thank you very much for your reply!

I really don’t mean to be hasty, but I having learned everything I know by myself on the Internet, I’m used to finding info rather effortlessly. This is not the case with Away3D. I’m just fighting massive migraines.

In fact I was already onto the Volger.org link some time ago. Unfortunately I can’t go Flare3D because of it’s commercial license, it’s paradoxical, but it’s more difficult to convince a large automotive manufacturer to acquire a 500$ license than to spend my time to reverse engineer and develop, which is generating a delta cost in excess of 15000$.

Not my problem really… it’s their budget. My problem is time. The deadline is coming up really fast!

I’ve started tinkering with the getVertexCode yesterday, modifying the FogMethod which is the simplest I could find for now. It does affect the shader, so at least it is alive.

Now I’m trying to figure out what/how is fed to the vertex program. For instance when are activate() and initConstants() called.

I am a huge believer in sharing. Obviously my intention is to publish the shader, should I manage to make it work!

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 15 May 2013 11:17 AM   Total Posts: 166   [ # 10 ]

@Ascanio

http://away3d.com/tutorials/Writing_Custom_Materials_1:_Getting_Started
http://away3d.com/tutorials/Writing_Custom_Materials_2:_Adding_Textures

Have you seen these tutorials?
These are also useful for vertex animation.
You can get the animation by rewriting getVertexCode() and uploading constants in activate().
(The material does not have lights yet. I’m tinkering)

Cheers.

   

Ascanio, Newbie
Posted: 15 May 2013 11:27 AM   Total Posts: 29   [ # 11 ]

Hi Goro! Great, I have to admit, I didn’t come across those links.

I am now in the process of optimizing my models. The problem is in the workflow, since I model by bezier surfaces in Alias Automotive, and then tesselate through to Blender, followed by PreFab3D.

I am now tackling the normal mapping technique, trying to minimize mesh defects (such as curvature continuity across fillets and mesh patches) by maxing polygon resolution, and baking the map onto a low poly without fillets.

It’s cool I’m learning so much stuff, but the timeframe I have is killing me, we will be presenting to the management in July, and I’m still floating…

   

mb85, Newbie
Posted: 15 May 2013 12:59 PM   Total Posts: 14   [ # 12 ]

Ascanio is absolutely right when it comes to the API docs. Lots of methods and variables have no description, making it very hard to get a handle on what everything does without days and days of trial and error.

With all the other features and enhancements going on we can’t expect greensock level documentation (though that would be very sweet), it would be nice if all the public methods at least had a sentence describing what they did.

   

Ascanio, Newbie
Posted: 15 May 2013 01:11 PM   Total Posts: 29   [ # 13 ]

Well, API documentation comes (or should come) from comments within the actual code, which are (or should be) a fundamental component of readability and maintainability.

That said, I’m the first one to cut corners, we all have timetable issues. So can’t blame anyone for them missing.

What I’m concerned about is the lack of blogs and tutorials, especially of the basic and intermediate level. I think that is the key to gaining momentum as a community.

I don’t have time to write about my findings right now, but if I do get a break this summer, I’d love to start blogging about them.

   

Pierce, Jr. Member
Posted: 30 June 2013 10:45 PM   Total Posts: 40   [ # 14 ]

I’ve always found that if I’m confused about how or why something works the way it does, actually opening the source files and following all the method calls between classes makes it pretty clear what’s going on (the actual code also has comments, which are pretty helpful). Between that and some experimentation, you can figure out pretty much anything you really NEED to very quickly, so long as you actually know what you’re doing. As far as documentation on par with adobe as3 references goes, that level of explanation takes a lot of time, people are busy, and no one is getting paid to do it, so… And on top of that, the framework is still very young, rapidly evolving, and still potentially subject to significant changes, so spending the time to document something that might be obsolete tomorrow isn’t really very worthwhile. That’s the thing about being on the frontier of an emerging open source technology; if no one has built something in particular with it yet, an explanation on how to do it isn’t going to magically materialize itself into a google search result. Best advice I can offer, if you aren’t willing to endure a steep learning curve, or if you just can’t hack it, use something else more friendly and come back in a couple of years. Otherwise, be prepared to lose some sleep and hair over it :/

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 01 July 2013 12:54 AM   Total Posts: 166   [ # 15 ]

Hi all,

Here is some hints for creating custom shaders.
http://away3d.com/forum/viewthread/4641/
But, at this time, we can not implement it easily yet…

I hope that Away3D team take more time for considering these problem.
Customizing shaders is one of the biggest fun for coding with GPU.

PS:
I think that you should make the tutorials stand out more.
Even the FlashDaily has not reported a updating of the pages.

Cheers.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X