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:
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.

Yes I have seen that your work is for GTR2, but doesn't use that game much myself as I personally prefer touring cars.
Not sure if there are problems with specular in all the SRPL materials or just some of them?

In a few occasions like trees it could be good to have this effect, but usually not.
I have programmed/edited my own shaders, so I am not using them at all, but the problem is probably caused by two negative values multiplied resulting in a positive value.

Trying to explain in detail can easily get technical if you are not interested in programming, but most values in the pixel shaders are between 0 and 1.
The direction (normal) of a point in a 3d surface (if it is normalized), the direction to a light source and the viewing angle of that point are all compared, and the more equal they are (or if view angle and light angle are close to the light reflection angle) the more specular light there is, and the value gets towards 1.0.

If surface direction is compared to sun direction (and surface is facing away from sun) the first value is negative.
If then sun direction is compared to camera/eyepoint angle the second value is also negative.
In some occasions this results in a positive specular value even if sun is behind the surface.

This depends on how the code is written obviously, but in some places I had to make a logical test: if the dot product of the surface and inverse sun direction is negative, specular value is set to 0.0.

It can look like this:

half backtest = dot(normal, worldLight);

if (backtest > 0.0f){
*do the specular calculation
} else {
*set specular to 0
}
 
Last edited:
Ok. Actually Im glad you know about shaders code.
I apply your Specular.gfx in GTR2 and the 1st issue dissapear. No more "going through" spec light. (still to be tested, cause same happen when delete it and not use one. And some tracks close the game with your spec.gfx)

But the second issue persist. is like the shadowmap it applies "on the surface" but it does still allow bump/cube/spec light on the shadowed area. Where it should only be ambient light.

did you have this on your shadow shaders? I couldnt test them right the way, they crash on GTR2.
001.JPG003.JPG
 
Ok. Actually Im glad you know about shaders code.
I apply your Specular.gfx in GTR2 and the 1st issue dissapear. No more "going through" spec light. (still to be tested, cause same happen when delete it and not use one. And some tracks close the game with your spec.gfx)

But the second issue persist. is like the shadowmap it applies "on the surface" but it does still allow bump/cube/spec light on the shadowed area. Where it should only be ambient light.

did you have this on your shadow shaders? I couldnt test them right the way, they crash on GTR2.
View attachment 509459View attachment 509460
I believe it is not possible to change shadow color for the moment. It seems they are applied after the material shaders, and the output colors are not used as actual colors.
Red is set to 1 and green is the amount/on/off, at least in shadow shader I had a look at.

So I think the only way to get "real" shadows is to find a way to make a shadow map and import it to the material pixel shader.

About using Race07 shaders in GTR2, (I thought about translating my shaders to GTR2 to use with my super touring cars) there are some problems. The main problem is probably texture channels. I think Bjarne told me a while ago that GTR2 doesn't support DXT5 refmaps.
 
Last edited:
with all that negativity is useless.
And knowing all that you know that is your answer?
what should I say then knwing nothig about code and shaders? You make me remember Bjarne with the same negativity.

BTW here is a comparison between your Tree Shader vs SRPL Tree Shader "customized by me".
View attachment 509977View attachment 509978View attachment 509979View attachment 509980

I don't know if this is a communication thing, or are you trying to insult me?

If you have seen the things I have worked on you can see that I am not the one that gives up ideas easily.
I have investigated the shadow shaders and these are my findings. It has nothing to do with being negative or being positive.
All evidence for the moment says that shadow colors are not accessible. If I or someone else finds a way to change it then it is a good thing.
The shadow shader outputs this in rgba format:

PS_OUTPUT ps20_shadowDraw(PS_INPUT Input)
{
PS_OUTPUT Out;
Out.Color = float4(1.0f,Input.PsPos.z,0,0);
return Out;
}

If it was handled as a color it would be a mix of red/brow/yellow with max transparency.
 
Last edited:
with all that negativity is useless.
And knowing all that you know that is your answer?
what should I say then knwing nothig about code and shaders? You make me remember Bjarne with the same negativity.

BTW here is a comparison between your Tree Shader vs SRPL Tree Shader "customized by me".
View attachment 509977View attachment 509978View attachment 509979View attachment 509980
Nice trees
Obvious improvement ;)

That’s why I asked you to take a look but please keep this conversation polite.
Maybe it’s language barrier but I’m in the late 40s and really can’t understand some of your tone.
We are hopefully just trying to bring best to those old classics, we are enjoying to play.
 
Yes those trees look better :thumbsup:
My tree material is still in development, so I haven't used it myself other than in my test track. The idea is that it should have a light "scattering" effect when sun light shines through, but it has a way too wide angle for the moment, resulting in the material just being bright :roflmao:
Trying to make a few specialized shaders: Road (works well now I think), grass (also works well), water (doesn't work yet), and trees (not very good yet)
These shaders are not released yet.
 
Ok thanks.
should have a light "scattering" effect when sun light shines through
Mine has that, but pictures were taken after I start messing around with some of your shaders (and Im not coming back to old ones). As a result the effect have been reduced and you can not see it. (I dunno know why)
Yes things start to change when I apply your shaders, and Im likeing it so far.
And those trees are the worst ugliest trees (EEC Nordschleife VLN). So I wanted to test on that.
but it has a way too wide angle for the moment, resulting in the material just being bright
I already solved that.
If I or someone else
Can we use some of these shadows?
At lest I hope the code is usefull to you.
Not sure if there are problems with specular in all the SRPL materials or just some of them?
All of them (Bumpmap.gfx included). But not your Specular.gfx. Still to test your Bumpmap version. But for now it crashes.
BTW in your Specualr.gfx at ShaderName=L2SpecularT0xT1X - typo extra character?
also in your Diffuse.gfx at ShaderName=L2NoLightingT0 ShaderDesc="T1". should be No lighting Tex1?
 
Last edited:
I think the best chance to improve shadows is to include shadow testing in every shader.

As far as I know it includes adding the right VertexDecl and ShaderConstants (I don't know how compatible they are, can standard materials have shadow VertexDecl?? ) I think this adds shadows from polygons only, not transparent texture shapes, but maybe that is enough for the moment. Shadows need to be calculated before each frame. Not sure how to do that, but there are passes in the gfx files, so maybe a simple shadow map shader can be called in the first pass and then pass the map to the next standard shader??? I have tried that but no success so far.

A lot of things to try and find out when there is time.
 
yes take time.
I remember I descover by accident that almost all tracks (in GTR2) seem to only use this for shadows "L1ShadowProject". And "L2ShadowProject " only for headlights. I dont know why all of the other shadow shaders need to be on the file or it wont start.

Maybe chek how reiza solved it? or maybe Racer sim? IDK
 
I am having a more in depth look at shadow shaders :O_o: :roflmao:
They work in a little bit different way than I expected. So it seems it is possible to change color, but it has to be tested in different conditions, and it should be effected by how much direct light there is.

119.jpg
 
Nice progress.
Now, I realize that maybe the problem is the fact that it is just a shadow map (a texture layer applyied on the surface).
Is not something blocking the "direct diffuse and or specular" light and leaving only ambient.
That is probably why it still preserves sun colour.
It would be cool to have a shader that simply makes all that lighting go to 0 (except ambient) in the shadowed area instead of pasting a "texture map" on it. And that would also solve the "overlapping" of one shadow texture upon each other.
And BTW where is that black texture? because the flickering on shadows i really think it comes from the lack of "mip mapping".

Are this things posible? IDK. Maybe to ask on some shader forums theres always some guys willing to help.
 
Yes it is applied afterwards, so it can not take away anything previously calculated.
But for the moment I make some tests to add the shadow calculation directly into the material shader, and if it works I can turn the specular off and just add ambient light. That would be a "real" shadow. Not sure if I can make it work, we don't have control over everything in these games, but I will try my best.
If it is not possible, at least we can give the shadows a little bit of blue color.
 
Last edited:
Back
Top