|
OneEightHundred posted:I really don't get this, there isn't really any reason that throwing calls into a work queue would do anything about the overhead of making those calls. OneEightHundred posted:Incidentally this sort of thing isn't even new, Quake 3 did it.
|
# ? Mar 26, 2010 05:38 |
|
|
# ? May 14, 2024 22:35 |
|
krysmopompas posted:There are a lot of reasons, the paper covers that. There's an additional presentation on the same subject from this year's gdc by some atvi guy that I haven't noticed out in the wild yet too. quote:Using opengl display lists is certainly an inventive way of bypassing d3d9's overhead.
|
# ? Mar 26, 2010 06:55 |
|
e: nevermind.
Poor Communist fucked around with this message at 08:17 on Mar 29, 2010 |
# ? Mar 29, 2010 08:09 |
|
Over on Reddit a guy is posting his modern OpenGL tutorial and so far it seems pretty great. Here's the the table of contents. So far he only has a few chapters out, but he's been churning out new ones almost every day. http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html
|
# ? Mar 29, 2010 15:16 |
|
Bitruder posted:Over on Reddit a guy is posting his modern OpenGL tutorial and so far it seems pretty great. Here's the the table of contents. So far he only has a few chapters out, but he's been churning out new ones almost every day.
|
# ? Mar 29, 2010 17:06 |
|
I'm having an issue with rotating a matrix. Over time my matrix seems to get wonky and my object will get skewed. I'm pretty sure it's not a problem with my math, but how should I go about avoiding this? The faster / more it rotates, the faster it distorts. http://www.mediafire.com/?4h2ljzmymcm
|
# ? Apr 1, 2010 05:40 |
|
slovach posted:I'm having an issue with rotating a matrix. Don't repeatedly add small incremental rotations to the same matrix, store the angle as a float and regenerate the whole matrix each time.
|
# ? Apr 1, 2010 05:46 |
|
Alternately use a quaternion for orientation since you can just renormalize it to prevent floating point error from accumulating.
|
# ? Apr 1, 2010 11:59 |
|
krysmopompas posted:As a side-note, if you want to get fancy, http://www.emergent.net/GameFest2008 is an interesting way of bypassing the draw call limitations. DirectX 9 also supports state blocks which are pretty much the same thing as opengl draw lists. If I recall, they also added a method for generalized command buffer building, but that might only be for the consoles. slovach posted:I'm having an issue with rotating a matrix. Alternatively, if you must use your matrices and they are orthogonal, you can always reorthognalize them. There are a few methods, (taking the cross product of x,y, then x,y... Gram Schmitt method, etc). But the methods stated in the above posts are probably the best unless you have an extenuating circumstance that you didnt mention.
|
# ? Apr 1, 2010 15:18 |
|
I'm guessing this has probably been asked as one point or another in this thread, but I can't seem to find anything about this so here goes: What's a good book for learning Direct3D 10? For reference, I have a CS degree and I've taken a graphics class which covered the theoretical side of things with some OpenGL-based assignments and I've gone through a good chunk of the Red Book. It's really a matter of learning D3D10 itself. Problem is, the tutorials on MSDN aren't nearly enough and the reference documentation isn't exactly the ideal learning material. Ideally, I'd want something like the Red Book in terms of presentation, but for D3D10. It doesn't have to be a book, but that's roughly the length I'd expect it to be.
|
# ? Apr 6, 2010 21:31 |
|
Check out 'Introduction to 3D Game Programming with DirectX 10' by Frank Luna. He does a pretty good job at explaining things in a logical sequence, and unlike most books with 'Game Programming' in the title he doesn't pull too many mathematical punches and provides the actual formulas for doing 3D operations. My only real complaint about this book is that the author tends to introduce and discuss tiny code snippets one by one, so you need to download the examples off his website to get a big picture view of how everything works together.
|
# ? Apr 6, 2010 22:06 |
|
Alright, I went ahead and ordered a copy. Thanks.
|
# ? Apr 8, 2010 01:32 |
|
For OpenGL and C++, I'm trying to clip this polygon using the Cohen-Sutherland algorithm. The way it should be clipped is that when the user selects a region using the mouse, the polygon should be displayed ONLY within that specified rectangular region (that black horizontal line is a test line I had for the algorithm to make sure it clips properly - it should go all the way across the screen if not clipped). If the program worked as intended, then the only bits of the polygon you'd see would be displayed within the pink region, and everything outside of that region would not be displayed. The only problem is that the way I'm displaying this polygon right now is manually connecting every single line segment, like so. code:
Upon the last mouse click, indicating that the user has finished selecting the region, global variable twoClicks is set equal to true, and this part of the template function in the display function thus gets called. code:
This only supports one line segment at a time. I have no idea whatsoever how to apply this to an entire polygon, especially when I'm using all those glVertex statements to draw it. I'm using a timer, so keeping everything on screen is really tough. Any suggestions would be greatly appreciated. All I can think of would be a global array with 64 points that'd all have to be calculated.
|
# ? Apr 8, 2010 09:30 |
|
Whilst farting I posted:For OpenGL and C++, I'm trying to clip this polygon using the Cohen-Sutherland algorithm. I think I found your problem. I'm not a graphics expert by any means, so I may be about to shove my foot in my mouth, BUT: Wikipedia posted:In computer graphics, the Cohen–Sutherland algorithm is a line clipping algorithm. A line clipping algorithm. Maybe you want this instead: http://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman I guess you can clip all the lines using the limits set by the bounding box that is drawn, but you're not going to have a well defined polygon anymore. Maybe you are just abusing the term 'polygon' and you meant a collection of lines that just happen to share endpoints. Here's what I'd do: code:
Whilst farting I posted:I have no idea whatsoever how to apply this to an entire polygon, especially when I'm using all those glVertex statements to draw it. I'm using a timer, so keeping everything on screen is really tough. Any suggestions would be greatly appreciated. All I can think of would be a global array with 64 points that'd all have to be calculated. Again, if need to apply this to a 'polygon' you need to look elsewhere, like: http://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman I don't understand why you are using a timer or what it could be possibly used for. How would that make drawing to the screen tougher? It sounds like your main problem is how to structure the code/solution so its clear and easy to work with. When you apply a little structure/planning this: code:
code:
|
# ? Apr 8, 2010 16:59 |
|
Sutherland–Hodgman can be simplified in the case of convex windings because you can guarantee there will never be more than 2 intersection points per plane. i.e.:code:
|
# ? Apr 9, 2010 04:03 |
|
Whilst farting I posted:For OpenGL and C++, I'm trying to clip this polygon using the Cohen-Sutherland algorithm. What exactly is your objective? Is it just to use that algorithm? Or are you just wanting to clip something? If it's the latter, then you can simply use the glClipPlane function.
|
# ? Apr 9, 2010 07:47 |
|
I'm trying to make a set of XYZ axes that float in the corner of the viewing area to provide some sense of direction while navigating around a scene. In the image above the large set of axes is an object in world space that is sitting at the origin and the colored lines are unit vectors with RGB <=> XYZ. The little set of axes in the lower-left corner is a similar object, but scaled and translated so that it is always sitting in front of the camera's near plane. The problem I'm running into is that the little axes aren't centered in the middle of the view space so the projection transform is causing them to be drawn with a slight tilt. Ideally, the big and little axes in the image above would have an identical orientation. Is there any easy way to get rid of this unwanted projection tilt? I suppose I could render the little axes to their own texture and then draw it as a sprite on top of the rest of the image, but it just feels like there's a simpler solution that I'm missing. PDP-1 fucked around with this message at 19:00 on Apr 17, 2010 |
# ? Apr 17, 2010 18:57 |
|
PDP-1 posted:Is there any easy way to get rid of this unwanted projection tilt? I suppose I could render the little axes to their own texture and then draw it as a sprite on top of the rest of the image, but it just feels like there's a simpler solution that I'm missing. Rather than setting up a whole new framebuffer, you can just change the viewport to a small rectangle in the corner and then the perspective will look correct. However, you probably also want to draw the axes with an orthographic projection to eliminate all distortion permanently.
|
# ? Apr 17, 2010 19:07 |
|
That worked brilliantly. Thank you.
|
# ? Apr 17, 2010 20:43 |
|
What's a good 3ds loader for OpenGL? I'm starting out with OpenGL and right now I want to load a 3ds model and have it rotate a bit. What would be the best way to do this? Keep in mind that I'm pretty much a noob when it comes to all this. Oh yeah, I'm coding in C++.
hey mom its 420 fucked around with this message at 19:46 on Apr 18, 2010 |
# ? Apr 18, 2010 19:43 |
|
What is the difference between pixel buffer objects and render buffer objects. I'm trying to render something offscreen and I looks like I can use either. What are their advantages/disadvantages? Is one more dated than the other?
|
# ? Apr 20, 2010 02:30 |
|
Bonus posted:What's a good 3ds loader for OpenGL? I'm starting out with OpenGL and right now I want to load a 3ds model and have it rotate a bit. What would be the best way to do this? Keep in mind that I'm pretty much a noob when it comes to all this. Oh yeah, I'm coding in C++. Check out Assimp. That'll load the file for you. You'll have to loop through the resulting data and draw it yourself, but it's a start.
|
# ? Apr 20, 2010 04:30 |
|
Contero posted:What is the difference between pixel buffer objects and render buffer objects. I'm trying to render something offscreen and I looks like I can use either. What are their advantages/disadvantages? Is one more dated than the other? As far as I know, PBOs require a context switch to render to and are slower because of this. I think the data you copy into a texture subsequently also has to travel over the bus. All the cool kids use FBOs nowadays. Plus you can use multiple render targets etc.
|
# ? Apr 20, 2010 10:09 |
I'm writing a software renderer in Java. When it comes to implementing a camera, I am thinking about simply having a point in space (the camera) with a target to view, then shooting rays from the camera to draw to the scene. This sound like it would work (and an early test shows it does). However, this goes against what I learned a long while back -- that you should have your camera at <0,0,0> and then translate all the objects in the world by -cameraX,-cameraY,-cameraZ, applying a projection matrix afterwards. Is one of these approaches preferable to the other?
|
|
# ? Apr 22, 2010 01:35 |
|
Well I've just spent a bunch of time trying to get FBOs to work and the most random thing seems to be causing the error. If I don't enable mipmaps for the texture I'm rendering into, I get a GL_FRAMEBUFFER_UNSUPPORTED_EXT error when I check the status. Even stranger, I've tried this code on 4 machines and both nvidia machines throw the error and both ati machines handle it just fine. Does anyone have any idea why this is happening?code:
|
# ? Apr 22, 2010 01:40 |
|
Jo posted:I'm writing a software renderer in Java. When it comes to implementing a camera, I am thinking about simply having a point in space (the camera) with a target to view, then shooting rays from the camera to draw to the scene. This sound like it would work (and an early test shows it does). However, this goes against what I learned a long while back -- that you should have your camera at <0,0,0> and then translate all the objects in the world by -cameraX,-cameraY,-cameraZ, applying a projection matrix afterwards. If your camera moves far enough away from the origin, you'll start seeing rendering errors because the precision of float-point numbers drops as you move further from the origin.
|
# ? Apr 22, 2010 02:06 |
|
Contero posted:Well I've just spent a bunch of time trying to get FBOs to work and the most random thing seems to be causing the error. Try a different format (i.e. not GL_RGBA8) Try glGenerateMipmapEXT(tex)
|
# ? Apr 22, 2010 04:48 |
|
Contero posted:Honestly I'm getting pretty sick of opengl. Think I'll start diving into directx pretty soon.
|
# ? Apr 22, 2010 18:09 |
|
Yeah dealing with pixel format validity in D3D is just as obnoxious. Once you start running into issues caused by lovely driver GLSL compilers, THEN you'll have a real reason to ragequit OpenGL!
|
# ? Apr 22, 2010 18:38 |
|
I'm going to implement a simple 3D racing with bullet and OpenGL. What's the best way to move the camera around -- manually doing the transformations with glRotate and friends or using gluLookAt?
|
# ? Apr 22, 2010 23:43 |
|
Either will work but I wouldn't say either is the best practice. You should learn how matrices (and quaternions, another important construct for rotations) work and just send a complete matrix. Especially since D3D doesn't give you either of those.
|
# ? Apr 22, 2010 23:52 |
|
I know how matrices work and I have an idea of how I'd be able to implement my own gluLookAt by just using transformations. Quaternions still baffle me though, gonna have to look them up.
|
# ? Apr 23, 2010 00:10 |
|
Can anyone recommend a "robust" camera class/mini-library with the ability to switch between arcball/flythrough manipulation modes etc. on the fly?
|
# ? Apr 23, 2010 00:12 |
|
To continue the theme of me complaining about FBOs and OpenGL, why, oh why would the clear color be used as the draw color when I'm rendering into an FBO? Click here for the full 1040x806 image. The clear color I'm using in the FBO is (1,1,1,0.5). When I'm drawing the actual object I explicitly set all materials and color to white or some shade of white (for ambient). When I set the clear color to solid yellow I get this: Click here for the full 1040x678 image. But if I take that same rendering code and remove the binds for the FBO it looks like this, which is what it should look like: Click here for the full 1040x806 image. What the hell?
|
# ? Apr 23, 2010 01:07 |
|
Somewhat relevant since I bet most people here will run into this the instant they try doing normalmapping: I've seen the question of how to generate tangent-space vectors for a mesh (or more specifically, the triangles on the mesh) come up a lot in various places. Incidentally, the most commonly-cited algorithm is wrong about forcing them to be orthogonal, and wrong about how they should be generated in the first place. So, I've posted an article detailing why it's wrong, how to correctly calculate them, the math behind it, and of course, source code. Contero posted:To continue the theme of me complaining about FBOs and OpenGL, why, oh why would the clear color be used as the draw color when I'm rendering into an FBO? OneEightHundred fucked around with this message at 03:56 on Apr 23, 2010 |
# ? Apr 23, 2010 03:50 |
|
OneEightHundred posted:Are you sure it's not using the draw color when it's drawing that quad with the FBO result as the texture? That would give you essentially the same result, i.e. on the yellow one, the white parts in the texture would become colorized yellow. The reason I'm sure is in the first picture, which I forgot to mention. When I have the clear color set to 0.5 alpha, you can see where the object overlaps itself, which wouldn't be possible if it were just drawing the quad that color. Also before you said try another format other than RGBA8, what would you suggest? I thought that would be a pretty normal/standard color format for a texture.
|
# ? Apr 23, 2010 04:05 |
|
Contero posted:The reason I'm sure is in the first picture, which I forgot to mention. When I have the clear color set to 0.5 alpha, you can see where the object overlaps itself, which wouldn't be possible if it were just drawing the quad that color. quote:Also before you said try another format other than RGBA8, what would you suggest? I thought that would be a pretty normal/standard color format for a texture.
|
# ? Apr 23, 2010 04:24 |
|
This question might belong more in the C++ thread but here goes: I am iterating over a list of a Shape class I created and attempting to update each object with some transformations, all I'm working on so far is updating the angle of rotation (for animation purposes): code:
code:
Glimm fucked around with this message at 22:35 on Apr 23, 2010 |
# ? Apr 23, 2010 22:21 |
|
Glimm posted:
You're making a copy of each shape and transforming the copy. Edit: To be a bit more helpful, what you want to do is code:
|
# ? Apr 23, 2010 22:23 |
|
|
# ? May 14, 2024 22:35 |
|
Nippashish posted:You're making a copy of each shape and transforming the copy. Thanks, I'm retarded I wish more of my earlier coursework had been in C++.
|
# ? Apr 23, 2010 22:26 |