Тёмный
No video :(

OpenGL Tutorial 27 - Normal Maps 

Victor Gordan
Подписаться 12 тыс.
Просмотров 17 тыс.
50% 1

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

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 40   
@VictorGordan
@VictorGordan 3 года назад
-Small mistake! As Charles van Noland pointed out, the bricks look sunken in rather than popping out (honestly didn't see this untill it was pointed out haha). A quick fix to this is to inverse the bitangent by putting a negative sign in front of it ;)- Ok... I discovered the actual problem... STANDARDIZATION :'( The normal map was inverted on the y axis as for the DirectX way of doing textures, while the OpenGL one is the opposite... So the real solution is to manually flip the textures in an image editing software :/
@AcceleratedVelocity
@AcceleratedVelocity Год назад
i used ambientCG and wondered why they had 2 normals (normalDX and normalGL) and y blender defaults to -z as forward axis. now i know
@shinystick241
@shinystick241 3 года назад
Your channel is growing so fast man, all the best!
@VictorGordan
@VictorGordan 3 года назад
Thank you, especially for leaving nice comments for me and our overlord, the algorithm! ^-^
@D3xt3rity
@D3xt3rity 3 года назад
Would you consider covering PBR in a video? I absolutely love your content!! Thank you!
@VictorGordan
@VictorGordan 3 года назад
Yup, PBR will be one of the last things I cover in OpenGL ;)
@D3xt3rity
@D3xt3rity 3 года назад
@@VictorGordan Whoop! I cant wait to see it!!!!
@Gille-mm1cr
@Gille-mm1cr 11 дней назад
How do you do apply a normal map on a sphere?
@chorong7351
@chorong7351 3 месяца назад
you saved my graphics homework
@rachit7645
@rachit7645 Год назад
I have a couple issues with this tutorial: 1. Why are you using a geometry shader if you don't need one? Geometry shaders generally have a lot of overhead on them. So using them for no reason just slows the application down. 2. You should use pre-calculated tangents and bitangents. Actually, you only need the tangent and then you can use a cross product to get the bitangent in the shader. 3. You should calculate the TBN matrix in the vertex shader instead of the geometry shader of the given reasons.
@VictorGordan
@VictorGordan Год назад
This was a while ago and I don't remember exactly what the code looks like, so what I'll say might not make sense, but: 1. Because I didn't know how to use compute shaders at the time and I wanted to generate the tangents and bitangents in real time. Also, using geometry shaders seemed like the most intuitive way to do this (not the best way of course). 2. Read 1 3. Read 2 haha Thx for pointing those issues out though! I should have probably made it clear that this is not the most optimal way to do it...
@AcceleratedVelocity
@AcceleratedVelocity Год назад
i mean it IS realy janky passing in 3 different verticies into the vertex shader, like that's unreadable. also some might need the geometry shader
@AcceleratedVelocity
@AcceleratedVelocity Год назад
actualy it does have overhead if u do it in vert shader
@AcceleratedVelocity
@AcceleratedVelocity Год назад
i know u moved the light, cam, etc into the nomal but i think thats slower, u see, the shader dimension is different then the cpu code dimension, bcuz they're executed in PARALEL on gpu (basically less instructions, more FPS). also on frag it only runs on the visable fragments so yeah, ima go with TBN * norm_map
@D3xt3rity
@D3xt3rity 3 года назад
NEW VIDEO HYPE!!!
@VictorGordan
@VictorGordan 3 года назад
🎉
@mitchellkelly241
@mitchellkelly241 3 года назад
Amazing as always! 😋
@VictorGordan
@VictorGordan 3 года назад
Thank you! Supportive as always :d
@CharlesVanNoland
@CharlesVanNoland 3 года назад
Looks like your XY normalmap values (red/green) are backwards, causing your lighting to look like the brick is sunken into the mortar.
@VictorGordan
@VictorGordan 3 года назад
Hmmm...are they? To me it looks like it's popping out 😅 I don't really get what you mean by "backwards" tbh.
@MustafaBerkeGureltol
@MustafaBerkeGureltol Год назад
How are normal maps applied to the surface with a) averaged vertex normals, and b) face-weighted vertex normals, or on a surface in general? Are the pixels on normal map get added, multiplied to/with the normals of the surface?
@VictorGordan
@VictorGordan Год назад
Honestly, I do not know. But I assume you apply some sort of interpolation 🤔
@gehenhajso1037
@gehenhajso1037 3 года назад
You are my dream come true
@VictorGordan
@VictorGordan 3 года назад
^-^
@hugofoltin5647
@hugofoltin5647 3 года назад
new mic? I like it
@VictorGordan
@VictorGordan 3 года назад
Good observation 🧐 I still need to work out some settings, but it already sounds much better than the last one! :,)
@sneper53
@sneper53 2 года назад
Pls upload about bullet physics in the next tutorials.
@diahaidificbs
@diahaidificbs 2 года назад
Hey Victor, when trying to load the normal texture, program crashes with error “nvoglv64.pdb not loaded”. I copied your texture and fragment shader code and still get the same error 🙁.
@VictorGordan
@VictorGordan 2 года назад
There might be something wrong with your vertex attributes. From what I remember when I encountered this before it's a pretty nasty error, could be multiple things...
@diahaidificbs
@diahaidificbs 2 года назад
@@VictorGordan well I’m trying to apply a normal map to a .gltf model and looking at vertex attributes, everything seems to be in order, I can in fact do the process of loading the texture for any texture type except “normal”. Any idea on how to fix it? Btw tnx for the reply man
@VictorGordan
@VictorGordan 2 года назад
Hmmmm, make sure your loading parameters are correct, so the depth and number or values (RGBA) should be correct. Otherwise I have no clue what it could be
@diahaidificbs
@diahaidificbs 2 года назад
@@VictorGordan I kinda found why it’s happening, the error only occurs when I try to change the format (not InternalFormat) of “normal” texture from GL_RGB to GL_RGBA in texture.cpp. Don’t know whether the results are the same or not without alpha…thanks a lot victor ❤️🙏🏻
@VictorGordan
@VictorGordan 2 года назад
The results should be the same without alpha
@sneper53
@sneper53 2 года назад
pls upload about bullet physics in next tutorials.
@VictorGordan
@VictorGordan 2 года назад
I am planning on making a physics series in the future, but not anytime soon, sorry :(
@willyjacquet4436
@willyjacquet4436 3 года назад
"The fragment shader runs many times more than the geometry shader, it is preferable to [do it on the geometry shader]" Dangerous baseless claim. Have you benchmarked it ? I could give a few arguments as to why you should avoid geometry shaders in the first place. Tangents can and should probably be precomputed in the first place. That's a memory-speed tradeoff that is often taken. Most 3D formats will provide them for you anyway and most model loaders are able to compute them too. Remainders on normal matrices could have been great also. So yeah, the video is just as outdated as the tutorial on learnopengl.com is... since it's mot much more than just parroting. Well you're probably learning at the same time that you're doing these tutorials. But what a pity, I believe you can do better than that; if I wanted to follow the learnopengl.com tutorial, I might as well go see the original one because I don't see much added value here.
@VictorGordan
@VictorGordan 3 года назад
I did not benchmark it. And yeah, I suppose it might be false? But I think I do specify they should be precomputed (at least I hope I did lol) I am indeed learning at the same time (I explain my reasoning for this in the Q&A). What exactly is outdate about the method? I am actually curious. I searched for papers on this stuff but there really aren't that many new ones I could find... :( And I am transparent about the fact I use learnopengl. I openly state it in the first tutorial and link to it everywhere on my channel. Even the creator of the website knows it and he said he likes my tutorials. About "parroting". Some of my tutorials do differ quite a bit from the stuff on the website. Many people read the website and also use my videos at the same time (they said it's a good combination). I did come up with a different and much more efficient method for finding the correct UV for the parallax, but sadly it had some artefacts if the depth map had repeating sharp edges so I thought the method is not mature enough for the video yet and decided to go with the slower but proven method.
@VictorGordan
@VictorGordan 3 года назад
Also, if you don't see much value here, just stop watching ;) Others see value in my tutorials (and they know about the existence of learnopengl). I would like to please everyone and help everyone, but sadly that's just not possible. Thanks for the feedback though! I appreciate some more negative feedback so I know how to improve. And if u want original content, stick around for the next series :p
@willyjacquet4436
@willyjacquet4436 3 года назад
@@VictorGordan I apologize if I came off as rude or condescending, I precisely gave negative feedback because I see potential in your content, not because I want to degrade you in any way. The method isn't outdated; the OpenGL used is. Many of the functions used could be replaced with more modern ones, removing most of OpenGL global state access. I still see a lot of people (even professionals) that don't know about them. I feel like that's reasonable for a learning resource in 2021 to be at least up to date on that front; that would be added value right there. Same thing with geometry shaders; since tesselation and compute shaders, they're mostly an artifact of the past. I cannot make any comment over your other content as I've not seen any of it. But it pretty much irrelevant to me as this video seems to be self contained; and should probably be as much as possible. (I mean I found it by typing "normal mapping opengl", not by searching for a playlist about learning OpenGL). When I said that the video doesn't have any added value over learnopengl, that's what it means. It has value, but nothing more than in the original material. It has the same faults too. Same pedagogy. Even the same models. I mean come on, at least try to show something more interesting than that brick wall. Being a beginner is something valuable, you've a sensibility to what is difficult. And I don't feel that being reflected in your explanations, I don't know what you found to be lacking in the original material, what difficulties you had, what made things click for you. That would have been valuable to me. That's why I called it "parroting". But once again, I haven't seen any of your other content. So perhaps it is much more personal and go further what is done on learnopengl. Perhaps you just wanted to get done with normal mapping and don't have much interest in it. Perhaps I expected something too different as my experience with normal mapping very unlike what you show (even though I went through this very same tutorial). Also you don't get to tell me what I should watch or not since you showed up in my search for normal mapping videos ;) I still look forward to your next content tho. So good luck with that.
@VictorGordan
@VictorGordan 3 года назад
​@@willyjacquet4436 No problem, sorry if it seemed like I tried to silence you by deleting your comment. RU-vid marked it as spam for some reason and it only allowed me to approve it to go public now :/ I hate it when RU-vid automatically clears up my comment section Yes, very fair, the methods used are indeed outdated. But I have a reason for that :) I am using 3.3 so that more people can follow the tutorials. Quite a few people in my Discord channel told me their GPUs don't support OpenGL 4.0+. Even with 3.3 sadly not everyone can follow... In my personal projects I am using OpenGL 4.6 and global state access from the extension GL_ARB_direct_state_access. And I plan on making "tips and tricks" videos at some point in the future after I am done with this series. To me the most important part of the series is the theory anyways. And the basic concepts of OpenGL (buffers, shaders, textures, etc). Well yes, some of my videos can be self contained, but they are best watched in a linear fashion, that's why I number them in order ;) Actually the models are different. I don't think I once used the same models... It isn't the same brick wall haha. I just decided to use a brick wall because I think the effect can be really well seen with brick walls haha Well in other tutorials I mention things that you should pay special attention to, but in this tutorial I really didn't find anything out of the ordinary. The method seems pretty straight forward to me. I think my tutorials are best seen in order honestly. And as I said, some of them are vastly different. The model loading one is completely different, I show how to make a basic glTF loader from scratch. Other vastly different tutorials would be the Camera one, and the Organizing one. Other don't differ so much, but they do differ. Can't control the RU-vid algorithm ;P Well I hope I see you commenting again with some negative or positive feedback. Feedback is always appreciated :) PS: I was rambling on about "my own algorithm" because for a second I thought you commented on my Parallax Mapping video, that's where I initially wanted to use my modified Parallax Mapping algorithm but then decided it's not ripe enough haha
Далее
OpenGL Tutorial 28 - Parallax Occlusion Mapping
4:34
Basic Shadow Mapping // OpenGL Tutorial #35
16:54
Просмотров 21 тыс.
Diffuse Lighting // OpenGL Tutorial #20
21:20
Просмотров 8 тыс.
OpenGL - normal maps
13:23
Просмотров 11 тыс.
Physically Based Rendering // OpenGL Tutorial #43
17:31
Normal Maps for Pixel Art
17:10
Просмотров 108 тыс.
OpenGL - shadow maps (for directional lights)
17:32
Просмотров 22 тыс.
OpenGL 3D Game Tutorial 31: Normal Mapping
21:45
Просмотров 65 тыс.
Modern OpenGL Tutorial - Compute Shaders
11:27
Просмотров 58 тыс.
What Is A Graphics Programmer?
30:21
Просмотров 418 тыс.