Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualSpck

Posted 29 December 2012 - 05:02 AM

If I have 2 objects, both exact copies except for position, is there a simpler way to render them besides passing the data twice?

 

You can pass a translation matrix as a uniform variable to a shader and render one object twice with different matrices.

 

Just to clarify, since I'm horribly new to graphics programming. Hypothetically, if I wanted 10,000 2D right triangles all with the same texture coordinates, I would only need 1 set of data in the VBO? (edit)

 

Could you explain how this would differ if I had multiple different shapes/textures? 

2 2D shapes + same texture = 2 sets of data?

2 2D shapes + 2 textures = 4 sets of data?

3 2D shapes + 2 textures = 6 sets of data?

 

Really having a tough time wrapping my head around, thanks for the help.


#1Spck

Posted 29 December 2012 - 04:59 AM

If I have 2 objects, both exact copies except for position, is there a simpler way to render them besides passing the data twice?

 

You can pass a translation matrix as a uniform variable to a shader and render one object twice with different matrices.

 

Just to clarify, since I'm horribly new to graphics programming. Hypothetically, if I wanted 10,000 2D right triangles all with the same texture coordinates, I would only need 1 set of data?

 

Could you explain how this would differ if I had multiple different shapes/textures? 

2 2D shapes + same texture = 2 sets of data?

2 2D shapes + 2 textures = 4 sets of data?

3 2D shapes + 2 textures = 6 sets of data?

 

Really having a tough time wrapping my head around, thanks for the help.


PARTNERS