UNLIMITED textures in your Shaders! (OpenGL tutorial)

  Рет қаралды 6,393

Low Level Game Dev

Low Level Game Dev

6 ай бұрын

In this video, I teach you how to use bindless textures in OpenGL. A technique that allows you to have as many textures in your shader programs as you want.
Graphics Hardware checker: opengl.gpuinfo.org/listextens...
BIndless Textures: www.khronos.org/opengl/wiki/B...
More useful OpenGL resources on my Discord!
/ discord
Wishlist Midnight Arrow:
store.steampowered.com/app/23...
Join this channel if you want to support me 😻:
/ @lowlevelgamedev9330
#cpp #opengl #computergraphics #programming
Music: Evan King - Let's Go!
/ contextsensitive
contextsensitive.bandcamp.com/

Пікірлер: 31
@GGodis
@GGodis 6 ай бұрын
Thank you for a really interesting and clear tutorial! Can't wait to see more.
@lowlevelgamedev9330
@lowlevelgamedev9330 6 ай бұрын
thank you 💪 there will be more tutorials whenever I find interesting stuff like this
@wjrasmussen666
@wjrasmussen666 6 ай бұрын
I guess I won't be watching at 2x
@lowlevelgamedev9330
@lowlevelgamedev9330 6 ай бұрын
😂😂😂😂 yeah bro that's my slow speed btw
@wraser
@wraser 6 ай бұрын
😂
@JtagSheep
@JtagSheep 3 ай бұрын
If you dont care about having to bind textures and dont care about supporting old OpenGL version then you can just use new GL calls like glCreateTextures(GL_TEXTURE_2D, 1, &texId); and glBindTextureUnit(slot, texId); Still giving you tons of textures since you choose what is bound when.
@Finding_Fortune
@Finding_Fortune 6 ай бұрын
Cool! I suppose the advantage of this over say a 2D texture array, is that all of the textures could be any size versus a texture array only handles textures of one size?
@lowlevelgamedev9330
@lowlevelgamedev9330 6 ай бұрын
yes precisely + for textures arrays I think you need to recreate the array to add a new texture to it
@KropedStudio
@KropedStudio 5 ай бұрын
ejj we meet again xD
@Finding_Fortune
@Finding_Fortune 5 ай бұрын
lol@@KropedStudio
@smugtomato5972
@smugtomato5972 4 ай бұрын
@@lowlevelgamedev9330 No, you can just add data to the buffer with glTexSubImage3D. Assuming you've allocated enough space for your texture array in the first place of course
@PaulSpades
@PaulSpades Ай бұрын
That's nice and all, but the GPU still has a limited number of TMUs, maybe 8, maybe 256. You are limited to that number, for each draw call, not because openGL wants to limit you, but because that's what the physical hardware is. Second, if you bypass the binding, you don't get access to the most compute intensive function the GPU (at least in games), which the TMU does - the filtered sampling. Bindless textures was a technique developed for feeding compute shaders(or all unified shaders) with arbitrary data. That's what you should use it for. If you want more textures than your player has texture unit hardware, you simply use more shader programs with different texture sets. Game engines typically bundle shader porgrams+textures as a data structure called a material.
@lowlevelgamedev9330
@lowlevelgamedev9330 Ай бұрын
this is kinda of a bold claim so I will have to investigate, as far as I know bindless is the modern way to go and for example ID7 engine switched from its mega texture from ID6 (and that thing is not easy to implement) and now they go with a fully deferred material system that uses bindless textures. But I don't use bindless to acces more textures but to be able to draw more without having to bind a different uniform each time, so maybe the title is missleading
@tokyospliff
@tokyospliff Ай бұрын
Great video man. Why are the handles uvec2 in the fragment shader?
@lowlevelgamedev9330
@lowlevelgamedev9330 Ай бұрын
good question, the handle needs to be an unsigned 64 bit int, to acces the texture, however you can't have 64 bit numbers without another extension, so this extension allows you to use a uvec2 aka 2 32 bit ints to use as one 64 bit number
@tokyospliff
@tokyospliff Ай бұрын
@@lowlevelgamedev9330 Nice, makes sense, I thought it might be something like that, very handy.
@tokyospliff
@tokyospliff Ай бұрын
@@lowlevelgamedev9330 is the array of handles bound with glBindBufferBase and GL_SHADER_STORAGE_BUFFER?
@jeyko666
@jeyko666 4 ай бұрын
The description of residency and nonresidency is wrong. You are not loading anything from memory. You are telling OpenGL driver how to do low level synchronization, same way you do by binding to units.
@lowlevelgamedev9330
@lowlevelgamedev9330 4 ай бұрын
thanks I didn't know that, I have to look into it
@TSD_Finance
@TSD_Finance 6 ай бұрын
how much harder is Vulkan then OpenGL? Do most things still apply?
@lowlevelgamedev9330
@lowlevelgamedev9330 6 ай бұрын
it is much much more difficult. But yes all graphics apis are very similar and you also have something equivalent in vulkan
@tokyospliff
@tokyospliff 5 ай бұрын
Ridiculously more difficult, but I do recommend spending 6 months to a year in Vulkan. It forces you to structure things and interact with the GPU efficently and when you return to OpenGL you will be writing much better code because of it.
@kocode13
@kocode13 4 ай бұрын
THANK YOU SO FUCKING MUCH I LOVE YOU
@lowlevelgamedev9330
@lowlevelgamedev9330 4 ай бұрын
glad you found it helpfull 💪💪
@LUN-bo2fb
@LUN-bo2fb 2 ай бұрын
I used it in my research of image synth in 2018. one of the best extension in OpenGL. note that mobile does not support this.
@samma-pixelstudio
@samma-pixelstudio 6 ай бұрын
what so why my game engine has unlimited texture storage (i tink it is cus i'm using a custom texture implementation)
@lowlevelgamedev9330
@lowlevelgamedev9330 6 ай бұрын
because they do something like this. Also it is possible to have unlimited textures without this, but not use all of them at the same time
@jmelon00
@jmelon00 6 ай бұрын
Any ways on DirectX?
@lowlevelgamedev9330
@lowlevelgamedev9330 6 ай бұрын
yes, I don't know dorectx but there should be one for directx also, I think bindless resources are available starting with directx12
@InfiniteCoder01
@InfiniteCoder01 6 ай бұрын
Actually, VRAM is probably for Video RAM, not for Virtual memory here
@lowlevelgamedev9330
@lowlevelgamedev9330 6 ай бұрын
wait did I say Virtual memory? sorry for that 😅
How to Implement Caustics in OpenGL
5:28
Low Level Game Dev
Рет қаралды 3,1 М.
All OpenGL Effects!
30:21
Low Level Game Dev
Рет қаралды 53 М.
ISSEI funny story😂😂😂Strange World | Pink with inoCat
00:36
ISSEI / いっせい
Рет қаралды 27 МЛН
Teenagers Show Kindness by Repairing Grandmother's Old Fence #shorts
00:37
Fabiosa Best Lifehacks
Рет қаралды 36 МЛН
How did CatNap end up in Luca cartoon?🙀
00:16
LOL
Рет қаралды 6 МЛН
Көтіңді қысып, ауылға қайт! | АСАУ | 2 серия
33:16
When Optimisations Work, But for the Wrong Reasons
22:19
SimonDev
Рет қаралды 767 М.
Make your first Multi-Player Game NOW! + DISCORD GAMEJAM CHALLENGE
15:11
Low Level Game Dev
Рет қаралды 4,5 М.
How Much Money Did my Steam Game Make?
5:50
Low Level Game Dev
Рет қаралды 11 М.
Greedy Mesher going BRRRR
1:26
ForceofPhoenix
Рет қаралды 1,7 М.
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 889 М.
Good API Design (C++ or any other language)
8:02
Low Level Game Dev
Рет қаралды 5 М.
How to start Gamedev in C++
5:58
Low Level Game Dev
Рет қаралды 15 М.
Making Minecraft, but the server can have UNLIMITED threads (almost)
6:04
Low Level Game Dev
Рет қаралды 20 М.
Ray Marching, and making 3D Worlds with Math
6:28
SimonDev
Рет қаралды 230 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 445 М.
ISSEI funny story😂😂😂Strange World | Pink with inoCat
00:36
ISSEI / いっせい
Рет қаралды 27 МЛН