- Home /
Render Texture out from a 3D Object
Hi everybody. Here's the thing. I have a simple 3D model of an sphere. I need to send (using NDI Sender) the lights, shadow and the albedo map applied on it to another software. Basicaly, I need to generate a texture based on the lights and shadow that the model has in unity.... is this possible?... Thanks!
Answer by Glurth · Oct 19, 2018 at 05:15 PM
you can take a "screen-shot" https://docs.unity3d.com/ScriptReference/ScreenCapture.CaptureScreenshot.html I'd suspect you would want the background to be a single color, in order to find the texture you want inside the screenshot.
Alternatively, you can apply a renderTexture to your camera, and extract the pixels from that. Using this method would allow you to use raycasting to determine if you want to keep/reject a given pixel. (https://docs.unity3d.com/ScriptReference/Camera.ScreenPointToRay.html , https://docs.unity3d.com/ScriptReference/Physics.Raycast.html ).
Still, I'd expect a single color background to check against would be more efficient.
Your answer
Follow this Question
Related Questions
Render to Texture artifacts 0 Answers
Converting a RenderTexture to a Texture2D for use in a shader 2 Answers
What is the exact size of texture padding required to avoid seams 1 Answer
From flat image to pseudo-3D, how to manage a texture/depth map couple ? 0 Answers
Get texture with UV Mesh Mapping 0 Answers