SubsurfaceScatteringDiffuseMethod errors

Software: Away3D 4.x

Leo Bergman, Newbie
Posted: 13 September 2011 10:34 AM   Total Posts: 4

I’m having some issues with using the SubsurfaceScatteringDiffuseMethod.
First I tried adding it as a diffuseMethod to a material which has a DirectionalLight, and that caused the following error:

ErrorAn abstract method was calledEither an instance of an abstract class was created, or an abstract method was not overridden by the subclass.
 
at away3d.lights::LightBase/getObjectProjectionMatrix()
 
at away3d.materials.passes::SingleObjectDepthPass/render()
 
at away3d.materials::MaterialBase/renderPass()
 
at away3d.core.render::DefaultRenderer/drawRenderables()
 
at away3d.core.render::DefaultRenderer/draw()
 
at away3d.core.render::RendererBase/executeRender()
 
at away3d.core.render::RendererBase/render()
 
at away3d.containers::View3D/render()

Only using a PointLight instead causes the following error:

Error #3692: All buffers need to be cleared every frame before drawing.
 
at flash.display3D::Context3D/drawTriangles()
 
at away3d.materials.passes::MaterialPassBase/render()
 
at away3d.materials.passes::DefaultScreenPass/render()
 
at away3d.materials::MaterialBase/renderPass()
 
at away3d.core.render::DefaultRenderer/drawRenderables()
 
at away3d.core.render::DefaultRenderer/draw()
 
at away3d.core.render::RendererBase/executeRender()
 
at away3d.core.render::RendererBase/render()
 
at away3d.containers::View3D/render() 

The code I’m using is this:

var material:ColorMaterial = new ColorMaterial(0xFF0000.2);
var 
method:SubsurfaceScatteringDiffuseMethod = new SubsurfaceScatteringDiffuseMethod();
method.scattering .25;
method.scatterColor 0xFFFF00;
method.translucency 2;
material.diffuseMethod method;
var 
capsule:Capsule = new Capsule(material1324);
capsule.x;
capsule.y;
capsule.z;
capsule.rotationZ 90;
var 
light:PointLight = new PointLight();
light.x;
light.y+12;
light.z;
material.lights [light];
   
_view.scene.addChild(capsule);
_view.scene.addChild(light); 

Am I doing something wrong, is SubsurfaceScatteringDiffuseMethod trying to use features not available on my graphics card, or should I report it as a bug?

I’m using the latest version of away3d-core-fp11 from github, have FP 11.0.r1.129 debug. Systems is Win 7 32-bit with a GTS250.

   

Avatar
Alejandro Santander, Administrator
Posted: 13 September 2011 12:46 PM   Total Posts: 414   [ # 1 ]

Hey Leo,

I’ve tried it with my own test and I do get the abstract method called error when using a directional light. I think the subsurface scattering method is supposed to be used with a point light. Just in case and to verify, I’m bringing this as an issue to the away3d-core-fp11 github repo, so let’s follow the progress of this part there: https://github.com/away3d/away3d-core-fp11/issues/93

Now, when using a point light, I do not get a runtime error. This suggests that you are having a system specific problem as far as I can tell. But we have to be sure before filing an inconsistency bug to Adobe. Could you please send me (1) your code, (2 ) a compiled swf of such code with your machine and (3) details of the playerglobal.swc and sdk you are using to compile this?

hth

   

Leo Bergman, Newbie
Posted: 13 September 2011 02:11 PM   Total Posts: 4   [ # 2 ]

Thanks Alejandro, I have been making a narrowed down example and it seems like it happens when i use a Filter3D. I tried with DepthOfFieldFilter3D, MotionBlurFilter3D and BloomFilter3D, and when I use those in combination with SubsurfaceScatteringDiffuseMethod I get Error #3692.

Here is the class I used for testing:

package se.leobergman.sstest
{
 import away3d
.containers.View3D;
 
import away3d.debug.AwayStats;
 
import away3d.filters.DepthOfFieldFilter3D;
 
import away3d.lights.DirectionalLight;
 
import away3d.lights.PointLight;
 
import away3d.materials.ColorMaterial;
 
import away3d.materials.methods.SoftShadowMapMethod;
 
import away3d.materials.methods.SubsurfaceScatteringDiffuseMethod;
 
import away3d.primitives.Capsule;
 
import flash.display.Sprite;
 
import flash.display3D.Context3D;
 
import flash.events.Event;
 
import flash.geom.Vector3D;
 
 public class 
Main extends Sprite 
 {
  
private const _shadowStepSize:Number 0.00025;
  
  private var 
_view:View3D;
  private var 
_directionalLight:DirectionalLight;
  private var 
_pointLight:PointLight;
  private var 
_material:ColorMaterial;
  private var 
_capsule:Capsule;
  private var 
_dofFilter:DepthOfFieldFilter3D;
  
  
  public function 
Main():void 
  {
   
if (stageinit();
   else 
addEventListener(Event.ADDED_TO_STAGEinit);
  
}
  
  
private function init(e:Event null):void 
  {
   removeEventListener
(Event.ADDED_TO_STAGEinit);
   
   
_view = new View3D();
   
addChild(_view);
   
addChild(new AwayStats(_view));
   
   
initLights();
   
initMaterials();
   
initObjects();
   
   
_view.width 800;
   
_view.height 600;
   
   var 
test:Context3D _view.stage3DProxy.context3D;
   
_view.camera.= -40;
   
_view.camera.50;
   
   
addEventListener(Event.ENTER_FRAMEonEnterFrame);
   
_dofFilter = new DepthOfFieldFilter3D(33);
   
_dofFilter.range 3000;
   
_dofFilter.focusTarget _capsule;
   
_view.filters3d  [_dofFilter];
   
  
}
  
  
private function initLights():void 
  {
   _directionalLight 
= new DirectionalLight();
   
_directionalLight.color 0xFFFFFF;
   
_directionalLight.position.= -50;
   
_directionalLight.direction = new Vector3D(50, -300400);
   
_directionalLight.specular .5;
   
_directionalLight.diffuse 1;
   
   
_pointLight = new PointLight();
   
_pointLight.0;
   
_pointLight.50;
   
_pointLight.= -50;
   
_pointLight.diffuse 1;
   
_pointLight.color 0xFFAA00;
   
   
_view.scene.addChild(_directionalLight);
   
_view.scene.addChild(_pointLight);
  
}
  
  
private function initMaterials():void 
  {
   _material 
= new ColorMaterial(0x8888AA);
   
_material.ambient .3;
   
   
_material.lights [_pointLight];
   
_material.gloss 0.1;
   
_material.specular 0.1;
   
_material.specularColor 0xffffff;
   
   var 
method:SubsurfaceScatteringDiffuseMethod = new SubsurfaceScatteringDiffuseMethod();
   
method.scattering .25;
   
method.scatterColor 0xFFFF00;
   
method.translucency 2;
   
_material.diffuseMethod method;
  
}
  
  
private function initObjects():void 
  {
   _capsule 
= new Capsule(_material70140);
   
_capsule.0;
   
_capsule.12;
   
_capsule.500;
   
_capsule.rotationZ 90;
   
_view.scene.addChild(_capsule);
  
}
  
  
private function onEnterFrame(e:Event):void 
  {
   _view
.render();
  
}
 }
 

Commenting out line 62 will remove the error.

I’m using Flex SDK 4.5.1.21328 and playerglobal.swc 090611.

If it still seems it could be system-specific, let me know and I will send complete project and swf for you to test.

   

Avatar
Alejandro Santander, Administrator
Posted: 13 September 2011 02:48 PM   Total Posts: 414   [ # 3 ]

Alternatively, commenting out line 100 also avoids the crash. Looks like you’re right, you can’t have Filter3D and sub surface scattering at the same time. It’s not an inconsistency in the player.

I’m putting this as another issue in github, please follow this topic there: https://github.com/away3d/away3d-core-fp11/issues/94

Thanks!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X