SVG Pattern Supported?

  • Thread starter pioSko
  • 22 comments
  • 3,143 views
111
Poland
Poland
Hi All,
Just wandering if anybody has managed to get <pattern> working for GT?
I have this simple code:
Code:
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve">
    <pattern id="Pattern" x="0" y="0" width=".01" height=".01">
        <circle cx="10" cy="10" r="10" fill="red" fill-opacity="0.5"/>
    </pattern>
  <rect fill="url(#Pattern)" width="2000" height="2000"/>
</svg>

Which produces this... pattern2.jpg

In GT however, I just get a black box.

If not supported, how the hell did this guy do a carbon fiber decal????

pattern.jpg



6197054315480219660_0.jpg
 
OK. Interesting. Difficult to visualise how that could be used to create a "weave" effect like carbon fiber. Linear gradient, of course.
I uploaded the sample to GT and it works on the site, but not in Gran Turismo itself.

spread.jpg

Not 100% anyway. It is buggy. The whole structure of the gradient is ... well, just all over the place, sort of like a Moire effect.
But I can see how one could use that bug to their advantage to attempt to create a weave... interesting.
 
OK. Interesting. Difficult to visualise how that could be used to create a "weave" effect like carbon fiber. Linear gradient, of course.
I uploaded the sample to GT and it works on the site, but not in Gran Turismo itself.

View attachment 727341

Not 100% anyway. It is buggy. The whole structure of the gradient is ... well, just all over the place, sort of like a Moire effect.
But I can see how one could use that bug to their advantage to attempt to create a weave... interesting.

Could be the difference between using percentages and values for the gradient stops maybe. Can't test it myself now.

Might take a few tweaks but I'm sure it would work. The SVG render in the game can be quite picky sometimes.
 
So I've been experimenting..

test3.png


These are both the same repeat, just using different dimensions, and the instances scale up with no difference in filesize... both just 734 bytes so this is definitely the way to do it.

... IF they work in game... can't test them yet.
 
Well it proves it can be done. Thanks. I'll play around with this. No point making carbon fibre again, but certainly might be able to make some cool patterns.
What about....Honeycomb? Small ones not big ones. ;)
 
I’m still curious if anyone wants to do a honeycomb pattern. :D

65734478-honeycomb-pattern-background-light-grey.jpg
 
Ah that sucks, cos then it could be smaller and not so time consuming to align a lot of them :lol: But thanks! Do you know if they keep the gradient when color is changed?

No, they won't. I think one of the two colours can if I change the file, is it the light colour or the dark that you would like to change? It's been a **** so I probably won't change it :D sorry
 
Last edited:
No, they won't. I think one of the two colours can if I change the file, is it the light colour or the dark that you would like to change? It's been a **** so I probably won't change it :D sorry
Ooohh so it wasn’t a fading transparent one, I thought it looked like it was fading into ‘nothingness’ :lol: no worries man it’s not a decal I’d use much anyway, and to be honest my memory wasn’t remembering the pattern correct. I looked at the livery again and it only had the ‘outline’ if you know what I mean, not the inside :lol:
 
@pioSko just replied to the message you left me on my profile, but it looks like y'all worked it out for yourselves. @MatskiMonk 's managed to crack it pretty well. It takes a lot of trial and error to get it looking like carbon especially the more 'threads' you try and cram in.

It seems the way GT Sport handles its vectors is a bit funny. It’s almost as though the game renders all decals to a predetermined 'thumbnail' size regardless of how you've scaled the SVG. That's why certain decals get pixelated once you enlarge them. For example if you create a very large, detailed decal it gets shrunk down to the game's smaller pre-set size, then when you blow it up the detail gets lost. The whole point of vectors is that this shouldn't happen so the game is rendering the vector as a raster image before it's placed on the car and scaled.

I had this issue with the 'GT' on the side of my Spoon NSX. On the first attempt I created a 'GT' with a long tail off the T so it stretched over the car. (Resulting in a big decal shrunk down to fit the 'thumbnail') When I enlarged it, the edges became fuzzy. Instead I created a 'GT' without the tail and this enlarged much better.

Another example is if you take the default thin rectangle shape and scale its height manually. Pretty soon the top and bottom edges turn into blurs. If the game were handling the shapes as vectors then this wouldn't happen.

...back on point...

With the above in mind, the game isn't rendering the SVG's at a 1:1 scale meaning careful adjustments of 1px here and there to the gradient's position, size and colour stops can create massively different results in-game. Hence why it took me a good week of trial and error to create a carbon effect that was usable.
 
I tried that too, (without a pattern, only with gradients). It's horrible to use, much too small :crazy:

size is 12'583 Bytes

Tried to make the front bumper of my BMW, you don't wanna know how long it took (and i didn't finished it nice, it has a lots of faults in it)
 
@pioSko just replied to the message you left me on my profile, but it looks like y'all worked it out for yourselves. @MatskiMonk 's managed to crack it pretty well. It takes a lot of trial and error to get it looking like carbon especially the more 'threads' you try and cram in.

It seems the way GT Sport handles its vectors is a bit funny. It’s almost as though the game renders all decals to a predetermined 'thumbnail' size regardless of how you've scaled the SVG. That's why certain decals get pixelated once you enlarge them. For example if you create a very large, detailed decal it gets shrunk down to the game's smaller pre-set size, then when you blow it up the detail gets lost. The whole point of vectors is that this shouldn't happen so the game is rendering the vector as a raster image before it's placed on the car and scaled.

I had this issue with the 'GT' on the side of my Spoon NSX. On the first attempt I created a 'GT' with a long tail off the T so it stretched over the car. (Resulting in a big decal shrunk down to fit the 'thumbnail') When I enlarged it, the edges became fuzzy. Instead I created a 'GT' without the tail and this enlarged much better.

Another example is if you take the default thin rectangle shape and scale its height manually. Pretty soon the top and bottom edges turn into blurs. If the game were handling the shapes as vectors then this wouldn't happen.

...back on point...

With the above in mind, the game isn't rendering the SVG's at a 1:1 scale meaning careful adjustments of 1px here and there to the gradient's position, size and colour stops can create massively different results in-game. Hence why it took me a good week of trial and error to create a carbon effect that was usable.

Yeah, I've been looking into this issue of scaling a bit recently. Given the fact they are vectors this is a big shame. I can understand for speed, using lower quality bitmaps in the editor itself would be okay, but it does then carry all the way through the game. I've started one of my art cars from scratch again because it seems any custom decal that needs to be stretched to fill more than one body panel looks like crap. I've been trying to figure out a way of determining what that 'native resolution' is for files, for want of a better term, is - just haven't gotten around to it. It really is a big shame, like you say, it undermines most of the benefit of using vectors in the first place.
 
Yeah, I've been looking into this issue of scaling a bit recently. Given the fact they are vectors this is a big shame. I can understand for speed, using lower quality bitmaps in the editor itself would be okay, but it does then carry all the way through the game. I've started one of my art cars from scratch again because it seems any custom decal that needs to be stretched to fill more than one body panel looks like crap. I've been trying to figure out a way of determining what that 'native resolution' is for files, for want of a better term, is - just haven't gotten around to it. It really is a big shame, like you say, it undermines most of the benefit of using vectors in the first place.

Yeah, I haven't cracked the native size yet either. I thought it may be related to the size of the preview images on the GT website but alas no.
 
So, how did you guys get it to work?
Been trying several approaches, but it still all results in a black decal in game. Frustrating...

This is what I have so far – just a basic checkered gradient pattern but GT Sport won't swallow it. Any pointers would be awesome :)

<svg version="1.1"
baseProfile="full"
width="1000" height="1000"
xmlns="http://www.w3.org/2000/svg">

<defs>
<linearGradient id="Gradient1">
<stop offset="5%" stop-color="white"/>
<stop offset="95%" stop-color="black"/>
</linearGradient>

<linearGradient id="Gradient2">
<stop offset="5%" stop-color="black"/>
<stop offset="95%" stop-color="white"/>
</linearGradient>

<pattern id="Pattern" x="0" y="0" width="0.05" height="0.1">
<rect x="0" y="0" width="50" height="50" fill="url(#Gradient1)"/>
<rect x="0" y="50" width="50" height="50" fill="url(#Gradient2)"/>
</pattern>
</defs>

<rect x="0" y="0" width="1000" height="1000" fill="url(#Pattern)" />
</svg>

//Edit:
After testing multiple codes for the last few days, it appears that everything inside the defs tag is ignored by GT Sport. Or am I missing something?
 
Last edited:

Latest Posts

Back