Jump to content

Question to devs: How does the depth map work?


Recommended Posts

Hello everyone!

 

I'm currently writing a tutorial on how to create and render PoE-esque landscapes with Blender (to allow future community projects that add custom user content).

However, I'm confused about how the depth map of PoE works, which is vital to create the occlusion effects ingame.

 

This picture is from the tech demo video:

http://media.obsidian.net/eternity/media/updates/0079/pe-passes.jpg

 

So, here are my problems:

Why does the building on the screenshot have a layered black-and-white striped pattern instead of a steady bottom-to-top gradient from white (ground plane) to black (maximum possible occlusion height)?

 

Also, why do the wall columns on the left side of the screen have a bright white top, brighter than the ground plane, which is clearly behind the wall columns, not in front of them?

 

This is very confusing, imho and makes it hard to find out the correct parameters for the rendering process.

Can you please share us some details about how the depth rendering is done (or at least, how the depth map works)?

 

 

Final, Normal and Albedo map are no problem so far.

Edited by Zwiebelchen
  • Like 2
Link to comment
Share on other sites

From what I see now, it looks like there is just a striped overlay over every vertical wall. This means replicating this would be as simple as projecting the striped texture onto all objects in X/Y directions. Am I on the right track here? Still, I don't see the purpose of this yet.

Edited by Zwiebelchen
  • Like 1
Link to comment
Share on other sites

I don't think there's a big mystery. It's not depth as in z-buffer, but height above ground. Since the max and min heights aren't known there's no range that's easily mapped to [0..1], so the debug visualization you're seeing is instead showing the fractional part. Each stripe represents an increase in height by 1.

Link to comment
Share on other sites

More specifically, the height of each pixel off the ground is encoded as a normalized floating point number into the 24-bit height texture.  The reason you get the striations and other strange patterns is that the image viewer has attempted to render this floating point number as a 24-bit RGB value, which doesn't exactly make sense - the stripes are not a feature of the format but rather an artifact.  You should pull any of the HGT_AR textures out of the build to get a better idea, that render is not completely accurate, though it shows the basic idea.

  • Like 4
Link to comment
Share on other sites

More specifically, the height of each pixel off the ground is encoded as a normalized floating point number into the 24-bit height texture.  The reason you get the striations and other strange patterns is that the image viewer has attempted to render this floating point number as a 24-bit RGB value, which doesn't exactly make sense - the stripes are not a feature of the format but rather an artifact.  You should pull any of the HGT_AR textures out of the build to get a better idea, that render is not completely accurate, though it shows the basic idea.

 

Thanks for the additional intel. Combined with the knowledge from the other thread about maps, I think I can now replicate all the maps with a satisfactory result. Now the remaining problem is porting them into a game-readable file...

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...