How to draw some objects "always on top"?
Members - Reputation: 296
Posted 14 December 2012 - 07:33 AM
Just like this picture (taken from Blenders homepage, http://www.blender.org), you can see axes on the bears arm even if they are "inside" the arm
Im rendering in dx11.
Crossbones+ - Reputation: 7123
Posted 14 December 2012 - 07:39 AM
My game: Gnoblins
Developer journal about Gnoblins
Small goodies: Simple alpha transparency in deferred shader
Members - Reputation: 913
Posted 14 December 2012 - 12:46 PM
[source lang="cpp"] ID3D11DepthStencilState* EnableAllDSS; D3D11_DEPTH_STENCIL_DESC depthdesc; memset(&depthdesc, 0, sizeof(depthdesc)); depthdesc.DepthEnable = (BOOL) false; depthdesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; depthdesc.DepthFunc = D3D11_COMPARISON_NEVER; depthdesc.StencilEnable = (BOOL) false; HR(device->CreateDepthStencilState(&depthdesc, &EnableAllDSS));[/source]
Then just set EnableAllDDS as the depth stencil state when rendering the axis arrows and reset it when done rendering them.
Crossbones+ - Reputation: 7823
Posted 14 December 2012 - 06:38 PM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Members - Reputation: 1562
Posted 15 December 2012 - 03:09 AM
Isn't Ashaman73's solution the only proper one in this thread?
Crossbones+ - Reputation: 2367
Members - Reputation: 157
Posted 18 December 2012 - 12:45 AM
(d3d render state ztest off just at drawins Axis and then turn it on )
It's so easy I see some wrong answer above
but you need self depth test? Am I right?
then you need mask like stencil and so many other way..
How about this?
draw Axis to other texture and compositing it It's very easy and simple
but you must draw 3 times but you can debug Axis and object so easily ..I never use stencil. and I think It's not necessary at all at over DX 9
any other help plz let me know
Ah sorry you just need turn on off Z test that's all I confuse with others message
sorry I'm new here and I'm Korean
Edited by GeniusPooh, 18 December 2012 - 12:47 AM.
Beauty is only skin deep , ugly goes to bones
World's only 3D engine tunner and 3D engine guru.
and real genius inventor but very kind warm heart .. and having serious depression for suffering in Korea
www.polygonart.co.kr ( currently out dated and only Korean will change to English and new stuff when I get better condition sorry for that)