Accessing camera images
Does anyone know a way to programmatically access the images rendered by a camera ?
I do not want to change the player's viewport or influence the environment in any kind.
The only thing I need is an object (camera) to place somewhere in the game which continously produces images from it's point of view, that I can get access to in c++
I really hope you'll be able to help me somehow.
Second attempt - I wrote this code especially for you, so don't tell me I'm lazy pasting all code here :)
I guess that's what you wanted, you get info about raw RGBA data. Probably it should work with access every frame - if not, you should probably look for function like
Another way is to use a SceneCapture2D, the actor class which is surprisingly different from common Camera actor class (they does not inherit from each other). Here is some code from my project, hope it'll help.
here are types of objects in header:
A little explanation. Here is created a USceneCaptureComponent2D, the camera attached to the portal, which gets us the view. View is send to copied Texture object, and, after start of the game, is attached to copy of material with input for texture. From the level of editor you need to create SceneCapture2D camera, create the Render Target object, set output of SceneCapture to this RenderTarget, and use this specific RenderTarget as a feed for Material. Because I spend some time trying to connect these things in script, I attach it, hoping that it can help :)
If I understand the question you would like to spawn a camera at a specific location to capture an image?
If this is so, you could try spawning an actor of class _camera in the desired location and reference the camera you spawned to get the image you want.
Hope this leads to a solution
answered Sep 12 '16 at 02:17 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here