2

I've been looking for this question and answer but have only come across a similar one in regards to shadow, I was unable to find an answer.

I'm creating assets for a project and am using IES lighting for certain light models (These are built into the models as flat planes, if you can imagine transparent textures around the edges of the model with "Bloom" effects)

I use a generator to create different styles of IES and can import them into Blender as lights, but the problem is capturing the lighting itself with a completely transparent background, so the image can be used as an "Overlay" on textures, such as Brick, Stucco, Wood etc.

I was thinking I could have the light casting the effect on a wall, somehow change the wall and background to be transparent and be exportable with an transparent/alpha layer.

Any ideas on how to do this?

enter image description here

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133
EHM
  • 81
  • 4

1 Answers1

1

Yes, you can do this with a holdout shader on the diffuse plane:

enter image description here

Note that the world background must be completely black/zero strength so that there are no other sources of light in the scene, and Transparent should be enabled in Render settings > Film.

gandalf3
  • 157,169
  • 58
  • 601
  • 1,133
  • Thank you, I've set the nodes and background colour, it seems almost everything is working. The light cast is indeed on a transparent background now, but I have what I believe is the final problem. Is there a way to export the image to image editing programs with the alpha intact without screenshot copy and pasting? – – EHM Jun 23 '15 at 11:04
  • @EHM Yes, by rendering the image (F12). Note that you'll have to position the camera in order to render from the point of view you want. Ctrl Alt Numpad 0 will snap the camera to the current viewpoint. For this particular case you might want to use an orthographic camera. – gandalf3 Jun 23 '15 at 17:37
  • Can't seem to get the light to appear inside the render, it just displays blank alpha. – EHM Jun 23 '15 at 18:54
  • @EHM Are you sure your camera is positioned correctly? – gandalf3 Jun 24 '15 at 02:19
  • Yeah, it's all inside the rectangle camera bounds, and is set at orthographic view (The image is top down flat as I'd want). – EHM Jun 24 '15 at 08:29
  • Here is the scene setup and the render settings, the background is 0 0 0 RGB/Total black. http://i.imgur.com/7kr46P2.png – EHM Jun 24 '15 at 15:27
  • @EHM Oh I see.. That's very strange, I've reported it as a bug here. In the meantime you can probably do something like this in the compositor (with transparent film disabled) – gandalf3 Jun 24 '15 at 20:08
  • THANK YOU. That suggestion about using the compositor completely solved the problem, works exactly as I had wished. Sorry about the late reply, I had pushed this problem down my priority list a little to work on other things in the meantime and only just got back to it. – EHM Aug 19 '15 at 11:48