Racer v0.8.13 is out

Ruud

RACER Developer
Nice for the weekend, v0.8.13
Get it at http://www.racer.nl/download/racer0813.zip (60Mb)

Have a good weekend!
Ruud

Changes:
- Updated FMOD to v4.30.5 (needed in a first attempt to create a 64-bit Racer, for what it's worth)
- standard_blur_f.cg had a syntax error; fixed.
- You couldn't select shadowmapping (CSM) but no bloom. Now you can with fs_filter1=shadows_f.cg (automatically done when selected from the menu)
- Bugfix: first moving menu image was faulty
- Added 'bloomFactor' to data/renderer/common/constants.cg (0.5) to adjust bloom amount
- Special.ini's gfx defaults were not too handy, giving division by zero and slow framerates.
- Number of available flares raised to 60 (was 40)
- Added physics.tracks.use_road_noise option to optionally ignore road_noise from track special.ini files
(not really useful for the internet version)
- 'show carpoints' now also shows flare normals
- Flare aspect was changed with viewing angle, making it appear as if the normal was bad.
- Flare texture rotation now a bit nicer (dot product with camera X instead of Z)
- Updated CSM filtering (+bloom) to use GPTDBiz's PCF filtering (nice work!)
It does have some aliasing/Z artifacts currently though, which need fixing.
- dyn_standard_bump_reflect*.cg had a bug in normal passing, which generated too much shadow areas
(all areas where the normals had negative components)
- Added 'track load <name>' console command to load an entire track (not too useful for general use)
- empty_f.cg shader was not released, giving QLOG warnings
- Rain could disappear sometimes (bad renderstate)
 
I've changed the following in lighting.cg...

//normalInfluence=(N.y+1.0)*0.2;
normalInfluence=(N.y+4.0)*0.5;

It seems to help the lighting considerably. Especially the ambient levels, surfaces in shadow are subdued but not totally black.

gtpdzbiz:
This shot shows a problem with the current shadow shaders, in that they are not blocking the specular on a material in shadow. I figured since you originally wrote them you would have a fix. :)

Your normal influence will increase to 2.0 when the normal points up (N.y=1), so you are artificially increase ambient twice. Better to modify the car.shd shader than to fix lighting mix problems in the Cg shader. Same way for negative normals; you'd even negate ambient influence. Might want to try to give the sun more ambient.

As for the shadows, that might be the reflection. The reflection should still work in ambient spots, but alas it then also picks up the sun. I don't think there's an easy fix for that.
 
@ Alex and Ruud

Your normal influence will increase to 2.0 when the normal points up (N.y=1), so you are artificially increase ambient twice. Better to modify the car.shd shader than to fix lighting mix problems in the Cg shader. Same way for negative normals; you'd even negate ambient influence. Might want to try to give the sun more ambient.

As for the shadows, that might be the reflection. The reflection should still work in ambient spots, but alas it then also picks up the sun. I don't think there's an easy fix for that.

The normal influence above (*0.2) is a really good setting... try a matte white object like a sphere in your track Alex, with no diffuse sun light, and it looks really natural.

This is where we need to be careful. People can end up tweaking values where there is more than one variable to determine the resultant appearance.

Right now an objects ambient behaviour is inpacted by many variables, more so for diffuse with a texture with much more information. To simply tweak one of many variables to get the appearance we think is right is the wrong approach.
Have a scene with a flat plane with a chess board pattern and a matte white, grey and black ball, and a chrome ball... set up the lighting there and make it look natural. We can all visualise how it should look quite easily, vs a car with all manner of reflections and so on impacting how it looks! (this is what I plan to do in real life because no one else has done it yet and it seems to be the preferred method for film makers compositing digital and real life material effectively right now!)

This approach removes as many variables as possible so you can be assured that the few you have control of at that point have to be correct, or very close to it.



As per why things look too dark right now to want to up ambient/shaded areas, I honestly am sure the reflection mix for fresnel is being done badly. With pure ambient as above, things look 'right' so it's only when we add reflections they look wrong.

I haven't devised a test to prove it, but a black car with lacquer top-coat paint (ie, a modern car) at a glancing angle should reflect like a mirror the environment around it. Right now it doesn't. It is almost like it is an overlay mix rather than a screen. Perhaps it is our fresnel default values that are just wrong!?
Either way, from first principles, matte objects look right in ambient only lighting, ergo, they are right. The problem seems to be with reflective materials intensities in shaded conditions!




As for the reflections/specular, the live envmap pics up the very bright sun spot, so even reflections in the shadow will show the sun spot.
This is clearly visible on the side air intake of the Lamborghini Murcielago at sunset. You can be looking at the shadow side of the car with the sun behind the car, but the sun is in the reflection on the part of the car in shadow. There is no elegant solution without rendering the envmap twice, perhaps every other frame is one with sun spot, one without, and then using the deferred rendering to use the non-sun spot envmap for reflections of shaded areas! (ie, this would halve the FPS of the envmap, and likely use up more memory storing the two envmaps etc)


Hmmm...

Dave
 
@ Alex and Ruud




As for the reflections/specular, the live envmap pics up the very bright sun spot, so even reflections in the shadow will show the sun spot.
This is clearly visible on the side air intake of the Lamborghini Murcielago at sunset. You can be looking at the shadow side of the car with the sun behind the car, but the sun is in the reflection on the part of the car in shadow. There is no elegant solution without rendering the envmap twice, perhaps every other frame is one with sun spot, one without, and then using the deferred rendering to use the non-sun spot envmap for reflections of shaded areas! (ie, this would halve the FPS of the envmap, and likely use up more memory storing the two envmaps etc)


Hmmm...

Dave

Gtpdzbiz, showed me that the problem was the fact that I had render once set in racer.ini and the sun was showing due to the fact that it was baked into the envmap and not using the live envmap (which works fine). I guess you could render the envmap once without the sun effect
and then just use the shadow mapping to test when to block it thereafter.

I look foreward to your tests, maybe we can give GT5 a run for it's money. ;)

Alex Forbin
 
Your normal influence will increase to 2.0 when the normal points up (N.y=1), so you are artificially increase ambient twice. Better to modify the car.shd shader than to fix lighting mix problems in the Cg shader. Same way for negative normals; you'd even negate ambient influence. Might want to try to give the sun more ambient.

As for the shadows, that might be the reflection. The reflection should still work in ambient spots, but alas it then also picks up the sun. I don't think there's an easy fix for that.

Where do I add ambient to the sun? Is it in the special.ini...

; Sky Cg shaders
intensity=1.0
; Dusk (is this it?)
diffuse=1 1 1
ambient=1 1 1
specular=1 1 1


Ideally we should have varying light levels according to certain conditions such as TOD and weather. An overcast day would subdue the specular much and diffuse some but slightly increase the ambient light, but a clear day will have high specular and diffuse with less ambient which results in a higher contrast.

Alex Forbin
 
My test of sky settings in special.ini led me to the conclusion that diffuse, ambient and specular have NO effect on the sky. I test them from all 0 to all 1 with no noticable effect!

rayleigh, mie and clouds do have an effect on the sky, especially clouds= which cntrols the brightness. That is what I used to get the sky image that was very close to the original photo image that I used for the sky.

I have also noted that there are no clouds on carlswood, where did they go? They are in the sky shader in the track.shd file. I haven't checked the cg's used on carlswood as I use the day/night cg's.
 
Being a perfectionist-ish person, I'd say the light flares still aren't correctly aligned to the camera. The flares should look perfect squares wrt the camera, but currently look a bit rectangle-ish and have perspective.

(I changed the alpha channel of the flare texture to all white, so the flare texture boundaries could be seen better)

Current:
wrongo.jpg


Correct (photoshop):
rightj.jpg
 
Where do I add ambient to the sun? Is it in the special.ini...

; Sky Cg shaders
intensity=1.0
; Dusk (is this it?)
diffuse=1 1 1
ambient=1 1 1
specular=1 1 1

It should go in 'ambient'. :) Just use ambient=2 2 2 for example, although that seems quite high. The balance is what matters (diffuse vs ambient, try to keep exposure to 1.0 for a basis). You can try it live using 'sun ambient 2.0' for example, although that only accepts 1 value and puts it in R, G and B (so only gray values).
 
My test of sky settings in special.ini led me to the conclusion that diffuse, ambient and specular have NO effect on the sky. I test them from all 0 to all 1 with no noticable effect!

rayleigh, mie and clouds do have an effect on the sky, especially clouds= which cntrols the brightness. That is what I used to get the sky image that was very close to the original photo image that I used for the sky.

I have also noted that there are no clouds on carlswood, where did they go? They are in the sky shader in the track.shd file. I haven't checked the cg's used on carlswood as I use the day/night cg's.

Indeed, sun diffuse/ambient only influence the objects on the ground. The sky shaders calculate the atmosphere color (ambient and diffuse) through the position of the sun and rayleigh/mie. The atmosphere colors change throughout the entire hemisphere, so I'm not sure how a single color value would be useful, except perhaps for a zenith color. The gradients in the atmosphere mean the color changes all over the place.

The atmosphere is rendered using rayleigh/mie/sun position, and the objects on the ground are lit using sun.diffuse/sun.ambient (perhaps named a bit strange therefore). So these diffuse/ambient values should reflect a bit on what the atmosphere is doing. One of the reasons I want to outplace those tables so that people with can tweak it to best effect.

'Clouds' doesn't control brightness, it controls the transparency of your sky texturemap (sky.tga?), as an added factor on top of the texture's alpha channel (final_alpha=texture.a*clouds). So if it effectively controls brightness, there's something wrong with your texture (perhaps you have blue sky in your texture and are not using alpha to completely take that out?).
In Carlswood, clouds was set to 0 for a test, and I forgot to put it back to 1. Fixed in 0.8.14.
 
Being a perfectionist-ish person, I'd say the light flares still aren't correctly aligned to the camera. The flares should look perfect squares wrt the camera, but currently look a bit rectangle-ish and have perspective.

The flares were billboard wrt to their normal. In 0.8.14 I'm now billboard wrt the camera. Also improved the visibility calculation a bit, which used camera direction, instead of a real view vector from camera to flare. Hopefully that satisfies your perfectionistic self. ;)
 
Where do I add ambient to the sun? Is it in the special.ini...

; Sky Cg shaders
intensity=1.0
; Dusk (is this it?)
diffuse=1 1 1
ambient=1 1 1
specular=1 1 1


Ideally we should have varying light levels according to certain conditions such as TOD and weather. An overcast day would subdue the specular much and diffuse some but slightly increase the ambient light, but a clear day will have high specular and diffuse with less ambient which results in a higher contrast.

Alex Forbin


Hopefully the TOD/sky curves should allow us to do what you are saying...

As Ruud said, use tracks special.ini diffuse= and ambient= for emulating the sun colour/intensity and skies colour/intensity, respectively.

As Ruud said, it's the balance that is mainly important, and colouring, since exposure can pump the overall look anyway.

As you say, on a bright day you get more contrast, but it's not from less ambient, there is maybe 4x more ambient on a bright sunny day vs an overcast bright day, BUT, there is probably 16x more diffuse on a bright sunny day, so that is where the contrast comes from. You only need to see how much the shutter speeds on an SLR have to drop when the sun goes behind a cloud for a moment... looks very similar to your eye, but in absolute terms it's much darker :)

However, the sky intensity and colouring and linked to the values set above (special.ini diffuse/ambient), so I think it's important they all work together (personally I'd like to see large range values for diffuse/ambient so night time is multiples lower than day time intensity, and the exposure control adjusts to make the rendered scene appear appropriately)
This may well then mean things like headlight flares don't look stupidly bright in the midday sun for example.



As for over-cast etc and specular influence, the sun spot will soften and dull via mie/rayleigh, and so soften and dull the specular, so good values for mie/rayleigh for a cloudy day will appropriately alter the appearance of the materials.

This is why I asked Ruud for control curves so that TOD values can all be set really nicely for varying conditions. Ie, clouds 0...1 should really also influence mie/rayleigh, so the above mentioned softening/dulling of the specular in the envmap occurs etc...


However, Ruud did mention that currently Racer is geared towards a 'sunny' sky simulation. Overcast works differently. Right now if you set sky intensity to say 0.5 the sky errs towards darkness despite the fact you may use a heavily clouded sky texture, having dark blue/black peeking through the gaps in the clouds looks wrong :(


All really cool stuff though. If you do a fixed TOD you can still achieve excellent results, it'd just be nice to have them work via TOD and all work together nicely via a curve system (someone posted the Crysis sky editor stuff which is the kinda thing we really need for Racer imo)

As for specular in the track special.ini, I think that is tied to diffuse now, or should be? (it is in the TOD system at least which seems sensible since any specular generated is done so via the diffuse generator anyway :) )


Hmmmmm, just throwing my thoughts out there wrt having a more HDR setup for scenes. Makes it easier to approximate to real information we can gather, and not have to fudge things when it comes to intensities elsewhere (ie, car lights working in the midday sun is just wrong hehe)

Dave
 
The flares were billboard wrt to their normal. In 0.8.14 I'm now billboard wrt the camera. Also improved the visibility calculation a bit, which used camera direction, instead of a real view vector from camera to flare. Hopefully that satisfies your perfectionistic self. ;)

Sounds good Ruud :D

Is there any way we could have a shader that makes a plane move around it's pivot point in the manner above...

Ergo, we can define our own car objects for flares instead. The inbuilt Racer ones are good for some stuff, but many cars now have arrays of LED's or strip lights etc, and it's just crazy having tens of entries for just one brake light or something, vs a simple texture to cover the entire array (which contemporary games like NFS Shift use for example)

Not so important for now, just I've seen Camsinny's F458 car.ini section for the flares, and it is half as big as the whole car.ini file and he still hasn't finished haha :D

Thanks

Dave
 
Sounds good Ruud :D

Is there any way we could have a shader that makes a plane move around it's pivot point in the manner above...

Ergo, we can define our own car objects for flares instead. The inbuilt Racer ones are good for some stuff, but many cars now have arrays of LED's or strip lights etc, and it's just crazy having tens of entries for just one brake light or something, vs a simple texture to cover the entire array (which contemporary games like NFS Shift use for example)

Not so important for now, just I've seen Camsinny's F458 car.ini section for the flares, and it is half as big as the whole car.ini file and he still hasn't finished haha :D

Thanks

Dave


The ultimate way of flare is via post-processing. It automatically generate star streak at bright area which supports unlimited number of flares . Hope it can come to Racer's world one day~
 
The ultimate way of flare is via post-processing. It automatically generate star streak at bright area which supports unlimited number of flares . Hope it can come to Racer's world one day~

+1. In fact, the previous method of blurring the shadow texture in screen-space almost gave the effect of having light flares (although, they were more like "dark-flares").

I think the easiest way would be an additive fullscreen shader that would filter out very bright pixels in one pass and do a vertical + horizontal blur in the next pass?
 
Sounds good Ruud :D

Is there any way we could have a shader that makes a plane move around it's pivot point in the manner above...

The particle shader (particles_v,f) does that, I'm not sure exactly how it works (in terms of the plane object you feed into it) but it should be possible to modify it to work like the other regular shaders (except billboarding).

My initial read seems like it would be a quad mapped square to the texture, and then shrunk so all 4 corners are at the centre of the flare. Then it uses texture coordinates to spread them out in camera space, and their normals to scale it back from the side.
 
It should go in 'ambient'. :) Just use ambient=2 2 2 for example, although that seems quite high. The balance is what matters (diffuse vs ambient, try to keep exposure to 1.0 for a basis). You can try it live using 'sun ambient 2.0' for example, although that only accepts 1 value and puts it in R, G and B (so only gray values).

Ah, thanks. I'll set the lighting back to normal and use that. I wasn't sure about those sun settings since it said "dusk" on it I thought it might be the control for the sun color at dusk. (duh)


Alex Forbin
 
Hopefully the TOD/sky curves should allow us to do what you are saying...

As Ruud said, use tracks special.ini diffuse= and ambient= for emulating the sun colour/intensity and skies colour/intensity, respectively.

As Ruud said, it's the balance that is mainly important, and colouring, since exposure can pump the overall look anyway.

As you say, on a bright day you get more contrast, but it's not from less ambient, there is maybe 4x more ambient on a bright sunny day vs an overcast bright day, BUT, there is probably 16x more diffuse on a bright sunny day, so that is where the contrast comes from. You only need to see how much the shutter speeds on an SLR have to drop when the sun goes behind a cloud for a moment... looks very similar to your eye, but in absolute terms it's much darker :)
Dave

Good points. As far as a TOD editor goes, it would be nice to have a small preview of a ball on a
ground plane.

Alex Forbin
 

Latest News

How long have you been simracing

  • < 1 year

    Votes: 254 15.2%
  • < 2 years

    Votes: 169 10.1%
  • < 3 years

    Votes: 167 10.0%
  • < 4 years

    Votes: 125 7.5%
  • < 5 years

    Votes: 230 13.8%
  • < 10 years

    Votes: 200 12.0%
  • < 15 years

    Votes: 125 7.5%
  • < 20 years

    Votes: 96 5.7%
  • < 25 years

    Votes: 77 4.6%
  • Ok, I am a dinosaur

    Votes: 228 13.6%
Back
Top