Headlight glass shader - help!

Hi guys! I'm having a bit of an issue with the headlight glass of my Challenger. As you can see from the screenie with the lights turned off, the glass reflects a bit of the track, such as it should in reality! The problem is that, when I turn on the lights, that reflection should disapear, but it doesn't! I'm tired of tweaking the shader and the alpha quantity on the .tga, but I can't get it right!

Is there any trick to make the reflection disappear when i turn the lights on?

screenshot038.jpg screenshot039.jpg

I'm using this shader:

vf_transparent
{
vertex_shader
{
file=dyn_standard_reflect_window_v.cg
}
fragment_shader
{
file=dyn_standard_reflect_window_f.cg
}
}
shader_glass_light~vf_transparent
{
cast_shadow=0
compression=0
reflect=0.2
sort_offset=1
layer0
{
map=glass_light.tga
blendfunc=blend
}
layer1
{
map=$trackenvmap
alpha_to_coverage=1
}
}

Thanks in advance! :cool:
 
Use my audi s4´s glass shader.

Inside car shader, you have glass.tga section glass_shader. try it at challenger.

I use 2 different tex for headlight glasses and windows. Headlights must be more clear and transparent, besides windowns one.
 
I'm also using two separate shaders!

I can't seem to understand one thing in your Audi shader. At the headlight glass material, you make reference to "shader_glass~vf_reflect_window" and vf_reflect_window doesn't exist in the car.shd! So it makes the head/tailight glass shader to be broken (it appears gloss grey, with no alpha).

I'm using v0810, so I don't know if it's something to do with that...
 
The best way to do this is to have the lamp as a reflect material, then just put the glass shader on the glass cover of the lamp itself.

Then have a standard material using a blendfund=blend (use alpha to fall off the glow) and emission value on a plane that sits proud of the lens/reflector.

That should be it.

The reflection on the glass is always there, as is the one on the reflector. Within a HDR environment, you use a big emission value to blow out the reflection intensity, so all you tend to see is the emission from the reflector/bulb.

Experimentation will be key. Check my Lambo update to see how I did it on that, same kinda principle... should be easy with just default shaders!

Thanks

Dave
 
+1 Dave, one way of doing it !

Somehow I get a similar issue on my updated car, where from my incar view (it's just the same model as for the exterior for now), I can't see my car lights, because of the windshield shader & params I've set. Got 2 aligned surfaces pointing (Normals) outwards & inwards with reflection on...
 

Latest News

Online or Offline racing?

  • 100% online racing

    Votes: 86 7.4%
  • 75% online 25% offline

    Votes: 123 10.6%
  • 50% online 50% offline

    Votes: 170 14.7%
  • 25% online 75% offline

    Votes: 321 27.7%
  • 100% offline racing

    Votes: 455 39.3%
  • Something else, explain in comment

    Votes: 4 0.3%
Back
Top