Random thought: Can we get any path variables for the cg shader directory in car.ini? In future I think it's better if cars & tracks have custom shaders in data/car/cg/ folder (easier to install/package, etc. than expecting people to un-zip into 2 places), but then they're referring to the default shaders with "../../../renderer/shaders_hdr/lighting.cg" and so forth. It doesn't allow for hdr/ldr/csm hdr shader sets to be chosen by racer.ini.
I'll try get a car released, with a decent FAQ on how it's made, on a good best practice method for others to reference. By no means will I pretend I am 100% right, but just as a guide... I think if you look back at what Stecki used to do his work still looks excellent today, and that is where I draw my inspiration/level of quality from... do the job right in mesh/textures, and it'll look good and work well anywhere
Dave
What about standard_tree_v/f
There is mention of it on racer.nl
BTW, i wanna know if new version of racer support blowoff sound? not a bugged on, like olders, that i made decelerate sound with natural different of accelerate one. It were good, but since 060, we couldnt do it, decelerate and accelerate were mixed. I mean like LFS blowoff sound, when you stop throttle, it drop the pressure and make that sound. Maybe using a script like horn, shiftin, shiftout.. blowoff code.. volume, natural, etc, but one time in each throttle you do. Well, it'd be nice.
There's a throttle off sound thing, have a look at brother_david's celica gt-four, it's used on it.
Why'd you need a shader for that? GPU shaders should be a little more generic imho. Trees made such a way (two polygon cross) should just be exported from 3ds max with normals pointing up (my exporter plugin can do that). Why not just write a little tool that takes a bunch of dofs and changes the normals to point up?It's on http://www.racer.nl/tutorial/gpushader.htm (you may need to refresh the specific frame). It's for trees, which are designed as crosses (normals all pointing sideways) where the lighting is really more expected as if the normal was pointing up. So it ignores the 3D model normals and just uses (0,1,0) (up) for lighting.
uniform sampler2D normalMap : TEXUNIT1,
Dave, I believe I've said it before, but one pretty good way of exploring what has changed, is using a file comparison utility, such as WinDiff (http://www.grigsoft.com/windiff.zip). Just select the old racer folder and new racer folder and do a diff. It will list all files that are new or have been changed and then you can view the differences in changed files.
edit: Figured out what was making it crash. I can't use "Select a car" to select a car, as soon as I click one it crashes. First one shows up ok. Back to using Quick Race I guess.
Yeah the smoke particles are wrong anyway, and where does the "wind" come from? a track's special.ini? Is this a constant or an expression?
Smoke particles should use bump mapping too, you could get away with using half the particles and have it look even better.
Currently I just don't have the time to play around with stuff like I used to, real life is creeping in too much and I just can't devote hours to figuring out problems that pop up.
Racer has SO MUCH potential...I just wish I had the time to unleash it
smoke
{
; foreach car
; Car tire smoke (light; smoke from burning engines uses a different particle system)
; Max #particle at once for a system
max=400
; Lifetime and variance (actualLifetime = life-life_var..life+life_var)
life=3
life_var=2
startvelocity=0 1 0
startvelocity_var=0 0.6 0
; Start size
size=0.9
size_var=0.3
; Growth of particle (m/s)
growth=0.6
;growth=1.5
growth_var=0.1
;growth_var=0.5
max_alpha=0.2
; texture=data/images/smoke.tga
texture=data/images/smoke_fake_lighting_norm2.tga
influences
{
airfriction=2
wind=0.8
gravity=-0.15
}
}
//Particle shader
#include "atmosphere.cg"
#include "lighting.cg"
// Vertex to pixel shader structure
struct v2p
{
float4 Position : TEXCOORD4; // POSITION
float2 uv : TEXCOORD0;
float4 color : COLOR0;
float3 Direction : TEXCOORD1;
float4 RayleighColor : TEXCOORD2;
float4 MieColor : TEXCOORD3;
float extinction : TEXCOORD6;
//float4 Position : POSITION;
//float2 tc0 : TEXCOORD0;
//float2 tc1 : TEXCOORD4;
//float3 lightDirTS : TEXCOORD7; // Light direction in texture space
//float3 eyePosTS : TEXCOORD5; // Eye position in texture space
};
void main
(
in v2p IN,
out float4 outColor : COLOR,
// Constants
uniform sampler2D baseMap : TEXUNIT0,
uniform sampler2D normalMap : TEXUNIT1,
uniform float3 lightDirection,
uniform float3 lightColor,
uniform float3 lightAmbient,
uniform float atmosRayleigh,
uniform float atmosMie,
uniform float3 eyePosW,
uniform float3 Ke,
uniform float3 Ka,
uniform float3 Kd,
uniform float3 Ks,
uniform float3 shininess
// uniform float exposure
)
{
float3 skyColor=GetSkyColor(lightDirection,IN.Direction,IN.RayleighColor,IN.MieColor,atmosRayleigh,atmosMie,lightColor,lightAmbient);
//Lighting is not used -> heavy + particles are flat anyway
//float3 normal = tex2D(normalMap, IN.uv);
float3 ambient,diffuse,specular;
//const float3 normal=float3(0,1,0);
float4 normalmap=tex2D(baseMap,IN.uv);
float3 normal = (normalmap.rgb-0.5)*2.0;
float2 dir = normalize(float2(IN.Direction.x,IN.Direction.z));
float2 perpdir = float2(dir.y,-dir.x);
normal.xz=dir*normal.z+perpdir*normal.x;
float3 pos = IN.Position.xyz;
// alter Ka and Kd to change balance for more diffuse smoke
LightingSun(Ke,Ka,Kd,Ks,shininess,lightDirection,lightColor,lightAmbient,pos,normal,eyePosW,
ambient,diffuse,specular);
// Get base texture color
float4 baseCol=float4(0.8,0.8,0.8,tex2D(baseMap,IN.uv).a);
float3 tempColor = baseCol*(ambient)+baseCol*diffuse* lightColor;
//float3 tempColor = baseCol * IN.color;
// Mix sky with texture color based on atmospheric influence
//outColor.rgb = lightColor.rgb;
outColor.rgb=lerp(skyColor, tempColor,IN.extinction);
outColor.a = baseCol.a * IN.color.a;
}
The particles fragment shader refers to a normal map
But particles.ini doesn't say where to set this texture.Code:uniform sampler2D normalMap : TEXUNIT1,
Is this available right now?
Just hijacking the original texture in the screenshot (using rgb as a normal map, alpha channel for transparency, and giving it a flat 0.8 grey)
Still need to wrap my head around multiplying by the IN.Direction (this is the orientation of the camera and thus the way the smoke's being faced, right) so the normals can look right on more extreme times of day.
Bit of z-fighting with the smoke where older smoke is rendered on top of newer but it's not too noticeable.
I'm seriously thinking about going out and buying a 9800 GT so I can try the CSM Seems to be under $100 now.