Hi There,
I need to render with depth testing enabled. I’ve checked in your code and you seem to not to use depth testing at all. Mostly because you do post processing most of the times.
Do you have any suggestion to render with depth testing? I need to render just a simple cube but it renders on top of everthing because of depth test not being enabled.
I’ve checked the depthstencil state of the pipeline state object and I’ve activated Less and depth write on but doesn’t produce any effect. The triangles on the back of the cube renders on top of the one are in front. Again no depth testing seems to be active at where I’m rendering my stuff.
I’ve overrided from a ViewExtennsion class and I’m doing my rendering inside
PostRenderView_RenderThread member function.
Any help would be appreciated thanks very much. Ah and also this is my pipeline state object:
FGraphicsPipelineStateInitializer GraphicsPSOInit;
RHICmdList.ApplyCachedRenderTargets(GraphicsPSOInit);
GraphicsPSOInit.DepthStencilState = TStaticDepthStencilState<false, ECompareFunction::CF_Less>::GetRHI();
//GraphicsPSOInit.RasterizerState = TStaticRasterizerState<FM_Solid, CM_CCW, false>::GetRHI();
GraphicsPSOInit.RasterizerState = TStaticRasterizerState<FM_Solid, CM_None, false>::GetRHI();
GraphicsPSOInit.BlendState = TStaticBlendState<>::GetRHI();
GraphicsPSOInit.BoundShaderState.VertexDeclarationRHI = GetPKSimpleVertexDeclaration();
GraphicsPSOInit.BoundShaderState.VertexShaderRHI = VertexShader.GetVertexShader();
GraphicsPSOInit.BoundShaderState.PixelShaderRHI = PixelShader.GetPixelShader();
GraphicsPSOInit.PrimitiveType = EPrimitiveType::PT_TriangleList;
GraphicsPSOInit.NumSamples = 1;
SetGraphicsPipelineState(RHICmdList, GraphicsPSOInit);
thanks in advance