# Half Vector Calculation

This topic is 4322 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I've been using the half-vector for blinn/phong lighting like this: H = (L+V) / (|L+V|) But I've read about an optimization using H = (L+V) / 2 Both my L, V vector have the length 1 - but correct me if I'm wrong: that doesn't necessary mean |L+V|=2. For example L = (0 0 1), V = (0 0 -1)? What am I missing or why should this work? thanks

##### Share on other sites
I've always seen the half-angle as normalize(L+V) (in shader language). (L+V)/2 is probably an optimization for when the vectors are more parallel than not (small angle approximation for cosine), but you would get increasingly incorrect results for larger angles. In all honesty it isn't much of an optimization since GPUs are designed for intensive math and vector operations. Your time would be better spent trying to eliminate texture reads.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633702
• Total Posts
3013450
×