How I can Create a Depth texture

I tried to do a ray from the screen to scene, but I think a need a depth texture from render to do that. I try to do it with a camera, which is active the depth mode, and make a texture2d to recive it and after encode to png in a file to see if some data as recorder, but apear a black texture. Did you think exist some valid formula to create a depht texture?

sounds like you're making it a little bit more difficult than it needs to be - fire a ray to the render texture, then use the hit uv to calculate the screen position to use for ScreenToWorldPoint to use with the other camera

basically just ScreenPointToRay(new Vector3(u*Screen.width, v * Screen.height, 0)) and you should be sorted to raycast that into the second camera

You do not need depth textures to fire rays into the scene and detect where they hit. You just need colliders on the things which can be hit.

(If I've misunderstood the question, e.g. you may be trying to use a depth texture for a different reason, then please go into a little more detail about what you are trying to accomplish.)

Hi Bampf, may be I do not expoused very well what a tried to do.

To be more acurate, I try pointer with a mouse a target in a scene with a orthografic camera (camera 1), far from the principal scene, which is target to a plane with a render texture. That texture is from another camera (camera 2) inside of the principal scene, and I want to fire a ray, from the data of the target relative position, in camera 1.

Using it as reference in the scene to lunch the ray starting from camera 2 position to a depth given by the depth from the render texture in the plane which is the target of the camera 1. Then I do a ScreenToWordPoint using that Depth, from camera 1 deph texture.