Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

430 Neutral

About Nairou

  • Rank
    Advanced Member

Personal Information

  • Interests

Recent Profile Visitors

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

  1. Nairou

    Good C (not C++) math library?

    It's mostly a hope at this point. I'm still planning the project, haven't started coding it yet. And I do most of my development on Linux, but will build on MSVC when it's far enough along to get other people to test it. So my hope is that C11 support will have improved some by then.   If it hasn't, then there's always MinGW, but I'm trying not to rule out MSVC at this stage.
  2. Nairou

    Good C (not C++) math library?

    It has potential, but the LGPL license and the fact that it only compiles with GCC (not MSVC) make it unattractive for my project...
  3. Nairou

    Good C (not C++) math library?

    Good idea. If I don't end up finding an existing library, I might look into doing that...
  4. Nairou

    Good C (not C++) math library?

    Unfortunately, GLM itself is C++ only, not C.   This is the problem I'm having, all of the good ones I know of are C++ only. :)
  5. Nairou

    Good C (not C++) math library?

    Good points. What I'm looking for would be primarily for use in 3D calculations, for 3D games. So just small vectors, small matrices, and quaternions. And operations like building translation/rotation/viewport matrices, generating camera projection/ortho matrices, quaternion interpolation, etc.   I know with C++ the math libraries can do operator overloading to make them feel natural, and I wouldn't have any of that in a C library, but that's fine. Even if the library was limited to integers and floats (and didn't mix them), since it doesn't have the template abstraction, it would be fine. When you're doing matrix operations with the goal of feeding it to the GPU, there isn't a lot of variety needed.   Simple enough set of requirements that I could probably write my own library if I had to, but I don't have the math optimization experience necessary to make the library as fast as it would need to be.
  6. There are lots of forum topics about C++ math libraries (like CML, GLM, Eigen, etc.), and I've used many of them in past projects.   However, my next project is going to be C (C11), not C++, so now I'm looking for a good C math library. I'm not having much luck finding one that isn't just someone's pet project.   Anyone have recommendations for good C math libraries that have been battle-tested in real projects?  
  7. Nairou

    Trying to project a point onto a cubemap

    Thanks for the reply. I actually had that thought as well, but got stuck trying to implement it. I'm pretty sure I could create a forward vector and use matrices to rotate that by the x and y angles, and then extract the position. But I don't know if there is a more direct way to convert it. I thought I could use the angles directly and just normalize them to get a point, but if the camera looks directly at the point then the angles are zero, and I get an invalid result doing that.
  8. I've got a simple test program with a camera within a cubemap (skybox). You can look around, and it feels like you're in a 3D room, but really it's just a cubemap image.   Now I want to draw a point (well, ultimately, a large number of points) on the screen, such that it appears to be anchored at a point on the cubemap. For example, if the cubemap is of a room, then I want to put a point on the "wall", and have it appear to be stationary when you look around.   Given that there is no actual environment, it's just a cubemap, the points I want to project are represented as x/y rotational angles, rather than absolute 3D vertices. I tried calculating the position manually, using the camera x/y angles and interpolating across the screen. However because the cubemap is distorted at the edges due to the camera's projection matrix, my linear calculations don't match up, so the point appears to wobble as you look around.   I know I need to incorporate the camera's projection matrix to get it to appear in the correct position, but I'm not sure how. I'm using the CML math library, and I noticed it has a project_point() function, but it works with absolute 3D coordinates, so I don't know how that helps me when starting with angles instead of coordinates.   If someone could get me pointed in the right direction, I would appreciate it.
  9. Thread is a bit old, but I wanted to point one thing out. You mention several times the desire to remove heavy programming and make the project as light on programming as possible. I assume this is with the intent of making things "easy" for whatever programmer you end up working with, in hopes of getting work done.   While that is a good idea when trying to do the programming yourself or use an existing framework, I don't think that is a valid concern when bringing in an experienced programmer to work on the project with you. Most programmers (especially those in games) do programming because it's what they enjoy. If we didn't like programming, we'd be doing something else. So reducing the amount of programming required is, to some degree, making the project more boring from our perspective. With less programming, you have less features, less options, less of a game to be proud of in the end. You don't want to cut down on programming effort for it's own sake. That's like asking an artist to help with a game that only needs drawings of stick figures in crayon. Where's the fun in drawing that?   Instead, have a clear idea of what game you want to make, and all of the necessary features and details. Think it through, don't be overly vague. If a programmer likes it, they'll do the necessary programming to make it happen. Stay focused on what's important, the end result.
  10. Nairou

    TTF Font Libraries?

    I use freetype (the original, not freetype-gl), and rasterize my fonts to a texture when my game start up. Then to draw text on the screen, I just generate quads with the font texture, one character at a time. Doesn't require anything special, and works on all platforms.
  11. What is the state of the art in terms of shadow rendering? My target is OpenGL 3.2, using a deferred rendering pipeline, if that matters.   It's been years since I looked into shadow rendering, and at that time there were numerous techniques available, from stencils to the various shadow mapping methods. At that time, rendering shadows required separate rendering passes, controlled by the CPU. But then recently I saw a demo where a scene was rendered entirely on the GPU, including shadows. I have no idea how that would have been accomplished, or if it is even a reasonable thing to do (beyond a tech demo).   Given the large amount of old info on the internet, I'd like to learn what methods people are using these days, and how much of it can be pushed to the GPU (assuming my target OpenGL version supports it).
  12.   But I'm assuming you can't have both textures bound for this to work, right? If you updated texture 0, and the shaders knew to only sample from texture 1 this frame, would the GPU really know that texture 0 wasn't accessed? Or would you still end up with a synchronous flush from updating texture 0?
  13.   Very interesting, I didn't know textures could be double-buffered. Do you have any links on doing this in OpenGL?
  14. How well does OpenGL (3.2, if it matters) handle modifying or replacing textures that have already been uploaded to the GPU?   I always had the impression that messing with textures was always much more expensive than replacing VBO data, even if the texture is far smaller in byte size, but I'm starting to think this might not be the case.   Is there perhaps a list somewhere that shows what sort of operations are most expensive in OpenGL?   For context, I'm working on a terrain system where the terrain colors can change frequently. I figure I can either do texture mapping, and modify the texture pixels, or put the color in the terrain vertices and rebuild the VBO for each change. I'm accustomed to continually rebuilding dynamic VBOs for other tasks, but in this case I am thinking that a texture would be a lot less data to upload than the block of geometry.  
  15. Say you have an arbitrary 3D line (not aligned to any axis), and a short distance away, a vertex. Is there a way to calculate what point on the line is closest to the vertex? I've seen posts that demonstrate how to find the shortest distance, but I need to come up with an actual 3D vertex that exists on the line. For context, I'm trying to move character joints with the mouse. The line is a ray cast into the world from the mouse pointer, from the arbitrary angle of the camera, and the vertex is the character joint that I'm trying to drag around.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!