Graphic&Shaders wip

The Good, The Bad and The Ugly!
It's anywhere near production ready but to involve more people I released the Playground mod.
Marketing pictures are great but there are numerous glitches and bugs.
@holacrosty already did something similar for GTR2 and anyone else with more experience or just willing to help more than welcomed. :)

1-Race_07-default.jpg

Race_07/Evo default look

2-Race_07-default-with-reflections-mod.jpg

Race_07/Evo with Reflections Mod. Thanks @GTR233 :)

3-Race_07-with-SRPL_25-clean-without-DX9-and-DX8.jpg

Race_07/Evo with Reflections Mod and forced calls to SRPL_25 shaders in DIFFUSE.GFX, BUMPMAP.GFX, CUBEMAP.GFX and SPECULAR.GFX

4-Race_07-blinndiffuse-custom-shader-with-DX7-and-DX8-calls-in-gfx.jpg

The ugly - Race_07/Evo with Reflections Mod and Custom BlinnDiffuse shader for DIFFUSE.GFX (BUMPMAP.GFX, CUBEMAP.GFX and SPECULAR.GFX with SRPL_25 shaders)

5-Race_07-with-blinndiffuse-custom-shader-clean-and-reflections-mod.jpg

Some custom mashup blinndiffuse shader. Race_07/Evo with Reflections Mod and Custom BlinnDiffuse shader for DIFFUSE.GFX (BUMPMAP.GFX, CUBEMAP.GFX and SPECULAR.GFX with SRPL_25 shaders and all cleaned from calls to DX7 & DX8 shaders)



Pictures from @AndreasFSC Super Touring mod.
This mod includes previous @Bjarne Hansen work on Fresnel and DX9 shaders for Race 07.
Additional Reflection Mod - Thanks @GTR233 for cubemaps from marvellous GTR2 Anniversary patch. (Please don’t use those emap textures in other mods without permission)
 
Last edited:
This @AndreasFSC track updates for his Reloaded Shaders bring magic to old tracks so I higly recommend those even if you use default shaders.

Also, often forgotten, cause there is no ingame option for changing the time of the day, Race 07 has built-in weather lighting and easy editing .gdb files (track updates has .gdb files editable or wtcced if necessary) can bring new life.

Race 07 Graphic&Shaders Playground 0.5 + Zandvoort 2007 updated for Reloaded Shaders 1.0
Race1Start = 08:30
Race 07 GraphicShaders Playground plus Zandvoort 2007 updated for Reloaded Shaders time 0830.jpg



Race 07 Graphic&Shaders Playground 0.5 + Zandvoort 2007 updated for Reloaded Shaders 1.0
Race2Start = 17:30
Race 07 GraphicShaders Playground plus Zandvoort 2007 updated for Reloaded Shaders time 1730 d.jpg
 
Spot lights are generally disabled "//" in the vertex shaders, so I think that's why they make no difference.
Haven't tested much yet, but used track omnilight code. Some progress was made, but had problems with lights values being out of range resulting in flickering and inverted materials, even if I limit values...

Light=NightLight01
{
Type=Omni Pos=(0, 0, 0) Range=(0.000000, 40.0) Active=True Intensity=(1.22) Color=(210, 235, 255)
}



The (usually) disabled spot shader code:

#elif SPOT == 1

// Compute spotlights
float4 spotColor = (0,0,0,1);
float3 worldNorm = mul (worldMatrix, inNorm);

//for (int i=0; i<numActive.y; i++)
for (int i=0; i<4; i++)
{
// check backface
if (dot (worldNorm, spotDirCone.xyz) <= 0)
{
float3 spotToVert = worldPos.xyz - spotPosRad.xyz;
float mag = dot (spotToVert.xyz, spotToVert.xyz);
// check if vert in range
if (mag < spotPosRad.w) // using square distances
{
// check if vert in cone
mag = dot (normalize(spotToVert.xyz), spotDirCone.xyz);
if (mag > spotDirCone.w)
{
float intensity = (1.0F - ( mag * spotRGBDelta.w));
spotColor.rgb += (spotRGBDelta.rgb * intensity);
}
}
}
}
Out.Omni = spotColor;
 
I just thought that flickering when there are many lights is due to my gpu and that disabling auto performance would fix it :(.
With one light added to car .cas file and only one car on the road it works perfect without any flickering or lights turning on-off.
Not at the comp currently but could rising .trk clip values to (0.5, 999000) like in GTR2 anniversary could fix it?

Edit: and is this line
for (int i=0; i<4; i++)
Limiting spotlights to 4?
 
Last edited:
Also this additional lights spec like fallooff from rf2 docs work it seems.
Well, at least it doesn’t throw errors.

Type=Spot Pos=( 0.678, 0.535,-1.958) Dir=(-0.05,-0.15,-0.99) Range=(0.0, 400.0) Active=False Attenuate=(0.25, 0.25, 0.0005) Hotspots=(1.0, 150) Falloff=(25) Intensity=(12) Color=(255, 247, 238)
 
Yes the limited number can be a cause, don't know how the limited number of lights is calculated, if it is the number of lights that can be displayed or if it is the nearest number of lights that can be calculated for the actual pixel?

spotColor.rgb shouldn't be a too high number, and it is added to the material and max is 1.0, so

spotColor.rgb = min(spotColor.rgb + (spotRGBDelta.rgb * intensity), 0.85); or something should be used I think.
I know out of range values can cause downgrades or (inverted(?)) lights... but hasn't been able to get it right. And lights can't be turned of as far as I know :unsure:
 
Can’t totally resolve flickering with many lights and can’t get projector working trough code alone
So currently adding 1 omni light to car .cas and testing track alone at night work as a gimmick.
I’m sure somewhere on no grip forum somebody surely already tried this:(

At least, enlarging clip values in .trk do magic for some old tracks ;)

Default - No horizons
Oran-Park-Default-Lighting-1.jpg



Horizon magically appear on Oran Park after rising clip planes in main view to
ClipPlanes=(0.50, 10000.00)
and using @AndreasFSC sun lighting definitions from 2007_Zandvoort .gdb track updates. Sky reverted to south.
Oran-Park-gdb-anc-clip-planes-updates-1.jpg


Also rearview for better mirrors (enlarging size also)
ClipPlanes=(0.50, 750.00)
Oran-Park-rearview-clip-values-mirrors.jpg
 
Donington comparrision

0-Race07-Graphic-and-Shaders-Playground-Donington-default-graphic-2.jpg

0-Race07-Graphic-and-Shaders-Playground-Donington-default-graphic

1-Race07-Graphic-and-Shaders-Playground-Donington-1 Player - Recomended.jpg

1-Race07-Graphic-and-Shaders-Playground-Donington-1 Player

2-Race07-Graphic-and-Shaders-Playground-Donington-2 Player Shiny.jpg

2-Race07-Graphic-and-Shaders-Playground-Donington - 2 Player Shiny

3-Race07-Graphic-and-Shaders-Playground-Donington-3 Player Vibrance.jpg

3-Race07-Graphic-and-Shaders-Playground-Donington - 3 Player Vibrance

4-Race07-Graphic-and-Shaders-Playground-Donington-srpl-25-test-shaders-2.jpg

4-Race07-Graphic-and-Shaders-Playground-Donington 4 Developer CyberPunk test
 
Strange Reshade Transparency Bug

I almost give up on Reshade cause of this bug, but it turns out that just turning different HUD give back trees transparency?! On the good side, basic fx filters work with builtin antialiasing.
Reseted all setting few times so no best lap this time :)

Donington-Graphic-and-Shaders-Playground-Reshade-LUT-HUD-BUG.jpg

Donington-Graphic-and-Shaders-Playground 1 plus Reshade only custom LUT - HUD-BUG

Donington-Graphic-and-Shaders-Playground-Reshade-LUT-different-HUD.jpg

Works with Race 07 antialiaising
Donington-Graphic-and-Shaders-Playground 1 plus Reshade only custom LUT - just different-HUD fix
 
Last edited:
OMG! :) Thanks
I see you guys talking about shaders. And you kinda asked me for help or ideas or something.

Specular gets "through" things and also on the "casted shadow".
The shadows "flicker" and they "overlap".

Those are the 2 bigest errors. Can you fix some of that code? because I have some ideas but not code.
- Here is the specular thing:
bad spec.JPG

and here the specular on the shadows:
GRAB_000.JPG
 
I see you guys talking about shaders. And you kinda asked me for help or ideas or something.

Specular gets "through" things and also on the "casted shadow".
The shadows "flicker" and they "overlap".

Those are the 2 bigest errors. Can you fix some of that code? because I have some ideas but not code.
- Here is the specular thing:
View attachment 508932

and here the specular on the shadows:
View attachment 508934
Nice findings
Thanks

My mod is actually just trying to force use of srpl shaders with few custom “mashup shaders”.
Also Race 07 with dlc tracks are ranging from years 2007-2011 and newer tracks obviously differ in materials and shaders use from the old ones.

Andreas is actually in the process of writing completely new shaders trying to “simulate pbr” and updating tracks where needed so maybe they will not produce those wrong results when he completes his work.

 
I see you guys talking about shaders. And you kinda asked me for help or ideas or something.

Specular gets "through" things and also on the "casted shadow".
The shadows "flicker" and they "overlap".

Those are the 2 bigest errors. Can you fix some of that code? because I have some ideas but not code.
- Here is the specular thing:
View attachment 508932

and here the specular on the shadows:
View attachment 508934
What code do you use for specular calculation?
You have to filter out if direct light is parallel to surface normal (or actually inverse since direct light in shaders is from point to light source).
Are these shaders also srpl based?
 
What code do you use for specular calculation? You have to filter out if direct light is parallel to surface normal (or actually inverse since direct light in shaders is from point to light source). Are these shaders also srpl based?
Is not Race07, Im on GTR2. Because of 24hs simulation.

Yes in my "GFX.GTR" Im using all of the SRPL shaders (not custom) to replace the original ones.

But AFTER I upload it here (It is called "GTR2 new shaders & lighting patch"), I found and corrected a typo error on the the SPECULAR.GFX wich was causing overbrightness and some weird effects of course.

But the specular is still "going through" things that use specular shader.
As I know nothing about code. I just reorder the things to fully work with SRPL.

Did you fixed it? let me know.
 
Back
Top