Announcement

Collapse
No announcement yet.

Can I replace background image?

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

  • Can I replace background image?

    We could not find 'background replacement function' on AppSDK training program.

    Basically, when we render some object,
    the upper side is white and lower side is black.

    Is it possible to replace background image using API?
    - Especially, We need gradation or transparent background.

    Is it possible to generate example's rendering environment using API?
    Attached Files
    Last edited by robin87; 06-07-2017, 10:39 PM.

  • #2
    You can set environment textures through the SettingsEnvironment plugin. Check the comments in examples/cpp/settings/05-environment. The example only uses flat colors, but you can use images of course. The environment in V-Ray terms is the sphere that surrounds your scene in all directions. So usually spherical or cubic environment maps are used. If you want to use a flat 2d image as a background, you should use the "screen" mapping type for UVWGenEnvironment. This should be used only for the bg_tex slot and not for GI or reflections as it will not cover the scene from other directions.

    p.s. The image on the right uses a ground plane that catches the shadows - this is what the camera sees directly and not the environment. The image on the left has no ground plane, so you see the color of the dome light above and black below it as there is no ground object or environment color.
    Last edited by npg; 07-07-2017, 05:16 AM.
    Nikola Goranov
    Chaos Developer

    Comment


    • #3
      How to make a infinite ground plane?
      Should I generate rectangle mesh and brdf material?

      I want to know c++ code that generates exactly same scene.
      - lighting, ground, and rendering options

      Comment


      • #4
        You can use the GeomPlane plugin instead of GeomStaticMesh for the plane. GeomPlane has no parameters. You just set it as the 'geometry' input for a Node.

        I really recommend looking at the vrscene file of the scene in question for more details. Notice that there are many settings plugins in every vrscene file with many properties, but they are often the default values. V-Ray just always writes them. So it's best to compare to your scene (exported to vrscene file as well) and only add code that sets parameters that have non-default values. The C++ code for creating plugins and setting parameter values is similar for everything. Only the names of the plugin classes and the names of the parameters are different.
        Nikola Goranov
        Chaos Developer

        Comment

        Working...
        X