Download

Project 3D to 2D with Camera Coords

Hi all,

I’ve been sitting on a new game idea for a year or so, and the new Unreal Engine subscription model has me thinking that I can finally build it. The announcement had me super excited, and I blitzed all the tutorials from my hotel room at GDC.

A core mechanic of my game is the mapping of 3D objects onto 2D space. Hopefully this image explains a little more:

The closest I have been able to get is using a spotlight with a light function to project a 2D image. I assume if I did a little more digging I could hook up a camera to render to texture too. My problem is that the light function is clearly designed for lighting rather than diffuse projection, and hence I don’t have control over blending modes. In terms of how the projection sits atop the scene, the decal seems the closest to what I’m looking for.

So to summarise the image, this is what I’m looking for:

  • Camera to capture an object on a transparent background to a texture.
  • Captured object is only visible to the projection camera. The player will not see the 3D captured object.
  • Camera to project image onto the scene using camera coordinates.
  • Projection to be shadeless, sit atop scenery materials, and not render on back faces.

Pretty crazy requirements I’m sure. Really hoping someone can point me in the right direction :slight_smile:

Many thanks!

Use a moveable Decal, and parent it to the camera using blueprints.

For the texture of the decal, you could render the object off screen, feed the results into a texture render target and finally feed this into the decal.

Thanks for the reply, but the problem is more advanced than a movable decal, I can do that just fine :slight_smile:

The problems with this solution:

  • Decal projection is orthographic - I need perspective, from the camera.
  • Decal projection is volumetric - it appears on polys that face away from projection source, and isn’t blocked by objects in front.
  • That doesn’t solve rendering an isolated actor to a texture, whilst being invisible to the player.

I was thinking of something similar, but is it possible to capture transparency into the render so as to isolate the object? Also decals seem to be orthographically projected, and show on faces that face away from the projection source (though there isn’t really a projection source as it’s volumetric).