
Drawing Outlines in 3D – 3D Games in GameMaker Studio 2
DragoniteSpam
Views: 1329
Like: 46
Drawing an outline around something in 3D is easier than you might expect, and works well enough in most cases. Here’s a simple but effective trick that games like Okami use!
As an added bonus, you can use a variation of this to get a silhouette effect.
This trick relies on smart use of the backface culling direction in order to work:
Here’s the code:
GameMaker 3D playlist:
GameMaker Studio 2 playlist:
#GameMaker3D
#GameMaker3DGraphics
#GameMaker3DOutline
– – – – –
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!
22.06.2022
Hi nice work! I have a question. Is it possible to create a top down 3d world with caves and houses with multiple floors and an uneaven landscape? or is programming something like that not doable in game maker?
first
your gms 2 3d skills are probably unmatched
Not sure what the performance hit would be like, but if you're worried about other objects occluding an outline, you could draw the outline to a surface and then draw that surface to a flat plane on the screen, lined up with the 3D object, with depth testing on. At least, this will work if I understand properly.
My mom played the hell out of Okami but I never really got into it.
Something that somebody reminded me that I didn't really give attention to in the video: simply scaling the model up wouldn't be enough for complicated objects. For something that isn't a uniform shape, you'd need to go to the extra work of selectively pushing vertices/faces outwards based on their normals – which may be a bit tedious, although the overall process wouldn't be any more complicated.
Edit: I can't believe I didn't think of this before, but you could totally do this automatically by pushing vertex positions outward in the direction of the normals in the vertex shader.