Trouble with transparency rendering. Can you help me?

Jun 17, 2013 at 5:32 AM
Edited Jun 17, 2013 at 5:34 AM
I dont get it to render a mesh (sprite) with transparency.

I setup a GBuffer that i use as a render target for rendering all nodes into it.
So i have a diffuseMap, specularMap, .. and so on.

When i simply render the resulting diffuseMap to the screen is see that there is no transparency on the sprites.

I set for the RenderEffectDX11 of my sprite nodes to this:
BlendStateConfigDX11 BS;
BS.AlphaToCoverageEnable = false;
BS.IndependentBlendEnable = false;

BS.RenderTarget[0].BlendEnable = true;
BS.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
BS.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
BS.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; 
BS.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
BS.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE;
BS.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; 
BS.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;

this->m_iBlendState = RendererDX11::Get()->CreateBlendState( &BS );
GBuffer Texture2d Config for Diffuse map:
Texture2dConfigDX11 RTConfig;
RTConfig.SetColorBuffer( rtWidth, rtHeight );
RTConfig.SetFormat( DXGI_FORMAT_R32G32B32A32_FLOAT );
A little bit shader code (from pixel shader part):
output.DiffuseAlbedo = DiffuseMap.Sample( DefaultSampler, input.TexCoord );
output.Normal = float4( SpheremapEncode( normalVS ), 1.0f, 1.0f );
output.SpecularAlbedo = float4(SpecularMap.Sample( DefaultSampler, input.TexCoord ).rgb, output.DiffuseAlbedo.a);
output.EmissiveAlbedo = float4(EmissiveMap.Sample( DefaultSampler, input.TexCoord ).rgb, output.DiffuseAlbedo.a); 
But no transparency. Idea whats wrong, or what i have forgotten?
Jun 17, 2013 at 5:46 AM
Edited Jun 17, 2013 at 6:07 AM
I think ive made it.. im overtired... i think

config of the StencilState and RasterizerState has made that transparency not working.

......

So that this thread is not useless as it is :S. Are you have new examples in mind, like streaming example or whatever that you will bring in the future someday.
Coordinator
Jun 18, 2013 at 3:35 AM
I would indeed like to build something to do with streaming, along the lines of what you described before. I have just been in a crunch at work and haven't had any time to really put onto Hieroglyph. That should change in about two weeks...

I also have some ideas for another Kinect based sample, a wxWidgets sample, and also one to incorporate the D2D1Renderer as well. These are all somewhat under way, but they require more time to wrap them up than I have at the moment :(

As always, if there is something in particular that you are interested to see, please let me know and I can try to re-prioritize. How are things going with your own game? Did you get to make some progress?
Jun 18, 2013 at 6:54 PM
Edited Jun 18, 2013 at 7:07 PM
The game progress is slow but there.

Someday it will be finished and i will show it to you. But im alone in programming and design. And time is rare you know. Switching to your engine instead of using my own DirectX11 engine is much faster.

Yesterday/Today ive made the shading + post effects for the game. I like it.

But there are much non-graphical things to do, that costs a lot of time too.