Racer v0.8.32 released!

Ruud

RACER Developer
After a small break (where I broke nothing except 1 snowscooter), a new Racer.

Get it at http://www.racer.nl/download/racer0.8.32.zip

Changes:
- The Lambo differential ratio was a bit low (1.75) - reverted to 2.53.
- Differential could become unstable when the 2 wheels got opposite reaction forces.
- Removed obsolete wheel<n>.friction_road values from data/cars/default/car.ini.
- Replay audio (replay.wav) was empty when recorded.
- Multiplayer fixes (billboard nodes/car names)
- Smoke tweaks (soft particles, improved motion)
- Shadowmapping normal dependency improved for shadow acne reduction
 
- when we have a model_incar {} + a pilot & looking from the cockpit cam (model=1), the pilot is missing
- more driver sequences (feet, handbrake, other customs)
- more projected lights in car.ini (neon, rear lights when on)
- script trigger areas in Tracked ? could be cool !

1. This was requested IIRC because people have their own hands so like to watch them instead of an animated set.
2. Feet is absolutely pointless, you're never going to see them anyway, handbrake could be useful but it's better to get the H-gate working before implementing new stuff
3. neons can be done with the car shadow, projected lights really aren't the way to go anyway IMO, headlights should be a proper lightsource somehow. Projected textures are somewhat costly too
4. We have triggerlines, what more do you really want? There's areas where sounds can be cued but if you want anything else you should probably be driving there anyway in which case it should be splined. Also, if we're going a new direction for AI (assuming we get rid of splines) then splines could be used in such a way.
 
@camsinny

1. I don't agree, that's not anymore the way to go, imho, I see every bit of pixel on my surround game system.
2. Not really, I have 1 copilot camera & I see my fully animated driver without his feet moving...Again on my system, it'd look awesome with that feature on.
3. I agree with emitters (particle system ?), have read that Racer will implement more projected lights soon...I did try to edit the default one, hm couldn't see the difference...
4. LoL I want more for sure, it's basically more an idea, easy to implement...Here's the details of it, when entering the script area, there would be one code when you enter + another when you leave, sure by default. That would avoid for example, to create 2 triggers...think about it !

BUGS :

- Tracked wireframe mode
- Flares + custom TOD + show splines/show carbbox => white flare planes
- car.ini different structures (debugged with note_ini_unused + note_ini_fallback) will produce issues with offsets + CG & other physical stuff, like RC => updating my car with it...
 
I thought Racer was using deferred shading already, with CSM?

Hmmm...

As for the other stuff. I'm always one for wanting more extras for Racer, but until we even have one good car and track using them all, AND done really nicely, it's crazy to want more and more and add potentially more issues/bugs pre v0.9.

Lets just get a good stable target and get some actual content out. Racer has just been a tinkering dream-scape for half a decade nearly, yet it deserves a proper community again where people play online together in their tens or hundreds :D



Dave
 
Crash while driving with an animated pilot after the wall hit at high speed :

OS-Version: 5.1.2600 (Service Pack 3) 0x100-0x1

0x00589057 d:\source\trunk\dev\src\libs\d3\danimation.cpp (line 64): DAnimTrack::GetKeys()
0x0058A042 d:\source\trunk\dev\src\libs\d3\danimation.cpp (line 218): DAnimInstance::Update()
0x0058B52A d:\source\trunk\dev\src\libs\d3\dbone.cpp (line 92): DBone::UpdateAnimInstance()
0x0058B58D d:\source\trunk\dev\src\libs\d3\dbone.cpp (line 105): DBone::UpdateAnimInstance()
0x0058B58D d:\source\trunk\dev\src\libs\d3\dbone.cpp (line 105): DBone::UpdateAnimInstance()
0x004A18CC d:\source\trunk\dev_racer\src\lib\rcarpilotcontroller.cpp (line 138): CarPilotController::Update()
0x004410BB d:\source\trunk\dev_racer\src\lib\rphysics.cpp (line 316): RPhysics::Snapshot()
0x00428AC0 d:\source\trunk\dev_racer\src\lib\rmanager.cpp (line 2609): RManager::SimulateUntilNow()
0x00428B34 d:\source\trunk\dev_racer\src\lib\rmanager.cpp (line 2648): RManager::Step()
0x0040272F d:\source\trunk\dev_racer\src\mrun.cpp (line 1449): rrIdleFuncGame()
0x004EC23F d:\source\trunk\dev\src\libs\license\qapp.cpp (line 902): QApp::Run1()
0x7C810693 [kernel32]: (filename not available): CreateRemoteThread
0x18EC83EC [(module-name not available)]: (filename not available): (function-name not available)
Hope you'll fix it !

==================
Also, thx Ruud for your previous tips, leaving the logitech 'Degrees Of rotation' at 900° + actually driving with 220 - 240 lock in profile1.ini feels even much better than ever ! :)

All good stuff !

======================
A question / a fix

When AI driving, my lights ON won't do the same for the AI (at dawn/dusk)...
For sure, autolights works & at night they light up 'automatically' as they should (for AI) but apart from that they don't...
 
I thought Racer was using deferred shading already, with CSM?

Hmmm...

As for the other stuff. I'm always one for wanting more extras for Racer, but until we even have one good car and track using them all, AND done really nicely, it's crazy to want more and more and add potentially more issues/bugs pre v0.9.

Lets just get a good stable target and get some actual content out. Racer has just been a tinkering dream-scape for half a decade nearly, yet it deserves a proper community again where people play online together in their tens or hundreds :D



Dave

I almost reported your post then. Where's the ****ing "thanks" button gone?

Great post, I hope Ruud & Mitch are listening.
 
Was playing lately with the projective shader, what a mess, it needs somehow to be merged with CSM/stencil shadow...That means if you virtualize a light in a scene ; that won't give you the proper realism, too bad...

Just saw a vid from Shift 2 at night & observing the shadows & lights at night, they somehow integrate it, but it's an unfinished feature with some issues.

Check the movie from 2.30 min :


Just LOL....

I don't blame Racer, I admit that requires Einstein knowledge to simulates a real night scene & that's frustrating for us...
I just wish they were 'shader experts' here to build/fix & compile rocket solid shaders which would increase Racer realism to 'unexpected' results.

Cry
 
That does look pretty good :D

BUT, Racer isn't suffering for us because it can't simulate shadows cast off other cars headlights at night time.
As much as eye candy is important, in the last 18 months we have got CSM and HDR, along with some really nice shader improvements. We have everything we need right now to make some absolutely stunning visuals in Racer!

If we get a v0.9, then we can attain some wonderful visuals because we set a standard for developers.
If we always try aim for the latest effects and eye candy, we will never reach a stop point for people to develop for...


For Ruud and co, Racer needs to work in much more important ways for their commercial venture, so such things as shadows cast from car lights is probably on the list, but that list doesn't get priority over other stuff... :(



Ultimately, I thought Shift was a bit pants, basically an arcade game. Looked really good, but that was about it. The looks didn't make it stay on my HDD for longer than a few days.

Racer right now, imo, CAN look fabulous, and to me that says to look fabulous all the time, it's up to us to make content that lets Racer shine :D


Not having a go at all. It's nice to have amazing visuals if you can, but I'd rather Ruud improve other areas first that will add more realism and immersion, than waste time on extra effects that ultimately won't really be appreciated by 99% of users because there is no really nice content to enjoy yet in the first place :D

Dave
 
I know what you mean Dave !

It's a philosophical question about how a project like this, is supposed to be completely finished, idk if there will be an end. Typically, you consume, enjoy & finally resell/extend/destroy physical projects.

Reaching standards is relative to lots of variables & nowadays I can't feel no 'stability' or stable version anywhere, everything moves so fast by definition that I'm feeling lost & insecure, because I know there will always be some issues & things to fix...no real truth at the end !

I fear, if I create tracks/cars & other stuff, at some point in the future, the whole thing would need a complete rebuild, for example the skeletal cars with the physics damage system, it would suppose, you create car parts in a closed way (Shift lacks from this technique which avoids seeing thru your deformed car mesh) etc...

The same goes for Ruud & co, at a certain time, the physical equations ruling our Racer 'faked/simulated' world will change as it'll always be in the future. (Cg / C++ code)

Anyway, I agree with you, Racer is awesome & generally talking, this 0.8.32 version works like a charm ! We got to unleash the hidden power, the dark side of it :D
 
2 things before I forget :

- In modeler, we could need a 'frame selection' function especially for animations.
- In racer.ini, for surround systems (+2 screens), having an option for screen positions across the desktop would be helpful when full screening the game. I don't exactly know how that's should be looking in racer.ini code in the particular case, if you had 15 (5 x 3 rows) or 25...I saw it from SoftTH recently, lol

Got a 3 1 2 display config which is mainly useful for SoftTH compatible games which I use massively. That would avoid setting another ATI CCC profile or whatever it is in Nvidia too, I suppose.

Anyway, apart from Burnout Paradise 2 & Racer, I didn't saw any games which 'natively' deals with multi-monitors systems, so you did a good job there !!

===============
A question :

Can we somehow attribute a particular livery to AI like the track variations (http://racer.nl/reference/tracks_skinning.htm) ?

Unfolding Uvs takes so much time, that once done, using it massively on our 50 AI cars ? (never tested) could be really cool !!! Hm, I'm AI driving a lot while debugging cars & tracks...
 
:D

Yep, I'd love to do many of the things suggested, but you have to stop and build sometimes.

Re-working content could be a massive pain, just look at GT5, 75% of their content is old cars haha!

Ultimately, imo, the Lambo Murcielago is proof that you can re-work relatively easily (imo a few bits were built badly initially for whatever reason, ergo needing work to re-work it!) and get stuff looking fairly swish for the latest versions, but clearly missing the required stuff to get it REALLY good.

That said, I'm working on MasterT's Audi TT for v0.9 now, not as much work as the Lambo, but it looks pretty cool and far from horrible. With a few new shaders from Ruud (nothing fancy, but imo they need to be in there for certain stuff full stop), then it would look really really nice :D

Expectations are a tough one to meet, but over the years it's the experience that is key to me and driving sims/games, and Racer offers an excellent way to enjoy cars imo, as faithfully as you can away from the real thing!

It's only getting better now with scripting. Some sound system improvements (HDR basically for sound), and more control over certain values, will make those as good as I'd reasonably want for the future.


The only thing I think is really missing longer term is a sweeter multiplayer hosting/joining/car.ini checking/consistency/skin selection kinda thing, which right now makes any online playing a kinda tough time unless all people in-game are familiar with Racer and how it works etc...

Dave
 
Hey, I tweaked the glass shader. As far as I know, since I didn't do anything to the csm/non-csm part, this should work for any graphics cards... but I welcome comments. Hope it's not kicking the 64-operation limit.

Code:
//
// 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
}

For best results, use with a shader material something like
Code:
shader_glass
{
  reflect=0.9
  specular=.1 .1 .1
  shininess=50
  layer0
  {
    map=glass.tga
    blendfunc=dst_alpha one_minus_src_alpha
  }
  layer1
  {
    map=$trackenvmap
  }
  fresnel
  {
    bias=0.04
    scale=0.96
    power=4.0
  }
  vertex_shader
  {
    file=dyn_standard_reflect_window_v.cg
  }
  fragment_shader
  {
    file=dyn_standard_reflect_window_f.cg
  }
}
(note that this is being excessively complete; you'll probably want to move fresnel and shader defs out to vf_reflect_window or something)
The important line here is blendfunc=dst_alpha one_minus_src_alpha - keep the rest from the existing glass shader. It does give other problems though - if textures (but not objects) are transparent, it goes funny.
 
Why reflect only at 0.9?

Doesn't glass act as a mirror at 90deg incident angle?

Also why the specular? Shouldn't that not be there since the envmap will provide the sharp reflections that glass exhibits?

Thanks

Dave
 
@stereo

Your shader tweak is cool, I could imagine to use it as a "building glass/window" too, so logically I would call it something with glass_xxx_f.
Great linear interpolation you implemented there, good job ! Thx a lot !

@all

I had some probs with the default "soft particles" code, where I couldn't see them ingame. So I decided to have a look, & finally tweaked the Cg particle_f code. So anyone who had issues (ATI ?) can try those 2 slightly modified Cg codes.

Basically, I created a private variable which holds the extracted alpha value & gets computed in the final stage of outputting the 'outColor'.

Yay, it's so cool, so it pays off my last 2 days of Cg learning....:)

Great Job Ruud/Mitch !

1st code :

Code:
//Particle shader
//Slighty modded by QuadCoreMax

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

#define SOFT_PARTICLES
//#define PARTICLE_CSM

// Vertex to pixel shader structure
struct v2p
{
  //float4 position       : POSITION;
  float3 position       : TEXCOORD4;
  float2 uv                : TEXCOORD0;
  float4 color            : COLOR;
 
  float3 Direction        : TEXCOORD1;
  float4 RayleighColor    : TEXCOORD2;
  float4 MieColor         : TEXCOORD3;
  
  float  extinction     : TEXCOORD6;
  //float3 wpos           : WPOS;
#ifdef SOFT_PARTICLES
  // Test Z
  float4 wpos           : WPOS;
#endif
};

float LinearizeDepth(float depth, float near, float far)
{
  return (2 * near) / (far + near - depth * (far - near));
}

void main
(
  in v2p IN,

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

  // Constants
  uniform sampler2D baseMap     : TEXUNIT0,
  //uniform sampler2D normalMap     : TEXUNIT1,
#ifdef SOFT_PARTICLES
  uniform sampler2D curDepthTex    : TEXUNIT6,
  uniform float     frustumNear,
  uniform float     frustumFar,
  uniform float2    resolution,
#endif
  
   
  uniform float3    lightDirection,
  uniform float3    lightColor,
  uniform float3    lightAmbient,
  uniform float     atmosRayleigh,
  uniform float     atmosMie,
  
#ifdef CSM
#ifdef PARTICLE_CSM
    uniform sampler2D    shadowArray  : TEXUNIT7,
  uniform float4x4     smTexMatArray[SM_MAX_SPLITS],  
  uniform float smSplits, 
#endif
#endif
  
  // uniform float3    eyePosW,
  uniform float3    Ke,
  uniform float3    Ka,
  uniform float3    Kd,
  uniform float3    Ks,
  uniform float     shininess,
  uniform float     sunny
  // uniform float     exposure
)
{ 
  float shadow=sunny;
#ifdef CSM
#ifdef PARTICLE_CSM
  float shadow;
  //float3 pos=IN.position;
  // Output shadowing and normals
  shadow=GetShadowFactor(IN.position, float3(0,1,0),shadowArray, smTexMatArray, smSplits, lightDirection)*sunny;
  //outShadow.rgb = IN.normal;
#endif
#endif

//shadow+=0.1f;
//shadow=saturate(shadow);

//shadow=0.1f;

  float3 skyColor=GetSkyColor(lightDirection,IN.Direction,IN.RayleighColor,IN.MieColor,atmosRayleigh,atmosMie,lightColor,lightAmbient);

  // Fast when close up
  if(IN.color.a<0.01)discard;
  
  //Lighting is not used -> heavy + particles are flat anyway
  //float3 normal = tex2D(normalMap, IN.uv);
  //LightingSun(Ke,Ka,Kd,Ks,shininess,lightDirection,lightColor,lightAmbient,IN.Position,N,IN.eyePosTS,
    //ambient,diffuse,specular);
  
    // Get base texture color
  float4 baseCol=tex2D(baseMap,IN.uv);
  float3 lighting = (lightColor*shadow)+lightAmbient;  //*0.5f + float3(1,1,1)*0.5f;
  float3 coloring = IN.color; //*0.5f + float3(1,1,1)*0.5f;
  
  float3 tempColor = baseCol * coloring * lighting; // + lightAmbient*0.25f;
  
//tempColor=baseCol;
  // Mix sky with texture color based on atmospheric influence
  outColor.rgb=lerp(skyColor, tempColor,IN.extinction);
//outColor.rgb=IN.wpos.z;
  //outColor.rgb=tempColor.rgb;
  //outColor.rgb=baseCol.rgb;

  //pixelPos.z=IN.wpos.w;
  
  outColor.a = baseCol.a * IN.color.a;
  //outColor.rgb=(1.0-tex2D(curDepthTex,pixelPos.xy).x)*50.0f;
  //outColor.rgb=;
  //outColor.rgb=(1.0f-pixelPos.z)*50.0f;
  //outColor.b=0.0f;
#ifdef SOFT_PARTICLES
  float3 pixelPos=IN.wpos.xyz;
[COLOR=darkred][B]  float alpha=(float)IN.wpos.a;[/B][/COLOR]
  pixelPos.xy/=resolution;
  pixelPos.z=LinearizeDepth(pixelPos.z,frustumNear,frustumFar);
  pixelPos.z=LinearizeDepth(tex2D(curDepthTex,pixelPos.xy).x,frustumNear,frustumFar)-pixelPos.z;
  // depth should be made linear
  //outColor.a*=pow(saturate(pixelPos.z*1.0*(frustumFar-frustumNear)),2);
[COLOR=darkred][B]  outColor.a*=shadow * alpha;[/B][/COLOR]
#endif

#ifdef CSM_MRT
  //outShadow.a=shadow;
  outShadow.rgba=0;
  //outShadow.rgba=float4(0,0,0,0);
#endif
}
2nd code :

Code:
//Particle shader
//Slighty modded by QuadCoreMax

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

#define SOFT_PARTICLES
//#define PARTICLE_CSM

// Vertex to pixel shader structure
struct v2p
{
  //float4 position       : POSITION;
  float3 position       : TEXCOORD4;
  float2 uv                : TEXCOORD0;
  float4 color            : COLOR;
 
  float3 Direction        : TEXCOORD1;
  float4 RayleighColor    : TEXCOORD2;
  float4 MieColor         : TEXCOORD3;
  
  float  extinction     : TEXCOORD6;
  //float3 wpos           : WPOS;
#ifdef SOFT_PARTICLES
  // Test Z
  float4 wpos           : WPOS;
#endif
};

float LinearizeDepth(float depth, float near, float far)
{
  return (2 * near) / (far + near - depth * (far - near));
}

void main
(
  in v2p IN,

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

  // Constants
  uniform sampler2D baseMap     : TEXUNIT0,
  //uniform sampler2D normalMap     : TEXUNIT1,
#ifdef SOFT_PARTICLES
  uniform sampler2D curDepthTex    : TEXUNIT6,
  uniform float     frustumNear,
  uniform float     frustumFar,
  uniform float2    resolution,
#endif
  
   
  uniform float3    lightDirection,
  uniform float3    lightColor,
  uniform float3    lightAmbient,
  uniform float     atmosRayleigh,
  uniform float     atmosMie,
  
#ifdef CSM
#ifdef PARTICLE_CSM
    uniform sampler2D    shadowArray  : TEXUNIT7,
  uniform float4x4     smTexMatArray[SM_MAX_SPLITS],  
  uniform float smSplits, 
#endif
#endif
  
  // uniform float3    eyePosW,
  uniform float3    Ke,
  uniform float3    Ka,
  uniform float3    Kd,
  uniform float3    Ks,
  uniform float     shininess,
  uniform float     sunny
  // uniform float     exposure
)
{ 
  float shadow=sunny;
#ifdef CSM
#ifdef PARTICLE_CSM
  float shadow;
  //float3 pos=IN.position;
  // Output shadowing and normals
  shadow=GetShadowFactor(IN.position, float3(0,1,0),shadowArray, smTexMatArray, smSplits, lightDirection)*sunny;
  //outShadow.rgb = IN.normal;
#endif
#endif

//shadow+=0.1f;
//shadow=saturate(shadow);

//shadow=0.1f;

  float3 skyColor=GetSkyColor(lightDirection,IN.Direction,IN.RayleighColor,IN.MieColor,atmosRayleigh,atmosMie,lightColor,lightAmbient);

  // Fast when close up
  if(IN.color.a<0.01)discard;
  
  //Lighting is not used -> heavy + particles are flat anyway
  //float3 normal = tex2D(normalMap, IN.uv);
  //LightingSun(Ke,Ka,Kd,Ks,shininess,lightDirection,lightColor,lightAmbient,IN.Position,N,IN.eyePosTS,
    //ambient,diffuse,specular);
  
    // Get base texture color
  float4 baseCol=tex2D(baseMap,IN.uv);
  float3 lighting = (lightColor*shadow)+lightAmbient;  //*0.5f + float3(1,1,1)*0.5f;
  float3 coloring = IN.color; //*0.5f + float3(1,1,1)*0.5f;
  
  float3 tempColor = baseCol * coloring * lighting; // + lightAmbient*0.25f;
  
//tempColor=baseCol;
  // Mix sky with texture color based on atmospheric influence
  outColor.rgb=lerp(skyColor, tempColor,IN.extinction);
//outColor.rgb=IN.wpos.z;
  //outColor.rgb=tempColor.rgb;
  //outColor.rgb=baseCol.rgb;

  //pixelPos.z=IN.wpos.w;
  
  outColor.a = baseCol.a * IN.color.a;
  //outColor.rgb=(1.0-tex2D(curDepthTex,pixelPos.xy).x)*50.0f;
  //outColor.rgb=;
  //outColor.rgb=(1.0f-pixelPos.z)*50.0f;
  //outColor.b=0.0f;
#ifdef SOFT_PARTICLES
  float3 pixelPos=IN.wpos.xyz;
[COLOR=darkred][B]  float alpha=(float)IN.wpos.a;[/B][/COLOR]
  pixelPos.xy/=resolution;
  pixelPos.z=LinearizeDepth(pixelPos.z,frustumNear,frustumFar);
  pixelPos.z=LinearizeDepth(tex2D(curDepthTex,pixelPos.xy).x,frustumNear,frustumFar)-pixelPos.z;
  // depth should be made linear
[COLOR=darkred][B]  outColor.a*=(saturate(pixelPos.z*1.0*(frustumFar-frustumNear)),2)* alpha * shadow;[/B][/COLOR]
  //outColor.a*=shadow * alpha;
#endif

#ifdef CSM_MRT
  //outShadow.a=shadow;
  outShadow.rgba=0;
  //outShadow.rgba=float4(0,0,0,0);
#endif
}
I also slightly modded the particle smoke tree, so don't forget it to get your proper/desired results. The smoke texture was also changed in my case, somewhere I released it already.

Feedback is appreciated, from now on, you can expect some great modifications & creations of new shaders, some stuff to come out soon :

- minimap which holds a projection (top view) of the whole map so you would see the terrain blended with the splines
- backfire after/post process deformation algorithm with a 2nd text map (NM: normal map as Shift does..?)
- real grass projecting shadow & moving randomnly (skeletal grass) => easier & realler to implement
- projective texture casting shadow
- real track/car light shader something like the sun, more subtle
- new displacement/HM(height-map) shader where you could project a raw 8/16 bits gray-scale texture on a highly tessellated terrain => off-road or far detailed complex mountains
- real water shader with a post process effect which virtually gives you the impression water is moving.
- real clouds casting shadows into the terrain , something based from the projective texture, also with some after-effect
- real fire shader in combination with particles, emitting omni light & casting car/object shadows.
- & lots more !

:D
 

Latest News

Are you buying car setups?

  • Yes

  • No


Results are only viewable after voting.
Back
Top