#How do you make light goes through a transparent object

1 messages · Page 1 of 1 (latest)

mortal beacon
pastel dome
#

Are you using refraction on that sphere?

#

actually, looking closer, I can see the pulsing light through the sphere. it's just very faint, because the material is pretty close to opaque

pastel dome
queen torrent
#

it looks like it's already working as expected

dry topaz
#

We may be misunderstanding what you mean by light "going through"

#

To us that would mean not casting shadows from the light source

mortal beacon
#

I just changed material, which using emission, but is there any way to not change material settings?

pastel dome
#

I still don't understand what you actually want

pastel dome
mortal beacon
# pastel dome I still don't understand what you actually want

Look. We have a transparent object. Inside it there is a Point Light, but this Point Light has no effect on the transparent object itself, and the lighting passes through it. I need to make it so that the lighting also affects this transparent object. Maybe I don't understand something about lighting in Unity, and this is how it should be?

pastel dome
#

Oh, I see

#

You want something like a frosted light bulb

#

The problem is that only the front side of the sphere is being rendered, but the light only ever hits the back side of the sphere

#

and Unity does not model light accurately enough to cause the surface to be lit up by light coming through it from behind

#

I'd just use emission in this case.

mortal beacon
pastel dome
#

Yeah. That's a very common way to make light fixtures

#

it's really nice in the HDRP, because you can actually specify how bright the surface is in real light units (instead of a very vague "intensity" value)

#

so you can make frosted bulbs, lamp shades, etc. that emit the right amount of light

mortal beacon
#

I apologize for not saying enough info 😅

pastel dome
#

If you want to be able to control the light's brightness, I'd make a LightFixture component that stores lists of lights and renderers

#

maybe even this:

#
[Serializable]
public class LightSettings {
  public Light light;
  public float intensity;
}

[Serializable]
public class SurfaceSettings {
  public Renderer renderer;
  public Color emission;
}

public class LightFixture : MonoBehaviour {
  public List<LightSettings> lights;
  public List<SurfaceSettings> surfaces;

  public void SetBrightness(float brightness) {
    foreach (var settings in lights) {
      settings.light.intensity = brightness * settings.intensity;
    }
    
    foreach (var settings in surfaces) {
      settings.renderer.material.SetColor("_Emission", brightness * settings.emission);
    }
  }
}
#

(You'd need to figure out the correct property for emission color)

dry topaz
#

It can be changed with custom lighting, but a plain emissive material is way easier

#

HDRP would allow customizing the normal attenuation via diffusion profiles

pastel dome
#

i'd never thought about how translucency works