|
Post by foxtrotm on Apr 25, 2015 17:12:41 GMT 10
The last few days I've been playing around with the "z" textures that come with each of the scenes. I was able work out how these textures are loaded, and made a small WebGL experiment that lets you play around with the depth information of the scenes. Take a look: re-depth-demos.s3-website-us-east-1.amazonaws.com/
Just a note, this uses WebGL and requires shader support. It will only work in Chrome, Firefox or Safari (IE11, maybe). The textures are about 1mb each so it may take a moment to load correctly. Examples
|
|
Posts: 687
Original Join Date: Jan 9, 2013
|
Post by Shigu on Apr 25, 2015 18:23:03 GMT 10
That's awesome, why aren't more mobile games designed to take advantage of this style?
|
|
"Hey, I'm not going anywhere. I'm the only cop left alive in this building!"
Posts: 457
Original Join Date: Nov 4, 2011
|
Post by Scout on Apr 26, 2015 1:08:56 GMT 10
Looks really cool.
|
|
Ada... Ada Wong :D
Posts: 9,898
Original Join Date: Aug 21, 2008
|
Post by EvilLord on Apr 26, 2015 4:17:28 GMT 10
what is this suppose to be again ?
|
|
✫Advanced Coder✫
Posts: 751
Original Join Date: Feb 15 2010
|
Post by Son of Persia on Apr 26, 2015 6:02:39 GMT 10
It very much looks like an AO map(Ambient Occlusion: some kind of shadow map) of the room.
Depth maps(z-buffer maps) are stored in *_z.dds textures.
I think in this case you just used green channel of z maps.
If so, it's a depth (and not AO) map.
|
|
|
Post by foxtrotm on Apr 26, 2015 14:29:45 GMT 10
They seem like depth maps. With the static backgrounds, I wouldn't suspect there'd be much point including AO in the game.
It looks like all the channels are used, not just green. They way the shader works in the OpenGL is to treat the red-green-blue channels as a single 24-bit integer. If you bit-shift each channel you get a number between 0 and 16,777,215 (compared to 0-255 in the green channel alone). In pseudo-code it is:
depth = (red << 16) + (green << 8) + blue Happy to share some Python scripts to do the conversion if anyone is interested.
|
|