x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Rendering multiple overlapping scenes in the same location

I am trying to create an effect which requires rendering multiple scenes in the same "place", so that the geometry sits in the same place in the world, but dependent on some property in the shader or the material settings one or other of the scenes will be rendered. There are a couple of approaches to achieve this:

  • The first, which I have successfully implemented, is to use a Material blueprint to determine whether the fragment should be drawn, and then set its Opacity to 0 or 1 based on that. This is relatively simple and allows me to have the geometry in the same location, but it doesn't allow me to have different lighting and other effects in the different scenes; it is less "two different scenes" and more "two different sets of geometry within a scene".

  • The second approach is to have the second scene at some offset, say -10000 in the Z, and use a Scene Capture 2D to get a capture of it rendered to a texture, which I can draw to the screen appropriately. This allows the scenes to be completely different in terms of lighting and so on, but means they are not at the same location.

It would be useful to have the geometry actually physically sit in the same location because there are times I will want to be able to collide with things in either scene and this would be a pain if the scenes are offset from each other (I suppose I would have to have some sort of proxy of the collidable in the other scene and then propagate any collisions back to the original Actor).

Another approach would be as follows:

  • Have two "scenes", including geometry, lights, and everything else, existing in the same space, and render them both using separate render passes, then composite the images later.

However I don't know if this is possible in UE4 as it stands. Other posts I've found that touch on similar issues seem to imply that the new deferred rendering model makes this difficult. I'd like to avoid having to modify the engine if possible. If it were possible, though, this feels like it would be the ideal solution.

My question then is as follows: Is this two-pass approach possible? If not, is there another approach I haven't considered?

Product Version: UE 4.8
Tags:
more ▼

asked Aug 17 '15 at 06:18 AM in Rendering

avatar image

dpwright
1 1 2 1

avatar image dpwright Aug 17 '15 at 06:20 AM

Incidentally, I did notice this question which looks similar: https://answers.unrealengine.com/questions/89117/rendering-two-camera-scenes-in-one-framebuffer.html however the linked forum post seems to have been deleted :-(

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question