[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1720927819249913.webm (2.51 MB, 1008x728)
2.51 MB
2.51 MB WEBM
/gedg/ Wiki: wiki.installgentoo.com/wiki/Gedg
IRC: irc.rizon.net #/g/gedg
Progress Day: rentry.org/gedg-jams
/gedg/ Compendium: rentry.org/gedg
/agdg/: >>>/vg/agdg

Requesting Help
-Problem Description: Clearly explain the issue you're facing, providing context and relevant background information.
-Relevant Code or Content: If applicable, include relevant code, configuration, or content related to your question. Use code tags

Previous:
>>101391816
>>
>>101432497
Hello everyone. Hope you are all productive today!
>>
File: z3er5xu2hscd1.jpg (87 KB, 696x767)
87 KB
87 KB JPG
This is the future of gaming.
>>
>>101432795
You too
>>
>>101432795
ty. same to you
>>
File: 1720460785667942.jpg (84 KB, 750x600)
84 KB
84 KB JPG
>>101432795
I slept late and wrote maybe 2 lines this morning and probably will only be able to write a few more this evening after working out.
>>
https://vkdoc.net/
>>
I'm still struggling to understand transparency:

>Alpha blending can be problematic in some cases:
>No depth writes, objects needs to be sorted by distance.

Why no depth write during the transparent pass? I first render opaque surface. Why can't I write depth when doing transparency if I order my transparency back to front?
Let's say I have triangle A and B (b is the further away).
I draw B, I do the blending with the background, I write into the depth buffer. A is drawn, blends with whats already in the framebuffer which is B, then replaces B in the framebuffer because it's depth is lower.
>>
File: Untitled.png (30 KB, 929x547)
30 KB
30 KB PNG
>>101435015
>Why no depth write during the transparent pass?
I'm not an expert at this topic, but isn't it because of intersecting/overlapping shapes?
>>
File: 1.png (357 KB, 1344x1400)
357 KB
357 KB PNG
Are there any game development studios that are not infested with liberal faggots? Even indie studios I have interviewed at were worse.
>>
>>101435324
Just suck it up and be a man
>>
>>101435324
Dude just work there and be the giga chad. My manager is a punk bitch and if he ever starts yelling at me I get up and start walking toward him like I'm going to hit him and he backs down.
>>
File: 1719872269905451.jpg (412 KB, 828x696)
412 KB
412 KB JPG
It's 2024 and we still don't have a better alternative to C++.
>>
File: a.webm (1.13 MB, 360x640)
1.13 MB
1.13 MB WEBM
>his engine doesn't have groyper support
>>
>>101436030
The better version has existed for decades.
>>
>>101435015
If you've correctly ordered everything, then the depth buffer is redundant, and there's no need for it to exist at all
If you haven't correctly ordered everything (which is the most likely case given situations like this >>101435189), writing to the depth buffer will give incorrect results
>>
>>101436030
You do, actually. It's called C3.
>>
File: 1717813463629291.webm (1.34 MB, 1920x1010)
1.34 MB
1.34 MB WEBM
After about a week of faffing about I got two monkeys on my screen. Next up is textures.
>>
>>101436030
Mojo whenever they open source it
>>
>>101436030
odin-lang.org
>>
i saw an UFO recently, now i know my game was a divine revelation and i must finish it because is the only way to save the world, btw... jews fear me because i'm the chudsen one.
>>
>>101432795
thank you!
>>
>>101435324
I heard Blizzard had cool office parties
>>
>>101438265
poetic, was your Dad named Terry by chance?
>>
>>101437166
>If you've correctly ordered everything, then the depth buffer is redundant,
Thanks, I'm feeling better now.
>If you haven't correctly ordered everything (which is the most likely case given situations like this
The thing is >>101435189 is impossible to deal with except with expensive techniques like depth peeling. And disabling the framebuffer so that transparent fragment that are drawn later can blend with front transparent fragments will give incorrect result (blending isn't commutative).
But perhaps disabling the depth buffer is better than nothing in case that case happens and transparent triangles/meshes intersect each other.
>>
>>101439461
>And disabling the framebuffer so that transparent fragment that are drawn later can blend with front transparent fragments will give incorrect result (blending isn't commutative).
Yes. This is why dithering is used instead of alpha blending. Typically you use alpha blending for stuff like particle effects where the incorrect blending order won't really make a difference
>>
Vulkanchads what are you doing today
>>
>>101439507
>Typically you use alpha blending for stuff like particle effects where the incorrect blending order won't really make a difference
You're reading my mind because that's exactly what got me confused in the first place:
I've been disabling depth writing + alpha blending for particles so far. And so I was thinking "well that must work the same for other transparency", hence why I was confused with all these research papers about ordering transparency and being able to do transparency without ordering (OIT) since from my pov, transparency was just a pass after opaque where you just disable depth buffer et voila. Thanks god I can keep doing it with particles.
>This is why dithering is used instead of alpha blending
The problem is that everytime I google about this, I find some 3D artist stuff where it's just dithering for objects that are close to the camera so they fade out properly.
But how do I do that for objects that are inherently transparent? If I have transparent object A in front of transparent object B, I apply this dithering algo and magically order doesn't matter, depth buffer is enabled and it works?
>>
>>101439585
You have a shader that takes the alpha value of the texture and turns it into a dithering pattern
The output pixel from a dithered object will always be 100% opaque or 100% transparent, so depth buffering works
>>
>>101439611
I see since there's no blending happening, we can use the depth buffer and no need to sort...
I can't believe it's that easy. I imagine that the shader will simply output more opaque pixels if the alpha is high... And so that's what video games do? 0 blending except for specific stuff like gpu particles.
>>
>>101439675
It's an artistic choice you have to make. Dithering doesn't look especially great if you apply it to semi-transparent materials like glass. Windows are usually alpha blended because they're convex, non-overlapping shapes so they can be sorted correctly. If you have a big complex structure made of a semi-transparent material then that presents a conundrum
>>
>>101439553
figuring out how to render a spline. you?
>>
>>101439732
Researching pipeline layouts
>>
>>101436030
it's called c#
>>
File: soylent.jpg (94 KB, 640x804)
94 KB
94 KB JPG
>>101435324
>not infiltrating and changing the values from within.
No wonder the west has fallen. Also, what are your skills?
>>
File: Nim.png (83 KB, 1280x1458)
83 KB
83 KB PNG
>>101436030
>>
>>101440020
Nim sucks and nobody will ever use it no matter how many times you post this image
>>
>>101440025
Man are you permanently online hating nim? Get a life and a better pl.
>>
>>101439553
Working on my editor.
Graphics-wise, everything is basically done.
>>
>>101440385
I wish there were tutorials that teach this on the internet: I'm terrible at C++ and design architecture.
Programming a simple engine that does basic thing (like you see on learnopengl) is fine. I understand the concepts and the algorithms. But if I want to tweak it easily (add objects, add a pass, do any basic modifications), it's a mess because it's spaghetti code. I don't even know how to use vs code to create an editor window. So I stick to imgui so far. But my architecture is just non existent so even adding one functionality on imgui is hell.
>>
>>101440526
You learn by doing and reading other's source codes.
>>
>>101440526
what I can suggest is writing your own immediate mode UI, if you have time for it. Unlike retained mode UI, its ez af. Once you understand how to draw multiple objects, it become even easier.
I'll write a step by step process to writing an Immediate mode UI. How you'll implement it is up to you.
1. First, all you gotta do is draw a rectangle and check if mouse pointer is within its drawn region and that's it. Input fields are a bit more complicated but you'll understand how to deal with then when you get to that point.
2. Now, draw multiple rectangles and check if the mouse pointer is within the appropriate rectangle's region.
3. Time to draw font. Its better to generate a bitmap of texture atlas and use it to display font over a quad. You first allocate memory for a blank texture depending on what resolution you want the texture to be. Then you can use something like freetype2 to get the font(glyph) data of ASCII characters and copy it into the texture you created earlier incrementally but you need to save the offset of where you copied the character into the texture. You'll need that to know what UV co-ordinates to use for display a character when drawing a quad.
4. Create an abstraction of "widgets" or whatever(there are several names for this. Some APIs use Views for the same thing) and create UI widgets like buttons using the rectangles and font you managed to create in the previous steps.
5. Here comes the important part. REFACTORING. Since you have the individual stuff present, gotta do a constant trial and error to figure out how these widgets should be interacted with. This also includes changing whatever you did in step 4 if need be.

Alright, this is as simple as I can put things.
>>
>>101441115
for step 3, you can take a look at my library that I wrote a while back for reference. It does exactly this and its in C++
https://github.com/FullGardenStudent/ft_to_atlas/blob/main/ft_to_atlas.cc
>>
>>101432497
could somebody please post links to good quality (non-gay non-normie) blogs or sites that extensively write about game design and development? the more obscure the better
>>
File: woot.png (207 KB, 1048x799)
207 KB
207 KB PNG
Ok. I'm a silly person and I need aid.

I am making a scene query subsystem. I have my rays, array inversion, and so on. Now I am puzzled about something.

From what I understand - a perspective projection matrix converts vertices from the world space into the NDC of the chosen graphics API. Vulkan in my case. Thus - if I multiply a point by an inverted perspective projection I should get my point back. Yet - I don't.

Mind you - what I do does work - after all I am getting pic rel.

contd.
>>
File: transf.png (42 KB, 844x577)
42 KB
42 KB PNG
>>101441173
Pic rel - how I construct my matrix. If I multiply a ( 500, 500, 1250 ) point through it, I don't get anything within the Vulkan NDC. I get something like ( 570, -570, 1400 ) or some such. I'd expect something like ( 0.4, -0.4, 1.0 ).

What am I missing here?

Note - my world Y axis is reversed to vulkan Y axis, whence the minus sign in the matrix.
>>
File: my-eyes.gif (650 KB, 360x244)
650 KB
650 KB GIF
>>101441206
>>
>>101441148
how can an indian not be a jeet
>>
>>101441173
There's some complicated math behind this, it's not as simple as just multiplying it by the inverse, you should be able to find a guide on it by googling
>>
>>101441231
idk. you tell me.
>>
>>101441115
I forgot to mention this. Don't perform any REFACTORING at all until you reached step 5. Focus on somehow implementing the necessary stuff till then. Don't start cleaning up your code whenever you write a line or two. Forget about it. It can wait till you get get your shit together. What it'll do is only waste your time and divert you from getting shit done.
>>
>>101441206
Didn’t read all but did you take into account that the projection matrix alone doesn’t send your vertex to NDC directly: there’s the perspective division done automatically by the api
>>
I've accepted that making an engine is not my forte and I will be switching to something like godot or unity.
>>
>>101437670
hahah blender monke
>>
>>101441655
filtered
>>
>>101440025
This desu
>>
>>101441655
I'm currently copying a feature I saw in Unity into my engine. I will never go back.
>>
>>101442131
That's because you knew already about unity. It's better to start with a third party engine before doing your own so you have a clear idea of how things work.
>>
>>101441655
maybe you should have tried making a game instead of an engine.
>>
>In the late 1960s, Edsger W. Dijkstra wrote a pair of now-famous papers that helped make this much clearer: Go to statement considered harmful, and Notes on structured programming. [...]And now that Dijkstra understood the problem, he was able to solve it. Here's his revolutionary proposal: we should stop thinking of if/loops/function calls as shorthands for goto, but rather as fundamental primitives in their own rights – and we should remove goto entirely from our languages. From here in 2018, this seems obvious enough. But have you seen how programmers react when you try to take away their toys because they're not smart enough to use them safely? Yeah, some things never change. In 1969, this proposal was incredibly controversial. Donald Knuth defended goto. People who had become experts on writing code with goto quite reasonably resented having to basically learn how to program again in order to express their ideas using the newer, more constraining constructs. And of course it required building a whole new set of languages.
>>
Just what kind of games are you guise making that you need to build your own engine and that current off the shelves engines can't offer?



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.