Jump to content
  • Advertisement

PlasmicSoup

Member
  • Content Count

    94
  • Joined

  • Last visited

Community Reputation

122 Neutral

About PlasmicSoup

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. PlasmicSoup

    glBufferData and glBufferSubData

    Hmm. It appears to actually be something really really stupid where somehow my constants aren't being evaluated right... (they were used to set the size of the data buffered)... So anyway, thanks for your help. The lesson to be learned is that when you know what your checking is right... check something else! :-)
  2. PlasmicSoup

    glBufferData and glBufferSubData

    How does the allocation of BufferData work? I'm finding it matters where/when I first use it. I BufferData with NULL and just the size of my array to set it up... when I do that at program launch with the rest of my opengl initialization the program performs erratically as described above... but if I use that same BufferData call later on, right before I use BufferSubData to upload my new vertex data, then the program works normally. Any info is appreciated... I've been reading a ton of docs and it's all starting to go over my head!
  3. PlasmicSoup

    glBufferData and glBufferSubData

    glGenBuffersARB(1, &vertexbuffername); glBindBufferARB(GL_ARRAY_BUFFER, vertexbuffername); glBufferDataARB(GL_ARRAY_BUFFER_ARB, maximumvertices * 3 * sizeof(float), 0, GL_DYNAMIC_DRAW_ARB); glVertexPointer(3, GL_FLOAT, 0, 0); // i use drawelements glGenBuffersARB(1, &indicesbuffername); glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, indicesbuffername); glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, maximumelements * sizeof(uint), 0, GL_DYNAMIC_DRAW_ARB); this should be enough to set it up right? my source for updating the buffer seems to be the same... except that for the sub routine right now i'm always starting at 0 but normally i have it at start (vertex # in the array) * 3 (for each component) * sizeof(float) thanks for the replies so far!
  4. PlasmicSoup

    glBufferData and glBufferSubData

    I've already called BufferData to allocate the memory when I set up the buffer names and such.
  5. Can anyone tell me how these two functions are different? glBufferSubDataARB(GL_ARRAY_BUFFER, 0, (end - start) * sizeof(vertexarray[0]) * 3, vertexarray); glBufferDataARB(GL_ARRAY_BUFFER, (end - start) * sizeof(vertexarray[0]) * 3, vertexarray, GL_DYNAMIC_DRAW_ARB); .... glBufferData works fine, while BufferSubData doesn't work at all... the *sub* function only displays a small portion of vertex data, and it doesn't even appear to resemble what is there, but I can't figure out how the functions are any different from each other. edit: screenshots here
  6. Hey there gamedev.net crowd. I've been wondering something for a long time... Is there any speed hit when dereferencing pointers? Is it quicker to dereference a pointer once into a new non-pointer variable, then use that variable, or just use the pointer and dereference it everytime you need to access it? Thanks!
  7. Good enough is exactly what I need, and your explanation worked wonders! Thank you so much for your help! (In the meantime I did think of an approximation that did work but is even more of an approximation, ontop of an approximation ^_^... what I did was find the center of the surrounding points (with integer x,y), which divides the square into 4 quadrants around the center... I then found which quadrant the floating point x,y's were in, and then setup a new square around those, subdividing the grid/averaging new height values for those new points each time, until the center was within x distance from the player... works! But yours is much better :-)... thanks again!)
  8. Actually, I spoke to soon.... that isn't what I needed! :-X... I keep trying to post some code but the forums keep acting up (see my initial post -_-)... so I'll try again. I have a 2d character walking along a 3d curvy terrain, with lookup z values that approximate the height of the curvy terrain in an evenly spaced (by x and y position) grid. Right now, as the character moves, I round the x and y position to the nearest point on the lookup grid and use that height... obviously making for some jolty movement in the z axis. I need figure out a way to move the player smoothly along, by averaging the surrounding points in the grid, based on where the player is between those points. Any thoughts? Thank you!
  9. Whoa! Thanks guys/gals... obviously my post didn't go through (I really did have a long and descriptive post!) but you helped anyway, how generous :-) Note to future posters: Have a specific topic! It helps!
  10. PlasmicSoup

    Performance HIT with VBOs?

    Yeah I used STREAM, and tried STATIC just for some giggles. I was on my way to use MapBuffer but they I started seeing a bunch of red flags- Lock/unlocking!? SATANIC! Buuuuuuuut I'll guess I'll labor another go, aaah 'til then, anyone else have any thoughts?
  11. Ok so this is kind of a weird application I guess but here's what I'm doing... It's pseudo 3d/2d game. It's in perspective, not ortho... simply quads flyin around as sprites, 4 vertices each, flat, and with tex coords being changed according the frame of animation. My procedure here is this, 1. load up my VBO's, create a buffer for vertex coords, texture coords, and color coords, 2. setup my indices (which is just an array, size equivalent to how many vertices at max i want on the screen, with data of 0 to that number.... array[0] = 0, array[1] = 1, etc.), because then... 3. a routine that goes through all of my object data, takes their x, y, z, and rotation into account and spits out the x, y, z of each vertice into my vertex array (along with my tex coords and color data in seperate arrays), so each object that's on the screen gets added to the array in the order they should be drawn (hence my indices being 0, 1, 2, 3, 4, 5, ...). THEN i BufferDataARB those arrays. 4. repeat step 3 each frame, walla. In my intense demo I setup, with like 300 sprites going crazy (1200 vertices), I get around 46 fps using standard vertex arrays (not buffered in graphics card memory as I understand it) and around 30 fps utilizing the VBO ARB extension which is supposed to be glorious in its infinite capacity for speed.... what gives? Am I doing something wrong or is doing it this way just bad news?
  12. PlasmicSoup

    crash on swapbuffers

    ok so i got around to testing it on my bro's computer finally and.... drum roll... it works. fancy that, eh? well im guessing its the vid card then. could it still be the memory? i know his computer has much more ram then mine has, i guess then with his there is less chance of randomly overwriting something important, and more of achance of writing over clear memory. but its quite consistent with the way its crashed. oh well lol i feel like im beating a dead horse here so thanks a lot for your input! *showers you with love* haha
  13. PlasmicSoup

    crash on swapbuffers

    aaaaaaactually (and i do hope this is a pointful post) ive been getting error messages on reboot that say my graphics hardware failed, was stuck in an infinite loop actually. listed one of my dll's for the g400. though i suppose once you start f'in hardcore with memory that could happen still but, well, if that changes your outlook on the problem, let me know. also, it crashes on open if i set the gltranslatef's y coord to a constant like say 4 or something (ive determined 2, roughly, or above makes it crash).
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!