Jump to content
  • Advertisement

Archived

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

md2ge

TnL and Vertex Buffers.

This topic is 6695 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Can''t access it ? does it mean that U can''t transform it by calling ProcessVerex (or something like that) ?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!