The online racing simulator
Normal Maps / Fancy Bling
1
(43 posts, started )
Normal Maps / Fancy Bling
Hi

I just wanted to quickly bring up the topic of normal mapped textures in LFS and what folks might have to say about that. Mostly I'm interested to hear what programmers would like to say about the potential performance impacts on the sim, whether it's possible with the current DX version of LFS, hassles with coding or integration etc... basically whether you think it's a good thing or not a good thing.

Personally, I'm kind of blown away by the possibility, atleast <ahem>, I'm very much interested- and am keen on learning and experimenting with normal maps as much as possible. Over the last couple of nights I've written some stuff and posted some images over in my high-res textures thread, starting here.

So, what do you think? Viable or not viable? Good idea or dumb?
Not quite sure I understand....

Is it something that makes textures appear to have bump mapping? If so, I think LFS could use that a little bit, to give textures some depth.

Or is it something you can do to actually make bump mapping in LFS?
Quote from Tweaker :Is it something that makes textures appear to have bump mapping? If so, I think LFS could use that a little bit, to give textures some depth.

normal maps are sort of a fancy version of bump maps which colour code a vector in 3d space (rgb => xyz) which is then taken as the normal of the pixel on the texture in lighting calcs
I'd like to see examples of it in LFS... like on a brick wall or something?
Yes, I would like it. If it's just a case of 1. Enabling it in DX and then 2. making a default normal map of every texture, then it has my vote.

If it requires weeks and weeks of programming I vote it should wait a bit longer.
As I said before, if it`s possible I would very much like to see that kind of textures in game. It probally would impact the FPS some, but I don`t belive it would be a totaly FPS - killer.
I don`t have knowlege enough to talk deep into LFS engine and FPS and such, for that kind of questions you gotta ask Jagk, he usually knows it.
#7 - bbman
Quote from Tweaker :I'd like to see examples of it in LFS... like on a brick wall or something?

As I've understood, normal mapping isn't possible in LfS yet, because the engine doesn't make use of shaders... EK posted a brickwall he photographed in his thread though, and I have to say it looks very impressive...
Quote from tristancliffe :Yes, I would like it. If it's just a case of 1. Enabling it in DX and then 2. making a default normal map of every texture, then it has my vote.

If it requires weeks and weeks of programming I vote it should wait a bit longer.

Ditto for me.
Quote :I'd like to see examples of it

Probably the best example I can give is this shot, which gives a pretty decent impression how normal mapped textures are affected under a shifting light source.

The trick is achieved by giving new texture information about the direction each surface point in a texture is facing (imagine a line extending perpendicularly from each surface point- that's the normal). If a texture were truly flat- placed horizontally, all lines issuing from all points would be vertically aligned. But of course that is hardly the case in reality, many surfaces have rounded or rough edges, bumps and dips etc. A normal map provides that surface information and then a calculation is done which measures between 2 angles- the angle of the light vector (the direction the light's coming from) and the normal vector. If the angle is slight, then that point is to be brightly lit, because it's almost facing directly into the light. Broader angles are more darkly lit because they're facing away from the light source.

"The core mathematical formula for lighting looks like this:
brightness = N dot L N is the direction that the surface is facing (the surface normal) and L is the line that we draw from the surface point to the light source (the light vector). “Dot” is the way we measure the angle between the two lines. It’s a dot product of the two vectors."


Normal mapping is classified as a bump mapping technique, but the effect is much richer and realistic looking textures than what is achievable with the older school grey scale bump mapping that we're pretty familiar with.
Attached images
tutorial_normals01.gif
tutorial_normals02.gif
tutorial_normals03.gif
irregular.jpg
happysun.jpg
I have an impression that you think that enabling enabling normal maps is as easy as:

LFSunbelievableGraphicsEngine->SceneManager->b_NormalMaps = TRUE;

... well it is not.

First of all standard graphics pipeline LFS use (well not really standard cause LFS use HVS but apart from that it has no difference) does not support per pixel lightning, so DOT3 bump mapping is not possible at the moment (to give same results as screenshots in from the other thread). LFS engine have to be a bit reorganised to support Pixel Shaders, what is required to have such effects ingame.
Yeah, well in the high res thread, I kind of suggested maybe it wasn't too hard to do- but that was only because I'd googled a bit, and found some programmer who said basically he added a few lines of code, and had it all up and running, with a bit of fiddling around involved. But that's why I started this thread- to get a better understanding from a programming side what happens (as you picked up I'm obviously clueless), and a rough idea of performance impacts. I'm aware LFS would have to switch over to per pixel lighting system, and from playing a game like F.E.A.R. - I can understand that things might want to slow down a bit. On the other hand though, lots of modern games cope well with per pixel lighting, so I don't think it's unreasonable as a suggestion anyway.
the problem i have with this is that lighting in lfs and racing games in general isnt dynamic at all ... there is 1 light source and it doesnt move at all over the course of a race
so what exactly is the point of adding normal mapping if you wont ever see any effect ?
On the surface, this is an amazing idea. I would really like to see it implemented in LFS someday. However, almost all of these details are so minor and sometimes obscure, that you probably won't notice them as much when you're blazing around the track. I'm just saying, I'd like the devs to actually improve the gameplay before they improve the graphics.

That being said, I'd actually like to hear what Scawen thinks about this idea, if it's even possible to implement at this point.
One obvious part to use them would be the tyres, and they'd probably benefit even more from (preferably dynamic) diffuse maps. That way you could actually make them look like rubber, and to top it off gradually reduce the shininess of the worn/flatspotted parts for visual feedback.

Cars and other dynamic objects like tyrestacks could use normal maps too, though especially cars rarely have any 'texture' to them, so the difference would be negligible.

On the static scenery it appears they wouldn't have an effect, but that is only partially true. Theoretically you could create all textures with a perfect shading already applied, but this would only work for one specific angle to the light source. If you for example have a brick texture that is used in more than one direction relative to the light source (which is very likely), then normal mapping would already make a difference. Well, if you weren't driving past said brick wall with 200km/h, that is.

I think overall shaders could improve LFS' graphics a whole lot, presuming Scawen applies them realistically and not overdone like in many first person shooters
Quote from Shotglass :so what exactly is the point of adding normal mapping if you wont ever see any effect ?

3D-looking textures
Quote :there is 1 light source and it doesnt move at all over the course of a race
so what exactly is the point of adding normal mapping if you wont ever see any effect ?

Maybe that's right, but that's more of a result of S2 not having real-time time of day/dynamic weather etc. I'm not really thinking about normal mapping as something that would improve S2 a great deal, although having that more accurate lighting thoughout would bump up the general presentation quite a bit I think. But for S3, if we want those other things, then I think normal maps for a range of textures should be considered.
Quote from Electrik Kar :Maybe that's right, but that's more of a result of S2 not having real-time time of day/dynamic weather etc. I'm not really thinking about normal mapping as something that would improve S2 a great deal. But S3, if we want those other things, then I think normal maps for a range of textures should be considered.

even then youd have a sun that barely moves over time and a texture you blast past ever 1 1/2 minutes at 200kmh
i rather doubt that anyone here would notice a texture shadow moving 1 pixel to the left over the course of several laps
I'm not thinking about it like that. I'm thinking more in a gestalt overall kind of sense where a scene has more accurate textural depth, lighting and shadowing than what is currently allowed given the limitations of the engine.

Textures should look different depending on whether the sun is high overhead, or dipping behind the horizon, or going behind a cloud. Of course, I realise I'm coming simply from an aesthetic viewpoint, which I guess LFS isn't really about, so maybe I'm barking up the wrong tree.

The other thing is- if LFS ever got dynamic time of day, you can bet that a fair whack of people will set it at 4X, 8X speed just so they can see the sun set over 3 laps.
Quote :If you for example have a brick texture that is used in more than one direction relative to the light source (which is very likely), then normal mapping would already make a difference.

Yeah. Running on that idea, here's two shots of a brick wall (since Tweak asked ), both normal and displacement mapped (to give a better 3D impression), under two different lighting arrangements. I've mapped it to a cylinder to highlight the effect. In the first shot, the light is basically coming at the texture front on, everything is quite well lit. In the second shot, the light's coming from the left, which puts the curve of the right side of the cylinder into shadow. Even in a static lighting environment (these shots are static), you can see how much of an improvement is being made to the surface details. In an environment where the lighting is shifting at a constant but perhaps very slow rate, ie- from the normal steady movement of the sun, you could perhaps appreciate that say- if you came onto a server at 5pm, and raced a few hours, things would look quite different by the time you exited the server at 8pm.
I dunno. It's exciting to me atleast. But we're all moved by different things I guess. Hey, atleast it's an original suggestion
Attached images
light.jpg
in shadow.jpg
Quote from Shotglass :i rather doubt that anyone here would notice a texture shadow moving 1 pixel to the left over the course of several laps

Ahhh, is it time to stop with that same argument of "it's a sim, graphics don't matter"... it's getting a bit old and silly..
You are saying that the default LFS tracks and Elecrik's version are the same, and that you don't notice the difference while driving? To me, pretty textures add so much to the immersion, and i feel more confortable playing.. When i go to a friends house and see LFS with no AA and AF and default textures it simply isn't the same game..
A man goes through so much trouble in helping us have a better looking LFS and gives a great suggestion... i don't think he deserves that cliche argument of "graphics doesn't matter"...
It is definately something LFS should do in the future, not overly difficult to add (except making the actual normal maps, but that is not too difficult either) and could bring alot of new detail to the graphics. Only thing to watch out for is not to overdo it, as excess amounts (like most games tend to do unfortunately imo) gives either a plastic look or too hard shadows like there would be no atmosphere or light scattering at all.
EK's textures are almost spot on in that regard (some kerbs are borderline imo) and as long as the devs refrain from adding that stupid reflection shader which makes everything look like either wet or plastic-y, it should be alright...
Quote :i don't think he deserves that cliche argument of "graphics doesn't matter"...

I didn't really take it that way- I think Shotglass was just thinking practically. To be honest, I struggled for a few moments considering what the benefits would be if you still had that static lighting. The first time I made a normal map, my mouth fell open as I panned the light across my texture. It was like magic. It was instantly seeing beyond photography into a whole other world of dynamic details. That's why I instantly thought of S3 and those realtime possibilities. But I'm sure things would look very nice in a statically lit environment as well, it's just that you'd miss out on some of the potentials.
dont get me wrong i really like elektriks work on textures but i really dont see much benefit in this for racing sims in general
race tracks are supposed to be quite flat and things which would really show a strong effect like brick walls are far away from where your car will be most of the time

i dont know how many gpu cycles a fully normal mapped environment would eat up but im sure that using them on full dynamic shadows casted by every single object around you would have a much greater impact on graphics and be noticeable while playing as opposed to something you can admire in the pits
What about in longer races (S3?), when there is dynamic transition from day to night and back, the sun moves (well, rather the earth in relation, but you get the point), along the skyline, so a normal mapped track, would create realistic shadows. I can see what EK is saying, and I think it'd look frikking awesome, if put in right.
1

Normal Maps / Fancy Bling
(43 posts, started )
FGED GREDG RDFGDR GSFDG