Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (804)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (868)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  I can't seem to find glUniform1fv() in GL20  (Read 4215 times)
0 Members and 1 Guest are viewing this topic.
Offline ShadedVertex
« Posted 2015-12-06 05:07:33 »

I can't seem to find glUniform1fv() in GL20. I mean, the normal glUniform1f() is there, but glUniform1fv...I can't find it.
Offline Longarmx
« Reply #1 - Posted 2015-12-06 06:02:49 »

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)

Offline Phased
« Reply #2 - Posted 2015-12-06 06:26:56 »

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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ShadedVertex
« Reply #3 - Posted 2015-12-06 08:08:35 »

Apparently it's in LWJGL 3. Anyway, I just can't combine the cubes into a single VAO. It's not working  Undecided Undecided
Offline Phased
« Reply #4 - Posted 2015-12-06 08:18:17 »

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.
Offline ShadedVertex
« Reply #5 - Posted 2015-12-06 10:25:26 »

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

« JGO Overlord »


Medals: 1371
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2015-12-06 10:33:26 »

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.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline SHC
« Reply #7 - Posted 2015-12-06 10:52:56 »

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
glUniform1
function. Here is the JavaDoc

Offline ShadedVertex
« Reply #8 - Posted 2015-12-06 13:10:39 »

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?
Offline Riven
Administrator

« JGO Overlord »


Medals: 1371
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #9 - Posted 2015-12-06 15:02:53 »

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

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

« JGO Spiffy Duke »


Medals: 1146
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2015-12-06 17:56:52 »

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

Cas Smiley

Offline theagentd
« Reply #11 - Posted 2015-12-10 16:58:11 »

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.

Myomyomyo.
Pages: [1]
  ignore  |  Print  
 
 

 
Riven (581 views)
2019-09-04 15:33:17

hadezbladez (5510 views)
2018-11-16 13:46:03

hadezbladez (2402 views)
2018-11-16 13:41:33

hadezbladez (5772 views)
2018-11-16 13:35:35

hadezbladez (1223 views)
2018-11-16 13:32:03

EgonOlsen (4661 views)
2018-06-10 19:43:48

EgonOlsen (5682 views)
2018-06-10 19:43:44

EgonOlsen (3198 views)
2018-06-10 19:43:20

DesertCoockie (4095 views)
2018-05-13 18:23:11

nelsongames (5115 views)
2018-04-24 18:15:36
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!