Math for Game Developers - Normal Maps
HTML-код
- Опубликовано: 14 окт 2024
- Normal maps can be used to increase the detail in the lighting of a surface.
Find the source code here: github.com/BSV...
New video every Thursday. Question? Leave a comment below, or ask me on Twitter: / vinobs
I love this channel. In a couple of months i will have vector maths/graphics as a course on my university, but most of it's already explained here.
thank you so much for the effort :)
I just found out this video. I was really curious about learning more on normal maps! Great video!
I keep watching your tuturials and i understand like 10% of it xD But i cant wait until your tutorials becomes relevent for me, they seem to be very very well explained.
Thanks alot, and keep it up :)
If you've not watched the videos in order they may be a bit tougher to understand. There are some more basic ones that you could benefit from. I'm also happy to answer questions. Also, the best way to learn is to try it out for yourself, that's why I include the source code. :)
why does does z axis in triangle space exist where y axis is in the local space?
What do you mean by the default [0,0,1] at 6:20 ? I always thought that normal maps used the range [-1,1] range for the R and G channels, and [0,1] for the B. Isn't that why the normal map is blue? Since we are trying to map negative numbers on R and G values, we use 0.5 as our baseline, but since we are not interested in mapping negative numbers to the B value, it utilizes the whole 1.0 range.
"Default" in this case means the vector that points straight up away from the triangle, and in this case z is "up" so the vector (0, 0, 1) points directly away from the triangle. This converts to (0.5, 0.5, 1.0) to be stored in the normal map, which is a pale blue.
The x and y components of this vector will sometimes be negative, but the z component will generally never be negative because it would be malformed for the normal to be facing "down" into the triangle instead of "up" above the triangle. Even though we generally don't use the whole range of the z/blue channel, we still perform the same calculation as the others, taking [-1, 1] to [0 1] for all three channels, since saving the extra bit of memory isn't generally worth it.
@@JorgeVinoRodriguez Thank you so much for your explanations
hello jorge, your tutos are so usefull and i'm learning a lot of maths from you so thanks a lot
one request if you want :) , can you make some tutos about glsl programming so that we can follow your tutos about fragment shaders.
(why you skiped the vertex shaders?)
Sorry don't have the time to do glsl programming videos. Vertex shaders are important, I'm going to cover them when I eventually do a video on animation.
love the video, is simply greatte
how difficult would be changing this into parallax occlusion ?
Some simple parallax mapping would be fairly straightforward but it's done a completely different way. With parallax you modify the uv coordinates that are passed in to the texture function according to the height of the texture and the viewing angle of the player. The occlusion usually involves some sort of raytracing step on top of that.
oh thx:) and thx for the vids i always enjoy watching them and learning the basics. cheers!
Your x or y on your normal map needs to be inverted.