Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

104 Neutral

About DKMr_Chaos

  • Rank
  1. If you're on DX10+ or GL3+, you can use texture arrays and pass the instance ID as the array index. Otherwise you can use texture atlases, e.g. pack 8 license plates together in the same texture among the U axis and use (u + instanceId) / 8.   With 25000 instances, wouldn't the array get awfully big or am I missing something ?
  2.   Of course!! :), that's the solution or at least part of it, i'll try both and see what performs the best
  3.   Was thinking of doing that, but wouldn't I have to branch in the vertex shader in order to do this, thought they where expensive.       First, while branches are expensive - assuming the compiler doesn't replace them with equivalent branchless code - but that doesn't mean you should avoid them like the plague, especially in vertex and geometry shaders.  Branches are expensive on the CPU as well, but you would never dream of writting purely branchless code for that, right?   Second, there's absolutely no need for branches to do this - it's doable entirely by performing mathematical operations on the ID number that you feed into the shader.     Don't want to sound like an idiot, but I can't get my head around how to do that.   The InstanceId would be the same for all vertexes in the cube, so how would I know only to change the uv coordinates for the vertexes that are part of the license plate, or am I thinking about this the wrong way ?
  4.   Was thinking of doing that, but wouldn't I have to branch in the vertex shader in order to do this, thought they where expensive.
  5. I'm currently trying to get the most performance based on the following constraints.   Each instance/object is only 22 triangles and it's the same mest for every instance. You can think of it as a cube with 4 quads on the top, where each quad contains a 4 digits (the licenseplate). The licenseplate is created by mapping into the numbertexture with different uv coordiantes.   Right now, I have only created a ProofOfConcept where I render 50000 instances, but the licenseplate is the same.   Now I want to make the licenseplate unique and my bet would be to bind the unique texture coordinate into a VBO, but it would be quite large (22(tricount) x 3(3 vertexes/tri) x numInstances), around 13MB just for texture coordinates.   Does anyone have a better idea ?
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!