[vtkusers] What illumination formula use VTK ? (it does not look as pure Phong)

Jana Sefcikova neollie at gmail.com
Sun Jul 29 20:23:40 EDT 2012


Hi Bill, thanks for your response, but
I am curious to Phong illumination (reflection) model not to Phong shading.
http://en.wikipedia.org/wiki/Phong_reflection_model
Have a nice day

On 29 July 2012 19:10, Bill Lorensen <bill.lorensen at gmail.com> wrote:

> If I recall, by default, uses gouraud shading as implemented in opengl:
> http://en.wikipedia.org/wiki/Gouraud_shading
> For very small polygons (< 1 pixel) I believe that Gouraud shading
> approaches Phong Shading.
>
> I believe you can program any illumination model you want with vtk
> programmable shaders.
>
>
> On Sun, Jul 29, 2012 at 9:44 AM, Jana Sefcikova <neollie at gmail.com> wrote:
>
>> 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.
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120730/8ac51ee5/attachment.htm>


More information about the vtkusers mailing list