View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

# DX11 - Position Maps + Depth Maps

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1Migi0027 (肉コーダ)  Members

Posted 01 July 2013 - 01:51 PM

Hi guys,

how can you, in the most correct way, map normals and position to a texture, I'm guessing like this, but I think I'm wrong:

PS. Is depth maps the same as position maps?

VS:

output.NormalW = mul(normal, worldMatrix);
output.depthPosition = output.position;

PS:


float depth = (input.depthPosition.w / 1000.0f);
output.Depth = float4(depth, depth, depth, 1);

output.Normals = float4(input.NormalW, 1);

float depth = (input.depthPosition.w / 1000.0f);
output.Depth = float4(depth, depth, depth, 1);

When I mean, 'the correct way', I mean so that this texture can be used in e.g:

Thanks!

Edited by Migi0027, 02 July 2013 - 11:51 AM.

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/cuboidzone.wordpress.com/

### #2Migi0027 (肉コーダ)  Members

Posted 03 July 2013 - 02:28 PM

I'm sure you all know, but you're awfully quiet, again.

Am I doing something really stupid here?

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/cuboidzone.wordpress.com/

### #3imoogiBG  Members

Posted 04 July 2013 - 09:03 AM

output.NormalW = mul(float4(normal.xyz, 0.f), worldMatrix);

float depth = input.depthPosition.z / input.depthPosition.w;

### #4Styves  Members

Posted 09 July 2013 - 12:05 PM

Better to output depth linearly for better precision distribution.

float depth = input.depthPosition.w * inverseFarPlaneDistance;

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.