3
$\begingroup$

I understand the absurdity of my question, but I'm curious to know if it is possible to do this (On Cycles, and Eevee)

Basically, the plane captures the shadow, if the material is not emissive. But I would like to make the plane emissive and at the same time capture the shadow,Avoiding the use of any shadow catcher

Plane with material not emissive: enter image description here

Emissive plane (Without shadow obviously) Emissive plane

$\endgroup$
3
+25
$\begingroup$

I can think of a way to do it in Eevee, but not Cycles. In Eevee, you can extract the color generated by a shader using a Shader to RGB node. If you connect this node to a Diffuse shader and a ColorRamp, you can get a shadow mask.

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ I think this is very useful, but it has a problem, as far as I'm concerned, this has a problem which is the change of light, with each added or removed light, or with the change of intensity, the points of the color ramp will have to be adjusted. However I think this answer can be very useful for many users $\endgroup$
    – Noob Cat
    May 7 '20 at 20:06
  • $\begingroup$ Sorry for the late vote, I will put this as the correct answer, although I was undecided, but I think that for the community, it is the best answer (This remains my opinion based on the various tests I did) It seems to me that this solution is the most reasonable of the various answers. $\endgroup$
    – Noob Cat
    May 14 '20 at 1:31
2
$\begingroup$

Use Principle BSDF shader for all material if possible.

enter image description here

I know there is a bunch of parameter which seems terrify. But they all do the perfect effect when you render it in Cycles. If you set the emission low enough you could see the shadow again. And if you want to adjust the strength of light, just add other color management nodes (Anything that you can output 3 value, R G B) to connect with the socket.


Update

If you don't want to enlarge the light difference between emit mesh and other light setting, you can use input: light path::is Camera Ray to filter your emission strength:

enter image description here

$\endgroup$
12
  • $\begingroup$ A color management node? Out of curiosity: How do you get the shadow? I honestly don't get any shadow when setting the emission value to 1 which is usually the case like when using images as planes add-on. $\endgroup$
    – brockmann
    May 5 '20 at 20:51
  • $\begingroup$ @brockmann I add a sun light to the scene if you see carefully. I don't understand why emission node socket use a default color chooser, if the thing is light setting, the value can exceed 1. eg. use a Bright/Contrast when manually set the Bright value and see what will happen in the scene. The material will act like a normal emission setting as an area lamp $\endgroup$
    – HikariTW
    May 5 '20 at 22:21
  • $\begingroup$ Interesting. Do you mind sharing a scene? Also, calling the Brightness/Contrast a Color Management node is slightly misleading, you should edit your answer. $\endgroup$
    – brockmann
    May 6 '20 at 6:56
  • $\begingroup$ You can manually input values higher than 1 in each of the R,G,B fields in the emission field of the principled bsdf shader. If it were a simple value slider, you would'nt be able to get colored emission. @brockmann : blend file $\endgroup$
    – Gorgious
    May 6 '20 at 7:17
  • 1
    $\begingroup$ Thanks @Gorgious. Tested your setup using an area light and it's only working if the power of the light is set to an incredible amount (the reason why the sunlight is working by deault). I think the question is how to get the shadow on the surface like when using a diffuse shader. Can we trick it using the Light Path node? $\endgroup$
    – brockmann
    May 6 '20 at 8:05
0
$\begingroup$

There is a simple way to do this using compositor. But you will need a shadow catcher. First (in cycles) position your camera -> enable shadow catcher in object visibility -> enable the transparent option in the render properties and render it out as an image and save it

Now uncheck the transparency( if you want), disable shadow catcher(Now you may add emission), and then disable render output for your cube and render it out as an image(save the image).

Now go to the compositor and add the nodes as shown in the image enter image description here

Now play with the color ramp sliders to get the desired shadow darkness

$\endgroup$
4
  • $\begingroup$ Consider that the shadow catcher does not preserve indirect light values. $\endgroup$
    – brockmann
    May 6 '20 at 6:24
  • 1
    $\begingroup$ The OP said: Avoiding the use of any shadow catcher $\endgroup$
    – HikariTW
    May 6 '20 at 6:24
  • $\begingroup$ you can get shadows without shadow catcher but once you increase the emission shadow will disappear. I did mention I'll be using the shadow catcher to achieve it. This might help him to achieve what he asked for. $\endgroup$
    – JacksonPro
    May 6 '20 at 6:34
  • $\begingroup$ I thank you for this useful clarification. Unfortunately I wasn't going to work with the compositor, I need to work in real time $\endgroup$
    – Noob Cat
    May 6 '20 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.