Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by SuperVGA

  1. Hi Everyone, It's been a while - I've been keeping myself busy with some less gratifying aspects to prevent me from playing too much with the unfinished product, then not knowing where to go next. I suppose we all learn as we go... So a few years back, I was so sure I nailed (tesselation) shaders. Obviously, I had just gotten lucky. I did things different back then - somehow I managed to get a 410 core tesselation shader working. I'm already suspicious of my Shader Loader class, because I can't for the life of me find anything wrong with my shaders. I'll proceed to refactor my Shader Loader now, but perhaps I'll upload that if you agree that my shaders are OK, and that I'm not going crazy... Vert #version 410 core in vec4 position; in vec4 color; uniform mat4 model; uniform mat4 view; uniform mat4 projection; out vec4 position_tc_in; out vec4 color_tc_in; void main() { position_tc_in = projection * view * model * position; color_tc_in = color; } TesC #version 410 core in vec4 position_tc_in[]; out vec4 position_te_in[]; in vec4 color_tc_in[]; out vec4 color_te_in[]; layout (vertices = 4) out; void main() { position_te_in[gl_InvocationID] = position_tc_in[gl_InvocationID]; color_te_in[gl_InvocationID] = color_tc_in[gl_InvocationID]; if(gl_InvocationID == 0) { gl_TessLevelOuter[0] = 4.0; gl_TessLevelOuter[1] = 4.0; gl_TessLevelOuter[2] = 4.0; gl_TessLevelOuter[3] = 4.0; gl_TessLevelInner[0] = 8.0; gl_TessLevelInner[1] = 8.0; } } TesE #version 410 core in vec4 position_te_in[]; in vec4 color_te_in[]; out vec4 color_f_in; layout (quads) in; void main() { float u = gl_TessCoord.x; float v = gl_TessCoord.y; vec4 a = mix(position_te_in[1], position_te_in[0], u); vec4 b = mix(position_te_in[2], position_te_in[3], u); gl_Position = mix(a, b, v); vec4 ca = mix(color_te_in[1], color_te_in[0], u); vec4 cb = mix(color_te_in[2], color_te_in[3], u); color_f_in = mix(ca, cb, v); } Frag #version 410 core in vec4 position_te_in[]; in vec4 color_te_in[]; out vec4 color_f_in; layout (quads) in; void main() { float u = gl_TessCoord.x; float v = gl_TessCoord.y; vec4 a = mix(position_te_in[1], position_te_in[0], u); vec4 b = mix(position_te_in[2], position_te_in[3], u); gl_Position = mix(a, b, v); vec4 ca = mix(color_te_in[1], color_te_in[0], u); vec4 cb = mix(color_te_in[2], color_te_in[3], u); color_f_in = mix(ca, cb, v); } The error assets/shaders/terrain failed to link: Tessellation control info ------------------------- 0(23) : error C0000: syntax error, unexpected '[', expecting "::" at token "[" (0) : error C2003: incompatible options for link This doesn't lead me to think the shader loading code is wrong, since it actually references a line in my tessellation shader. It's just that I don't think it's making a lot of sense. This is why I think my loader might be wrong, I just think it's really strange that everything here works if I remove the color part. I've spent a lot of time thinking it was the wrong way to pass a vertex attribute through the tessellation stages, but it doesn't really seem incorrect. Many thanks in advance! Best - Svga
  2. SuperVGA

    Funky GLSL Linker Error

    Sorry for the trouble everyone. It was in deed my loader which messed up. More specifically, it was my fs utility function to read files into strings. I did blindly follow some advice, and everyone who might come across this: do not trust tellg() to deliver the size of your files! https://stackoverflow.com/questions/22984956/tellg-function-give-wrong-size-of-file/22986486#22986486 My buffer was too big, and the dirty part of it ended up containing this [], which curiously enough was always found near the last line of the shader source.
  3. Dear TexasJack, If you're new to programming and have a passion for image processing, I'd advise you to start with python. Install it, put python.exe on the path and go through a few easy examples first. Get comfortable with the python language (I recommend this, but if you're impatient - I get it) Image manipulation using a good library is often very easy (at least when you're not starting out with advanced image manipulation and real-time graphics) but it still gets somewhat tougher if you've never gotten comfortable with the language. Then get the pillow library (it's easy with pip, which is the package manager for python) Look at all the pillow tutorials. I've found pillow very useful for mass image processing down to pixel manipulation. I'm sure it can do most of what you're looking to do. And so what if it's not ultra-fast: It's a solid, easy start. Ping me if you need a hint or two. I'm not going to pretend I didn't dive right into the deep end myself, but I think this is might quickly get a little difficult.
  4. It's tough to make a game engine. Since you're already hell-bent on this, my advice is: Think of one basic game that you'd like to use on the engine, aim for that. Implement the game, then generalize all the components, tear away the game-specific stuff. Use your general components to implement a more complex version of the game, incorporate scripts etc outside the engine itself. Don't focus on the rendering part until last (I personally get distracted and play around with physics and lighting for months, when I should be doing other, more fundamental things)
  5. SuperVGA

    OOP is dead, long live OOP

    Thanks, aside from the organizational advantages I never considered the build-time benefits of this before.
  6. Ah, right. Yeah, I don't think it's something that requires a whole lot of thought either, so it's fair enough. Mostly I was just puzzled as to why the paper didn't reference it.
  7. SuperVGA

    Daily Bonus Logic

    I think it was Need for Speed: World which had me coming back. (And I hated it - really felt addicted and I felt a bit dumb for doing it, even if the rest of the game was good) One would need to do a daily task. I think it mostly involved driving around in an area of the city, to collect crystals floating over the street. Once 25 (?) had been collected, that was it for the day. A little one-time bonus, a "days-in-a-row" sort of bonus was also given. But I was going for this, Audi Quattro I think it was, special car, that required me to do this for 150 days IIRC. On day 80-something, I went to on a long weekend trip and, yeah - bummer. 😕
  8. It's interesting that neither this thread nor the linked paper mentions it: I'm convinced this is just a 3D bresenham implementation. (credit where due) Back in early 2010, I played around with implementing bresenham in a fragment shader working on a volume texture, and it actually did pretty good. It's sort of a nice way to avoid using polygons, if you're into that sort of thing, but it was a little too much branching for my GPU at the time...
  9. SuperVGA

    OOP is dead, long live OOP

    Isn't it still good C++ practice though to keep free functions in a namespace or even within a class, as static functions? I have gotten into the habit of starting to implement every member function as static, and if I discover that using the interface is sufficient, I reevaluate its placement - otherwise I turn it into an ordinary instance member function.
  10. SuperVGA

    God Help Me, I'm Making A Tactical RPG

    Since you've already had some luck with Game Maker, I'd say return to that, see how much you can do. I promise you it's possible to do an isometric map in GM as well - I think your issue in that regard is that you wouldn't know how to work with isometric coordinate systems and tiles - but read an article on it. Check these. Since you're coming from the design angle, then I think the most valuable and important bit you can create now is a design document for your first working prototype. Be concrete about what your game is supposed to do. Describe everything and use it as a bible when working on your project. It's cool to dive in to larger engines and programming languages, but if you can start with *anything* you're comfortable with, I'd say do that. There's some learning associated with making a game either way. And It will be a rocky road too. (Nice portfolio btw - I suppose you're making all the sprites, tiles and visual novel art for your project?)
  11. I currently have  std::map<const guid, CommWrapper >* comm_table;   where guid  struct guid  {   unsigned char d[16];      // Less-comparer for std::map with GUID keys   bool operator<(const guid& rhs) const   {    for(unsigned c = 0; 16 != c; ++c)    {     if(d[c] == rhs.d[c]) {   continue;     }     return d[c] < rhs.d[c];    }    return false;   }   };   But it seems to be way slower than the approach i took before, where i just based the (gu)id on the index the pointer had in a std::vector. for instance truck would be in comm_table[5], and thus its id would be 5.   But I kinda like the idea of using some big, fancy guids. It's just really slow for autonomous inter-instance communication, and I'm wondering if I'm doing it right. Perhaps there's no reason to go this way at all.   Or am i just using a wrong collection?
  12. Do you really need a global, unique id  here ? What's wrong with a 32bit or 64bit application unique id ? It would be a lot faster and would make it even more useful in combination with a hashmap. Looks a little bit like over-engineering to me   Thanks for your input. Yeah, I have been over-engineering. It's probably because I've become so accustomed to these 128bit guids at work that I feel like I should be using those too. But you're absolutely right - less will definitely suffice. I'll moderate this, and overhaul this communicator thing with hashmaps and shorter uids. I only want them to be unique application-wide, after all. 
  13. Wow, the article describes one technique. I wouldn't call it modern, either.   You could explain GPU raycasting, polygon aided raycasting, different approaches to approximate or truncate isosurfaces, so why is MC getting all the love?   And I'd mention metaballs in connection with explaining scalar field polygonization, but perhaps that's just me. Also, here the scalar field is described as "our voxels" - I'd say it's a bit more than that.
  14. SuperVGA

    Geometry Clipmap Question

    I'm back! Thanks Funkymunky, that did in fact help. I ended up understanding it, but before I sat down to rewrite some things, I discovered that I would eventually have to deal with a patented approach, a Geoclipmaps apparently is.   So I went back to sort of a compromise. I do classic LOD chunks now, but baked into a single mesh, where every verex has its fp LOD value set as one of its attributes. The cool thing about this is that i can use euclidean distances rather than manhattan or chessboard distances, and that I get a seamless result, as I lerp the LOD values downward towards the next chunk (which requires it's sample LOD to match its mesh density or be coarser.)   I now have [attachment=19009:standardlod.png]   ... And I'm now at the point where I'm actually considering applying a modulo equal to the highest density -quads, rather than using modulo of a chunk size. (here, the chunk size is constant, only the density changes) This causes obvious but smooth vertex scaling in the distance, which I actually like. Viewing with the wireframe on also makes it more obvious.   I think I've managed to do a fair settlement, but you're welcome to input on the approach, of course! :)
  15. Hi Guys! Been a while! My project sees constant changes, and it really helps that I learned to stick to stuff. That said, I often see myself rewriting a module or replacing it with others. Feels clean.   I've tried to grasp the principle of Geoclipmapping. Following various articles, but mostly the one from GPU gems 2 (see, I even used the colours :P) I get that all the vertices should move relative to the camera movement, and thus represent static points in the world. While I'm mostly successful at this, the "rings" that represent the overlap between the detail levels cause me some headaches. (They're the ones on the picture which fades to a darker colour on the inside) [attachment=18917:geoclipmaps.png]   I've done it so that these rings will snap to the same points where the outer vertices on the ring within are. That means that these in-between rings scale a bit, and that the quads in the corners have issues snapping to the inside.   The individual rings are each offset with eye.xy modulo size (where size is the size of an individual quad in that ring) - when I look at these isolated, they move seamlessly, so I think I got those right. But I can't wrap my head around how the ones on the inside can stay without being distorted a bit. And how to do the corners at all.   Any feedback or hints highly appreciated! :D Have a good weekend,
  16. SuperVGA

    Geometry Clipmap Question

    Ah, the only thing I meant by slide was the movement relative to the eye, before the modulo bit resets the positions of the vertices. I see how that was a weird term to use.   I've read so much and re-coded so much of this that I think I need to take a break. All this talk about grids is weird, when they are not really complete. I somehow fail to comprehend why I should use an odd number of cells in the "grids". Also, is it supposed to be the innermost grid that's 2^n -1, or the surrounding ones?   Anyways, thanks for trying to help out. I thought I got it, but it appears that I didn't really do it how it's supposed to be done. And now I'm sorta stubborn to learn the "right" way. :)
  17. SuperVGA

    Geometry Clipmap Question

    Hi Funkymunky! Thanks for responding. Yes - those are the ones I'm talking about. The way you do it, do these triangles that connect the two LOD levels maintain size, and therefore overlap either the inner LOD area, or the outer one, as the camera pans across the landscape?   Because with how I do it, letting the innermost slide to a max of 0.25 (as the innermost quads are 0.25 in width and height), and letting the next layers slide by 0.5, 1.0 etc in each direction, there is at most a gap or an overlap between two LOD levels of the inner quad size. And this means that the gaps are often narrower. But I see your point. Just as how I've mapped it down, there's still something I need to figure out.... Huh. - Could it be that I'm fitting the inner part of the coarser LOD to the finer? This means having fewer vertices to move around than if I used the outermost triangles of the finer LOD level...   I keep my LOD value for the vertices in the texcoords, but it seems we do just about the same thing with regards to picking the applicable level.
  18. SuperVGA

    How to profile SIMD

      Hi Rob,   Why do you recommend passing vectors by value rather than reference? I've made it a habit to use const ref parameters wherever possible, and wherever ref makes sense compared to the size of the type (I wouldn't pass a char by reference)
  19. SuperVGA

    Gameplay vs. programming abilities

    That's like asking "Will a Mechanic will be able to think of a better car, the better his skills as a Mechanic are?".   The mechanic may never have to deal with cars in his lifetime. Much like programmers don't necessarily develop games. The mechanic may be a mechanic due to a natural interest in building cars, but this is not a given. The mechanic may spend some time fixing sewage control plants before getting interested in cars. Does his skills carry over, and how much?   I'd say that the part of developing games that exist within GAMES && PROGRAMMING will improve as long as one works on GAMES while working on PROGRAMMING. Also, I think that if you get an interest for games out of the blue, after several years of programming other things, there may still be some rare topics existing within both sets that will take some learning. But obviously, if the programmer did audio synthesis for hearing aids, 3d rendering for ct scans and graphs for whatever solution, he may be well on his way.   But it is a very vague question, and I think it depends a lot on many different things.
  20. SuperVGA

    Renderer too slow

    Have you checked whether your card maintains vertical synchronization with your displays refresh rate? (That could, and likely would explain your 60fps)
  21. If i understand frob correctly, you shouldn't have to determine it, only set it. You could drop points behind the car and create bezier curves through them, you'll have a nice path for your camera to follow, while looking at points closer to your car. 
  22. SuperVGA

    [C++] Curious problem with rand()

    What do you mean by "static initialization on a global level"? Like initializing global variables outside of a function? I avoid doing that.   Yeah, sort of. Even if you do something neat like only having one, or very few of them, it can hurt; It's really more of a linking issue than it is a design issue, - but I suppose by sticking to pure functional programming and no static classes, it's doable.
  23. I agree, but I only told how to do it as an answer to Tom_Mai's question "...before stopping at the first line of code..."   - There's nothing as infuriating as stepping from main() all the way to the 20000th frame because that's around the point I'm through the menu, my world has loaded, and the buggy AI discovers an ammo crate.   Also, I strongly encourage using breakpoint conditions where possible. In the Borland/Embarcadero IDE, there was/is an option to enable and disable entire breakpoint groups. Powerful stuff. I don't think Netbeans or VS does this.... :(
  24. SuperVGA

    Mushroom House

    Having a decent page inspector/js debugger, Hodgman always wins! :D   On topic (If the topic is not about obscuring your js), game is entertaining. Typical addiction through timing - approach! I see that it works... :)
  25. SuperVGA

    [C++] Curious problem with rand()

    Often, If you use static initialization on a global level, you can't tell which order the objects are created in. Usage of rand() here may cause code invoking rand() in a different order than expected. Of course, if the same build is causing different sequences, that's a different thing .   (Also, i must agree with Mir, stl http://www.cplusplus.com/reference/random/ is really sweet - I use it a lot.)
  • Advertisement

Important Information

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

GameDev.net 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!