Пример #1
0
        public void SetPassData(CRenderContext rc, CGfxMesh mesh, UInt32 index, CGfxSceneView vp, CPass pass)
        {
            //OnEffectRefresh(rc);
            if (pass.RenderPipeline == null)
            {
                var rplDesc = new CRenderPipelineDesc();
                pass.RenderPipeline = rc.CreateRenderPipeline(rplDesc);
            }
            pass.RenderPipeline.ShaderProgram     = mEffect.ShaderProgram;
            pass.RenderPipeline.RasterizerState   = mMaterial.RasterizerState;
            pass.RenderPipeline.DepthStencilState = mMaterial.DepthStencilState;
            pass.RenderPipeline.BlendState        = mMaterial.BlendState;

            pass.GeometryMesh = mesh.MeshPrimitives.GeometryMesh;

            pass.BindCBuffer(mEffect.ShaderProgram, mEffect.PerInstanceId, CBuffer);
            pass.BindCBuffer(mEffect.ShaderProgram, mEffect.PerFrameId, CEngine.Instance.PerFrameCBuffer);

            if (vp != null)
            {
                pass.ViewPort = vp.Viewport;
            }

            var textures = new CShaderResources();

            {
                Material.BindTextures(textures, mEffect.ShaderProgram);
                foreach (var i in Textures)
                {
                    textures.PSBindTexture(i.Key, i.Value);
                }
                mesh.ShadingEnv.BindResources(mesh, CBuffer, textures, mEffect.ShaderProgram);
            }
            pass.ShaderResources = textures;

            CShaderSamplers samplers = new CShaderSamplers();

            {
                CSamplerStateDesc sampDesc = new CSamplerStateDesc();
                sampDesc.SetDefault();
                sampDesc.Filter = ESamplerFilter.SPF_MIN_MAG_MIP_POINT;
                CSamplerState samp = CEngine.Instance.SamplerStateManager.GetSamplerState(rc, sampDesc);
                for (UInt32 i = 0; i < mEffect.ShaderProgram.SamplerNumber; i++)
                {
                    CSamplerBindInfo info = new CSamplerBindInfo();
                    mEffect.ShaderProgram.GetSamplerBindInfo(i, ref info);
                    samplers.PSBindSampler(info.PSBindPoint, samp);
                }
            }
            pass.ShaderSamplers = samplers;

            foreach (var i in mesh.MdfQueue.Modifiers)
            {
                i.OnSetPassData(pass);
            }

            CDrawPrimitiveDesc dpDesc = new CDrawPrimitiveDesc();

            mesh.MeshPrimitives.GetAtom(index, 0, ref dpDesc);
            pass.BindDrawPrimitive(ref dpDesc);
        }
Пример #2
0
 public void RT_ParseShader(CShader pSH, ulong nMaskGen, uint flags, CShaderResources Res) => throw new NotImplementedException();
Пример #3
0
 public bool mfModifyGenFlags(CShader efGen, CShaderResources pRes, ref ulong nMaskGen, ref ulong nMaskGenHW) => throw new NotImplementedException();
Пример #4
0
 public bool mfRefreshResourceConstants(CShaderResources Res) => throw new NotImplementedException();
Пример #5
0
 public CShader mfForName(string name, int flags, CShaderResources Res = null, ulong nMaskGen = 0) => throw new NotImplementedException();
Пример #6
0
 private void mfRefreshResources(CShaderResources Res, SLoadShaderItemArgs pArgs = null) => throw new NotImplementedException();
Пример #7
0
 private void mfCheckShaderResTexturesHW(ref SShaderPass[] Dst, CShader ef, CShaderResources Res) => throw new NotImplementedException();
Пример #8
0
 private void mfLoadDefaultTexture(EEfResTextures Id, ref CShaderResources RS, EEfResTextures Alias) => throw new NotImplementedException();
Пример #9
0
 private bool mfLoadResourceTexture(EEfResTextures Id, ref CShaderResources RS, uint CustomFlags, bool bReplaceMeOnFail      = false) => throw new NotImplementedException();
Пример #10
0
 private void mfRefreshResourceTextureConstants(EEfResTextures Id, out CShaderResources RS) => throw new NotImplementedException();