Racer v0.8.40 released


RACER Developer
A newer version. Get it at http://www.mediafire.com/?dm4nkc5bnn3j96n
The latest patch (textures in subfolders) can be found at
http://www.mediafire.com/file/g5i0mkhzbkcejmh/racer0_8_42exe.7z (exe/pdb only)

The changelist:

- User camera offset and angles now take an approach relative to the camera. It might take a while
to get used to it compared to the old method.
- User camera offset/angle works with fixed & free (SMD) car cameras.
- Selecting graphics options and then doing a race would not have any controllers loaded.
- Look left/right works again (although not set by default; go into Controls)
- Onyx classes now supports member functions (no constructors yet)
- Added Onyx mouse functions to get coordinates & buttons (see data/scripts/onyx/include/racer.oxs).
- Added timing.fixed_time_step for ultrasmooth graphics; set vsync=1 and fixed_time_step to 0.016666
for example for a 60Hz screen. May go wrong when Triple Buffering is turned on though.
- Shadowmap rendering pass will now invert culling (instead of turning culling off entirely).
- TrackEd's Split function would generate bad DOFs if more than 21,845 (or perhaps 65,536?) vertices were present
in a single cell. Now it will generate multiple DOFs, each containing at most 21,000 vertices.
- Replay exporting development using DirectShow (instead the ancient VideoForWindows) to get better
video files. May requires openglfilter.ax to be registered (run 'regsvr32 /s openglfilter.ax').
See http://www.racer.nl/index.php?jump=tutorial/replays.htm
- Replay export using DirectShow (replay.video.type=2) now requests a filename (intermediately generates replay_TEMP.avi/wav).
- Replay format changed; now stores the driver names as well and can display those in replays (if show_names=1 in racer.ini).
The format is incompatible with previous replay formats.
- Added replay.auto_save, replay.database.dir for more control on saving replays
- Added support for custom reflection maps in tracks, see http://www.racer.nl/index.php?jump=tutorial/reflection_map_creation.htm
- audio.frequency was unused for a long time. It became apparent when writing replays where timing was off due to 48kHz vs 44.1kHz

For an interesting experiment, download http://www.mediafire.com/file/04t1dvj6tl2qyvb/WORLD.7z and put the files in data/tracks/carlswood_nt. Very alpha stuff.
Textures don't load from subfolders anymore - ie, the shader call "map=txt/brakelight.tga" isn't working and qlog reports "can't load 'data/cars/69ccz28/txt/txt/brakelight.tga'". This applies to both cars and tracks.

Hope it's a quick fix, because I'm not too keen on changing around all my content structures just to have a decent picture again and do proper testing ^^


I downloaded the 0.8.41 .exe and cubemaps still don't work in subfolders.
Thu Jun 07 14:24:41 (WARN): [racer/4156] QImage ctor: can't load 'DATA/TRACKS/CARLSWOOD_NT/CUBESKY/CUBESKY/SKY_lt.tga'
If the file's actually in /cubesky/cubesky/sky_lt.tga, it still fails though.
Thu Jun 07 14:26:14 (WARN): [racer/5068] QImage ctor: can't load 'CUBESKY/CUBESKY/SKY_lt.tga'

Anyway, maybe this'll be of interest: a sky that uses a cubemap instead of textures. (note that it ignores texture coordinates of the skybox dof)

(skybox texture from http://reije081.home.xs4all.nl/skyboxes/images/skyboxsun5deg.png )
// Sky shading - single cloud texture

#include "atmosphere.cg"

// Vertex to pixel shader structure
struct v2p
	float4 Position			: POSITION;
	//float3 Color 			: COLOR;
	float4 RayleighColor	: TEXCOORD2;
	float4 MieColor			: TEXCOORD3;
	float3 tc0              : TEXCOORD0;
	float3 Direction		: TEXCOORD1;

void main(
  // In
  in v2p IN,

  // Out
  out float4 outColor : COLOR0,
#ifdef CSM_MRT
  out float4 outShadow: COLOR1,

  // Constants
  uniform samplerCUBE dayMap   : TEXUNIT0,
  uniform float3    eyePosW,
  uniform float3    lightDirection,
  uniform float3    lightColor,
  uniform float3    lightAmbient,
  uniform float     atmosRayleigh,
  uniform float     atmosMie,
  uniform float     exposure,
  uniform float     clouds,
  uniform float     sunny,
  uniform float3    Kd,
  uniform float3    Ka
  float3 skyColor;


  // Add textures
  //float4 dayCol=tex2D(dayMap,IN.tc0);
  float4 dayCol = texCUBE(dayMap,IN.Direction);

  // Cloud cover modifies alpha

  // Atmosphere outside
  float3 atmosColor=skyColor;
  // Clouds are much closer than the outer atmosphere
  float3 cloudColor=dayCol.rgb;

  // General light

  // Mix of inner & outer atmosphere
  float3 mixColor;
  float  mixClouds,mixAtmos;

  // Determine mix of atmosphere and inner ring of objects (clouds)

  // Output
#ifdef CSM_MRT
  // No blending normally
Use as fragment shader - put your cubemap into layer0 in the track.
(for the screenshot I bypassed the rest of the shader and just wrote outColor=dayCol*50.0; - with transparent clouds that wouldn't be necessary)

Avoids the stretching issues with UV mapped skies, just do up a tesselated half-sphere so that the atmosphere has enough points to work with. Can also go below the horizon pretty easily.
Funny thing, with the same settings as before (copied racer.ini from my old 0.8.34), it's very CPU-intensive. When I press Ctrl+6, I can see that 75% of CPU time is used for the mirrors, as opposed to 10% for main rendering.
If I turn off mirror texture with F4, it goes back to normal.


RACER Developer
Scripts still require "reload scripts" command from the console to work.
Did you see any reason why my scripts shouldn't work Ruud?

I tried your 2 scripts (paint/physics); named them both genmodels.rsx, and it worked in one go. Can you provide me with an entire car that doesn't work at once in v0.8.40?


RACER Developer
Nice to see a new version!

Ruud, what happened to the plans of getting the 0.9 final out? A stable enough platform for modders to base their content on?

You're totally right. It might be better to branch off this version to v0.9 and fix tiny things from there, instead of keeping all things on the trunk. I know from experience that that only always adds more side effects. I have these showstoppers currently:

  • Backfire particle normal is ignored
  • I've just noticied two bugs, first, when i do a lap, then i've the ghost car, and when i turn on the lights of my car, it's done to the ghost car and not mine
  • Lambo car_ghost.shd
  • Selcar car is too low
  • Shader loading from subfolder also working for envmaps
Another frustrating bug are the skid marks which sometimes aren't correctly projected to the surface. It also appears some of them are incorrectly generated in wrong places. Could be cool to have them baked somehow & reused/assembled afterwards.

About replays, would be nice to have a 'pause' button, just pressing P while replay is on, will just slower the motion...
Although not a showstopper, but I would be great if the static car shadow (ambient shadow) was also properly "shadered" - meaning that it would get the fog (mie or whatever) applied to it and that it would be correctly z-sorted.


RACER Developer
Ruud, does fixed time step work with NVidia's vsync set to adaptive?

That's an issue yes. :) The strange thing is that my FPS seems to stick at 60, even with Adaptive V-Sync + Triple Buffering. I would have expected it to go above 60, because of all the rendering going on invisibly in the 2 backbuffers. So when I tested vsync+TB+fixed_time_step=0.01667 once, it worked, but I don't get why.

Also, setting Adaptive V-sync programmatically is an unknown to me, hopefully this will become clear. So for now it can only be set in the nVidia control panel.

A nice thing would be to get slightly faster monitors, say 100Hz, for less control lag, and just use adaptive or true v-sync and use fixed_time_step. That is the ultimate smooth method. Perhaps I should try a 120Hz 3D monitor one day.


RACER Developer
Another frustrating bug are the skid marks which sometimes are correctly projected to the surface. It also appears some of them are incorrectly generated in wrong places. Could be cool to have them baked somehow & reused/assembled afterwards.

About replays, would be nice to have a 'pause' button, just pressing P while replay is on, will just slower the motion...

Not sure when the first happens, although I have seen flying skidmarks here & there.
In the replays, SPACE is stop. It might be nicer to have SPACE=start & stop in fact, which is what most GUI's seem to use.


RACER Developer
I downloaded the 0.8.41 .exe and cubemaps still don't work in subfolders.

Indeed, I've fixed this already, haven't posted an exe yet. I might do that in combination with some other files to get trunk/doors working in Onyx (I added some functions). See also http://www.racedepartment.com/forum/threads/movable-doors-trunk-in-onyx.52125/

Your image also shows the downside of 8-bit envmaps; the dynamic range. Perhaps I should add some kind of curve which is the reverse of the tonemapping, to get back at 16-bits somehow. The sun in the envmap shown is quite grayish.
Nice work Ruud!

A bit of a shame about the LDR envmap's... I suppose that if we end up at position "envmap" then chances are the scene will be exposed consistently, so the envmap will represent what we would generally see.

I guess they are also faster and smaller in memory vs HDR data... and blurring them also gives us some flexibility for creating certain effects like faking soft reflections on track-side objects!

I know this sounds crazy, but it might be cool to simply store certain track camera locations and render the env-maps at load time (set to the current TOD) in the HDR format that live envmaps use. In theory the system to generate envmaps with 16bits is in place, you just need to do a lot more at render time to a variety of locations. You could even add a blur factor too perhaps. So just store a load of xyz coords, a reference name, and a blur amount maybe, and even perhaps an update rate (so we could update them every 1 minute or so so they worked with TOD)?!
Then reference them from the shaders... we never even have to touch/see them just like the car envmap...
Maybe something for the future!

Stereo, I like the idea of a cube map system for clouds. Storing the data that way is more efficient (much less waste than a circle with empty edges), and also no stretching.
I believe the Racer sky should move towards the mie/ray 'dome' for all the colouring and appearance from day to night and so on... the current 'clear day' in Racer looks great imo... then the cube-map can do the clouds only... ideally with normal mapping data and alpha doing opacity... the rgb should be a function of how they are lit and their opacity.
That way we can have dark clouds (opaque), light clouds (half transparent alpha), and they also get nice tints at sunset, or whatever else (rather than being white all the time as is currently the case)
As for the moon/stars on the night, I guess even they could be programmed in to the sky.shd file?!




Your image also shows the downside of 8-bit envmaps; the dynamic range. Perhaps I should add some kind of curve which is the reverse of the tonemapping, to get back at 16-bits somehow. The sun in the envmap shown is quite grayish.
Yeah it is, I did a quick and dirty hack
dayCol = tan(1.5*dayCol); // 1.5 is a lower bound on pi/2, which is 1.57something
which curves it up nicely and looks much better, albeit I have no idea whether it's realistic.

(the seam in the texture is my fault, I think)

RaceDepartment Store

The perfect addition to the GT Omega ART Racing Simulator Cockpit, this monitor stand allows ergonomic positioning of monitors from 22” to 52” in size. Buy now from GTOmega.com for USD 119,95 It offers a practical and convenient monitor position to suit any location with movable and lockable...
The Podium Kill Switch is designed for use with all Podium Series Direct Drive wheel bases. Buy now from Fanatec.com for EUR 99,95 Features Brushed aluminium Emergency Stop button instantly cuts power to any connected Podium Series wheel base. Dedicated power button to remotely turn on (and...
  • Featured
Reaction score
FANATEC® Direct-Drive technology comes to the CSL Series. From subtle sidewall flex to powerful self-aligning torque, you’ll feel everything with a heightened sense of realism. Exceptionally crisp and dynamic force feedback sensations await. Buy now from Fanatec.com for EUR 349,95 Features...
  • Featured
The popular pedal set returns with an overhauled load cell brake, Hall sensors on throttle and clutch, and many refinements to the design. Buy now from Fanatec.com for EUR 299,95 Both the throttle and brake axes use precision Hall-effect sensors. By measuring pedal position with magnets, the...
  • Featured
Reaction score
Introducing the official Direct Drive Wheel for Gran Turismo®. Combining PlayStation®5 console performance with FANATEC® Direct Drive technology for the smoothest and most dynamic force feedback sensations. Buy now from Fanatec.com for EUR 849,95 FEATURES Gran Turismo DD Pro Wheel Base: The...
Complimenting the design of the Fanatec ClubSport Shifter, you can securely clamp the wheel base to a desk or table. Buy now from Fanatec.com for EUR 39,95 Features Clamping system allows for endless height adjustments when connected to the ClubSport Shifter’s T-slot rails CSS and CSS SQ can...