Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (672)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Questions on VBO and adding geometry  (Read 8825 times)
0 Members and 1 Guest are viewing this topic.
Offline Vermeer

JGO Coder

Medals: 16

« Reply #30 - Posted 2013-03-24 20:55:54 »

I figured one thing out, I changed this:
glTexCoordPointer(2, GL_FLOAT, 0, 0L);

to this:
glTexCoordPointer(3, GL_FLOAT, 0, 0L);

But now only one side of the blocks have textures. When I render out a skybox in immediate mode with the same texture coords, it works fine. So whats wrong with my VBO?

Im not entirly sure but i think it should be 2,
I interleaved mine like this.
glVertexPointer(3, GL_FLOAT, /* stride **/21, /* offset **/(1) << 2);
GL11.glTexCoordPointer(2, GL_FLOAT, /* stride **/21, /* offset **/(4) << 2);

1 thing that may help is making a square texture, with a border, with different colour sides. It may help you see whats going on.....

I think someone more experienced with this would give better advice. I dont want to advise you wrongly..

Hope you sort it soon...... Smiley

you have put no offsett on yours.....
Offline Opiop
« Reply #31 - Posted 2013-03-25 02:45:47 »

I used 2 and the textures were all screwed up:/ 3 partially works. For the offsets, why would I need them? I already offset my blocks when rendering, why would I need to offset them again?
Offline Opiop
« Reply #32 - Posted 2013-03-25 09:17:38 »

Ok, I really would love some help, I'm incredibly frustrated right now. I have 2 problems:

1. The textures for my cubes are actually stretching across the right, bottom, top and left sides of the blocks, but work normally on the front or back. I know my texture coords are right because I use them to draw a skybox in immediate mode! Should I be using some sort of wraping function?

2. First off, I know OpenGL is a state based machine. However, I need help because when I texture my skybox, and the texture my blocks, the skybox texture is applied to the blocks. I bind the texture for the skybox, draw it, then bind the texture for the blocks and then draw them. Should I unbind the textures after I'm done with them so they arent applied to anything else? Or is there a better way? Someone suggested using
to keep attributes of those vertices away from other vertices and thus my textures will not bleed over. I feel like this isnt the right way to do it though. Any thoughts?

Thanks for everyones help!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven

« JGO Overlord »

Medals: 1209
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #33 - Posted 2013-03-25 10:07:51 »

@vermeer: Those strides and offsets are nuts. Please read the specification of those methods.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline Vermeer

JGO Coder

Medals: 16

« Reply #34 - Posted 2013-03-25 18:30:10 »

@vermeer: Those strides and offsets are nuts. Please read the specification of those methods.

These are the values Im using currently, which agree with the specifiaction.
   glVertexPointer(3, GL_FLOAT, 32, 0*4);
   GL11.glColorPointer(3,GL_FLOAT, 32, 3*4); 
   GL11.glTexCoordPointer(2, GL_FLOAT, 32, 6*4);

I copied thouse others from an outdated method by accident! I dont even remeber how I had 21 there!
Pages: 1 [2]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

IanParcs (49 views)
2016-04-18 14:18:53

KaiHH (47 views)
2016-04-18 08:35:41

KaiHH (77 views)
2016-04-15 12:43:58

theagentd (81 views)
2016-04-14 02:16:17

theagentd (95 views)
2016-04-14 02:15:43

IanParcs (110 views)
2016-04-12 03:51:16

IanParcs (49 views)
2016-04-12 03:50:03

IanParcs (45 views)
2016-04-12 03:49:54

IanParcs (42 views)
2016-04-12 03:49:52

IanParcs (50 views)
2016-04-12 03:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30 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‑
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!