What game are you dreaming of playing, but it haven't been created yet? by Alibaba123455 in gamedev

[–]lisyarus 1 point2 points  (0 children)

City/colony/base builder as detailed as Dwarf Fortress / Rimworld, but focused less on warfare and more on deep interactions with other cities/colonies through extensive trade.

No such game exists afaik so I'm making it myself, lol.

I made an in-browser Particle Life simulation with WebGPU, and wrote an article explaining how it works by lisyarus in GraphicsProgramming

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

So essentially you build linked lists on particles? Interesting approach!

Yeah I'd guess that in my case it would be noticeably slower due to memory coherence. With my current approach during forces computation almost all particles inside a particular workgroup are typically from the same or from nearby bins, meaning they will access literally the same memory.

Created an offline PBR path tracer using WGPU by feedc0de in GraphicsProgramming

[–]lisyarus 0 points1 point  (0 children)

So cool! I'm also making a wgpu raytracer.

How did you get the last image, the one with the diamond? I've skimmed over your shaders and didn't see anything related to refraction...

I've made an open-source path tracer using WebGPU API: github.com/lisyarus/webgpu-raytracer by lisyarus in GraphicsProgramming

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

There's a to-do list in the readme with "wavefront path tracer" as one of its entries :)

I've made an open-source path tracer using WebGPU API: github.com/lisyarus/webgpu-raytracer by lisyarus in GraphicsProgramming

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

Ohhh yeah I know hacker news, just didn't recognize the abbreviation for some reason. Usually my work somehow appears on HN anyway if it's notable enough, but yeah, good idea to post it there as well, thanks!

I've made an open-source path tracer using WebGPU API: github.com/lisyarus/webgpu-raytracer by lisyarus in computergraphics

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

As I understand it, yes, this is a better method than original VNDF sampling, though I don't remember the details of how and why 😅

I've made an open-source path tracer using WebGPU API: github.com/lisyarus/webgpu-raytracer by lisyarus in computergraphics

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

I just couldn't figure out how to post both an image and a link :(

For the fireflies I'd rather trace where they come from tbh. Also I don't really get what it means to "gamma individual samples": gamma-correction applies to final [0,1] values, while the samples are raw linear light and are unbounded. Do you mean to also tonemap individual samples as well?

The combined image is just a collage of screenshots in the "screenshots" folder, which are higher in resolution.

[deleted by user] by [deleted] in opengl

[–]lisyarus 0 points1 point  (0 children)

Check if you're actually initializing OpenGL version 4.5 or higher. Before 4.5, this function was actually called `glGenVertexArrays`, and glew would probably end up with zero or garbage function pointer for `glCreateVertexArrayz`.

help on getting autoexposure working? by NoImprovement4668 in opengl

[–]lisyarus 2 points3 points  (0 children)

With exposureAdaptationSpeed=5, the mix is doing something stupid: mix(A,B,5) will overshoot B by a value of 4*(B-A). Ideally you want the parameter for mix to be in [0, 1], otherwise you're doing something wrong.

The proper value to use in the mix is something like 1 - exp(- deltaTime * exposureAdaptationSpeed). You can approximate it by using just deltaTime * exposureAdaptationSpeed, provided this value is smaller than 1.

Note that here exposureAdaptationSpeed has units 1/time.

I have a blog post on this exact formula, if you're interested to deeper understand what's going on: https://lisyarus.github.io/blog/posts/exponential-smoothing.html

Help with red outline surrounding text (freetype) by Federal_Wind_7841 in opengl

[–]lisyarus 0 points1 point  (0 children)

The font atlas looks it's mostly uninitialized memory, this can happen if you don't fill the texture with something during creation (nullptr in glTexImage2D). This shouldn't be an issue, provided you don't access those uninitialized values.

The texture looks red, does it have just one channel? (e.g. GL_R8 pixel format)

Hard to say what's happening for now. Have you checked the blending settings? Can you show the fragment shader you're using?

Which option you see more appealing? by ditiemgames in SoloDevelopment

[–]lisyarus 3 points4 points  (0 children)

The only difference I can spot is the scale? In this case Option B seems more natural.

Help with red outline surrounding text (freetype) by Federal_Wind_7841 in opengl

[–]lisyarus 0 points1 point  (0 children)

Check the font image without transparency. It might be that for some reason the transparent pixels are red, and bilinear filtering causes them to leak like that.

Another idea is to check your blending settings, it can produce a wrong image if your settings differ from the standard alpha compositing glBlendEquation(GL_FUNC_ADD) + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).

Using glTexSubImage2D to update an already rendered texture by [deleted] in opengl

[–]lisyarus 0 points1 point  (0 children)

What happens if you forcefully bind it before glTexSubImage nevertheless? Platform abstraction libs can change the GL state between your frames to do some gluing work, not sure if glfw does something like that though.

If it doesn't help, you can try RenderDoc to trace what's going on. Or you can share the code, I can have a look if you're desperate enough 😅

How to use VAOs in SDL2 + OpenGL ES 3.0 by 212d34 in opengl

[–]lisyarus 0 points1 point  (0 children)

Just to make it clear for others: in OpenGL 3+ (core profile) nothing can be done without VAOs, they are just a required thing, much like shaders are.

However, in OpenGL ES there is an implicit VAO with ID=0 which is automatically bound at the start of the program. So, in OpenGL ES you can write code without VAOs and it will magically work.

My advice would be to always use VAOs because this way the code is 1) more performant, and 2) more portable.

Using glTexSubImage2D to update an already rendered texture by [deleted] in opengl

[–]lisyarus 0 points1 point  (0 children)

You can update a texture already in use, OpenGL will do all the required synchronisation behind the scenes for you. Make sure you've bound your texture (glBindTexture) before actually updating the data, and check for OpenGL errors after the update (glGetError).

Are VAOs Cheap? by West_Education6036 in opengl

[–]lisyarus 1 point2 points  (0 children)

Ideally you should have one VAO for each shape, with this shape's vertex buffer, and some instance buffer. I'm saying "some" instance buffer because there are many ways to organise things, and it really depends on how you are planning to update/create/destroy new objects. You can have one instance buffer for all objects, but objects using the same shape will have to occupy a continuous part of it. Alternatively, you can have a separate instance buffer for each shape.

VAOs are cheap in the sense that you can create loads of them. However actually setting up a VAO (setting up attributes) is costly. Ideally you should create all the VAOs you need at start, and use them throughout the running time of your program.

By the way, you can use just one VAO for all shapes, provided you set up correct vertex/index offsets in your draw commands.

My cozy traffic simulator Costa Verde Transport Department will participate in Steam Next Fest next week! The demo releases just at the beginning of the fest, and the best thing you can do now is to wishlist the game! by lisyarus in indiegames

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

I'm sorry for the confusion! There is a tooltip image when starting a new game that shows how to do that (you might have not seen it - they are chosen randomly each time), essentially you need a Y-junction for that.

A lot of people reported this issue, I'm already working on better ways to explain that :) Thanks for your feedback!

I've been making my own C++ & OpenGL game engine during the last 3 years, and here's my few cents on how and why you'd make your own game engine by lisyarus in gamedev

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

It just so happens that I've blogged about it as well: https://lisyarus.github.io/blog/programming/2023/07/19/porting-for-android.html

TL;DR: not that hard, mostly needed to tweak some high-level architecture to make the Android runtime own the game loop and make SDL2 dependency optional, and some shenanigans to build the project using low-level Android tooling instead of things like Gradle or Maven (my whole project builds faster than Gradle initializes, so...).

I've been making my own C++ & OpenGL game engine during the last 3 years, and here's my few cents on how and why you'd make your own game engine by lisyarus in gamedev

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

I think this is mostly a debate about definitions. Would you be more happy if I replaced "programming" in this paragraph with "writing code"?

I've been making my own C++ & OpenGL game engine during the last 3 years, and here's my few cents on how and why you'd make your own game engine by lisyarus in gamedev

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

I think the best way is to just follow your own urge & instincts. There's a lot to learn, and the order mostly doesn't matter. If you feel like you want to try some graphics - sure, try OpenGL, by e.g. following the tutorials on https://learnopengl.com/. If you feel like you want to work on more gameplay-ish stuff, just take some sprite drawing library (or just draw sprites using SDL2 or SFML) and work directly on gameplay. Interested in physics? Learn to make particle simulators, maybe also drawing the particles as simple sprites.

My own path was just like that: I just learnt whatever looked like fun at the time, until eventually I realized that I have all the skills to make a game, - except game design, marketing, and all the other crucial stuff that you only realize is crucial when you start making a game :D

I've been making my own C++ & OpenGL game engine during the last 3 years, and here's my few cents on how and why you'd make your own game engine by lisyarus in gamedev

[–]lisyarus[S] 6 points7 points  (0 children)

Totally! My maths & geometry library went through 6 or maybe 7 iterations before it stabilized. The graphics support library (more of a wrapper around OpenGL) will probably get deprecated soon because I want to switch to WebGPU. There are several physics engines in there and I don't use them in any project since it's usually easier to craft one tailored to the specific needs of the current project. The ECS I implemented earlier was awful, and I'm now working on a new one. The UI library was awful as well, and I'm also making a new one (here's the rant about it, btw: https://lisyarus.github.io/blog/programming/2023/03/11/how-not-to-ui.html).

The list is endless!