0 Replies Latest reply: Oct 16, 2011 9:06 PM by Philipp Fischer RSS

    Post-processing pipeline causes error when placing "SceneGrid" object into 3D scene

    Philipp Fischer Community Member

      Hi,

       

      first want to thank you guys for the great work with proscenium and the awesome features.

       

      I was going through the examples and found a bug. I tried a combination of the examples "TestLines" and "TestPPEncodeDecodeHDR".

      The post processing pipeline somehow manipulates the render sates/vertex program in a way it crashes as soon as it should perform the drawTriangles call for a "SceneGrid" object.

      It does not seem to be related to my particular post processing setup - I tried TestPPBloom and TestPPEncodeDecodeHDR from the examples. The post processing pipeline seems to work fine with a 3DS model (Teapot) .

       

        //add grid

        scene.addChild(new SceneGrid());

       

        //setup post-processing

        if(true) {

      instance.createPostProcessingColorBuffer();

      instance.colorBuffer.targetSettings.useHDRMapping = true;

      instance.colorBuffer.targetSettings.kHDRMapping = 4;

       

      var colorToPrimary:RenderGraphNode = new RenderGraphNodePPElement(instance.colorBuffer, null, RenderGraphNodePPElement.HDR_DECODE, "Decode HDR" );

      colorToPrimary.addStaticPrerequisite(instance.colorBuffer.renderGraphNode);

       

      instance.renderGraphRoot.clearAllPrerequisite( );

      instance.renderGraphRoot.addStaticPrerequisite(colorToPrimary);

         }

       

      This gives me the following error:

       

      Error: Error #3607: Stream 2 is set but not used by the current vertex program.

                at flash.display3D::Context3D/drawTriangles()

                at com.adobe.scenegraph::Instance3D/drawTriangles()[D:\Depots\Proscenium\branches\rel\code\P roscenium\src\com\adobe\scenegraph\Instance3D.as:537]

                at com.adobe.scenegraph::PB3DCompute/compute()[D:\Depots\Proscenium\branches\rel\code\Prosce nium\src\com\adobe\scenegraph\PB3DCompute.as:332]

                at com.adobe.scenegraph::RenderGraphNodePPElement/render()[D:\Depots\Proscenium\branches\rel \code\Proscenium\src\com\adobe\scenegraph\RenderGraphNodePPElement.as:272]

                at com.adobe.scenegraph::Instance3D/render()[D:\Depots\Proscenium\branches\rel\code\Prosceni um\src\com\adobe\scenegraph\Instance3D.as:304]

                at com.adobe.scenegraph::BasicScene/enterFrameEventHandler()[D:\Depots\Proscenium\branches\r el\code\Proscenium\src\com\adobe\scenegraph\BasicScene.as:273]

       

       

       

      Thanks,

      Philipp

       

       

      ----

      Full Source Code:

       

       

      package

      {

                import com.adobe.scenegraph.*;

                import com.adobe.scenegraph.loaders.*;

                import com.adobe.scenegraph.loaders.collada.*;

                import com.adobe.scenegraph.loaders.obj.*;

       

                import flash.display.*;

                import flash.display3D.*;

                import flash.events.*;

                import flash.geom.*;

                import flash.utils.*;

       

                public class TestLinesWithPostProcessing extends BasicScene

                {

       

        // ----------------------------------------------------------------------

        override protected function initModels():void

                          {

       

        //add grid

                                    scene.addChild(new SceneGrid());

       

        //add teapot

      //                              var f:Function = function(event:Event):void { (event.target as ModelLoader).model.addTo(scene); }

      //                              var loader:OBJLoader = new OBJLoader("res/content/teapot.obj");

      //                              loader.addEventListener(Event.COMPLETE, f, false, 0, true);

       

        //setup post-processing

                                    if(true) {

                                              instance.createPostProcessingColorBuffer();

                                              instance.colorBuffer.targetSettings.useHDRMapping = true;

                                              instance.colorBuffer.targetSettings.kHDRMapping = 4;

       

                                              var colorToPrimary:RenderGraphNode = new RenderGraphNodePPElement(instance.colorBuffer, null, RenderGraphNodePPElement.HDR_DECODE, "Decode HDR" );

                                              colorToPrimary.addStaticPrerequisite(instance.colorBuffer.renderGraphNode);

       

                                              instance.renderGraphRoot.clearAllPrerequisite( );

                                              instance.renderGraphRoot.addStaticPrerequisite(colorToPrimary);

                                    }

                          }

       

        override protected function resetCamera():void

                          {

                                    scene.activeCamera.identity();

                                    scene.activeCamera.lookat(new Vector3D(0, 5, -15), new Vector3D(0, 0, 0), new Vector3D(0, 1, 0));

                          }

                }

      }