Тёмный

A Quick, Easy and Extendable OpenGL Renderer in 250 LOC! 

VoxelRifts (PixelRifts)
Подписаться 16 тыс.
Просмотров 9 тыс.
50% 1

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@DylanFalconer
@DylanFalconer Год назад
Nice, I have been using something similar myself for quite a while, but with quad rendering as the atom. Nice tip about the EBO not being worth it in these cases - I'll be using that info :)
@springogeek
@springogeek Год назад
I don't think that the EBO tip is entirely accurate. It makes sense if you have very little vertex data, but once you start adding texture coordinates, texture ids, colors, the vertex reuse saves data on quads for sure.
@enriquedelacal2814
@enriquedelacal2814 15 дней назад
@@springogeek yea idk where he got that from, itd be nice if he clarified
@torphedo6286
@torphedo6286 Год назад
This is pretty cool! I'll consider using this if I do more 2D rendering in the future. It's a little too barebones for my 3D needs (I'm trying to support GLTF loading), but this is perfect for a 2D game.
@Maxjoker98
@Maxjoker98 3 месяца назад
Nice video, I've used completely custom "game engines" for game jams etc. before, but mostly for 2D stuff. However, the way you handle textures is very OpenGl 2. In more modern OpenGL you can use TEXTURE_2D_ARRAY: It is basically what you've manually implemented, you just give it 3 indices when sampling. (u, v, and "texture id" aka "layer" or "w"). I think it's an OpenGL 3 feature, might be 3.3, either way WebGL2 supports it :)
@BiskitSlippers
@BiskitSlippers Год назад
Thank you for taking the time to make these videos! I think I understand the concept of a memory arena - I like to think of it as a stage where the memory lives for a certain amount of time. What I don't understand is how do you load specific data into them? Do you just use void pointers everywhere and cast them whenever you need to use them? I think I am on the edge of fully understanding this but I'm not there yet.
@voxelrifts
@voxelrifts Год назад
Yeah, I implement them as linear allocators, holding an offset of where the next allocation will go with respect to a base pointer. If you haven't seen it already, I made a video about arenas that goes indepth into the semantics of it all (as you said, the allocations living a certain amount of time)
@JacobElliottSermons
@JacobElliottSermons 2 месяца назад
I think I am grasping what you are doing. I am wanting to develop a 3D renderer. This seems to be extendable to the 3D world but I think I will need to study it and make sure. Do you think the concepts work and are transferable? It seems to me but need to think on it further.
@yogxoth1959
@yogxoth1959 Год назад
Thanks a lot for this video. It’s very helpful since I’m learning OpenGL right now. But I’m wondering why you aren’t using the GL types, like GLuint? What are those u32 types?
@voxelrifts
@voxelrifts Год назад
they are typedef-ed to the same thing. the u prefix stands for unsigned, the i prefix is for signed, the f prefix stands for floating point. the number stands for how many bits the type takes up. Only reason for using those is shorter type names. (Also since I'm doing opengl function loading myself, I'd have to typedef GL types myself so It isn't really great)
@torphedo6286
@torphedo6286 Год назад
GLuint is just a 32-bit int anyway, so it's the same thing. I typedef'd them to "gl_id" in my codebase to shorten the name, but "u32" works too.
@anon_y_mousse
@anon_y_mousse Год назад
This is a good idea, but I think it should be written more portably. Something that might help is if you download a copy of MingW or CygWin. When I was still using Windows, they made it a lot easier to target POSIX as a platform, and both include a port of bash. For getting input, you might consider using SDL, and for simple GUI construction consider GTK. I think I'm going to see what it takes to port this by getting your tetris clone working.
@voxelrifts
@voxelrifts Год назад
Oh definitely. The main point of the repository was JUST the renderer c file. The rest of the scaffolding was just my codebase which I'm in the process of making more cross platform at the moment.
@torphedo6286
@torphedo6286 Год назад
GLFW also works and can get you both the rendering and input. I've been using that with CMake, and my code is portable to MinGW, MSVC, and GCC on Linux
@anon_y_mousse
@anon_y_mousse Год назад
@@torphedo6286 Yep, another excellent choice.
@LainIrukawa
@LainIrukawa 8 месяцев назад
i like the colorscheme and font , names ?
@voxelrifts
@voxelrifts 8 месяцев назад
Font is inconsolata, the colorscheme is Ryan fleury's which is modified from the theme Casey uses for handmade hero. I don't think it has a name.
@asherhaun
@asherhaun Год назад
things look to have improved since azurite :D
@voxelrifts
@voxelrifts Год назад
Improved AND simplified a lot indeed!
@Shadowblitz16
@Shadowblitz16 Год назад
How would I use render textures?
@voxelrifts
@voxelrifts Год назад
What do you mean by render textures? I cover rendering simple textures in the video
@Shadowblitz16
@Shadowblitz16 Год назад
@@voxelrifts like rendering a texture onto a texture
@voxelrifts
@voxelrifts Год назад
@@Shadowblitz16 That's something you would want to use a framebuffer for separately. That's not something the renderer itself is concerned with. You make a separate framebuffer with a texture attachment. If you want to render to the framebuffer, bind the framebuffer then use the renderer like normal (begin frame, push geometry, end frame) then swap over to the screen framebuffer and use the renderer again to render the framebuffer texture
Далее
Arenas, strings and Scuffed Templates in C
12:28
Просмотров 89 тыс.
Harder Than It Seems? 5 Minute Timer in C++
20:10
Просмотров 181 тыс.
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 719 тыс.
My 2 Year Journey of Learning C, in 9 minutes
8:42
Просмотров 626 тыс.
I Optimised My Game Engine Up To 12000 FPS
11:58
Просмотров 699 тыс.