I am working on a tool that creates icons of GameObjects.
A basic rundown of what it does:
It uses the scene view to align the snapshot.
A temporary camera is created and its position/rotation is set to the same as the scene view camera
I do this to change a few settings on the camera (I dont want to mess with the scene view camera)
After calling Render() on the camera and setting RenderTexture.active, I get exactly what I need when I call
snap.ReadPixels( _snapArea, 0, 0, false );```
Is setting the active render texture the only way to get a camera render ?
It feels weird to save the current render texture, set the active one manually, read the pixels and set it back to the saved one.
I tried doing the same with ```Graphics.CopyTexture( _cam.targetTexture, 0, 0, (int)_snapArea.x, (int)_snapArea.y, (int)_snapArea.width, (int)_snapArea.height, snap, 0, 0, 0, 0 );``` but the result is always grey.
I guess thats because it doesnt actually render the camera to its render texture.
Frankly, I dont get it :face_with_spiral_eyes: