Jump to content
  • Advertisement
Sign in to follow this  
Paul C Skertich

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

This topic is 2169 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 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!

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. Edited by Hodgman

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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? Edited by Ripiz

Share this post


Link to post
Share on other sites
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. Edited by powly k

Share this post


Link to post
Share on other sites
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. Edited by Ripiz

Share this post


Link to post
Share on other sites
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.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!