2
$\begingroup$

So I'm trying to figure out a way to replicate how some games apply lighting to billboard sprites where they stay lit even if light sources are placed behind them. I aim to use similar lighting for animated particle textures in cycles.

Example (Don't Starve):

Left: desired result / Right: what blender does (since light is coming in from behind)

enter image description here

I managed to kind of get what I want by using an empty + object coordinates + spherical gradient as a factor for a diffuse/emission mix shader. However, this feels jury rigged and it only works for one light source. (my actual project uses several). I'd also have to manually tweak the colors if the light source is a different color. Is there a more practical way of doing this? Like something that lets one side of a face inherit the same lighting from the other? I couldn't find anything online about this.

Bad: Point light directly in the center of particle emitter, particles in foreground are dark.

enter image description here

Good: point light + empty directly in the center of particle emitter, particles in foreground are lit.

enter image description here

I tried doing things like using transmission in the principled bsdf with a roughness of 1 but it didn't produce useful results. I also did a bit of experimenting with the light path node but I don't fully know how it works yet.

$\endgroup$
2
  • $\begingroup$ What about simply adding a slight emission on those objects themselves? $\endgroup$ Apr 6, 2022 at 7:14
  • $\begingroup$ If I were to use an emission, I would lose most of the shading from the light and the particles would glow in the dark. I wanna keep the shading, I just want the light to bleed through the particles, as if it were a thin piece of paper, while keeping the particles opaque $\endgroup$
    – spyro
    Apr 6, 2022 at 16:45

2 Answers 2

5
$\begingroup$

I would either

  • combine Translucent BSDF with Principled BSDF (or Diffuse BSDF if you prefer that) through an Add Shader, both set to the same color (maybe the translucency darker if it's too bright)

or

  • just use a Principled BSDF where I set the Emission Color the same as the Base Color and lower the Emission Strength to something like 0.1 or 0.2 for example.

Of course both methods also work if you plug an image texture or a gradient texture etc. into the color inputs instead of a solid color.

translucency

emission

$\endgroup$
3
  • $\begingroup$ Yes, for comparing that's correct. Since I didn't try to replicate his reference exactly, I was just going for the basic task: objects that are lit from behind should not be completely dark on the front side, without placing another light source in front of them. The rest - which result looks better for his needs and how dark or bright the shadowed side should be - is completely up to tweaking and personal taste I think... I just tried to show the path to "enlightenment" :D $\endgroup$ Apr 6, 2022 at 9:04
  • $\begingroup$ Looks like using a translucent bsdf does the job. I seemed to have better results using a mix shader instead, as using an add shader made the particles glow in the dark. Disabling "transmission" in the particle's ray visibility settings also keeps the particles opaque. Thanks for the help. $\endgroup$
    – spyro
    Apr 6, 2022 at 17:29
  • $\begingroup$ @spyro As I suggested in the answer, you don't have to use the same color for the translucency. They are not glowing, just letting light pass through - of course this might look like glowing since the side opposite the light is supposed to be in the shadows... The problem with a Mix Shader is in my opinion, the mix factor sets a percentage of how much the surface consists of one shader and the other. But the Translucent node has no real surface qualities itself apart from letting light through, no roughness, no fresnel, no bump - so you're losing these qualites partly to a certain percentage. $\endgroup$ Apr 6, 2022 at 19:25
4
$\begingroup$

I'm not sure about Light Path ... so just a tips ...

  • in your current setup you can use a light object as coordinator directly
  • you can simplify node tree if you use the "fake" light for both sides
  • you can close "fake" light into a NodeGroup so you can share with other materials easily
  • If you have more lights you can use several node groups closed into one light system so the only one thing you have to is add this node group into each material

enter image description here

enter image description here

enter image description here

enter image description here

$\endgroup$

You must log in to answer this question.

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