Sign in to follow this  
AquaMacker

1 VB Lock trouble...

Recommended Posts

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

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

In Code...
[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();
}
[/code]

Is that Possible ?

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

Is that Possible ?
[/size][/font]

Share this post


Link to post
Share on other sites
kdmiller3    178
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
AquaMacker    255
[quote name='kdmiller3' timestamp='1307035901' post='4818756']
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.
[/quote]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this