- Advertisement
Content Count739
Joined
Last visited
Everything posted by SuperVGA
OpenGL Funky GLSL Linker Error
SuperVGA posted a topic in Graphics and GPU ProgrammingHi 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 ); } Frag ); } 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
Funky GLSL Linker Error
SuperVGA replied to SuperVGA's topic in Graphics and GPU ProgrammingSorry 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! 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.
Learning Graphical Programming - Where to Start?
SuperVGA replied to TexasJack's topic in Graphics and GPU ProgrammingDear 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.
Making a game engine. Looking for advice
SuperVGA replied to Entex's topic in For Beginners's ForumIt'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)
- Thanks, aside from the organizational advantages I never considered the build-time benefits of this before.
Voxel Traversal Algorithm (Ray Casting)
SuperVGA commented on thecheeselover's blog entry in 3D, AI, procedural generation and black jackAh, 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.
Daily Bonus Logic
SuperVGA replied to JoAndRoPo's topic in Game Design and TheoryI 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. 😕
Voxel Traversal Algorithm (Ray Casting)
SuperVGA commented on thecheeselover's blog entry in 3D, AI, procedural generation and black jackIt'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...
- 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.
God Help Me, I'm Making A Tactical RPG
SuperVGA replied to Brakinja's topic in For Beginners's ForumSince 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?)
Fastest map-like collection for <GUID, BaseClass*> lookup
SuperVGA posted a topic in General and Gameplay Programming?
Fastest map-like collection for <GUID, BaseClass*> lookup
SuperVGA replied to SuperVGA's topic in General and Gameplay ProgrammingDo.
Overview of Modern Volume Rendering Techniques for Games - Part 2
SuperVGA commented on avenkov's article in Graphics and GPU ProgrammingWow, 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.
- 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! :)
Geometry Clipmap Question
SuperVGA posted a topic in Graphics and GPU Programming :P)) [attachment=18917:geoclipmaps.png]! :D Have a good weekend,
- 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. :)
- 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.
How to profile SIMD
SuperVGA replied to ongamex92's topic in General and Gameplay ProgrammingHi 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)
Gameplay vs. programming abilities
SuperVGA replied to Shane C's topic in For Beginners's ForumThat'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.
Renderer too slow
SuperVGA replied to Paragon123's topic in General and Gameplay ProgrammingHave you checked whether your card maintains vertical synchronization with your displays refresh rate? (That could, and likely would explain your 60fps)
camera following a racing car
SuperVGA replied to sobeit's topic in General and Gameplay ProgrammingIf 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.
[C++] Curious problem with rand()
SuperVGA replied to SeeForever's topic in General and Gameplay ProgrammingWhat 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.
Eclipse: How do you start stepping into/over like how Visual Studio does it in C++?
SuperVGA replied to tom_mai78101's topic in For Beginners's ForumI 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.... :(
Mushroom House
SuperVGA replied to Ral04's topic in Your AnnouncementsHaving 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... :)
[C++] Curious problem with rand()
SuperVGA replied to SeeForever's topic in General and Gameplay ProgrammingOften, 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 is really sweet - I use it a lot.)
- Advertisement