color_correction when looking at a given entity or direction?

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
I've been playing with the color_correction entity a little and I'm trying to experiment with different ways I could use it.

So far it appears that the color_correction entity only works on proximity, meaning the players view is effected based on how close they are to the source entity.

One effect I'd like to try is to apply a given effect only when looking at at given entity, with the effect getting stronger the more directly they look at it. They could be stood directly next to the source entity, but if it was 100% behind them their view would not be effected.

I know the effect is possible with materials using proxies, but for what I have in mind I'd prefer something that effects the players view of the world, not just the brush faces a texture is applied to.

So the question is, might this be possible somehow? And if so, how?
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
An example of a proxy:
Code:
LightmappedGeneric
{
  $basetexture "dev/dev_measuregeneric01b" //dev/dev_measuregeneric01b de_dust/dutile9 de_chateau/interiortile02
  $color  "[1 1 1]"
   
  $view  0.0
  $scale  10.0
   
  Proxies
  {
  PlayerView
  {
  scale  10.0
  resultVar  $view
  }
  Subtract
  {
  srcVar1  $scale
  srcVar2  $view
  resultVar  $view
  }
  Clamp
  {
  min  0.0
  max  1.0
  srcVar1  $view
  resultVar  $view
  }
  Equals
  {
  srcVar1  $view
  resultVar  "$color[0]"
  }
  Equals
  {
  srcVar1  $view
  resultVar  "$color[2]"
  }
  }
}
 

Werewolf

Probably not a real Werewolf
aa
Apr 12, 2011
873
309
I gave it a try and it didn't appear to work.

EDIT: I stand somewhat corrected. The trigger look entity does work, but not for the effect I had in mind. It enables the color_correction entity, but then it still works on distance rather than how directly you look at the source entity.
 
Last edited: