Hmm, directly referencing a
<linearGradient> element multiple times using a
fill attribute value of
url(#[id]) does actually work but it appears that the in-game renderer has been hard-coded to always set a
<linearGradient> element's
gradientUnits attribute to
userSpaceOnUse. Attempting to use
objectBoundingBox, thus omitting any
x1, y1, x2 and
y2 attributes, results in the renderer falling back to (specification compliant)
x1, y1, x2 and y2 values of
0%, 0%, 100% and
100% respectively.
I'm struggling to think of any real, valid reason why they would do this?! I suppose it may be an order-of-execution speed optimisation thing, with:
SVG:
<linearGradient id="[id]" x1="[value]" y1="[value]" x2="[value]" y2="[value]" gradientUnits="userSpaceOnUse">
[colour stops]
</linearGradient>
the renderer knows everything about the gradient before it is actually used. However, with
SVG:
<linearGradient id="[id]" gradientUnits="objectBoundingBox">
[colour stops]
</linearGradient>
the render engine may know the colour stops but it has to "stick a pin" in the processing of the gradient until it has also processed the bounding box(es) of any referencing element(s).
But these are SVG's we're talking about, designed to be small, lightweight and easy to process, its not exactly crypto mining. 10 Years ago I used to occasionally edit SVG's in Adobe Illustrator on a
1Ghz Intel Atom powered
netbook with no problems whatsoever. No system chug, nothing. (If you knew all the unnecessary crap to disable in Windows they were actually far more capable machines than many people realised... but thats a different thread... for a different site... of a different decade
). If a 1Ghz Netbook can edit SVGs, with all the editing application overheads included, without any issues them I'm fairly certain - no, I'm 100% certain - that a PS5, or PS4, could render full 1.1 spec SVGs and it would barely even register! If the PS5, or PS4, were a sentient being it would raise any eyebrow because knew it did something, but it was so quick that it didn't know what, then shrug its shoulder and carry on as if nothing happened!
When you say "it doesn't like transform" I presume you specifically mean the in-game
<linearGradient>'s
gradientTransform attribute? The
transform attribute seems to work in general as we can see in the image you posted (although the filter is not working on the sample text, the
transform clearly is)... so at least we can still get free drop shadows even if we can't blur them.