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); }
public void RT_ParseShader(CShader pSH, ulong nMaskGen, uint flags, CShaderResources Res) => throw new NotImplementedException();
public bool mfModifyGenFlags(CShader efGen, CShaderResources pRes, ref ulong nMaskGen, ref ulong nMaskGenHW) => throw new NotImplementedException();
public bool mfRefreshResourceConstants(CShaderResources Res) => throw new NotImplementedException();
public CShader mfForName(string name, int flags, CShaderResources Res = null, ulong nMaskGen = 0) => throw new NotImplementedException();
private void mfRefreshResources(CShaderResources Res, SLoadShaderItemArgs pArgs = null) => throw new NotImplementedException();
private void mfCheckShaderResTexturesHW(ref SShaderPass[] Dst, CShader ef, CShaderResources Res) => throw new NotImplementedException();
private void mfLoadDefaultTexture(EEfResTextures Id, ref CShaderResources RS, EEfResTextures Alias) => throw new NotImplementedException();
private bool mfLoadResourceTexture(EEfResTextures Id, ref CShaderResources RS, uint CustomFlags, bool bReplaceMeOnFail = false) => throw new NotImplementedException();
private void mfRefreshResourceTextureConstants(EEfResTextures Id, out CShaderResources RS) => throw new NotImplementedException();