Jump to content
  • Advertisement

Archived

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

kaostika

VB->IB->Render method?

This topic is 5905 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

I have a bit of code that puts my mesh format into a vertex buffer and then the face of the mesh into an index buffer. I am stuck on how to get the little (animated) bugger to render though. right now i am updating the VB and IB each frame, and then rendering(in theory). What is the right way to do this (or at least a way that works)?

Share this post


Link to post
Share on other sites
Advertisement
DrawIndexedPrimitive ??

Sorry, I don''t fully understand what you''re asking, and what you''re having difficulty with. Are you looking for code? A way to organise your data? A way to render a complicated mesh that uses several different materials? What do you want?

John B

Share this post


Link to post
Share on other sites
Sorry. I am using DrawIndexedPrimitive to render, but am not getting any visible results. pseudo code below:

count meshes
for each mesh
count submeshes
for each submesh
check vertex data
lock vertex buffer
update buffer with new mesh data
unlock buffer

check face data
lock index buffer
update buffer with face data
unlock buffer

set stream source, stream data, vertex shader etc.
DrawIndexedPrimitive
end
end

I think that my logic is flawed but I''m not sure how. Is this the proper method to update and render vertex and index buffers? Is there a better way (that actually works)?

Share this post


Link to post
Share on other sites
Have you tried setting D3DRS_CULLMODE to D3DCULL_NONE, to turn face culling off? Are you setting any world matricies? If not, try setting that matrix to an Identity matrix. Try changing the clear color to something odd (magenta is good) to see if its just being rendered black. Turn on the Debug runtimes, and see what pops up in the Output Window, if anything...

Z.

Share this post


Link to post
Share on other sites
I set the clear color to every color I could think of, so I am sure it isn''t being rendered black. CULLMODE_NONE slowed the frame rate to 5 fps (from 40 fps), I also tried CULLMODE_CW and CCW, both of which returned my frame rate. I am having a devil of a time with it''s matrices, so I''ll try to fiddle with these. Is it a possibility that it actually is being rendered, just in some area of my world that I don''t have access to (i.e. outside my map)? I think it could be. I will try increasing the zbuffer, as well as turning it completely off (I love how that looks), and then rendering in wireframe mode to see if the little bugger is under my map. Grr... this is too much fun.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!