TnL and Vertex Buffers.

Started by
2 comments, last by md2ge 23 years, 12 months ago
Hi =) The only place in the Direct3D help file I noticed mention of the TnL HAL is during initializing, so I''m assuming that once you''ve found an TnL HAL device and intitiated Direct3D using it, all the rest of Direct3D API is used as normal, only that it will be TnL accelerated? For example I dont need to call something like DrawIndexPrimitiveTNL(...) or some other thing. Also I''m wondering about the best way to use Vertex Buffers with a TnL card. I read someplace that ProcessVertices is always done in software, so using it with a TnL card is pointless. But then access to already transformed vertices could be very usefull, for frustrum checks, collision checks, etc. So I thought a combination of both would be the best, have a vertex buffer with (for example) a bounding box of some object and have another vertex buffer with the actual object''s vertices, run ProcessVertices on the bounding box and check of frustrum visibility, if viewable then send the actual object''s vertex buffer for rendering, this way I do minimal ProcessVertices and use hardware acceleration when needed. Am I in the right track here? One last question, what is the concept behind Optimize() function, does Direct3D assume no more operations will be done in the VB and arranges the data in a way better suited for rendering? Thanks, Rick
Advertisement
You have already stated the right answers so I will only confirm them.

First question:

There are no special calls needed to utilize TnL after you have found the TnL HAL device. But as you also said some calls is only performed in software, e.g. ProcessVertices, usually because they need access to the vertices after transformation.

Second question:

You are on the right track.

Third question:

Again you are right. After Optimize you can no longer access the data in the VB, as such the D3D Driver can arrange the data as best suits the hardware.

A pair of articles that you can read on the subject:

DirectX FAQ - Most notably on Direct3D and Vertex Buffers
Optimizing Direct3D for the GeForce 256 - this one is good even for other TnL hardware



WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Can''t access it ? does it mean that U can''t transform it by calling ProcessVerex (or something like that) ?
No after optimization, you can still use ProcessVertices() on it _if_ the buffer has been created in systemmemory. You can also make the usual DrawPrimitiveVB() and DrawIndexedPrimitiveVB. What you can''t do is Lock() the buffer to read or change its content.

WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement