示例#1
0
        public void init(int width, int height, int scaleFactor)
        {
            mScalingFactor = scaleFactor;

            Globals.setValue("4D", "true", true);

            m_iSynthWidth  = width;
            m_iSynthHeight = height;

            m_Quad     = new D3DQuad(true);
            m_QuadDual = new D3DQuad(false);

            allocateBuffers(m_iSynthWidth * mScalingFactor, m_iSynthHeight * mScalingFactor);



            loadPrograms();
            clearJacobianMap();


            createControlPackets();

            // load splat texture for painting
            m_d3dSplat = BRenderDevice.getTextureManager().getTexture(AppDomain.CurrentDomain.BaseDirectory + "textures\\splatBrushMask.png");



            // set miscellaneous render states
            BRenderDevice.getDevice().SetRenderState(RenderStates.DitherEnable, false);
            BRenderDevice.getDevice().SetRenderState(RenderStates.SpecularEnable, false);
            BRenderDevice.getDevice().SetRenderState(RenderStates.Lighting, false);
            BRenderDevice.getDevice().SetRenderState(RenderStates.ZEnable, false);
            BRenderDevice.getDevice().SetRenderState(RenderStates.CullMode, (int)Cull.None);

            // set the world matrix
            BRenderDevice.getDevice().Transform.World = Matrix.Identity;
            BRenderDevice.getDevice().Transform.View = Matrix.Identity;
            BRenderDevice.getDevice().Transform.Projection = Matrix.OrthoOffCenterRH(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f);
        }
示例#2
0
        public void init(String filename)
        {
            mShader = ShaderManager.loadShader(filename, null);


            s_Quad = new D3DQuad(false);



            // call FxShader constructor

            mShader = ShaderManager.loadShader(filename, null);

            // init default parameters

            m_fxViewport          = mShader.GetParameter(null, "Viewport");
            m_fxDestRegionCoord   = mShader.GetParameter(null, "DestRegionCoord");
            m_fxDestRegionSize    = mShader.GetParameter(null, "DestRegionSize");
            m_fxInvDestRegionSize = mShader.GetParameter(null, "InvDestRegionSize");
            m_fxTechMain          = mShader.GetTechnique("t_main");

            mShader.Technique = m_fxTechMain;
        }
示例#3
0
        public void destroy()
        {
            for (int i = 0; i < mSynthNodes.Count; i++)
            {
                mSynthNodes[i].destroy();
            }
            mSynthNodes.Clear();

            m_Quad     = null;
            m_QuadDual = null;

            if (mJacobianMapSrf != null)
            {
                mJacobianMapSrf.Dispose();
            }
            if (mJacobianMap != null)
            {
                mJacobianMap.Dispose();
            }
            if (mJacobianMapInverseSrf != null)
            {
                mJacobianMapInverseSrf.Dispose();
            }
            if (mJacobianMapInverse != null)
            {
                mJacobianMapInverse.Dispose();
            }
            if (m_d3dPaintLayerSrf != null)
            {
                m_d3dPaintLayerSrf.Dispose();
            }
            if (m_d3dPaintLayer != null)
            {
                m_d3dPaintLayer.Dispose();
            }
        }