trouble in Globe Materials Tutorial?

Software: Away3D 4.x

Lx, Newbie
Posted: 21 February 2013 08:13 AM   Total Posts: 2

My English is not good, I hope you can understand.in Globe Materials Tutorial eighth step of the tutorial,there are some Errors:can not find _atmosphereDiffuseMethod.viewDirFragmentReg and _atmosphereDiffuseMethod.normalFragmentReg?

I do not know how to modify ,THanks!

   

_kihu, Jr. Member
Posted: 21 February 2013 03:46 PM   Total Posts: 43   [ # 1 ]

Hey,

please paste here the error message, exactly how it look like in your debugger. Also paste your code (the class in which the error occurs).

   

Lx, Newbie
Posted: 22 February 2013 03:06 AM   Total Posts: 2   [ # 2 ]

the error is:
156 line 1119: Access of possibly undefined property viewDirFragmentReg (static type away3d.materials.methods: CompositeDiffuseMethod references).
157 line 1119: Access of possibly undefined property normalFragmentReg (static type away3d.materials.methods: CompositeDiffuseMethod references).

I used the away3d-core-fp11_4_1_0_Alpha.swc ,I use flash cs6.Thank you.

   

_kihu, Jr. Member
Posted: 22 February 2013 09:06 AM   Total Posts: 43   [ # 3 ]

Try using this source:
https://github.com/away3d/away3d-core-fp11

You can download this as .zip file or using git or svn client.

add Away3D’s ‘src’ folder to your source paths.

   

Avatar
owntheweb, Jr. Member
Posted: 13 March 2013 03:34 AM   Total Posts: 32   [ # 4 ]

Hello,
I seem to be running into the same issue as well, while pulling the globe tutorial into a fun Mars project. I took it one or two steps at a time and all was well until adding the custom diffuse method - same errors.

I started using the src you linked to (may have been using it already). The issue remains. Any thoughts on where I might be going wrong?

I’m using Flash CS6 if that helps.

Thanks for helping point me in the right direction. I’ll post if some sleep resolves the issue first (most often does). smile

=====
Current wild guess:
A global non-existing CompositeDiffuseMethod attribute is being accessed from within modulateDiffuseMethod. Am I wrong?

I’m setting the diffuse method like this:

_atmosphereDiffuseMethod = new CompositeDiffuseMethodmodulateDiffuseMethod ); 

The modulateDiffuseMethod is trying to access attributes that don’t exist according to the current docs or new CompositeDiffuseMethod.as:
http://away3d.com/livedocs/away3d/4.0/away3d/materials/methods/CompositeDiffuseMethod.html

private function modulateDiffuseMethodvo:MethodVOt:ShaderRegisterElementregCache:ShaderRegisterCache ):String {

 
//craziness
 
var viewDirFragmentReg:ShaderRegisterElement _atmosphereDiffuseMethod.viewDirFragmentReg//????
 
var normalFragmentReg:ShaderRegisterElement _atmosphereDiffuseMethod.normalFragmentReg//????
 //end craziness ;)

 
var temp:ShaderRegisterElement regCache.getFreeFragmentSingleTemp();
 
regCache.addFragmentTempUsagestemp);
 var 
code:String "dp3 " temp ", " viewDirFragmentReg ".xyz, " normalFragmentReg ".xyz\n" +
 
"mul " temp ", " temp ", " temp "\n" +  
 
"mul " ".w, " ".w, " temp "\n";
 
regCache.removeFragmentTempUsagetemp );
 return 
code;

Edit:
Still waking up, but so far I found protected _viewDirFragmentReg and _normalFragmentReg at CompositeDiffuseMethod’s base. No dice yet on something I can use…

   

Avatar
Rob Bateman, Administrator
Posted: 13 March 2013 02:18 PM   Total Posts: 120   [ # 5 ]

Hey owntheweb

The problem is most likely the examples you are using are out of sync (in release terms) with the library you are using.

As a suggestion, try using the latest source for library and examples from dev:

https://github.com/away3d/away3d-core-fp11/tree/dev

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

this should give you an error-free compilation

   

Avatar
owntheweb, Jr. Member
Posted: 13 March 2013 02:44 PM   Total Posts: 32   [ # 6 ]

That worked like magic! I was able to update my code quickly with the example. Mars is moving forward. :D

http://www.flickr.com/photos/8139783@N08/8553873975/

Thank you muchly.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X