Jump to content

  • Log In with Google      Sign In   
  • Create Account


AnthonyB

Member Since 16 May 2009
Offline Last Active Jun 19 2012 04:41 PM
-----

Posts I've Made

In Topic: vector reallocation

24 March 2012 - 07:31 PM

That makes sense. I was blindly ignoring the fact that some classes may not have move constructors. Thanks.

In Topic: [C++, DX9] Combining Vertex and Index buffers

20 July 2010 - 07:35 PM

Quote:
Original post by Dom_152
Quote:
Original post by AnthonyB
Quote:
Original post by Dom_152
Quote:
Original post by AnthonyB
Quote:
Original post by Dom_152
// Which texture will this tile use?
float TextureID;

How would you go about utilizing this value in the shaders? If I understand the way Direct3D works, this would also limit you to 8 (?) textures per draw call, wouldn't it?


You bind it using the TEXCOORDn semantic where n matches the usage index you designated for it in your vertex declaration.

In that case, wouldn't the value(s) need to be a series of texture coordinates and not just IDs?

Quote:
I think the 8 texture limit only exists if you use Direct3D's built in texture stages. You could have an array of Texture2D variables to have more than 8 textures in your pixel shader should your GPU be able to handle it (I believe the upper limit of samplers is 16 in SM 3.0).

I didn't remember that the shaders have their own limit on samplers. Shader model 2.0 has a limit of 8 still, but you were right, 3.0/4.0 is 16. Still, this is fairly limiting if you want to use this method in a 2D-only environment with lots of random elements. (Which is why I was asking.)

Oh, and sorry if it seems like I'm somewhat derailing the thread.


The TEXCOORD semantic is generally used for arbitrary data as well as actual texture coordinates. You would have a normal set of texture coordinates for the vertex and the ID would simply be used as an index to select which texture to sample from.

Is there any special reason for using TEXCOORDs for this data? I can't remember off of the top of my head if there are any alternatives.

Quote:
If you needed to have a very large number of textures the best way would be to use a texture atlas where you have all of the texture you would want for the tiles all in a single texture.

Isn't there a performance cost for using a very large texture? If so, I have no idea how it would compare to the cost of switching textures and calling Draw*Primitive more often.

I appreciate the responses, and again, I apologize to the original poster if this is distracting.

In Topic: [C++, DX9] Combining Vertex and Index buffers

20 July 2010 - 05:25 AM

Quote:
Original post by Dom_152
Quote:
Original post by AnthonyB
Quote:
Original post by Dom_152
// Which texture will this tile use?
float TextureID;

How would you go about utilizing this value in the shaders? If I understand the way Direct3D works, this would also limit you to 8 (?) textures per draw call, wouldn't it?


You bind it using the TEXCOORDn semantic where n matches the usage index you designated for it in your vertex declaration.

In that case, wouldn't the value(s) need to be a series of texture coordinates and not just IDs?

Quote:
I think the 8 texture limit only exists if you use Direct3D's built in texture stages. You could have an array of Texture2D variables to have more than 8 textures in your pixel shader should your GPU be able to handle it (I believe the upper limit of samplers is 16 in SM 3.0).

I didn't remember that the shaders have their own limit on samplers. Shader model 2.0 has a limit of 8 still, but you were right, 3.0/4.0 is 16. Still, this is fairly limiting if you want to use this method in a 2D-only environment with lots of random elements. (Which is why I was asking.)

Oh, and sorry if it seems like I'm somewhat derailing the thread.

In Topic: [C++, DX9] Combining Vertex and Index buffers

19 July 2010 - 09:26 AM

Quote:
Original post by Dom_152
// Which texture will this tile use?
float TextureID;

How would you go about utilizing this value in the shaders? If I understand the way Direct3D works, this would also limit you to 8 (?) textures per draw call, wouldn't it?

In Topic: Clipping

09 July 2010 - 10:10 PM

Apparently I didn't look as thoroughly for a solution as I thought. I'll check into those options and see if they're suitable. Thanks.

Edit: Wow, I feel retarded. I have no idea how I missed any of these. I guess I just assumed past researching was complete when it obviously wasn't.

PARTNERS