Jump to content

  • Log In with Google      Sign In   
  • Create Account

_Silence_

Member Since 19 Feb 2012
Offline Last Active Jul 21 2016 12:28 AM

Posts I've Made

In Topic: Webgl: Is It Possible To Emulate Baseinstance?

21 July 2016 - 12:27 AM

Then, you'll need to completly emulate the thing. The idea is that you loop over all your instances, incrementing an instance_id, send it to the shaders, then call to glDrawElements.

 

You can see this for example: https://www.opengl.org/sdk/docs/man/html/glDrawElementsInstancedBaseInstance.xhtml

 

The thing is that you'll need to upload to the shaders the instance_id for each draw call. So, it might be more efficient to do it in a different way.

 

Also, if you have VAO (https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/), then I highly suggest you to use them. Sending pointers to GL will be far more efficient, since you'll do them only once (at the VAO creation). It might also be possible to use both VAO and the kind of BaseInstance emulation by using dynamic VBO and only update the required part of the buffer (the attrib array that might vary).

 

Hope that helps.


In Topic: Webgl: Is It Possible To Emulate Baseinstance?

14 July 2016 - 07:26 AM

You might be interested in: https://www.khronos.org/registry/gles/extensions/OES/OES_draw_elements_base_vertex.txt

 

You'll need to send uniforms more often (each time the location changes) but that will give you exactly the same result (maybe slower than if instanced were able to be used).


In Topic: Opengl: is gltexcoord1d() deprecated?

13 July 2016 - 03:02 AM

 

Put glTexCoord inside glBegin/glEnd and before glVertex.


That should not really be the problem, glTexCoord can be called at any time since it just modifies state. glVertex* is only allowed to be called inside glBegin/glEnd.

You're right. I did never know that it could stand out of the Begin/End statement. But this has some relevance only when rendering points (which is indeed what the OP is currently doing).


In Topic: Opengl: is gltexcoord1d() deprecated?

13 July 2016 - 12:10 AM

Put glTexCoord inside glBegin/glEnd and before glVertex.

 

 

glTexCoord1i(c % max_palette_size);
      glBegin(GL_POINTS);
          glVertex2i(x, y);
      glEnd();

In Topic: Linux for game development

11 July 2016 - 02:16 AM

I plan to use Linux for game development. I looked around a bit for a dist then i looked at
https://upload.wikimedia.org/wikipedia/commons/1/1b/Linux_Distribution_Timeline.svg and now I'm really confused.

I have a Intel CPU and a NVIDIA Gefore GTX 560. I will code in C++ and Lua and also use QT for user interface. Anyone that use Linux for development and have an good idea what dist to use? It looks like there are dragons out there among the dists ;).

 

I am on Debian since many years now. Before I was using the testing version, but for stability purpose and also in order to keep my dependencies with almost the same versions, I'm now with the stable version.

And despite of the fact that I seldom meet issues (mainly with dependency upgrades), I'm happy with this. But I also use other computers for development, one having the previous stable version of debian, and the latter having the current testing version. This helps me keep things portable, but this is not an easy task.

 

If you're not an advanced user in lua just like me, I already met issues when my distro upgraded lua to a newer version. I also recently had to face with other issues since I moved from Gtk+ 2 to Gtk+3.

 

There's currently one issue with using Debian on nvidia graphic cards, when a bug happens due to your proprietary drivers, you'll have very few chances that it will be resolved. This is why I don't use Gnome for example. And this is also why that I don't use the nvidia drivers provided by the distribution anymore.

 

I guess the most painful thing to deal with, currently, is the new C++ ABI. So my two cents are directly start with a distribution version that use this new ABI (gcc 5 or higher).


PARTNERS