If there's more indices loaded - does the shader need to have more bytes?

Started by
19 comments, last by Paul C Skertich 11 years, 8 months ago
I noticed, I can import my custom mesh of a box, or a cross and zero problems. However, if I import a custom mesh using more than 2000 indices or around the 1000 range. The mesh won't show up. Currently, the shader's bytewidth is set at 178. Would I have to adjust this?

Thanks for awesome input!
Game Engine's WIP Videos - http://www.youtube.com/sicgames88
SIC Games @ GitHub - https://github.com/SICGames?tab=repositories
Simple D2D1 Font Wrapper for D3D11 - https://github.com/SICGames/D2DFontX
Advertisement
Currently, the shader's bytewidth is set at 178. Would I have to adjust this?
Can you clarify what you mean here. What is the bytewidth of a shader?
Do you mean the size of your vertex/index buffers?
Sure, the Constant Buffer that has the input element layout for the shader. In the Buffer Description for the Constant Buffer. The ByteWidth is set 178. I looked up on MSDN and it shows that in the Buffer Description that a ByteWidth represents width of bytes returned.
Game Engine's WIP Videos - http://www.youtube.com/sicgames88
SIC Games @ GitHub - https://github.com/SICGames?tab=repositories
Simple D2D1 Font Wrapper for D3D11 - https://github.com/SICGames/D2DFontX
the Constant Buffer that has the input element layout for the shader
Input layouts are stored in input layout objects, not in constant buffers! An input layout is valid for any number of primitives (if it works for 100 verts, it will also work for 1000 verts).
What are you putting in this constant buffer, and where does the magic number of 178 come from?
in the Buffer Description that a ByteWidth represents width of bytes returned
It's the size of the buffer in bytes. For a constant buffer, this should be the size of the cbuffer structure defined in the HLSL code. For an index or vertex buffer, it's based on the maximum amount of vertices/indices you want to be able to put in the buffer times the size of a vertex/index.
So, the question would still remain that if I can load a simple cube or a simple box....then I should've have a issue importing a heart model than - correct? I created a model valentines heart in Zbrush4 then in Max I converted into OBJ - Triangles. Converted into my custom format with the conversion application...finally, it doesn't show up but a blue screen which just indictates that DX is initialized. The cross and the Cube were made in 3D Studio max and converted and they work.

So, regarless the mesh should load property right?
Game Engine's WIP Videos - http://www.youtube.com/sicgames88
SIC Games @ GitHub - https://github.com/SICGames?tab=repositories
Simple D2D1 Font Wrapper for D3D11 - https://github.com/SICGames/D2DFontX
It depends on your code whether it is able to load or not. DirectX has no problems with that as long as you tell it what to load and what it is.

Edit:
Maybe you'd like to show how you load that heart model?
Yes, this sounds more like a problem with your obj-loading code. The bytewidth you should be changing is the one of your vertex and index buffers, not your constant buffer.
Made a quick video of what's going on. I show in this video comparison of the demo cross loaded fully and just a simple cone import which failed. I

Game Engine's WIP Videos - http://www.youtube.com/sicgames88
SIC Games @ GitHub - https://github.com/SICGames?tab=repositories
Simple D2D1 Font Wrapper for D3D11 - https://github.com/SICGames/D2DFontX
The part of code you showed is fine.

But we need to see how you load your .sgm files, or more specifically, code that creates vertex and index buffers for the model.
So, I get a minus rep point because I showed what the world I was talking about? Dat's messed up. As you can see in the freaking video the GD Cross loads. Nothing wrong with the Custom Mesh importer. It just doesn't like Hearts and cones. FIne, I'll look over the code AGAIN and see what I can come up with. Wow, showing a video - minus rep point! F'ing gay! Ripits said how about show what's happening. So, I did.
Game Engine's WIP Videos - http://www.youtube.com/sicgames88
SIC Games @ GitHub - https://github.com/SICGames?tab=repositories
Simple D2D1 Font Wrapper for D3D11 - https://github.com/SICGames/D2DFontX

This topic is closed to new replies.

Advertisement