diff --git a/tutorials/materials/globe/src/GlobeMaterialsTutorialListing07.as b/tutorials/materials/globe/src/GlobeMaterialsTutorialListing07.as index d672297..5fc2431 100644 --- a/tutorials/materials/globe/src/GlobeMaterialsTutorialListing07.as +++ b/tutorials/materials/globe/src/GlobeMaterialsTutorialListing07.as @@ -8,7 +8,6 @@ package import away3d.lights.PointLight; import away3d.materials.ColorMaterial; import away3d.materials.TextureMaterial; - import away3d.materials.methods.FresnelSpecularMethod; import away3d.materials.methods.SpecularShadingModel; import away3d.primitives.SkyBox; import away3d.primitives.SphereGeometry; @@ -106,7 +105,7 @@ package var earthFresnelSpecularMethod:FresnelSpecularMethod = new FresnelSpecularMethod( true ); earthFresnelSpecularMethod.fresnelPower = 1; earthFresnelSpecularMethod.normalReflectance = 0.1; - earthFresnelSpecularMethod.shadingModel = SpecularShadingModel.PHONG; + // Material for earth surface. var earthSurfaceMaterial:TextureMaterial = new TextureMaterial( Cast.bitmapTexture( EarthSurfaceDiffuse ) ); earthSurfaceMaterial.specularMethod = earthFresnelSpecularMethod; @@ -147,7 +146,7 @@ package var moonFresnelSpecularMethod:FresnelSpecularMethod = new FresnelSpecularMethod( true ); moonFresnelSpecularMethod.fresnelPower = 1; moonFresnelSpecularMethod.normalReflectance = 0.1; - moonFresnelSpecularMethod.shadingModel = SpecularShadingModel.PHONG; + // Material. var moonMaterial:TextureMaterial = new TextureMaterial( Cast.bitmapTexture( MoonSurfaceDiffuse ) ); moonMaterial.specularMethod = moonFresnelSpecularMethod; diff --git a/tutorials/materials/globe/src/GlobeMaterialsTutorialListing08.as b/tutorials/materials/globe/src/GlobeMaterialsTutorialListing08.as index 2595542..c21162c 100644 --- a/tutorials/materials/globe/src/GlobeMaterialsTutorialListing08.as +++ b/tutorials/materials/globe/src/GlobeMaterialsTutorialListing08.as @@ -11,7 +11,6 @@ package import away3d.materials.methods.CompositeDiffuseMethod; import away3d.materials.methods.FresnelSpecularMethod; import away3d.materials.methods.MethodVO; - import away3d.materials.methods.SpecularShadingModel; import away3d.materials.utils.ShaderRegisterCache; import away3d.materials.utils.ShaderRegisterElement; import away3d.primitives.SkyBox; @@ -111,7 +110,7 @@ package var earthFresnelSpecularMethod:FresnelSpecularMethod = new FresnelSpecularMethod( true ); earthFresnelSpecularMethod.fresnelPower = 1; earthFresnelSpecularMethod.normalReflectance = 0.1; - earthFresnelSpecularMethod.shadingModel = SpecularShadingModel.PHONG; + // Material for earth surface. var earthSurfaceMaterial:TextureMaterial = new TextureMaterial( Cast.bitmapTexture( EarthSurfaceDiffuse ) ); earthSurfaceMaterial.specularMethod = earthFresnelSpecularMethod; @@ -150,9 +149,9 @@ package _earth.addChild( earthAtmosphere ); } - private function modulateDiffuseMethod( vo:MethodVO, t:ShaderRegisterElement, regCache:ShaderRegisterCache ):String { - var viewDirFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.viewDirFragmentReg; - var normalFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.normalFragmentReg; + private function modulateDiffuseMethod(vo : MethodVO, t:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):String{ + var viewDirFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.sharedRegisters.viewDirFragment; + var normalFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.sharedRegisters.normalFragment; var temp:ShaderRegisterElement = regCache.getFreeFragmentSingleTemp(); regCache.addFragmentTempUsages( temp, 1 ); var code:String = "dp3 " + temp + ", " + viewDirFragmentReg + ".xyz, " + normalFragmentReg + ".xyz\n" + @@ -167,7 +166,7 @@ package var moonFresnelSpecularMethod:FresnelSpecularMethod = new FresnelSpecularMethod( true ); moonFresnelSpecularMethod.fresnelPower = 1; moonFresnelSpecularMethod.normalReflectance = 0.1; - moonFresnelSpecularMethod.shadingModel = SpecularShadingModel.PHONG; + // Material. var moonMaterial:TextureMaterial = new TextureMaterial( Cast.bitmapTexture( MoonSurfaceDiffuse ) ); moonMaterial.specularMethod = moonFresnelSpecularMethod; diff --git a/tutorials/materials/globe/src/GlobeMaterialsTutorialListing09.as b/tutorials/materials/globe/src/GlobeMaterialsTutorialListing09.as index fd28bac..153d8ed 100644 --- a/tutorials/materials/globe/src/GlobeMaterialsTutorialListing09.as +++ b/tutorials/materials/globe/src/GlobeMaterialsTutorialListing09.as @@ -12,9 +12,9 @@ package import away3d.materials.methods.CompositeDiffuseMethod; import away3d.materials.methods.FresnelSpecularMethod; import away3d.materials.methods.MethodVO; - import away3d.materials.methods.SpecularShadingModel; - import away3d.materials.utils.ShaderRegisterCache; - import away3d.materials.utils.ShaderRegisterElement; + import away3d.materials.compilation.ShaderRegisterData; + import away3d.materials.compilation.ShaderRegisterCache; + import away3d.materials.compilation.ShaderRegisterElement; import away3d.primitives.SkyBox; import away3d.primitives.SphereGeometry; import away3d.textures.BitmapCubeTexture; @@ -162,7 +162,7 @@ package var earthFresnelSpecularMethod:FresnelSpecularMethod = new FresnelSpecularMethod( true ); earthFresnelSpecularMethod.fresnelPower = 1; earthFresnelSpecularMethod.normalReflectance = 0.1; - earthFresnelSpecularMethod.shadingModel = SpecularShadingModel.PHONG; + // Material for earth surface. var earthSurfaceMaterial:TextureMaterial = new TextureMaterial( Cast.bitmapTexture( EarthSurfaceDiffuse ) ); earthSurfaceMaterial.specularMethod = earthFresnelSpecularMethod; @@ -201,9 +201,9 @@ package _earth.addChild( earthAtmosphere ); } - private function modulateDiffuseMethod( vo:MethodVO, t:ShaderRegisterElement, regCache:ShaderRegisterCache ):String { - var viewDirFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.viewDirFragmentReg; - var normalFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.normalFragmentReg; + private function modulateDiffuseMethod(vo : MethodVO, t:ShaderRegisterElement, regCache:ShaderRegisterCache, sharedRegisters:ShaderRegisterData):String{ + var viewDirFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.sharedRegisters.viewDirFragment; + var normalFragmentReg:ShaderRegisterElement = _atmosphereDiffuseMethod.sharedRegisters.normalFragment; var temp:ShaderRegisterElement = regCache.getFreeFragmentSingleTemp(); regCache.addFragmentTempUsages( temp, 1 ); var code:String = "dp3 " + temp + ", " + viewDirFragmentReg + ".xyz, " + normalFragmentReg + ".xyz\n" + @@ -218,7 +218,7 @@ package var moonFresnelSpecularMethod:FresnelSpecularMethod = new FresnelSpecularMethod( true ); moonFresnelSpecularMethod.fresnelPower = 1; moonFresnelSpecularMethod.normalReflectance = 0.1; - moonFresnelSpecularMethod.shadingModel = SpecularShadingModel.PHONG; + // Material. var moonMaterial:TextureMaterial = new TextureMaterial( Cast.bitmapTexture( MoonSurfaceDiffuse ) ); moonMaterial.specularMethod = moonFresnelSpecularMethod;