Skip to main content
deleted 6 characters in body
Source Link

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from these three my assumptions that

  1. depth check happens beforeafter vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of the value of SV_POSITION doesn't affect anything except in depth checking, because it is in projection space.

so after calculating projection position(local pos * WVP matlocal pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief VertextVertex shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; 
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

it doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from these three my assumptions that

  1. depth check happens before vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of the value of SV_POSITION doesn't affect anything except in depth checking, because it is in projection space.

so after calculating projection position(local pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief Vertext shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; 
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

it doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from these three my assumptions that

  1. depth check happens after vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of the value of SV_POSITION doesn't affect anything except in depth checking, because it is in projection space.

so after calculating projection position(local pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief Vertex shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; 
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

it doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from these three my assumptions that

  1. depth check happens before vertex shader
  2. value of SV_POSITIONSV_POSITION is used for depth checking
  3. modifying z component of the value of SV_POSITIONSV_POSITION doesn't affect anything except in depth checking, because it is in projection space.

so after calculating projection position(local pos * WVP matlocal pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief VertextVertext shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; 
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

it doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from these three my assumptions that

  1. depth check happens before vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of the value of SV_POSITION doesn't affect anything except in depth checking, because it is in projection space.

so after calculating projection position(local pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief Vertext shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; 
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

it doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from these three my assumptions that

  1. depth check happens before vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of the value of SV_POSITION doesn't affect anything except in depth checking, because it is in projection space.

so after calculating projection position(local pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief Vertext shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; 
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

it doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

added 197 characters in body
Source Link

Hi recently i am trying to implement z ordering systemz ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from the factsthese three my assumptions that

  1. depth check happens before vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of projection positionthe value of SV_POSITION doesn't affect anything except in depth checking (my assumption), because it is in projection space.

so after calculating projection position(local pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief Vertext shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; // i guess this will affect nothing after(maybe wrong)
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

iit doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Hi recently i am trying to implement z ordering system into my directx framework. the current idea is from the facts that

  1. depth check happens before vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of projection position of SV_POSITION doesn't affect anything except in depth checking (my assumption)

so after calculating projection position(local pos * WVP mat), i did projective dividision and modified only z component corresponding orders that i want to draw with.

This is brief Vertext shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; // i guess this will affect nothing after(maybe wrong)
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Hi recently i am trying to implement z ordering system into my directx framework. So every object will have z order property(int), and this value will have higher priority than depth checking for rendering. the current idea is from these three my assumptions that

  1. depth check happens before vertex shader
  2. value of SV_POSITION is used for depth checking
  3. modifying z component of the value of SV_POSITION doesn't affect anything except in depth checking, because it is in projection space.

so after calculating projection position(local pos * WVP mat), i did projective dividision(it seems to make problem) and modified only z component corresponding orders that i want to draw with.

This is brief Vertext shader code

VS_OUTPUT output;

output.pos = mul(WVPMat, input.pos); // projection pos
output.pos /= output.pos.w; 
output.pos.z -= renderPriority;

return output;

And !!! it kinds of works !!! but when i get my camera closer to any object, it weird thing happens enter image description here

it doesn't make any this weird thing unless projective division. i am just curious why it happens instead of knowing another alternative way for z ordering. but any further advices and informations would be really appreciated.

Source Link
Loading