I want to make the entire avatar have the cel shading-like outline, but when it comes to hats, they are very inconsistent.
You usually do this by just cloning the part and making the scale of the mesh negative (-x,-y,-z), but this doesn’t work with hats, it ends up messing with their orientation.
I noticed that doing (-x,y,z) works just fine with most hats, but that’s the thing, it doesn’t work with all of them, some require it to be (x,y,-z), others require (-x,-y,-z) and to change the weld.
So I wanted to know if there’s any way I can easily do this.
How it looks:
-The bird and bowtie work fine with the (-x,-y,-z) scale outline, but the hair, eyepatch and potion don’t
I don’t think there is any in-game way to make it work consistently. This is just how normals work. Scaling a mesh negatively would just make the normals flip which is what you’re experiencing, you would have to edit the mesh in blender in order to get the desired effect 100% of the time.
I know the way you achieve this effect in 2d is by simply making a scaled up copy of the thing you want to outline, paint it black, and placing it behind the actual thing.
I’m kind of new to roblox so I’m not certain how much control you have over the rendering of things. But it should work the same way in 3d. Just create a duplicate of each part you want to outline that is slightly bigger (more bigger for bigger outline.), paint it solid black, and have it render on the earliest render pass in the same position as the normal object then render the normal object over it in a second pass.
If you couldn’t access the rendering pipeline, you’d have to do some hacky detection for camera facing and ensure that the black painted part dynamically moved itself so it is further from the camera than the normal part.
The only reason the things you’re doing it with now seem to be working is because they are symmetrical. The things that aren’t working are not symmetrical.
In Roblox we don’t really get control of meshes like that, nor do we get much control of what’s rendered when and how. There are some functions like :BindToRenderStep which basically allows code to be executed at a certain time in the rendering process but we don’t really get anything like layers.
We also can’t invert any faces at runtime which is how the cartoony effect is done.
We do, however, get viewport frames which can kind of be used as layers so maybe that could work?