• Advertisement
Sign in to follow this  

1 VB Lock trouble...

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

[font="Verdana"][/font][font="Verdana"]I'm sorry. I will not speak English very well.
Please forgive me ^ ^[/font][font="Verdana"];

using Large 1 VB(vertexbuffer), I want many object Loading()...

In Code...

void Render()
{
pVB->Lock( unVertexBufferOffset, unVertexBufferSizeToLock, (void**)&v, D3DLOCK_NOSYSLOCK );
~~~
~~~
~~~
pVB->UnLock();

pVB->Lock( unVertexBufferOffset, unVertexBufferSizeToLock, (void**)&v, D3DLOCK_NOSYSLOCK );
~~~
~~~
~~~
pVB->UnLock();

pVB->Lock( unVertexBufferOffset, unVertexBufferSizeToLock, (void**)&v, D3DLOCK_NOSYSLOCK );
~~~
~~~
~~~
pVB->UnLock();
}


Is that Possible ?

using XFile Almost 2MB...In 1 Render()..

Is that Possible ?
[/font]

Share this post


Link to post
Share on other sites
Advertisement
If your geometry doesn't change at runtime, you should only lock the vertex buffer once after creating it to fill in the vertex data. You can then draw from it as many times as you want, using SetTransform with D3DTS_WORLD if you need to reposition the model.

For procedurally-generated geomtry like particles, you need a dynamic vertex buffer (created with D3DUSAGE_DYNAMIC and D3DPOOL_DEFAULT). Even then you want to lock as few times as possible since locking a vertex buffer can be expensive.

Share this post


Link to post
Share on other sites

If your geometry doesn't change at runtime, you should only lock the vertex buffer once after creating it to fill in the vertex data. You can then draw from it as many times as you want, using SetTransform with D3DTS_WORLD if you need to reposition the model.

For procedurally-generated geomtry like particles, you need a dynamic vertex buffer (created with D3DUSAGE_DYNAMIC and D3DPOOL_DEFAULT). Even then you want to lock as few times as possible since locking a vertex buffer can be expensive.


Thanks your answer..

[font="Verdana"]But I want to know is can written 1 Large VB.

In Code...[/font]

[font="Verdana"]CreateVertexBuffer
Tiny Lock
Dwarf Lock
SimpleTriangle Lock[/font]

[font="Verdana"]That's it...[/font]

[font="Verdana"]But show that only Tiny + Dwarf...
SimpleTriangle isn't show...??[/font]

[font="Verdana"]Changing the order........................[/font]

[font="Verdana"]CreateVertexBuffer
Dwarf Lock
SimpleTriangle Lock
Tiny Lock[/font]

[font="Verdana"]show that Dwarf + SimpleTriange..
Tiny isn't show...??[/font]

[font="Verdana"]shader debugging...
use PIX for Window..
There is no VB...(simpletriangle, Tiny) unwritten...[/font]

[font="Verdana"]I wonder that 1 Large VB is faster than each of mesh(VB) ?
Using each of mesh(VB) is simple.[/font]

[font="Verdana"]This trouble make me crazy.
Please help me ??[/font]


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement