D3D & TnL

Started by
4 comments, last by jLeslie 23 years, 10 months ago
If I''m porting my applications from DirectX6 to 7 and I want to take advantage of TnL do I just need to create the device using IID_IDirect3DTnLHalDevice? No other code changes need to be made? I can''t find much in the SDK about it.
Advertisement
For one, I heard that you aren''t supposed to use vertex buffers. For two, pass as a D3DVERTEX to let it do T&L. D3DLVERTEX to let dx do Lighting and D3DTLVERTEX for no transforms or lighting. I think that''s it.

------------------------
Captured Reality.
Hmm, well it looks like thats how you do it Anyone have any tips on when you should use it? Because right now it looks like my programs run faster if I let the CPU handle it. (That is if I''m using it right)
While I''m at it...Does anyone know how I can find out a good number of polygons to send to a graphics card at one time? I know calling DrawPrimitive for every single triangle isn''t a good idea :p, but I''m wondering if theres a max limit on the number of polys sent you should try not to pass, depending on the hardware of the computer you''re running on.
Ah the wonders of doing TnL.

Right lets start from the top.

Yes - you do need to create an IID_IDirect3DTnLHalDevice. It''s
the only way you will get the card to enable the TnL part.

DO - I repeat - DO - try to use vertex buffers. They are neater
and faster than sending just raw data through D3D. Let the driver
decide where to put them in memory - it knows best.

I''d be very surprised if letting the CPU handle all the TnL is
faster than passing stuff to the TnL device.

As to the part about sending stuff through DP - aim for somewhere
above 32 tri''s at once - else the overhead isn''t worth it. I can
not remember off the top of my head what the ''ideal'' number is though.

I think I might have to write a small tutorial on using TnL hardware and vertex buffers at some point - good idea maybe ?
MrF.--Code..reboot..code..reboot..sigh!
Guess I learn vertex buffers tomorrow.

This topic is closed to new replies.

Advertisement