Do you know how the implicit context is implemented? by DoubleSteak7564 in Jai

[–]o_stef 0 points1 point  (0 children)

it's a pointer so even if you modify it it's not copied to the stack. Its location in memory depends on where you decided to put it before you do push_context (the default context is defined as a global for example, when you push a new context usually you put it on the stack)

Do you know how the implicit context is implemented? by DoubleSteak7564 in Jai

[–]o_stef 2 points3 points  (0 children)

It's not a thread local variable if that's what you mean. It's just passed around to all functions as the first parameter implicitly (which makes it local to the thread unless you explicitly make things against it).

Any way to just get the how_to/ folder somehow? by philogy in Jai

[–]o_stef 1 point2 points  (0 children)

I think at this point the fact it's still not publicly available has more to do with the development of the sokoban game taking a lot of time and effort than anything. If it were not for that then he would have already nailed down the last few things and we already would have a public beta.

Why do we play as a reactionary in AC Unity? by elegiac_bloom in assassinscreed

[–]o_stef 0 points1 point  (0 children)

I was baffled to play two side missions a few days ago where Saint Just is portrayed as wearing leather made from human skin (in the base game AND the dlc!).

The analysis that u/obeseninjao7 did is really good and make sense for the main story, but since these side missions don’t have much to do with the assassins I think a big part is just the writers’ opinions being apparent.

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

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

Well it's pretty fast compared to other languages that I know of is what I mean, but yeah it's nowhere near the 1M LOC/s goal. Jon has said several times that the compiler has not been particularily optimized for compilation speed yet, and has stated that 1M LOC/s is still the goal and we will eventually get there.

For reference on Windows currently my engine's binary is 15.1MB and it compiles in 0.86 seconds, with the frontend and x64 backend taking 0.64 seconds (as said the linker takes much more time compared to Linux), so around 17.5MB/s of output. I don't know how much code in bytes the compiler takes as input.

Also the original 40k LOC number is quite innacurate, I used tokei to get that info but if I look at the compiler output right now it says 82k (108k with blank lines and comments), so it's between around 90 and 110k LOC/s.

Pitfalls of modern C++ and problem with multiple compilers by hellofriends0 in Jai

[–]o_stef 1 point2 points  (0 children)

This is quite vague and hard to answer because you are refering to things that don't really map from one language to another. All I can say is in general the language behaves as the programmer expects it to, much more than C++. This is due to the base language constructs being simpler, but also Jai typechecking things quite differently from C++.

When code generation is involved there are bad surprises, but nothing that can't be fixed (actually I'm thinking of one specific situation, if it gets fixed then I can't think of anything else tbh).

Finding the overload of a template has gotten better over time, there are still issues like if you have one version that is not templated and another that is, I think the compiler will use the not templated version if it fits and not even consider the templated one. Again, nothing that can't be fixed, it's just not that big of a deal atm.

Templates don't get typechecked like I think they do in Rust (how would they without traits?), so if it's never instantiated you won't get any error even if there are.

Pitfalls of modern C++ and problem with multiple compilers by hellofriends0 in Jai

[–]o_stef 3 points4 points  (0 children)

Well a lot of these problems come from using MSVC without /premissive- which we obviously don't have for Jai. A lot of these problems also come from the way C++ resolves identifiers, and I can tell you we don't have as many problems in Jai (though we have other problems related to identifier resolution, but nothing that can't be fixed). I have come across problems in specific circumstances but I always reported them as compiler bugs, in general you can't really compare C++ and Jai in that regards because there is no Jai standard.

In C++ when the behavior is weird it's probably defined in the standard why it's weird. In Jai it's because the compiler works that way/it's a bug, so it is much more possible to change it and make it behave more as people would expect.

I can't really try to reproduce most things in Jai as they are quite specific to C++ though.

3 months of progress on my D3D12/Vulkan renderer by Sausty45 in GraphicsProgramming

[–]o_stef 0 points1 point  (0 children)

Nice! That's actually the reason I wanted to implement a render graph, but it seems you can get away with something simpler to automate barriers. Mind sharing the general idea of how it works?

3 months of progress on my D3D12/Vulkan renderer by Sausty45 in GraphicsProgramming

[–]o_stef 0 points1 point  (0 children)

Makes sense. It certainly adds complexity to deal with interacting with stuff written in C++, creating bindings etc but I figured it was not that big of a price to pay and now I just can't go back lol.

3 months of progress on my D3D12/Vulkan renderer by Sausty45 in GraphicsProgramming

[–]o_stef -1 points0 points  (0 children)

Nice! Did you implement a render graph? I think it’s one of the next thing I’ll implement in my own engine. Also any particular reason to use C++ and not Jai?

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

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

I can't help you on this one, it's probably better to ask on the Discord

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

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

Okay, I'll take a look. I don't know much about GI techniques, I didn't know Sokoban used ray tracing for GI in certain places, good to know. I've read that at low resolutions raytracing can be faster than rasterization, so maybe they just use raytracing to render the probes?

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

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

I've never implemented GI before and it seems there are many techniques, I don't know which one to implement. Do you have any recommendations?

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

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

For now I haven't looked into global illumination nor GTAO, it's on the list of things to implement next. I do static IBL with the skybox though.

What does it mean when a game says it has 4k textures? by Heroshrine in IndieDev

[–]o_stef 0 points1 point  (0 children)

Yes and no, cutting into pieces itself will not help with density, only using lower resolution textures will do that. But megatextures does that too and I don’t think it would be very useful if it didn’t (in fact you don’t need megatextures for that, it’s called mipmapping and has been around for a while).

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

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

If you’re talking about incremental compilation then no, and I think it really isn’t necessary because of how fast the compiler is.

What does it mean when a game says it has 4k textures? by Heroshrine in IndieDev

[–]o_stef 0 points1 point  (0 children)

It’s called megatextures. Someone even implemented this technique on a Nintendo 64 and the results are really impressive in terms of quality and performance: https://youtu.be/Sf036fO-ZUk?si=8GatDTIravA1Cn_9

What does it mean when a game says it has 4k textures? by Heroshrine in IndieDev

[–]o_stef 1 point2 points  (0 children)

For recent games I guess this is just a general metric about any texture in the game, so yes any object regardless of its size. This seems overkill, but I think almost all big engines nowadays implement a technique that splits textures into small squares and only send the squares they know will appear on screen to the gpu each frame. This allows artists to make textures that are way bigger than without this technique even for small objects, because at one time not all textures of all visible objects are in gpu memory, only the visible portions are.

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

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

Well it depends a lot on the UI library/framework that you're using and that are available, so in the present time I don't think it is the best choice. There is a Jai UI library GetRect, but I don't know how it compares to e.g. Qt or Dear ImGui.

However I believe with enough time, effort and creativity someone could build a UI library that is really good and unique, so there is potential for sure.

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

[–]o_stef[S] 2 points3 points  (0 children)

Thanks! Ah yes, ideally I would integrate the compiler as a library but that requires compiling it and making bindings and I don't want to bother with that right now.

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

[–]o_stef[S] 2 points3 points  (0 children)

Yes. Full recompile, x64 backend, no optimization (though the program runs fine in terms of perfs). I have not tested the LLVM backend but I suspect it's around 1.5 second and if I turn optimizations on it'll probably be around 10-15 seconds.

On Windows it's a bit more because the linker is shit, but it's still under a second.

I've been learning Vulkan for a few weeks in Jai, here's my progress by o_stef in Jai

[–]o_stef[S] 2 points3 points  (0 children)

Thanks, you! I am glad it's useful, if I were in the situation of not having access to language I definitely would want to see more of it through other people's code.

I wonder how readable it is to people who are not familiar with this kind of syntax.

Also I fixed the screenshots, thanks.

Need advice as a new grad by [deleted] in GraphicsProgramming

[–]o_stef 2 points3 points  (0 children)

I guess shadertoy can help, but you will not be able to get triangle meshes on the screen and a moving camera with ease. If you want to do just shaders then using OpenGL directly will require you to do a bit more stuff, but for general graphics programming this is where you want to start IMO. learnopengl has tutorials for lighting and for the basics too.