Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!

We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 26 Oct 2011
Offline Last Active Nov 20 2014 11:24 PM

Posts I've Made

In Topic: Wrong stride: glVertexAttribPointer

28 October 2014 - 10:43 PM

your stride should be the same for all glVertexAttribPointer calls. i think you are mixing up the last 2 parameters.


1. is the sizeof(vertex)

2. offset from 0 to that data element in vertex.

In Topic: gles2.0 lowp, mediump, highp precision sizes

28 October 2014 - 09:42 PM

thank you kalle_h for the link


and thank you cgrant. this is the reason i asked for the specification. as we appear to be seeing some devices that are behaving slightly different. we resolved it by raising the precision however we would like to know if it is an implementation error on the driver or our part.


thanks again for the link kalle_h

In Topic: Orthographic camera

18 June 2014 - 01:35 AM

looks like you have your matrix multiplication reversed.


A * B * C != C * B * A


reverse the order.

In Topic: Optimising my renderer

17 April 2014 - 07:39 PM

for(texture in textures)

    for(sprite in sprites)

      if(sprite.texture == texture)



    if(list.size > 0)




thats the basics. implementation is up to you

In Topic: Optimising my renderer

17 April 2014 - 03:07 AM

•Minimize state changes and group the remaining state changes. How do you group state changes?

- for example... changing the alpha blending. 

•Use static vertex buffers where possible. How do you know if it is static?

-i forget the flags but basically... can you write to it after it's created? then it isn't static

Use one large static vertex buffer per FVF for static objects, rather than one per object. What if each object has the same vertex property? Eg. all objects are 256 x 256 quads? reuse the same buffer?

- i create 2-3 pools. switch pools every frame. hopefully reduces lag to gpu

•If your application needs random access into the vertex buffer in AGP memory, choose a vertex format size that is a multiple of 32 bytes. Otherwise, select the smallest appropriate format. Random access as in needing to change vertexes at runtime?

- data = vb->lock(); data +13 = x; vb->unlock();   lock/unlock as minimally as possible. write to a locked buffer as minimially as possible.


one thing i noticed is you are doing 1 draw call per sprite. group sprites by texture to reduce draw calls. you may have 10k sprites but do you have 10k textures? maybe you have 10k sprites but they are on 2 textures. you don't need 10k draw calls. you can do it in 2.