10
$\begingroup$

In a Cycles scene I have an equirectangular image serving as an Environment Texture background (set in the World settings).

I have a glossy object being partially lit by the Environment Texture, as well as getting reflections from it.

Is there a way I can exclude the Environment Texture from affecting the glossy object completely? I want the image as background wallpaper only. The glossy object should be affected by other objects and lights within the scene: everything except the Environment Texture.

$\endgroup$
0

3 Answers 3

5
$\begingroup$

You could use Is Glossy Ray and a mix node in your environment material, but it might look weird..

Node setup

$\endgroup$
4
  • $\begingroup$ Cheers ChrisH, this might be an idea I'll have to go with, but I was hoping for an object/material-based solution rather than an Environment Texture-based one. Your idea will affect all glossy objects: I was hoping to apply it to just one, or just selected objects (which had me looking at the compositor for ideas, but nothing's coming to me).That said, I'm sure I can work with it :) $\endgroup$
    – OroNZ
    Commented Sep 20, 2015 at 21:18
  • $\begingroup$ Ok, you could do it with an material index and working with the passes in the comp. (It's 1am here, so this might not be the best solution [but it's came to mind] or description ..). So by using a compositing node setup similar to this: link you could accomplish it on a single material-basis (I don't think it's possible in the material). The nodes in the blue box is based on the "default combining" link, and you might not need all of it (dep. on the material and scene). $\endgroup$
    – ChrisH
    Commented Sep 21, 2015 at 23:05
  • $\begingroup$ The nodes in the purple box is the ones affecting the reflection/glossy, the middle mix node just replaces it with blue, so that's the node you want to edit to change the the. (The greater than-node just singles out the environment [which is black in that pass]). The nodes in the green box combines the separated parts with the original image based on material index. You can download the .blend here: drive.google.com/file/d/0B88eAnH_kxSrejM5NEF6YW5mY28/view I hope that's sort of clear (It's not that complicated, just a bit messy..) $\endgroup$
    – ChrisH
    Commented Sep 21, 2015 at 23:13
  • $\begingroup$ Holy crap... I have a bag of cables and phone covers that looks exactly like this node setup... :) Thanks Chris: Material Index! I think that's the key! Yay! $\endgroup$
    – OroNZ
    Commented Sep 22, 2015 at 4:09
2
$\begingroup$

@Oroboros, I asked the same question and I think I've just found a way to achieve a perfect result without having to use the compositor or doing any kind of node setup. It's a little trick with two additional layers and an additional mesh.

  1. Put the object that you don't want to be affected by the Environment Texture onto a new Layer.
  2. On yet another new Layer, create a Sphere which is big enough to enclose your object and your whole lighting setup. (In other words, you put your whole scene inside a big mesh.)
  3. Add a Holdout material to the Sphere.
  4. Under Render Layers, exclude the Layer of the Sphere for all Layers except the one that holds your object that you want to hide from the World.

This way the Sphere will block all the rays coming from the World to your object, but since every other layers are excluded, it won't affect any other parts of your model.

  1. Finally, select the Sphere, and under Object > Cycles Settings, turn off Camera, so it won't be visible on your rendering.

I hope this helped.

Edit: In case you'd like only the world's texture not to show on your object and miss its lightness that gets blocked by the sphere, you can create a slightly smaller sphere inside your original one, give it an emission shader so it can nicely illuminate your object with the amount of light that it would receive from the World normally. Make it smooth, don't forget to hide it from the camera, and one more thing: recalculate its normals inside.

$\endgroup$
1
  • $\begingroup$ Hmm... I've always wondered what the Holdout node was for. Thanks @tom, I'll give it a try soon (moving house this week, kinda busy :) $\endgroup$
    – OroNZ
    Commented Oct 26, 2015 at 21:04
0
$\begingroup$

This is a little late, but the answer to this question fixed the problem beautifully. Simply turn off the World's Ray Visibility to everything except the camera!

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .