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!