I can't seem to find glUniform1fv() in GL20

I can’t seem to find glUniform1fv() in GL20. I mean, the normal glUniform1f() is there, but glUniform1fv…I can’t find it.

That’s because it isn’t GL20 IIRC. Try checking under later versions (sorry on mobile or I would search it for you)

if you are uploading 1 float, just pass the float in, not a FloatBuffer (which is what the v is for).

Atleast all the methods that have the v, take in a FloatBuffer, without the v it takes just n floats / ints

Apparently it’s in LWJGL 3. Anyway, I just can’t combine the cubes into a single VAO. It’s not working :-\ :-\

If you need help, jump on to IRC, and I can help.

I just did one of my optimisations earlier today, it trippled my FPS for the same world size as before.

Can now render 30x4x30 chunks (16x16x16) at 34 fps.

edit: I got confused, so I changed my reply.

I really don’t understand how I’m supposed to group the cubes into a single VAO. I’ve tried everything. A little help?

Start by reading the docs. It seems you have a few misconceptions about VAOs.

VAOs are basically objects that hold attribute configurations, like whether there are texcoords/normals/colors, which format they have, which stride and offset. This means there is always at least 1 VAO in your game, or there wouldn’t be a place to store the data passed to, say, glVertexAttribPointer. VBOs existed long before VAOs did, and the usage of explicit VAOs is optional. Most games don’t even use them, given that explicit usage of VAOs is reported to be a tiny by slower than to re-specify vertex attribute configurations occasionally.

You can use the Javadoc’s index page to find missing functions:

http://javadoc.lwjgl.org/index-all.html

Now click on the link. It should be in GL20 class in LWJGL3. In LWJGL2, the post fix is stripped off, so it is [icode]glUniform1[/icode] function. Here is the JavaDoc

From what I learnt, VAOs represent models since they can store positional data, texture coords, etc.

So is it right to treat VAOs as the models themselves, just in the form of data?

As said, your interpretation is incorrect. VAOs describe the configuration of vertex data in VBOs, they do not hold vertex data.

After mucking about with them extensively a couple of months ago, I’ve concluded that they are basically a total waste of time.

Cas :slight_smile:

A VAO stores which buffer to read which vertex attribute from (and how to read it), plus which index buffer to read from. If you modify or delete the buffers the VAO is referencing your draw calls will read the new/invalid data.