Just finished watching the old OpenGL videos, I must admit, the quality and video editing has drastically improved.
@Doylgaafs94 жыл бұрын
Hey, what is up the Cherno? We want "Hey, what is up guys" back!
@JayAnAm4 жыл бұрын
Thx a lot, this helped a lot on my Blender addons, just had to change the built-in shader (2D_COLOR) to custom shaders (vertex and fragment) and dynamically change the position and color of my vertices to draw a custom textbox with background, text and outlines in one batch!
@lephobix2 жыл бұрын
You taught me how to love OpenGL! Thanks for all the high quality content😄
@3Descape4 жыл бұрын
Really liking the new, more focused videos! Keep it up, really great work you are doing here!
@oblivionronin4 жыл бұрын
Looking at this after watching the whole series (awesome work btw) The reason we have indices buffers in the first place is to avoid being wastefull with memory. Woudl it be possible and not better to create some sort atlas of colors we need for our next render and use the generated indices of that atlas to pass color in the vertex buffer instead of copy-pasting colors mutliple time as shown @ 5:15 ? I also understand this video is made to be simple. So my question is more is that possible ?
@nevergarden52252 жыл бұрын
Shoutout to my Ukrainian fans here with these colors 7:19 🥺
@Schnief2 жыл бұрын
Yeah, that aged well
@bluesillybeard2 жыл бұрын
Hey, that was the solution I was thinking of! GLSL layouts ftw!
@colinmaharaj2 жыл бұрын
7:17 Shout out to the python weirdos you mean 😆
@juliancruz19274 жыл бұрын
Amazing video. Can you please make a group of videos about GPU profiling and Debugging? That would be amazing. Thanks in advance!
@RadicDotkey4 жыл бұрын
Hi. I'm trying to implement Signed Distance Field fonts with batching, but I stumbled across one issue. When I draw a wide shadow underneath each letter using SDF shader the shadow overlaps the letters drawn previously. Do you know any way around it apart from drawing twice or creating an intermediary render buffer? If so, could you adress it in your video? The overall SDF subject is a good material for a video, with its strenghts and disadvantages in my opinion.
@mjthebest72942 жыл бұрын
Nice Ukraine colors! :)
@anilkumarsingh32414 жыл бұрын
So, does batch rendering always come at the cost of more data on cpu(like colors in this one per vertex and duplicate vertices in the previous one)? For example, in case of rendering multiple copies of assets with millions of vertices at different location with different optical properties, can't rendering be batched without having to duplicate all the vertex data?
@sam_is_people11702 жыл бұрын
thanks!!
@fredhair4 жыл бұрын
Well this is good if you want each vertex a different color however in the video both quads are the same color at each vertex. If you are looking to do a single color as shown in the video I would personally avoid sending so much data through the pipeline unnecessarily. Just send the data once and use the glVertexAttribDivisor function to specify that this color will be the same for each triangle (or 6 vertices if you know you'll only want quads). If you don't want any alpha blending also you could just send a vec3 to save sending more data.
@TheCherno4 жыл бұрын
Yep, that's definitely a valid approach as well. I'll probably address this in a future video, I wanted to keep things simple here.
@fredhair4 жыл бұрын
@@TheCherno That makes sense, I like being able to specify individual vertex colors and transparency as it can lead to some nice effects.
@lukassoo4 жыл бұрын
Valid approach but not possible on an older device that supports only OpenGL ES 2 meaning glVertexAttribDivisor does not exist yet. For normal OpenGL programming these days it's probably never going to be a problem with new hardware but in my case i have to use the simplest way like in the video or upgrade.
@richardlighthouse53284 жыл бұрын
Using vec3 or vec4 for color is worse than using integer for color. vec3 has 3 floats, one float is 4 bytes so 12 bytes. whereas using integer only uses 4 bytes. Huge improvement. Sparky game engine series included how to do that.
@fredhair4 жыл бұрын
@@richardlighthouse5328 That's true, I've done that in my recent projects as its rare you actually need that many different colors! 8-bits per channel is plenty.
@harei64403 жыл бұрын
I'm your Ukrainian fan, thanks for the colors and for cool videos
@__gadonk__2 ай бұрын
hope you're doing fine man
@dekrain4 жыл бұрын
Hi! What would you recommend for implementing flat shading? (i.e. store one attribute per face, not vertex)
@dustinhollar97104 жыл бұрын
For flat shading, you would probably continue to use the {position, color} attributes per vertex, but add another attribute for normals. Your Vertex representation might then look like: {position, normal, color}. Now what gets you the flat shading look is by using face normals rather than vertex normals, so three vertices of a single triangle will have the same normal.
@Neran2804 жыл бұрын
Do your lighting calculation in the vertex shader and pass the computed color as flat out param to the fragment shader. flat means that after rasterizing you will not get interpolated colors but the same per triangle. in the fragment shader just set gl_color to the color.
@BlockAssault4 жыл бұрын
Hey, could you do a video on texture atlas and use them in batch rendering, and then lead that on to applying shaders with different UV coords to the triangles being represented? I'm having some difficulty in producing a shader on top of a texture atlas. Assuming there is a 128 x 128 texture atlas comprising of 4 different textures that each have their own UV min and max, how can I apply a shader with a picture size of 64 x 64 onto each of those 4 textures on the 128 x 128 image?
@G1g4ntvltLP4 жыл бұрын
You can join chernos discord server. The community is increadibly helpful and very fast! I bet you get some help for your problem there ;)
@ccricers4 жыл бұрын
I've been making 1x1 pixel textures for color materials and some models have dozens, then I just learned OpenGL has texture arrays so I really only have to make one texture fetch per model. whoops...
@ymi_yugy31334 жыл бұрын
How do I change the way colors are interpolated between vertices?
@geraldofada4 жыл бұрын
Hey Cherno, what do you think about Vulkan? Are we going to have a series about it or nah?
@Tachi1074 жыл бұрын
Man, I love music as much as you do, but I find it kinda distracting :/ What about keeping it on just during the intro?
@RafaelCamposNunes4 жыл бұрын
I agree that is quite loud and should be at a bit more low after the intro.
@faimenDev4 жыл бұрын
5:11 HOW??????
@faimenDev4 жыл бұрын
@@trol9880 TY TY TY TY TY TY TY!!!!!
@lolcat69 Жыл бұрын
i colored the quads in the first video passing a vec3 for the color in every vertex ( like what you did with texture coords ), but i am going to stay to see what you do :)
@paullipczyk5216 Жыл бұрын
why aren't you using a vec4? Shouldn't the values be R G B and alpha for colors?
@DrOptix4 жыл бұрын
@TheCherno, can we save vertex buffer space using a memory layout like the following one, per quad? R, G, B, A, P1.X, P1.Y, P1.Z, P2.X, P2.Y, P2.Z, P3.X, P3.Y, P3.Z, P4.X, P4.Y, P4.Z I feel we waste space mentioning the same color 4 times. I don't know maybe I'm over optimizing.
@minirop4 жыл бұрын
OpenGL doesn't handle that. Imagine a vertex like an index into an array (of colours, positions, etc.). i.e. I don't think there is a way to say to OGL "all my next drawn vertices will be this colour".
@richardlighthouse53284 жыл бұрын
what is 4 floats * 8 = 32 floats * 4 bytes = 128 bytes gonna do? Modern GPU's have VRAM into gigabytes. Yes it is over optimizing.
@bartpelle34604 жыл бұрын
@@richardlighthouse5328 It has nothing to do with VRAM but with bus speed.
@richardlighthouse53284 жыл бұрын
@@bartpelle3460 Yes, forgot about that. Bus speed is very fast and only optimization you can do with colors is use unsigned integer for rgba.
@jamesmnguyen4 жыл бұрын
If you really want to have only one color per quad. Try looking into Instancing.
@ragdude73234 жыл бұрын
Wooo
@Narblo4 жыл бұрын
I use instancing for my gui but didnt meassure performance against this kind of batching. UvCoords and transforms are per instance attributes. What do you guys think? did someone did the performance test or can foresee a drawback?
@jamesmnguyen4 жыл бұрын
One of the reasons we use batching is to reduce the time sepnt sending data to the GPU. Sending everything at once is faster than sending little bits multiple times. Instancing is a different approach. Send a small bit of data and per-instance data. Then let the GPU assemble the instance rather than you.
@Crisslt34 жыл бұрын
so a substitute for uniforms is polluting 16 bytes of memory for EVERY VERTEX?? XD seriously I'm looking forward to textures tutorial
@mcmikecreations4 жыл бұрын
Shout out for Ukrainian fans accepted 😁 Have you ever thought about making a Vulkan series after the OpenGL and Game Engine one?
@PcGameHunter4 жыл бұрын
He already answered this: "Vulkan is much more low-level and complicated, it's really difficult for some starting out with graphics to immediately jump into Vulkan. It's likely that eventually I'll have something like this for Vulkan, but for now much more of my audience will benefit from OpenGL. As a rough comparison - it's like trying to learn to make games using C++ or Unity; Unity is going to help you learn how to actually make games, whereas with C++ you'll be stuck building an engine the whole time."
@akchilov4 жыл бұрын
vulkan-mare...
@ccricers4 жыл бұрын
I'll give V-EZ a try. It's a wrapper framework that would try to bridge the gap between APIs like OpenGL and Vulkan.
@KennyTutorials3 жыл бұрын
@@ccricers Cherno already try Vulkan :) Check his last video.
@nathanpinard51324 жыл бұрын
Hey Cherno! I saw the piano at the back, do you actualy play piano?
@jonphillips40824 жыл бұрын
After seeing him Sing and play guitar, my guess is, "Yep" :)
@iozsaygi4 жыл бұрын
Can someone give me the link of the music that plays at the start?
@iozsaygi4 жыл бұрын
@@igorteixeira2962 Thank you so much
@animania69474 жыл бұрын
I was waiting to see a multi-draw indirect 😔
@jamesmnguyen4 жыл бұрын
I've only used that command when I wanted to draw multiple different 3d textured models at the same time. But it's satisfying.
@muhammadseyan83613 жыл бұрын
can't we set the color per triangle or something? isn't this method kinda wasting memory?
@awuuwa4 жыл бұрын
this music in the beginning of this video sounds similar to "Future - Mask Off" without the singing, not so much, but it reminds me of it. just my opinion
@DrJams4 жыл бұрын
Music gets a bit annoying after a few minutes.
@Doylgaafs94 жыл бұрын
Where is "what is up guys"? :(
@Dr.SexySpice4 жыл бұрын
he's not doing that since the start of the new decade
@Doylgaafs94 жыл бұрын
@@Dr.SexySpice That's the end of an era :(
@Light-wz6tq4 жыл бұрын
Does anyone here know DirectX? I am trying to implement batch rendering myself, I've done OpenGL the side and I have difficulties with DirectX. this is my glsl code: #version 450 core out vec4 FSOutFragColor; in vec2 VSOutTexCoords; in flat uint VSOutTexIndex; uniform sampler2D[16] u_Textures; void main() { FSOutFragColor = texture(u_Textures[VSOutTexIndex], VSOutTexCoords); } When I do the same thing with hlsl's Texture2D it gives me: X3512: sampler array index must be a literal expression Can someone help me through? ^__^
@jvcmarc4 жыл бұрын
in the main(), when you call the u_textures array and invoke the element by passing VSOutTexIndex I believe you can't pass a variable as the array index, it has to be a literal value that's what the error means at least
@Light-wz6tq4 жыл бұрын
@@jvcmarc I knew that but thanks for replying :3
@Light-wz6tq4 жыл бұрын
hi
@jalomic3 жыл бұрын
Здоровеньки булы, хлопец =)
@torf1746 Жыл бұрын
Ahead of the times with the Ukraine colors
@__gadonk__2 ай бұрын
fym the war started in 2014
@TheIgoorR4 жыл бұрын
Like from Ukraine: ✓
@ilnev37383 жыл бұрын
и из России
@lukasjetu97769 ай бұрын
@@ilnev3738a také z Česka
@obinator90654 ай бұрын
@@ilnev3738нет
@lorenzof47872 жыл бұрын
I understand that the OpenGL series was filmed over a time span of 3 years, but for someone watching it in the span of 2 weeks, there's quite a lot of cognitive dissonance going on with how the code is written. At the beginning of the series he basically spent a whole episode writing code to parse the shader so that it could be read from 1 file, and here he is with 2 separate files for vertex and fragment shader! ahah There are other inconsistencies too, but I think that's good overall, it forces me to actually write code without mindlessly following Cherno verbatim. I've absolutely loved this series so far.
@codemastercpp2 жыл бұрын
The inconsistencies is because he's showing code of game engine, where he originally creates the batch renderer iirc
@odismal4 жыл бұрын
love u cutie
@farukalpay85224 жыл бұрын
Bist du deutsche?
@__gadonk__2 ай бұрын
der Bre ist Australier
@__gadonk__2 ай бұрын
Scheint aber sowohl Deutsch, als auch Russisch zu sprechen
@mohammedshoaib16354 жыл бұрын
First. Nope that's it. That's all I had to say.
@alexwhite61334 жыл бұрын
good channel, but actually the channel is just about the basic stuff, just always reissued, don't think the Hazel Engine will ever get beyond a basic render framework ;)
@jonphillips40824 жыл бұрын
Tru'Dat, Great stuff!, he's also been currently implementing Vulkan into the development version.
@WillMcCKill4 жыл бұрын
You could always go read code on GitHub or be a patron ;)