Hi,
I'm redoing my specular highlight implementation in my shaders, and with this I have a few short questions. Also after refreshing my knowledge reading some articles. This is my calculation in pseudo:
** viewdir = normalize(camerapos - vtx wpos)
** half vector = normalize(viewdir + -lightdir
** specular term = pow(saturate(dot(half, normal)), power) * lightcolor/intensity
My specular material properties I retrieve like this (from 3ds max):
- specular level RGB, i.e. 1.0 / 1.0 / 1.0 is full bright white
- specular power is glossiness from max (50 in max = 50, 100 in max = 100 power)
My questions:
- would you agree that I could use either lightcolor/intensity or specular material level (/color)? Where the 1st makes the specular highlights in the color of the light, and the 2nd makes them the color of the specular properties of the material?
- in the past I had 2 different approaches to getting the lightdir for the half vector equation:
1. lightdir = -lightdir (most logical)
2. lightdir = normalize(-lightdir - vtx wpos)
Both work, bot from all theory I know the 1st one seems most realistic/best. What would you say?
- is it correct that a specular highlight on for example a glass material, gets bigger the further the camera is away?
Here's an example from further and nearer to a glass material: