Racer v0.8.38 released

Ruud

RACER Developer
Racer v0.8.38 is now available at http://www.mediafire.com/file/a9z1omd6rmhzymb/racer0.8.38b.7z

Enjoy!
Ruud

Changelist:
- Look_up/look_down controls added for to make TrackIR devices possible.
That makes head tracking possible, although currently a bit crude.
- In your controller file you can add global.up_down_velocity to set up/down look velocity (default=250)
- In your controller file you can add global.up_down_look_max to set the max up/down look angle (default=45)
- Removed energy conserving diffuse/specular lighting for version 0.9.
- Auto exposure turned back on. It can cause dips in framerate on some systems (every second, a grab is mipmapped to obtain the scene brightness).
- Added shader .mipmap_bias for the global shader and optionally for separate layers.
- Added cubemap mipmapping to all reflection shaders for environment mapping.
Requires a good graphics card; otherwise, turn off envmap.generate_mipmaps (set to 0).
- Fixed keep_aspect (dials/views.ini) for multi-monitor setups.
- Setting up graphics settings and starting a race would crash.
- Added dev.collisions setting to globally turn off collision checking.
- Wireframe mode gave bad texturing for the rest of the graphics.
- Trackcam FOV clamped to zoom range indicated by the camera
- Newton solver parameters reverted in the hopes of fixing now & then hangups (10-200 seconds each, after several hours of play)
- Car camera offset seems back working; the FIXED camera type should now work correctly again.
- Shadowmapping in car camera mode focuses on the car, even if the camera from/to positions are some distance away from the car.
- Reverted back to FMod 4.30 (was v4.36) since some people had volume problems at startup.
- Differential power_ratio warnings were mistakenly given for non-LSD type diffs.
 
The code I had doesn't work in front of various other shaders cause they (particularly the skybox shader and the track decals) use transparency funny. (note to self, developed it in 0.8.31)

anrTs.jpg

bu0nn.jpg

blendfunc=dst_alpha one_minus_src_alpha
-> trees actually brighter than sky (they're making the material more reflective)
-> Carlswood's track has a very low alpha value and ends up not reflecting anything

UBkEx.jpg

blendfunc=one one_minus_src_alpha
-> trees don't show up at all

lB9cB.jpg

blendfunc=blend (src_alpha one_minus_src_alpha)
-> glass tint shows up much too strongly, sky ends up really dark.

In the first pic you can also see that even on the frame (where src alpha is 100% opaque) dst alpha varies and causes problems. The issue being that the sky is not opaque to the shader - I'm not sure what's "showing through" but it's too dark.

The other issue is that some shaders use alpha for things other than transparency - in which case the dst_alpha method also fails badly, eg. Carlswood track.

The second blendfunc is best, except in cases where it just doesn't work (eg. it doesn't show skidmarks)
 
Part of me thinks it might be better to model them as a different material (black reflective), rather than trying to use a texture to do it all.

Looking at Forza 4 screenies makes me think they do that!

Not ideal for old content, but for old content the 'old' method works 'ok' enough to be left alone.

Not sure what others think!?

Hmmm

Dave
 
Hmmm, it's hard to tell but it doesn't look right to me.

Surely the reflection would be much more intense than that? The sky is almost totally whited out in both images yet the reflections look almost dull in comparison.

Would it be easier to infer 100% reflectivity (with appropriate fresnel set in the car.shd file) in the shader itself, so that the glass always reflects fully, and then simply have alpha adjust the opacity of the glass only?

In theory the fresnel function can be used to adjust reflectivity amount generally over the entire material anyway, which seems perfectly acceptable for glass!?

Hmmmmm

Dave
 
Really with a single texture it's going to have to compromise somewhere, you can't control transparency and reflectivity separately in one alpha channel. Some textures should have both work together, some oppositely, some with a constant reflectivity. Putting a regular blendfunc=blend onto standard_reflect gets you the one where they work together (100% transparent = no reflections), standard_reflect_window does the opposite (100% transparent = 100% reflective, 0% transparent = 0% reflective) which still leaves a need for the third case, reflectivity constant regardless of transparency.


The fragment shader I use is
Code:
// dyn_standard_window_f
// Modified by Stereo; 2011-03-10
//

#include "atmosphere.cg"
#include "lighting.cg"
#include "fresnel.cg"
#include "shadowmapping.cg"

// Vertex to pixel shader structure
struct v2p
{
  float2 tc0            : TEXCOORD0;
  float3 Direction      : TEXCOORD1;
  float4 RayleighColor  : TEXCOORD2;
  float4 MieColor       : TEXCOORD3;
  float4 Position       : TEXCOORD4;    // For fragment shader
  float3 normal         : TEXCOORD5;
  float3 I              : TEXCOORD6;
  //float  fresnel        : TEXCOORD6;
  float3 R              : TEXCOORD7;    // Reflection vector
  float  extinction     : COLOR;
};

void main(
  // In
  in v2p IN,

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

  // Constants
  uniform sampler2D   baseMap : TEXUNIT0,
  uniform samplerCUBE envMap  : TEXUNIT1,
  uniform float3    lightDirection,
  uniform float3    lightColor,
  uniform float3    lightAmbient,
  uniform float3    eyePosW,
  uniform float     atmosRayleigh,
  uniform float     atmosMie,
  uniform float3    Ke,
  uniform float3    Ka,
  uniform float3    Kd,
  uniform float3    Ks,
  uniform float     Kr,
  uniform float     shininess,
  uniform float     sunny,
  uniform float     exposure,
#ifdef CSM
  // shadow mapping
	uniform sampler2D    shadowArray  : TEXUNIT7,
  uniform float4x4     smTexMatArray[SM_MAX_SPLITS],
  uniform float smSplits,
#endif
  uniform float    fresnelBias,
  uniform float    fresnelScale,
  uniform float    fresnelPower
)
{
  float3 skyColor;

#ifdef CSM
  float  shadow;

  // Output shadowing and normals
  shadow=GetShadowFactor(IN.Position, IN.normal,shadowArray, smTexMatArray, smSplits, lightDirection)*sunny;
  //outShadow.rgb = IN.normal;
#else
  const float shadow=1;
#endif

  // Get sky gradient color
  skyColor.rgb=GetSkyColor(lightDirection,IN.Direction,IN.RayleighColor,IN.MieColor,atmosRayleigh,atmosMie,lightColor,lightAmbient);

  // Get base texture color
  float4 baseCol=tex2D(baseMap,IN.tc0);

  // Reflection
  //const float Kr=0.5f;
  float4 envColor=texCUBE(envMap,IN.R);
//envColor*=3.0f;

  // Lighting
  float3 ambient,diffuse,specular;
  LightingSun(Ke,Ka,Kd,Ks,shininess,lightDirection,lightColor,lightAmbient,IN.Position,IN.normal,eyePosW,
    ambient,diffuse,specular);
  float3 litColor=(baseCol*diffuse+specular)*baseCol.a;
  float3 shadowColor=(baseCol*(ambient+Ke))*baseCol.a;
  //baseCol.rgb=baseCol*(ambient+Ke)+baseCol*diffuse+(specular*((int)outShadow.a));

  // Add reflection
  float fresnel=Fresnel(fresnelBias,fresnelScale,fresnelPower,normalize(IN.I),normalize(IN.normal));
  outColor.a = lerp(1.0,baseCol.a + fresnel - fresnel*baseCol.a,IN.extinction);
  shadowColor=FresnelMix(shadowColor,envColor.rgb,Kr,fresnel);
  // Reflection influences opaque-ness?
  //baseCol.a=max(baseCol.a,envColor.g);

#ifdef CSM_MRT
  // Mix sky with texture color based on atmospheric influence
  outColor.rgb=lerp(skyColor,shadowColor,IN.extinction);
  //outShadow.rgb=lerp(skyColor,litColor,IN.extinction);
  outShadow.rgb=litColor*IN.extinction;
//outColor.rgb=fresnel;

  // Blending
  //outColor.a=baseCol.a;
//outColor.a=1;
  // CSM
  outShadow.a=shadow;
#else
  outColor.rgb=lerp(skyColor,shadowColor+litColor*shadow,IN.extinction);
  //outColor.a=baseCol.a;
#endif
}
This tweaks brightness up to compensate for transparency and results in correct intensity with the 'one one_minus_src_alpha' blend func.
It doesn't have the other features of the 0.8.38 shaders though - that is shadow mipmapping, not sure what else.

At the time I wrote it I looked at how light reflects from glass physically and based the numbers on that, along with the 'one one_minus_src_alpha' function doing mixing, so this does look right - but has some blend issues when there are certain types of transparent objects behind it.

Oh, and
Code:
  fresnel
  {
    bias=0.05
    scale=0.95
    power=5.0
  }
Don't leave fresnel at default.
 
Hrm, found two problems with sky_f.cg compounding difficulty in working with cloud maps.

#1 (major):
cloudColor*=clouds;
This makes clouds look terrible at anything other than clouds=1. Just delete the line.
D2Vq0.jpg

clouds=0.2 in both cases, top is with the line, bottom without. Instead of being faded gray, clouds are white as they really should be. There are just less of them than when clouds=1.0.

#2 (minor):
uniform float Kd,
uniform float Ka
-->
uniform float3 Kd,
uniform float3 Ka
and...
cloudColor*=(lightColor+lightAmbient);
-->
cloudColor*=(lightColor*Kd+lightAmbient*Ka);
Make Ka and Kd useful. As it is, you need to adjust the texture directly in order to change how bright the clouds are. This moves that option into track.shd, so diffuse= and ambient= tweak how the light affects it (try setting ambient=0 0 0)
Also, really should be float3's, just for adjustability.
zvEwD.jpg

Cause someday, there'll be a track with pink clouds.




I also did a fun edit to standard_detail_burn_a_f.cg:
Code:
  float3 ambientColor=baseCol*(ambient+Ke)+texCUBElod(envMap,float4(reflect(IN.Position-eyePosW,IN.normal),1+7*pow(1.01,-shininess)))*Ks*baseCol.a;
(needs texCUBElod, obviously) Which is why the track has a pink sheen.
 
Part of me thinks it might be better to model them as a different material (black reflective), rather than trying to use a texture to do it all.

Looking at Forza 4 screenies makes me think they do that!

Not ideal for old content, but for old content the 'old' method works 'ok' enough to be left alone.

Not sure what others think!?

Hmmm

Dave

Sure, it's always best to think in term of shading when assembling your different objects into 1 UV map. The real problem is sharing the same shader properties (amb, dif, etc..) to different UV shells, so it's a compromise between a lot of materials controlling almost all the 3D or optimization, have less shaders, but also, the frustration of not been able, to fully control each little area of your map with specific material properties.

IDK, maybe one day, the UV algorithm will be smarter, telling the code to extract just according UVs from single car UVmap & assign it dynamically to any virtual shader, but for now, let's create a bunch of stable shader templates for cars & tracks to reuse quickly. :)
 
+1 All of you !

Just a question, there are some really cheap smart hacking alternatives for the IR Track devices, here's an example thanks to J. Lee :


http://johnnylee.net/projects/wii/

You think it's pluggable into Racer ?
Maybe somebody here already knows more about it ?

Yes Johnny Lee has some great stuff, I've been following him since he was in school. It should work fine in mouse mode, there are also some other DIY solutions such as facetrackernoir and Freetrack. Until Ruud gets the dev kit for TrackIR it will work in mouse mode.
No more crappy interiors allowed ;)

Alex Forbin
 
Qlog Errors
(INFO): [racer/480] Racer version: 0.8.39 (Jan 10 2012/18:23:16) - customer: Internet
(INFO): [racer/480] DGPUShaderManager: render engine using Cg
(ERR ): [racer/480] DFBOCubeMap; frameBuffer status not complete (Unsupported framebuffer format)
(ERR ): [racer/480] DFBOCubeMap ctor: OpenGL error (1286): (null)
(INFO): [racer/480] Physics engine: NEWTON v2.34, architecture 0
(INFO): [racer/480] Safety changed to: SAFE
(INFO): [racer/480] Loading track 'carlswood_nt'
(INFO): [racer/480] QNClient:Connect() attempt to localhost:25000 (RNetwork)
(INFO): [racer/480] QNClient: connected to server (our clientID=71, client name 'RNetwork')
(INFO): [racer/480] Loading car 'lamborghini_murcielago'
(WARN): [racer/480] Car 'Lamborghini Murcielago' braking factor of all the wheels don't average out to 0.5 per wheel (now: 1.0000); brake balance is not correctly setup like this
(ERR ): [racer/480] DFBOTexture ctor: OpenGL error (1286): (null)
(ERR ): [racer/480] DFBOCubeMap; frameBuffer status not complete (Unsupported framebuffer format)
(ERR ): [racer/480] DFBOCubeMap ctor: OpenGL error (1286): (null)
(INFO): [racer/480] Physics engine: NEWTON v2.34, architecture 0
(INFO): [racer/480] Safety changed to: SAFE

posted a fix for the Lambo braking_factor a while back should have been fixed.

Sky is AFU in Early Fall but it was good in ver 0.0837-8
Early Fall in Norway download link:
http://www.mediafire.com/?e4si5j1xt3nerag

Cars are very bright but I do have one car that is ok just can't fix it for all my other cars and the default lambo.
 
Alex, what changed?

When we went to the new Fmod originally it was doing the same thing, after a few tried Ruud got it straightened out, now that we've gone back to the old Fmod the problem is back. I'm suspecting that the problem isn't Fmod after all, but a code error on Racers side since it's done it with BOTH versions now.

On another note I had very strange MOI problems with the last version, the roll/pitch/yaw seemed to be coupled in a very odd way, it tried adding a huge number to each parameter, one at a time to isolate the problem. It appeared at first that the roll and pitch were reversed, but then it would act normally. Sometimes the roll moment seemed to be VERY high and the car would roll back and forth at low speeds but when I contacted the track it would suddenly go VERY low. It's fine now though.

Alex Forbin
 
Yes Johnny Lee has some great stuff, I've been following him since he was in school. It should work fine in mouse mode, there are also some other DIY solutions such as facetrackernoir and Freetrack. Until Ruud gets the dev kit for TrackIR it will work in mouse mode.
No more crappy interiors allowed ;)

Alex Forbin

Cool Alex, that's exactly what I meant !
Looking at the compatible FreeTrack games, ouch all other famous racing games are there...

http://www.free-track.net/english/freetrack/liste-titres-compatibles.php

Anyone already tested FreeTrack with recent Racer versions ?

Could be cool if Ruud implements it fully & give us finally the camera script functions & properties we need to get full control over cameras behaviors & events.

why the lamborghini damage doesn't work ? when i try to select this car i get an error on the dyn_standard_bump_reflect_damaged_v.cg and dyn_standard_bump_reflect_damaged_f.cg :(

It should work, make sure you set vertex_damage=0 in racer.ini & activate the damage.chassis.texture_damage.enable=1. Make sure you have the correct material/shader structure, 5 layers etc..

Consider also, for real nice damage, that your body car UVs should be layout/unfold correctly, to have accurate damage simulation. Hope it helps !
 
Cool Alex, that's exactly what I meant !
Looking at the compatible FreeTrack games, ouch all other famous racing games are there...

http://www.free-track.net/english/freetrack/liste-titres-compatibles.php

Anyone already tested FreeTrack with recent Racer versions ?

Could be cool if Ruud implements it fully & give us finally the camera script functions & properties we need to get full control over cameras behaviors & events.

It seems with PPJoy it is already compatible, without any mouse movements. The latest version is also from 2008, and it's in Pascal, hm...
 
It seems with PPJoy it is already compatible, without any mouse movements. The latest version is also from 2008, and it's in Pascal, hm...

So cool :)

================================================





Get ready to animate yourself in front of the webcam. It will be perfect for future driver facial animation morphing via bones/skeletons !
 
It seems with PPJoy it is already compatible, without any mouse movements. The latest version is also from 2008, and it's in Pascal, hm...

I love Pascal.
If I read it correctly PPjoy only supports digital (non analog) joysticks, wouldn't this be the same thing as the POV switch on the G27?
If so wouldn't it be easier to just activate the POV?

Alex Forbin
 

Latest News

Online or Offline racing?

  • 100% online racing

    Votes: 96 7.8%
  • 75% online 25% offline

    Votes: 130 10.5%
  • 50% online 50% offline

    Votes: 175 14.2%
  • 25% online 75% offline

    Votes: 348 28.2%
  • 100% offline racing

    Votes: 480 38.9%
  • Something else, explain in comment

    Votes: 5 0.4%
Back
Top