Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (499)
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 3849 times)
0 Members and 1 Guest are viewing this topic.
Offline Vermeer

JGO Coder


Medals: 16



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

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

to this:
1  
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 opiop65

JGO Kernel


Medals: 123
Projects: 7
Exp: 3 years


Team Alluminum


« Reply #31 - Posted 2013-03-25 03: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 opiop65

JGO Kernel


Medals: 123
Projects: 7
Exp: 3 years


Team Alluminum


« Reply #32 - Posted 2013-03-25 10: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
1  
glPushAttrib()
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
« League of Dukes »

JGO Overlord


Medals: 605
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #33 - Posted 2013-03-25 11: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 19: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.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (27 views)
2014-04-15 18:08:23

BurntPizza (23 views)
2014-04-15 03:46:01

UprightPath (38 views)
2014-04-14 17:39:50

UprightPath (20 views)
2014-04-14 17:35:47

Porlus (36 views)
2014-04-14 15:48:38

tom_mai78101 (61 views)
2014-04-10 04:04:31

BurntPizza (119 views)
2014-04-08 23:06:04

tom_mai78101 (219 views)
2014-04-05 13:34:39

trollwarrior1 (186 views)
2014-04-04 12:06:45

CJLetsGame (193 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!