Techniques for Texturing the Racing Line?

blakboks

What are some techniques for creating the rubber laid down in the braking areas and corners?

I know one technique (used quite a bit by BTB-created tracks, I believe) is to create another layer of geometry over the track geometry with an alpha texture of the rubber (similar to 'transition' textures from the grass to the gravel traps, etc.). It seems though that sometimes the line can seem to 'float' above the track surface rather than being integrated to the surface itself.

Is this about the only way to do it to allow the texture to follow the racing line with any accuracy? Is it just the best way?

Since rF2 is (seemingly) right around the corner, does anyone have any info as to whether or not creating these textures in the track will even be necessary for rFactor2, since it's going to have a dynamic racing line? Will there be other provisions that the track builders will have to build into the track to get it to work?

Thanks in advance,
Chris
 
Sounds like an awful lot of work for something normally done with a single mouse click in the AIW editor...
 
First of all I have to say that whole approach of texturing best line in all known simulations is BAD.
It is enough to watch tv broadcasts from real racing and also watch common streets under sun light.

1. First of all, best line is not black. It may be a bit darker in breaking zones bot not in visible from cockpit way like in sims
2. in corners/turns, only outside area is significant darken because of rubber. best line is not

Additionaly in current sims there is no sky reflection in tarmac/rubber imitated. You have no to be racing driver. Just stand near a street. Compare how street surface looks while looking againts the sun and in oposite direction. Except of colour changes from more blue to more warm, you will probably probably notice brighter stripes along a street. Just in place where car tyres touch a tarmac. Brighter stripes are rubber pressed into tarmac. Yes... it reflect the light more - that's why it shines.

The conclusion is that how best line is vissible depends mainly on the angle of sunlight, track and driver and also insensitivity of dispersed light from sky. It effect cannot be reached just by texturing. There must be a special shader used. And such one exists. Hope the author will do public release soon. We are testing his work in our leagues for about a year. Results are really impressive.

Here is a quick demo how it works with new shaders
 
Last edited:
Hey MaXyM,
The road looks fantastic in that video, but I think we can get at least 90% of that look with just a good diffuse and specular map (and an appropriate bump map as well, since the rubber tends to fill in the crevices of the tarmac). A different specular power between the 'rubbered' tarmac and the 'clean' tarmac would probably round off the whole look; whether this is achieved with another map to control it or otherwise is just technical details, I think.

Hopefully rF2 will be a little more open toward custom shaders. My understanding is that right now if I wanted to use that shader from the video, it would override any object that also happened to use that shader? So, for instance, if it overwrite the 'Bump Spec Map T1' shader, anything that's defined to use that shader, including buildings or Armco, etc., would also use the road shader (just with their own textures). It'd be nice if we could use our own custom shaders that the track modders would just include in a .zip with the rest of the assets for that track when it comes to distribution. Of course, the best option would be a material system akin to UDK's or any of the DCC software (i.e. 3DSMax, Maya, XSI, Houdini).

@Keeper - where exactly is that in the AIW Editor? Is it under 'unsupported features'->'Recalculate groove on save?'

Instead of creating a whole new thread, since it's somewhat related to my original question, I'm going to take this discussion in a new direction:

How might we go about creating more 'true to life' track textures efficiently? What I mean by this is how can we create track textures that accurately represent that specific part of the track? For example, going into turn 1, you might have more skid marks than on turn 3 because that's the primary passing spot. Down another part of the track you might have a dirt patch next to the road, so dust tends to blow onto the track there. Maybe you have a chicane where a lot of people end up having to cut and go off-track, so when they re-enter they drag dirt and debris with them. And so on...

The obvious answer would be to just create one big texture that runs the length of the track. The problem with this is, obviously, the immense size of a texture that large and computer hardware being able to handle it. Even a 2km track (assuming that 1024 pixels = 10 m---not an uncommon resolution amongst tracks out there now) would be 600MB uncompressed--that one texture would take up more RAM that many graphics cards even have.

If you do multiple smaller textures, maybe only 2048x1024 at a time, you're talking about a large number of textures that you have to swap in and out of memory as well (100 times over that same 2km track). Anyone have any idea if modern hardware can handle this ok? (to speak nothing of actually having to create 100's of texture maps)

So, is it feasible to even do what I'm asking? I think iRacing is doing what I'm talking about...anyone have any idea how they handle it? Is it something that the engine specifically needs to be designed for, or is it something that any engine that uses textures maps can theoretically do with current hardware?

Are there other ways to go about it? i.e. decal textures, etc.?

Thanks,
Chris
 
I have a single overhead for the rubber on my current track project as a multa map. It uses different uv co-ords than the diffuse road texture, the road is unwrapped in a straight line and the multa'd skids are overhead planner unwrap, there is also a spec map that is box unwrapped and tiled. The skids are on a 1024x texture, when you don't focus on it, it seems to do the job, but when you stare at it, you see big fat square blurry pixels where the texture is on a diagonal.

I think I have a solution though, but I haven't tried it yet cause I'm still trying to figure out how to do it. To render a shadow map by using the alpha on a texture to erm,, project(?) the skidmarks onto the shadow map. Once I get that figured out, I intend to pack the uv's so they are all going straight up and down/left and right, that way it will remove the square pixels and be smooth.
There is also a blur setting in the material thingy, but I haven't checked that out yet,


Here is an overhead showing how it is.


Up closer where you can see the square pixels
 
@mianiak - hmmm...yeah, that seems like a horribly inefficient way to get the tire marks on the track :(. I'd think that about 90% of your texture is wasted space. Seems like it'd at least be more efficient to UV the track in such a way that you basically get a bunch of 'strips' of the track arranged vertically or horizontally (in UV view). Plus, you wouldn't need to apply the texture to places where there's no rubber on the road, leaving more resolution for the places you do need it.

I'm not really following you re: rendering a shadow map onto another texture. I'm familiar with the technique (you're basically baking the shadows, right?), but I don't see how it will help you in this instance. You still need UV's to render the 'shadows' onto a texture. Besides, it seems like you could do the same thing right in Photoshop.

Overall, I like the idea of doing a multiply map on top of the diffuse. Only thing is, is that I'd rather use Bump and Spec maps, and there doesn't seem to be a 'Bump Spec Map T1 mul T2' shader.

You also reminded me of a technique I read in a book. Wherein you create an atlas texture of details that are all alpha'd, and then blend that over the repeated texture. But now that I think of it, I believe that's basically 'decal' texturing which we can't do with these shaders, anyway.
 
I'm not really following you re: rendering a shadow map onto another texture. I'm familiar with the technique (you're basically baking the shadows, right?), but I don't see how it will help you in this instance. You still need UV's to render the 'shadows' onto a texture. Besides, it seems like you could do the same thing right in Photoshop.
I mean exactly like you said, pack the uv's in strips vertically and horizontally. Then bake a shadow map using a high detail single overhead.
It's the same as doing it in photoshop I suppose, but a lot faster and it will be more accurate.

Another way I thought of was to have a texture with skidmarks straight down the centre, then drag the uv's left or right to mould them to the skid. But that would take a lot of manual effort. (does that make sense? I'll draw up an example if it doesn't.

You know, this would all not be necessary if there was a way to make the racing line higher detail :D.

I have chosen not to use bump for the track on this one, but you can always customise a shader if you desire. https://community.racesimcentral.net/showthread.php/552-Custom-shaders?p=6454&viewfull=1#post6454
 
It's easy to create new shaders, and for your textured racing line, take a look at my Jerez ;)
 
It's easy to create new shaders, and for your textured racing line, take a look at my Jerez ;)

That's the go, It's something else I had in mind, but never got around to looking into it yet. I like the idea of using multa maps for the line, its much neater than extra planes over the track that can start flickering etc. I guess you could also add another multa level for extra darker skidmarks with a higher detail. I also like the way that those road textures on Jerez are simple shades of colours and not one is a complete image of a road surface, but when blended together it makes a nice looking road. That's the beauty of it all, it all blends into the one thing and gives it that unique all over look.

With Toban, the way the track is done with all the bump materials etc, its not just an A to B on the track, it's individual polys within the track that are independently set up to do different things. This technique could be utilised for small details on the track surface visually or physically, like skid marks for example.

I found these a while ago and am using one of them for my track,
http://www.cgtextures.com/texview.php?id=44129&PHPSESSID=t8e2v53av37mheqprvflr0qut6
http://www.cgtextures.com/texview.php?id=44129&PHPSESSID=t8e2v53av37mheqprvflr0qut6
You also could use these and do a similar thing to Jerez, but have the corner line as t1 on a separate material (after a bit of photo shopping to the texture). I am starting to learn that the possibilities are never ending and that the hardest part is picking which technique you want to use. :D

Just as a note towards bump mapping on a track surface, I read in a few places that it's not that effective and I experimented a bit trying to get the gaps in between the stones in the asphalt, but it always ended up like a smooth plastic looking lump, not a rigid edge of a stone. In the end, I found spec map alone can do a much nicer job. You can also add fake ambient occlusion with multa maps and the opposite with add maps. Like the bevel in photoshop, to give the 2d object a 3d appearance it uses multa with black for the shade and screen (add) with white for the light. IMHO, it works much better than bump mapping. In this case you can use t1 mul t2 add t3, mul t4 with t4 being the skids, t3 being the light and t2 being the shade.

I'll stop here so I don't fill up the whole page :D As I said, it's never ending I could keep going for ever typing up different ways of using these shaders.
 
You know, this would all not be necessary if there was a way to make the racing line higher detail :D.
As far as I can tell, this won't be necessary at all in rF2; which is good, since the racing line and the rubber being laid down is dynamic!

This is from the SimHQ interview with Gjon:
While we're implementing many requests from various league admins to enhance the online experience, probably the biggest feature that affects both single and multiplayer is our new dynamic racing surface technology, or RealRoad. The track will "rubber in" as the weekend unfolds, excessive rain can clean the track surface, drylines will appear as the cars dry out the track, and marbles begin to build up as the race unfolds. All of this is constantly affecting the grip level of the track, and none of it is predetermined, but rather it is based on where and how the cars are driven.


Another way I thought of was to have a texture with skidmarks straight down the centre, then drag the uv's left or right to mould them to the skid. But that would take a lot of manual effort. (does that make sense? I'll draw up an example if it doesn't.
Yeah, that would definitely work as long as you're doing a multiply map. I wouldn't think it'd take much more effort than any other technique, really; in some ways, it's nicer! Well...assuming you can copy the UV's for your diffuse texture and then modify them for that particular mapping channel. The trick is to get it to begin and end smoothly so you don't have that hard edge where the edge of the poly is.

It's easy to create new shaders, and for your textured racing line, take a look at my Jerez
That looks real nice! My question is, though, do the custom shaders overwrite all instances of that shader? i.e. Will it affect my other, already-installed, tracks? Or does it only apply to that particular track?

My impression is that you have to basically 'hack' one of the factory shaders in order to use the new shader, right? You're just basically inserting new code for all calls of that particular shader? Or are you actually creating a new instance and it's only being used where you've applied it?
 
Hey MaXyM,
The road looks fantastic in that video, but I think we can get at least 90% of that look with just a good diffuse and specular map .

I cannot agree with that because there are 2 main problems to reach a goal a way you are referred to:
1. shaders provided with rF are quite simplified. There is no Fresnel effect for example. Using original shaders you may mix textures adding specular, but you cannot affect transparency of mixed textures depending on camera-object-sun angle. In our case we mix tarmac diffuse texture, skids black texture, specular main texture, specular additional texture and of course bump texture. Additionally we may control how much bumps sticks out a surface (ie simulating lines paint wearing). It's the reason why you cannot reach the same visual effect as using shaders from SRPL pack.

2. you must provide as much diffuse and specular textures as number of different looking parts of tarmac. Which is inefficient of course.
Our (Krzysztof's) shader works similar to vanilla best line generated by rf: just uses single RGBA texture over whole track. Best line shape and intensity is read from AIW by special tool, modifying track surface objects.

Result is amazingly dynamic. The view is changing not only by changing direction of driving (around a track) but also minute by minute when sun is moving over a sky.
 
Last edited:
My impression is that you have to basically 'hack' one of the factory shaders in order to use the new shader, right? You're just basically inserting new code for all calls of that particular shader? Or are you actually creating a new instance and it's only being used where you've applied it?

Nope, you can add your own GFX file, call it whatever you want and rfactor just loads all gfx files in the shared folder. Then you can add as many shaders as you like in there, just give them a unique name. Of course take the existing shaders as a base, but if you rename it appropriately, it wont overwrite any others.
 
It's easy to create new shaders, and for your textured racing line, take a look at my Jerez ;)
Very nice! How did you get the fog to change with the time of day? I've been somewhat disappointed with the way fog works with rFactor (as I understand it at the moment). It'd be nice if you could define different fog for the different times of the day, and whether or not the skybox(i) were rendered with/without fog. During a clear day, I'd prefer to only have the fog act as atmospheric perspective; which my skybox(i) textures already have built into them. At night, I'd like to turn the value of the fog down quite a bit. And on a cloudy day, it'd be nice to actually have some 'real' fog to limit your visibility.

What's causing the "high frequency noise" (to use a technical term) on the road surface on Jerez? Is that the spec map? diffuse map?

As far as the 'racing line' goes; it 'seems' as though it's actually inverted to how it 'should' be. You have it such that it's more visible at a distance (lower eye angle), and less visible nearby (higher eye angle). It 'seems' as though it should be the other way around. I don't know if this is actually how it is or what, it just seems a bit 'off' is all. I do appreciate what you're trying to do, and it definitely looks better than standard techniques! I just thought I'd mention it as constructive criticism, I'm not trying to downplay your achievements in any way shape or form.

Nope, you can add your own GFX file, call it whatever you want and rfactor just loads all gfx files in the shared folder. Then you can add as many shaders as you like in there, just give them a unique name. Of course take the existing shaders as a base, but if you rename it appropriately, it wont overwrite any others.
Sweet! I will definitely have to look into this more as I get into it some more. I've dabbled in programming before, I've even tried writing a particle shader for Mental Ray/XSI--unfortunately without much success--probably not the best place to start shader writing! hahah I think I had the 'shader' part of it down pat, but I struggled in sampling the particle data.

Are people releasing shaders to the mod community? I think I saw a really nice billboard tree shader that takes the sun angle into account that I could REALLY use on my current track, a much better water shader, and of course, that track surface shader you've got for Jerez. :)
 

Back
Top