Archived

This topic is now archived and is closed to further replies.

Volgut

Z buffer and specular highlighting

Recommended Posts

Volgut    256
Hi! I need to render some objects without using z-buffer (materials of those objects using alpha channel). I was trying to do this by using: PR_ClearViewportOpt( viewport, PR_CLEAR_DEPTHBUFFER ); and PR_DepthBufferMode( PR_DEPTHBUFFER_DISABLE ); It''s works but... If I render other entity with alpha before cleaning depth buffer (I want use depth buffer to render it), then this entity is rendering without using it, too! How to do this? Next question is about specular highlighting. I found in PR help function PR_SetMaterialSpecular, but I don''t know how to use it. First argument of this function is PR_MATERIAL. When I''m loading object from *.pro I can only find number of material (entity->shape->segment_list->face_list->material), but how to find PR_MATERIAL structure? General I want to add specular highlighting to my object. Best regards, Tomasz Przechodzki mailto:volgut@mdg.pl

Share this post


Link to post
Share on other sites
ChrisE    184
PR_RenderAlphaPolys () will flush out any alpha polygons from previously rendered entities. Call it before you turn off the zbuffer.

There is a single material list in PR_Globals.PR_Materials that you can access to change the material properties.

Chris



Author of Power Render (http:/www.powerrender.com)

Share this post


Link to post
Share on other sites
Volgut    256
Thank You for help, but I have still some questions. As You wrote - I used PR_RenderAlphaPolys() but it''s only works with PR_ClearViewportOpt( viewport, PR_CLEAR_DEPTHBUFFER ). Maybe there are other ways to do this (I don''t want to clear depth buffer) like PR_DepthBufferMode( PR_DEPTHBUFFER_DISABLE ) - but it didn''t work.

I have found material in PR_Globals.PR_Material and used it in PR_SetMaterialSpecular but this did no effect. When I''m loading my object in PRO Edit and set Specular in Edit Material box, then everythig is right but only in PRO Edit - when I''m saving object to .pro file and load it in my program then I don''t see any reflection :-( What I''m doing wrong? How can I add specular highlighting to my object?

Best regards,
Tomasz Przechodzki

Share this post


Link to post
Share on other sites