(Webgl2 / WebGPU support) A better outline shader than the one that already exists on the C3 addon stack exchange
skymen there is one issue in this effect if we rotate layout 90 or 270 degree by setting its angle then outline streches from one side. see this image
Hi, yeah this is an issue with C3's effect compositor. It doesn't provide a good way to get the size of one layout pixel unit across all scales and angles. I use an approximation that hopefully works in most use cases, but assumes that the render target and the layout are aligned which isn't true if the layout is rotated.
In fact my approximation only works at angles 0 and 180 and breaks on every other angle value, and there is no way to really fix this without also breaking the fact that the outline pixel size is tied to layout pixels.
If you want, you can modify the effect. In the code you should find a value called "texelSize" which is my approximation, and instead use C3's "pixelSize" value and it should hopefully stop stretching, and you can counter act the wrong pixel size value by using bigger width values
Nice effect!
Thank you for the great effect, Skymen! It's very very useful. ✨
no work on Text
Hey folks! For those that want to have an outline effect for your text - as skymen has mentioned, this plug-in will be an intense resource hog. You can try using the BBcode [outlineback] (see documentation here construct.net/en/make-games/manuals/construct-3/plugin-reference/text )
However, you might run into some odd spiky bugs in some characters depending on the font. You can try to tweak the font by editing the vectors here: tophix.com/font-tools/font-editor
It's not trivial but at least you get both: The font you want and an outline that will not tank your performance.
Amazing, thank you!
Not sure why people are saying it doesn't work on text. The text and spritefont objects can do an outline with bb code.
I tested this and bb codes like that don't work on spritefonts. Just text objects.
Omg...Thanks!
i.imgur.com/dlPdg0F.png
any ideas how can i set thickness of outline? (when i use stroke i receive only outline without inner color)
Hello, I noticed important performance impact after upgrading from an old version (1.4.3 to 2.1.0.1) in a project with extensive use of this effect (hundreds of sprites and spritetexts).
- Are there any known reason that can explain this ?
- Do outlines and alpha require more calculation ?
Thanks !
Hi, the performance should not be that much worse, but it's possible that you switched to webgpu that is known for having performance issues with shaders sometimes
Thank you for your answer, I switched to webgpu indeed but have same performance with webgl2 and didn't really notice any difference between the two. Redrawing all sprites with oultines was the only solution for now.
новый
Is there a way to have the outline not extend beyond the character? Instead, have it scale inner, rather than outer?
Hi, this would not be an outline, but an inset shadow or glow. This outline doesnt support this.
Not a problem, I managed to make a plugin that allowed it. Thanks!