Save DepthBuffer and Normals to Texture

Hello,

I am working on a project where I export 3d scenes to 2d tiles.

I want to be able to export Depth Buffer and Normals as jpg or png, too.

In case of depth buffer I would like to convert the r channel to a black and white color space that uses the full available value range so that it makes sense to save it in jpg…
Is there any shader for this conversion and i missed it?
if not, would a simple map function in a shader be enough?

Second in case of the normals I have another problem. when i want to save the normal pass of my multipass renderer directly to a file then i have also just a red image although i see the normals in a preview. i can however pass the normals through a renderer and save that image but not sure if it will be usable later because it looks partly typical normal but some surface directions are coded as black which i think is eventually wrong.

the thig is i can not realy test if the result would be usable or not because i am just making this exporter without having the receiving webgl shader yet.
for now i am working without the extra effects but i just want to export the tiles more sustainable so the thing can get a upgrade later or other people can use it with depth and normals

Any hints welcom!

thanks

DDS not anyuse? You can have 16bit per channel, and store normals and depth into separate channels.
I did make a 16bit-> 2 bit channels in a shader, but not sure where it is now ( I was fraps capturing a depth map)

hi, in case of depth, if u want true black and white depth, texture should be set to R32G32B32A32 since, it’s floating point precision, u can export to dds only.
With normal pretty much same shit, also should be written to 32 bits floating point dds only… Otherwise u gonna see some artifacts…

In case of NRT rendering and changing formats, u need temptarget with format or tfx with specified format in the pass… Also preview should be connected on preview pin of NRT Writer

btw there nice way to save both tex in one file, just combine RGB normal and Alpha as Depth, then u can work with it nicely in after effects.
As how to work with dds, there is batch dds to tga converter

thanks guys i think you are right. i can store it in dds for now and if i need it in another format later i can convert it but at least im sure to not have any loss at that point.

also did some research and dds support is existing for webgl although might be not easy to implement in vvvv.js

just a side note