Calculating Smooth Normals - 3D Games in GameMaker

preview_player
Показать описание
Generally your 3D model authoring tool of choice will be more than happy to calculate triangle normals for you, but sometimes you need to be able to do such a thing yourself - for example, if you generate a vertex buffer on-the-fly. In the last video I did flat triangle (per-face) normals; here we're going to look at smooth (per-vertex) normals!

If you haven't seen the video on flat normals, you probably should, because this video is essentially a Part 2 of that one:

The code:

You most likely want to be semi-familiar with cross products.

Shader playlist:
GameMaker 3D playlist:
GameMaker Studio 2 playlist:

Thumbnail:
frustum by Bohdan Burmich from the Noun Project

#GameMaker
#GameMaker3D
#GameMaker3DCamera
- - - - -
I've now made that Patreon:
That promised social media link spam.
Transition / idle music is by my old friend Kamex:

Rate, comment, subscribe, watch more, enjoy!
Рекомендации по теме
Комментарии
Автор

Hey so on my test model the lighting seems to come from the opposite direction, any idea why? I played around with the script but if I import my model with smooth shading the normals from blender work fine.

derikdotdigital