[vtkusers] What illumination formula use VTK ? (it does not look as pure Phong)
Jana Sefcikova
neollie at gmail.com
Sun Jul 29 09:44:40 EDT 2012
Hi, I made small algorithm when I am manually computing phong illumination.
What illumination formula is used in VTK ? It looks that is not phong
illumination.
I would need obtain same color as VTK made is.
---------------------------
I made small test :
My 'phong' illumination formula is :
I = kd * abs((n*l)) + ks * abs(h*n) ;
where diffuse term kd = 0.6 and specular term ks = 0.4,
view vector is default v = (0,0,1), light vector l is also located at
(0,0,1),
n is normal at the point, and h is standard halfway vector.
For comparison with VTK I used same settings for drawing purely with vtk
setting property :
actor->GetPorperty()->SetAmbient(0);
actor->GetProperty()->SetDiffuse(kd);
actor->GetProperty()->SetSpecular(ks)
The results are different, see attached picture.
Therefore it looks that VTK is not using pure phong. So what illumination
formula is used in VTK ?
It is done via shaders ? Or it is somewhere computed ?
Where is made color computation in vtk, where those ambient, diffuse,
specular coefficient are used ?
I found method GetColor() in vtkProperty() , but it has different meaning,
but i am searching for s.t. like this.
Any hint would be highly appreciate.
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120729/a107d600/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Zajacci.jpg
Type: image/jpeg
Size: 89823 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120729/a107d600/attachment.jpg>
More information about the vtkusers
mailing list