Skip to main content
GameDev.net gamedev.net
🔒 Locked

Strange Problem using D3DFILL_WIREFRAME

Started by sdoherty55 Jan 5, 2002 at 5:45 PM 1 replies 550+ views
Original Post
sdoherty55
sdoherty55
I seem to be experiencing a problem when I set more than 2 mesh to to wire frame:
  
if FAILED( pd3dDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_WIREFRAME) ){
			return E_FAIL;
		}
  
The problem is that all of my meshes render without a problem until I select 3 or more meshes with the mouse. However, once three or more meshes are wire frame the rendering is totally screwed until I unselect one of the meshes. The program is coded to change of selected objects to wire frame if the cursor was over top. My code is drawing various object using different methods. However, when I try turning off some of the unselectatble objects suck as the backgound the problem still exists but seems to require four or more meshes to be selected before it occurs. I can''t seem to replicate the problem in REF mode, but it is difficult since the background seems to disapear (Probably a bug). Anyone have any idea at all? Is there a hardware limit with the pipeline? Thanks
S1CA
S1CA
Support for lines in hardware is generally very flaky - many drivers are bugged in this respect - hardware manufacturers have largely concentrated on polygons over the years, I''m not even sure if any of them test lines extensively.

Wireframe fillmode is even more flaky than just plain lines (this is a hardware/driver thing, NOT an API thing).
It tends to be considered purely as a "debugging" feature, never used for commercial titles.

Since you can''t guarantee line texturing, line thickness control etc if you need to display a wireframe object in a released product, it tends to be better to draw each line as a textured quad. This is even how some hardware actually draws lines in the first place (i.e. their chips only draw polygons - everything else is emulated). Another knockon advantage is you can get very stylised texturing for your lines in your wireframe this way (e.g. shaky pencil lines).

Some hardware/drivers don''t like it if you toggle the wireframe state more than 2 times in a frame, any more and it goes wrong. Try batching all of the objects into one of two groups so that you only toggle twice.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
sdoherty55
sdoherty55
S1CA,

Thanks, I was more or less using them for debug. I just started to bother me because I thought I had a bug in my code. Clearly, it is best to stay away from D3DFILL_WIREFRAME mode.

Thanks for your help.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.