, Jr. Member
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).
=====
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 CompositeDiffuseMethod( modulateDiffuseMethod );
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 modulateDiffuseMethod( vo:MethodVO, t:ShaderRegisterElement, regCache:ShaderRegisterCache ):String {
//craziness
var viewDirFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.viewDirFragmentReg; //????
var normalFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.normalFragmentReg; //????
//end craziness ;)
var temp:ShaderRegisterElement = regCache.getFreeFragmentSingleTemp();
regCache.addFragmentTempUsages( temp, 1 );
var code:String = "dp3 " + temp + ", " + viewDirFragmentReg + ".xyz, " + normalFragmentReg + ".xyz\n" +
"mul " + temp + ", " + temp + ", " + temp + "\n" +
"mul " + t + ".w, " + t + ".w, " + temp + "\n";
regCache.removeFragmentTempUsage( temp );
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…