Announcement

Collapse
No announcement yet.

CG Integration w/ HDRI and Backplate Process

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CG Integration w/ HDRI and Backplate Process

    This was brought up in the Free Topics section, but I thought it may be more useful here. This is a quick breakdown of how I integrate CG objects onto backplate lit by a HDRI in Vray Domelight. I in no way claim that this is the best or correct way, however i seems the simplest to get results commensurate with other render engines. This is not a Perspective Match tutorial, there are plenty of help docs for that. For this example, I downloaded the free scene from HDR-Sets.com, so if you want to follow along you can download it for free. The download will come with everything you need, including pre-aligned cameras with matching backplates. That is why I am using their assets for this.

    Step 1: Open 3ds Max, make sure Vray is your render engine, and create a V-Ray Domelight. Open the material editor, and load a VrayHDRI map. Load the HDR map you have, or if you have the free one, it is called "env_domelight.exr". Instance that map into the Vray Domelight texture slot, and make sure the domelight is "Invisible". You may also wish to tick it to Full Dome, but since this is used for lighting only, it is up to you.


    Step 2: If you downloaded the free set to follow along, import the .fbx file with default settings. This will import all of the cameras that are already aligned with their corresponding backplates. For this example I am using Camera 17. If you have your own HDRI and Backplates, you will need to align a camera to the backplate using the Perspective Match tool.

    Step 3: Press [8] on your keyboard, and load the 3ds Max environment dialog. Copy the HDRI map into the background slot. Also, turn on Vray exposure control, and set it to an EV of -3. This will depend on the HDRI map you are using.

    Click image for larger version

Name:	Capture2 copy.jpg
Views:	1
Size:	533.0 KB
ID:	885090

    Step 4: Load Camera 17 into 2 viewports, and locate them on top of each other. In the top viewport, press [Alt+B] to bring up the Viewport Config. In the Background tab, change the background for the top viewport to “By File” and locate the corresponding backplate. Close the Viewport Config, and make the lower viewport active. Press [Alt+B] again, and this time, set the viewport background to “By Environment”. This way you will be looking at the HDRI map on the bottom, and the backplate on the top. If the resolution of the environment on the screen is too low, go to the Display Performance tab of the Viewport Config, and set the resolution of the Viewport Background/Environment to something high enough that you can see the HDRI clearly.


    Step 5: Load the material editor, and select the HDRI map. Now, watching the two viewports, rotate the HDRI map until it is aligned with the top viewport. You may have to mirror the HDRI horizontally. Once they are aligned, you can disable the background from both viewports if you wish. Now, press [8] again, and switch the environment background from the HDRI to the Backplate, and make sure the backplate is set to environment mapping in Screen Mode. In later versions of 3ds Max, it sometimes switches on you when you apply the backplate to certain slots, so after you move it into the Environment slot, double check it is set to Screen, not Spherical.

    Click image for larger version

Name:	Capture5 copy.jpg
Views:	1
Size:	531.2 KB
ID:	885091

    Step 6: At this point, you can position your CG objects how you please. In this case, I am using some simple shapes with different materials, for illustration purposes. The cylinder has a chrome shader applied, to illustrate some pitfalls of merging CG object into a backplate, but more on that later.

    Step 7: Now, create a plane on the ground to capture the shadows of your CG objects, making sure it is large enough to not clip the shadows. Open the material editor, and create a material that represents how reflective your ground plane should be. This is how Vray handles reflectivity for the ground, not in the MtlWrapper. Then, put that into the base material slot of a VRayMtlWrapper Material. In the MtlWrapper dialog, set it to be a matte surface and also matte for reflection/refraction. Put the alpha contribution at -1, and enable shadows and affect alpha. Next, set the GI contribution to reflect the approximate Albedo of the ground in your backplate. This will affect how much GI shows up in the shadows and any illumination of your matte surface. The default is 1, and if you render it with that setting, you may notice a tone of GI spill on the surface, because that would represent a pure white plane, which is obviously much more reflective for GI rays than most surfaces.

    Click image for larger version

Name:	Capture6 copy copy.jpg
Views:	1
Size:	520.8 KB
ID:	885092

    Step 8: Open the Render Settings dialog, and in the Common tab, set the resolution to be that of your backplate. In this case, that is 1080x720, with a ratio of 1.5:1. I will not go into any additional render settings, as the defaults will work, except that we need to set some additional things up in the Environment Tab of the Vray settings.

    Step 9: Load the Environment section of the Vray settings, and enable the GI Environment override. Set the color to pure black, and make sure there are no maps in that slot. This is to ensure that the backplate does not contribute additional GI to the matte plane you made, causing it to show up in the render. There are several forum threads here about this topic should you wish to know more.

    Step 10: At this point, you could hit render, and the results would be as the first render image. Note, in this first image, I have not changed the GI contribution of the matte plane, which is why you see so much reflection spill around the cylinder. You may also notice that another thing that seems strange. If, like this example, you have a flat plane, or cylinder that has a mirrored surface, you may notice that you appear to be able to see through the object in the reflections. This is due to Vray trying to reflect an environment that is not actually there, if you recall, your backplate is set to screen mode. So, the secondary reflection rays are simply returning the environment, which is just your image. You will probably also be able to see where your matte plane is returning the proper reflections, and then it will be cut off, because, again, the image that the material is reflecting cannot travel off the screen. In order to get around these limitations, in a perfect world, you would have a HDRI that is taken at the exact spot as your backplate, so that when you align them, where the backplate reflection in the matte object ends, your HDRI would pick up. However, this is not always the case, and sometimes you have obvious edges. Depending on your CG element, this may not be a problem, but I wanted to try and explain why you might see this. It is not wrong, just Vray returning the information it has.

    Click image for larger version

Name:	render 1 copy.jpg
Views:	1
Size:	93.5 KB
ID:	885094

    Step 11: To correct this, or at least provide a more accurate reflection/refraction, under the Environment section of the Vray Settings, below GI Environment there is a Reflection/Refraction override. If you copy your HDRI map into this slot from the material editor, you will then have the final render as shown. I have also attached the Alpha channel so you can see that you will be able to use this technique for compositing purposes in a more traditional workflow.

    Click image for larger version

Name:	render 2 copy.jpg
Views:	1
Size:	139.8 KB
ID:	885093

    That’s it. Again, I am in no way saying this is perfect, and in fact, somebody may chime in with a better way, but for me this works, and at least helps some to understand what things are. It also does not rely on ray-switchers or any other complex workaround, nor does it contain the camera-map-per-pixel map that many dread. It will also return the exact result that you would get if you followed the Corona tutorials for shadow catchers.

    Thank you

  • #2
    Might not be perfect but you still took the time and effort to think about your process and write it down. The people who it isn't perfect for are probably smart enough to solve their problems but for everyone else this'll likely be a really useful run through!

    Comment


    • #3
      Yeah I figured it was not the one and only solution, nor does it factor in anything intricate. This is just a basic way to set it up and get comparable results to Corona or MR, unless there was something glaring I did not account for?

      The funny thing is, I don't ever have a real use for this type of thing. I do archviz work almost exclusively, as I am an architect by trade that dabbles in rendering, so to the guys that do this day in day out, this will probably seem like a long winded example of how to do the most simple thing. But this is my first time posting so hopefully I will be forgiven...

      Comment


      • #4
        Nope,

        this still does not work correctly.

        There is a big issue that a part of surface of matte object (ground plane in this case) which is out of camera frustum will pass reflection rays and GI rays straight to the environment, ignoring the dome light. As a result, those rays will sample environment HDRI map without MIS, and therefore, if there is a strong highlight on HDRI map in that particular direction, will cause excessive noise and wrong HDRI illumination intensity.

        Comment

        Working...
        X