Original Post
hello every one .
1:why when the writer in his tutorial always do this in HLSL shader file;
position.xyz /=position.w;
or
depth.xy/=depth.y; where ( y == w == 1 )
why he do this while w is always 1 for points ????????????????????????
Sure I am taking position from model so position represented as [ X Y Z 1] (where 1 == w)
so why he divided it always on w??
----------------
2: why the writer do this when he want to take depth and store it in render target (texture) for further usage
he do this at the last step :
output.depth= input.Depth.x / Input.Depth.y ; where (input.Depth=vertexposition.zw) ??????
1:why when the writer in his tutorial always do this in HLSL shader file;
position.xyz /=position.w;
or
depth.xy/=depth.y; where ( y == w == 1 )
why he do this while w is always 1 for points ????????????????????????
Sure I am taking position from model so position represented as [ X Y Z 1] (where 1 == w)
so why he divided it always on w??
----------------
2: why the writer do this when he want to take depth and store it in render target (texture) for further usage
he do this at the last step :
output.depth= input.Depth.x / Input.Depth.y ; where (input.Depth=vertexposition.zw) ??????