News for hackers. Stuff that matters.
Re:3D Game Shaders for Beginners by csdreamer7 on Monday May 13, 2019 @12:59AM (#19896529)
Cool! Is there a tutorial for cell shading? (The Borderlands 2 or Paper Mario look.)
Re:3D Game Shaders for Beginners by Jasper_ on Monday May 13, 2019 @01:22AM (#19896596)
Those are two drastically different artstyles. Neither of them really are engine shader stuff, just someone drawing good textures in Photoshop.

Paper Mario is all hand-authored baked vertex colors and very simple textures. Artists spent a lot of time in Maya hand-tweaking each vertex individually, e.g. see my viewer here https://noclip.website/#ttyd/jin_00

Borderlands has some basic engine technology with outlines -- running a basic Sobel on the depth buffer to find depth discontinuities and drawing lines there, but most interior lines are on the texture itself. Lighting is also modified with a ramp -- the "raw" incoming radiance from lighting is thrown into an artist-authored lookup table and tweaked before being thrown to the shader. Normal maps are seldom used.

Re:3D Game Shaders for Beginners by jayd16 on Monday May 13, 2019 @02:11AM (#19896733)
>find depth discontinuities and drawing lines there, but most interior lines are on the texture itself

I honestly thought a lot more was going on here but now that I look back at it you seem to be correct. Impressive how simple it is.

Re:3D Game Shaders for Beginners by wlesieutre on Monday May 13, 2019 @08:58AM (#19898756)
Borderlands isn't cel shaded, it's just nice textures. To get that look you you need:

1) good texturing (including some linework and hatching)

2) diffuse only (more or less)

3) draw edges in black

Which is pretty vanilla techniques, shader wise. The hard part is doing the textures well.

Somebody on reddit did a character model walkthrough back in 2014: https://www.reddit.com/r/gamedev/comments/2bftyc/i_reverse_e...

Re:3D Game Shaders for Beginners by corysama on Monday May 13, 2019 @02:37AM (#19896810)
A very simple implementation of cell shading is to run the result of traditional lighting through a lookup table in the form of a 1D texture. Having runs and steps of solid color posterizes the smooth lighting input so that it resembles painted cell artwork.

A very simple implementation of outlining is to draw the object a second time solid black, with the vertex positions extruded out in the direction of the vertex normals, and with backface culling flipped so that you see only internal faces. Those black, internal faces peeking out around the edge of the regular mesh form the outlines.

That's a good starting point. Many iterations and improvements from there gets you to this: https://www.youtube.com/watch?v=yhGjCzxJV3E

Re:3D Game Shaders for Beginners by tonyarkles on Monday May 13, 2019 @01:17AM (#19896579)
There’s a section on posterization, which may get you close