#How do you make light goes through a transparent object
1 messages · Page 1 of 1 (latest)
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
(i was thinking of a different problem, where refraction can cause other transparent objects to not show up at all)
it looks like it's already working as expected
Material settings
We may be misunderstanding what you mean by light "going through"
To us that would mean not casting shadows from the light source
smth like this
I just changed material, which using emission, but is there any way to not change material settings?
I still don't understand what you actually want
emission means that a material emits light on its own
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?
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.
Like in this example?
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
Alright, thank you!
I apologize for not saying enough info 😅
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)
Thank you)
Technically light "passes through" everything that doesn't cast shadows
But the reason the sphere doesn't light up is because light even withput shadows doesn't illuminate faces facing away from it as per typical light normal attenuation
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
oh, that makes a lot of sense
i'd never thought about how translucency works