Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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  
  LWJGL using modern OpenGL examples or Open Source  (Read 1800 times)
0 Members and 1 Guest are viewing this topic.
Offline Khazrak

Senior Newbie





« Posted 2013-03-01 11:05:02 »

Hi

I'm trying to develop a game using LWJGL.
Everywhere I look, everybody says that you should use Modern OpenGL (not glBegin() and glEnd() I guess).

And I followed the tutorials on the LWJGL homepage.
But every time I try to make a moving Quad with textures i get som sort of ghosting or studdering.
Most likely I've done something wrong.

I'm using a delta for the movement and I'm using VBO's and VAO.

Every project or example code I find is using glBegin() and glEnd().

Could anybody show me or give me a link to some code that uses VBO's and VAO's to move a quad (textured)?

Offline Mac70
« Reply #1 - Posted 2013-03-01 11:26:11 »

Do you clear screen buffers each frame using glClear?

Check out my Devblog! Smiley
Offline Khazrak

Senior Newbie





« Reply #2 - Posted 2013-03-01 11:34:06 »

Do you clear screen buffers each frame using glClear?

Yes. I've tried both
1  
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
and
1  
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);


But it's not that.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline opiop65

JGO Kernel


Medals: 156
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #3 - Posted 2013-03-01 12:03:52 »

Could you post the code?

Offline Khazrak

Senior Newbie





« Reply #4 - Posted 2013-03-01 12:41:41 »

Could you post the code?

I have it split into several classes, mostly Game and GameObject.

I'm linked my github: https://github.com/Khazrak/ManaEngine.git
Offline Mac70
« Reply #5 - Posted 2013-03-01 13:57:52 »

I see that you don't have any matrixes - movement in modern OpenGL is all about shaders and matrixes, so you should add them.

Check out my Devblog! Smiley
Offline Khazrak

Senior Newbie





« Reply #6 - Posted 2013-03-01 17:33:01 »

I see that you don't have any matrixes - movement in modern OpenGL is all about shaders and matrixes, so you should add them.

I was actually wondering about that since I'm going to do SNES-style 2D. Is it necessary? Will it change anything "right now"?
Offline Mac70
« Reply #7 - Posted 2013-03-01 18:55:06 »

I am usign matrices even though I am making 2D game - this has lots of benefits: the game look the same on every computer, everything is displayed correctly, you an easily manipulate everything.

Check out my Devblog! Smiley
Offline davedes
« Reply #8 - Posted 2013-03-01 22:00:07 »

The problem with forcing a 3.2+ context is that only a subset of users will be able to play your game. For example, only ~38% of Minecraft users support GL 3.2+.

My tutorials focus on "modern GL" (i.e. programmable pipeline) using code and techniques that will be compatible with GL 2.0+ and GL ES. Check out the API to see how things are done, like custom vertex attributes, shader compilation, and so forth. You can add your own VBO/VAO stuff on top relatively easily by implementing VertexData. (Although, for most purposes, simple vertex arrays will suffice.)

Tutorials
API

Briefly looking at your code, I have a couple suggestions:

- Decouple GL boilerplate/rendering from your game and entity structure (rather than putting VAO/VBO stuff inside of Player)
- You should re-use float arrays (i.e. in your Vertex class) instead of creating new ones every frame, to minimize garbage. This is especially important if you ever plan to do mobile/ES programming.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (44 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (38 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (68 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!