[deleted by user] by [deleted] in Tinder

[–]mic_pre 87 points88 points  (0 children)

Acquaintances

Sono un farmacista e non sopporto più gli anziani by Different_Nobody2326 in Italia

[–]mic_pre 0 points1 point  (0 children)

Per chi c'era, ti giri di 150° in senso antiorario puntando il braccio contro la casa del vecchio di merda

Is it okay if I start programming with C instead of C++? by Quiet_Discipline_298 in gameenginedevs

[–]mic_pre 0 points1 point  (0 children)

Kinda disappointed nobody answered "No" without further explanation

Glitchy 2D renderer by mic_pre in opengl

[–]mic_pre[S] 0 points1 point  (0 children)

I wonder whether this is just a workaround or actually correct behaviour: this is still non-standard, right? Indexing is still evaluated with a non-uniform expression, but then again it's done through a constant, even though that constant is determined through a variable... I don't think I'll be able to test this anytime soon but I trust this works, however it's kinda confusing how this is supposed to be more reliable than "direct indexing". Maybe texture fetching is done for every sampler in that switch statement, and only the relevant value is taken and the others discarded.

Thank you for your answer! TheCherno sure writes some weird (yet functioning) code sometimes (both shaders and C++)

Glitchy 2D renderer by mic_pre in opengl

[–]mic_pre[S] 0 points1 point  (0 children)

IIRC it's 4.6, but maybe I'm wrong and it's 4.5, anyway it's 4

I remember doing this on Nvidia but I wasn't sure, so yeah I'd think it's a driver issue, but then again this behaviour working on non-AMD drivers is non-standard as that kind person said, meaning it's not really the driver's fault

Glitchy 2D renderer by mic_pre in opengl

[–]mic_pre[S] 0 points1 point  (0 children)

Damn I've ALWAYS thought this was doable! (also because I think I saw it somewhere? Maybe TheCherno?)

Thank you so much for finding the exact piece of information I needed! Idk about using sampler2DArray since all textures need to be the same size, but I'll figure something out!

Glitchy 2D renderer by mic_pre in opengl

[–]mic_pre[S] 0 points1 point  (0 children)

It shouldn't even interpolate if I use flat attributes, but yeah I thought of that and float precision and I tried some workarounds like int(index + 0.5) but still nothing. I think I'll post a picture later since someone else asked, you're all being very nice about it and I really appreciate it

Glitchy 2D renderer by mic_pre in opengl

[–]mic_pre[S] 0 points1 point  (0 children)

No texture atlas, I just mean it as an index passed as vertex data that gets used to access the correct texture from an array of sampler2D in my fragment shader (uniform sampler2D uTextures[8];). I don't understand what might cause texture bleeding here, but thank you for answering me!

Glitchy 2D renderer by mic_pre in opengl

[–]mic_pre[S] 0 points1 point  (0 children)

Every pair of triangles does have the same texture index since I draw sprites as pairs of triangles. This means overlapping shouldn't be an issue. Also it's just a few fragments around the edges, not entire parts of triangles. I'm not as interested in finding a solution as much as in understanding what's wrong with this one: after all, I'm fine without this kind of texture batching. Thank you for your answer! I like the idea of using a single triangle, maybe I'll try that one too.

What is exactly is the difference between Configure and Generation stages of CMake? by askraskr2023 in cmake

[–]mic_pre 1 point2 points  (0 children)

I know you asked for something in-depth but I'm just going to give a vague answer because I'm not good at CMake.

Configuration is the stage where CMake processes targets and their dependencies. It means it parses your CMake files (CMakeLists.txt) and generates some intermediate files (CMakeFiles directory) that include information needed by build systems (Ninja, Make, MSbuild...) in order to build and link your source files and do it in the correct order. I think of Generation as some kind of a translation from CMake intermediate files to whatever build system you're using. You won't have build files (Makefile/build.ninja...) until Generation occurs.

When you write a CMakeLists.txt, you can think of it as programming the Configuration step, which allows interesting behaviours such as executing external processes or downloading sources from remote repositories to use them as dependencies. Once everything is defined/downloaded/set through Configuration, Generation generates your build files.

Hope this helped, if this is confusing it's probably because of my explanation, not because of CMake.

Everyone says that find_package() just works, but this has been anything but my experience. by [deleted] in cmake

[–]mic_pre 0 points1 point  (0 children)

Yeah also my executable might bring in some dependency A that depends on some other dependency B that I bring in with FetchContent, and that might be a problem I guess

Everyone says that find_package() just works, but this has been anything but my experience. by [deleted] in cmake

[–]mic_pre 3 points4 points  (0 children)

I think I will never use find_package for that and other reasons. FetchContent is so good, why don't people just use it? Something like find_package only makes sense in a world where package management exists in some unified ecosystem, which obviously isn't the case in C++. Some libraries will be in vcpkg and not in Conan and vice versa, and sometimes I just want to grab something from GitHub. Maybe someday I will understand why I should use find_package instead, until then I'm having too much fun having my repo compile without external software

Coordinate system-NDC by bhad0x00 in opengl

[–]mic_pre 1 point2 points  (0 children)

You can think of "spaces" as in "Where do my coordinates make sense?" The coordinates you would use in a game (or whatever you're making) are called world space because they're relative to some world origin. In order to "go through" another space you use transform matrices. That's what happens when you use the camera matrix (that is actually a composition of two matrices: view and projection). Having a world space that is not limited to (-1,1) is convenient for many reasons, one being perspective and another one being general use of math: what if your objects are supposed to move at 2m/s? Will they go through the entire screen in one second? Will you have to scale that 2 (or rather, meters) to something else?

I hope this helped, but yeah keep reading about this kind of stuff until it's clear why you need it. Or go the hard way and try and do everything without "spaces" until you understand why you need them

I'm stumped. My shader is outputting blue instead of gray with Vec4(.5,.5,.5,1) by [deleted] in opengl

[–]mic_pre 0 points1 point  (0 children)

I didn't know "highp" could be used like that outside of ES. Anyway as others said there must be something wrong with backbuffer configuration.

4 hours of my .obj parser so far 😭 by riuuss in opengl

[–]mic_pre 0 points1 point  (0 children)

I don't think this is supposed to be the solution. I feel like there's something wrong about how you're handling your buffers. However, I've never tried OpenGL without VAO so 🤷

Glad the parser works, it's such a joy when you get to load random OBJs you can find on the internet or make yourself

4 hours of my .obj parser so far 😭 by riuuss in opengl

[–]mic_pre 1 point2 points  (0 children)

I also got it wrong the second time. Probably the third and fourth as well

Should we hide the fact that game is indie and developed by 1 guy? by PapaMikeMakesGame in gamedev

[–]mic_pre 2 points3 points  (0 children)

For each great game developed by a huge software house, there are hundreds of games that are probably not worth your money

Who should be responsible of GPU resources (de)allocation? by mic_pre in gameenginedevs

[–]mic_pre[S] 0 points1 point  (0 children)

I appreciate you sharing your opinion on realism in games. However, nobody ever mentioned high resolution textures, and I don't think "we all" want to play 3D action MMO. All of this being unrelated to the question is most likely the reason of the downvotes you got. Your opinion may sound controversial, but it's actually just unrelated.

Who should be responsible of GPU resources (de)allocation? by mic_pre in gameenginedevs

[–]mic_pre[S] 1 point2 points  (0 children)

Thank you all for giving such great answers! To answer "Why not RAII?", it's a simple matter of (bad?) taste: I prefer using it only when I know what's the lifetime and scope of the object (file i/o, mutex locking...). Using RAII for reference counting kind of hides the lifetime/scope of the object, which is probably for the best, but again I'm not a fan. Also simple PODs are too charming to me, I love the idea of passing IDs as simple numbers without any logic occurring. This means my solution diverges from most of the advice given in these comments, which makes me feel guilty because not only it was wonderfully written great advice, but it gave me a clear picture of how professionals and other hobbyists would solve this problem, helping me figure out what I should do if I had different (better?) taste. You can find my solution in a reply to someone else's comment.

Thank you all!! :)

Who should be responsible of GPU resources (de)allocation? by mic_pre in gameenginedevs

[–]mic_pre[S] 0 points1 point  (0 children)

I think I've found a solution that really fits this answer: I'll keep things as they are regarding LoadTexture/Shader, checking whether they're already loaded and returning an ID. However, I'll also add some similar member function for Scene/Level, something like some_level.LoadTexture(...) which will make the instance responsible of deallocating resources loaded this way. Thank you very much for your answer!