OK, Cosmo figured out the sky issue.
Flags for sky objects, where 11 worked fine before, now needs 65
Interestingly I spent DAYS trying to work out why some cars didn't settle on their suspension on spawn on my track, and it came down to the flags for the sky, so after reading ALL the racer.nl docs, I came to the conclusion flags=11 was the right setting.
But NOW it's changed, no changelog, nothing to tell us why they changed, they just have.
WHY do these fundamental things have to keep changing? It's really REALLY annoying! Why were flags=11 which worked fine for the last 4 releases, maybe more, now made not to work?
Important question here. If I/we the community give you some nice defaults for Racer, can you please use them in future releases? The defaults are horrible.
Also the continued omission/ignorance of Stereo's dyn_standard_alpha_reflect_f.cg shader is starting to annoy me now. Loads of cars used this shader (the Lambo still *SHOULD* because it looks twice as good when doing so), and yet it is ignored each time it is posted up on the forums.
It is a fundamental shader type, why not add it and update it and make it work with the CSM stuff?
//
// Standard with reflection cubemap
//
#include "atmosphere.cg"
#include "lighting.cg"
#include "fresnel.cg"
// Vertex to pixel shader structure
struct v2p
{
float extinction : COLOR;
float2 tc0 : TEXCOORD0;
float3 Direction : TEXCOORD1;
float4 RayleighColor : TEXCOORD2;
float4 MieColor : TEXCOORD3;
float3 Position : TEXCOORD4; // For fragment shader
float3 normal : TEXCOORD5;
// Fresnel in pixel shader
float3 I : TEXCOORD6;
//float fresnel : TEXCOORD6;
float3 R : TEXCOORD7; // Reflection vector
};
void main(
// In
in v2p IN,
// Out
out float4 outColor : COLOR,
// 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 float3 shininess,
uniform float exposure
)
{
float3 skyColor;
float3 N=normalize(IN.normal);
// 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);
// Lighting
float3 ambient,diffuse,specular;
LightingSun(Ke,Ka,Kd,Ks,shininess,lightDirection,lightColor,lightAmbient,IN.Position,N,eyePosW,
ambient,diffuse,specular);
baseCol.rgb=baseCol*(ambient+Ke)+baseCol*diffuse*lightColor+specular;
// Add reflection with fresnel
float fresnel=Fresnel(0.15,0.85,2.0,normalize(IN.I),normalize(N));
baseCol.rgb=FresnelMix(baseCol.rgb,envColor.rgb,(Kr>0?Kr:-Kr*baseCol.a),fresnel);
// HDR toning of sky
//skyColor.rgb=1.0-exp(-exposure*skyColor.rgb);
// Mix sky with texture color based on atmospheric influence
outColor.rgb=lerp(skyColor,baseCol,IN.extinction);
// Blending
outColor.a=baseCol.a;
}