One Index Buffer Multiple Line Strip

Started by
3 comments, last by Mr_Fox 7 years, 7 months ago

Hey Guys,

How do you guys cut linestip within one index buffer? MSDN says we could do that by adding -1 index to explicit cut line strip, but I have tried it, it doesn't work.

int16_t cubeLineStripIndices[CUBE_LINESTRIP_LENGTH] = {
0, 1, 5, 4, 0, 2, 3, 7, 6, 2, 0xffff, 6, 4, 0xffff, 7, 5, 0xffff, 3, 1
};

Any idea?

Thanks

Advertisement
Try declaring your array as UINT for 16 bit index. Your 0xffff is correct.

Assume you are using direct x 11.

Int16_t is a typedef i believe and might be resolving back to int 32 bit. Just check

Indie game developer - Game WIP

Strafe (Working Title) - Currently in need of another developer and modeler/graphic artist (professional & amateur's artists welcome)

Insane Software Facebook

Try declaring your array as UINT for 16 bit index. Your 0xffff is correct.

Assume you are using direct x 11.

Int16_t is a typedef i believe and might be resolving back to int 32 bit. Just check

Thanks ErnieDingo, but changing to UINT doesn't help, also BTW I am using DirectX 12.

also BTW I am using DirectX 12.

In D3D11, primitive restart was permanently enabled, but in D3D12 it must be configured.
In your D3D12_GRAPHICS_PIPELINE_STATE_DESC struct, there is a IBStripCutValue member -- you need to set this to D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF.

also BTW I am using DirectX 12.

In D3D11, primitive restart was permanently enabled, but in D3D12 it must be configured.
In your D3D12_GRAPHICS_PIPELINE_STATE_DESC struct, there is a IBStripCutValue member -- you need to set this to D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF.

Thanks Hodgman, you solved my problem~ I should really read those documentation carefully

:)

This topic is closed to new replies.

Advertisement