Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


thecheeselover

Member Since 25 May 2010
Offline Last Active Sep 09 2014 08:46 AM

Posts I've Made

In Topic: Shared vertices or not for primitives

28 June 2014 - 07:24 PM

Ok thanks everyone! Now I understand! :)


In Topic: Shared vertices or not for primitives

25 June 2014 - 07:52 AM

What are these debug shapes used for? Do they even need uv's?

Yes they need uv's because I'm learning GLSL and testing shaders.

 

And I'm still confused. I have a rectangular map that I want to apply to a sphere. How could the vertices that are at the beginning and the end of the texture in uv coordinates work normally, and by working normally I mean making a beautiful sphere. If a vertex at (0.9,0) (in uv's) makes a triangle with a random vertex and the one with (0,0) the texels applied to the triangle will cover the whole texture on the X axis instead of making a continuous texture mapping, i.e. (-0.1,0) to (0,0).


In Topic: Shared vertices or not for primitives

24 June 2014 - 05:14 PM


If you go ahead an try to project a rectangular texture (or other more fancy things) onto the sphere, you have to dublicate the "top" and "bootom" of the sphere, where you have that triangle fan like structure.

 

What about the sides? If one vertex reaches the end of the texture on the X axis how will it go back to the beginning?


In Topic: Cannot allocate a decent amount of memory glBufferData()

07 February 2014 - 12:53 PM

To summarize, this is how my code should look like?
 

glBufferData(GL_ARRAY_BUFFER, NUM_VERTS * sizeof(GLfloat) * (ELEM_PER_POS + ELEM_PER_COLOR + ELEM_PER_NORM),
                  vertexData, GL_STATIC_DRAW);

In Topic: Cannot allocate a decent amount of memory glBufferData()

07 February 2014 - 07:23 AM

If the commented out line is the one that crashes, that's because you're copying past the end of vertexData. glBufferData (using text replacement with your code) is basically:

boundBuffer[GL_ARRAY_BUFFER] = malloc(10000);

memcpy(boudBuffer[GL_ARRAY_BUFFER], vertexData, 10000);

 

And assuming vertexData is less than 10000 bytes long, the memcpy part of that crashes after trying to copy past the end of vertexData.

Possible, but why allocating 1000 bytes doesn't crash?


PARTNERS