Race Remaster

Very long shadows are now possible.

38.jpg


Not sure how to solve resolution and shadow draw distance (except using brute force...). I will try to position the shadow map render with an offset so no space is wasted on areas behind the camera.

39.jpg


Short shadows draw distance for the moment, but very nice trees shadows.

40.jpg
 
Last edited:
Trying to add "cascade shadow mapping".
The strange line in the screenshot is a temporary visualization to show the edge of the first level.

The biggest problem is that the objects have to be rendered (using simplified materials and colors) one time for each shadow level, so it's kind of expensive, and I don't have all the matrices on their own, so I have to calculate the positions where to set the "cameras" manually, and probably not as optimized as in the standard way to do it.

41.jpg
 
Minor improvement. The shadowmap is now rotated so that screen X is shadowmap U direction etc.
This makes it possible to scale things to get a little bit better resolution close to the camera. I had to abandon cascade shadow mapping (it just didn't work for some reason). Still fiddling and testing how to best scale the coordinates to something that looks good enough to be useful.

42.jpg
 
It took like forever to get the shadowmap perspective scaling to work. It still needs some tweaking, but at least the scaling is in the right direction.
I had to redo some matrix work, but it is better now over all. TV and track side cameras will be a challenge, because they are often placed around the car and not the camera, so the focus and shadow map center can be far away. Luckily I can read the camera type from the game, so I need to add some special conditions for those cameras somehow.

Next thing will be to read the near by shadow map pixels to get an average (trickier than usual because the shadow texture is warped) and fade out shadow mapping edges when they are visible on things like track side buildings.

43.jpg
 
Shadow map resolution increased (might be a multiplication setting), and also added some fade out at edges. A little bit better.
The main problem right now is that objects that are completely outside of the screen are not rendered on the shadowmap because of game optimization (if they are not rendered on screen they are not rendered on shadowmap), so some shadows may pop in or suddenly disappear. Maybe there is some variable in the game to set if an object is rendered or not based on distance, I don't know.

45.jpg
 
Just some eye candy...
Inspired by the upcoming Raceroom update I added some more things, but as always, there are still many challenges.

Now included (more or less completed):

DXVK Vulkan support (but mipmapping and multisampling issues)
D3D9on12 (but will probably not be included, too slow)
Deferred shading
PBR-based shaders (simplified)
Reverse z-depth to reduce z-fighting
Dynamic exposure
Triple buffer support
Z pre render pass support
Global shadow mapping
Simple depth of field
Simple ambient occlusion
Simple bloom
Simple motion blur
Screen shadows (still a few artifacts)
Possibly new sky material system. Non texture based, except clouds.

46.jpg
 
Mipmapping and multisampling in DXVK are solved.
Would still like to have something better to smooth normals and materials textures (as they can't be rendered with multisampling).

My own color blended sky is used now. It supports color mixing for different time of day (not finished yet). It should also support clouds if I can find suitable textures. I will probably use standard texture for rainy weather.


47.jpg


48.jpg


49.jpg
 
should also support clouds if I can find suitable textures.
I imitate moving clouds this way:
Copy a single sky dome model, resize it to be smaller than the sky, for example 0.6x, then move the model not to be in the middle of the track.
Finally I rename the material to Clouds, replace the texture to transparent clouds, center pivot, save it and add the model to .trk file.
There can be more than one cloud layer on the track. Cloud layers can be included into the instance=skyboxi {} or not.
 
Last edited:
This is what rain looks like for the moment (the pink eurosport logo is caused by a debug color I use on screen shader). The dynamic weather system sets fog, fog color and sky color.

No rain reflection for the moment, maybe it can be added.
I run the game in windowed mode (that's why the resolution is low) for the moment when working on the mod.

51.jpg
 
I think I have solved the car under shadow now.
Shadow mapping only has one shadow layer, so the cars looked kind of pasted to a track image when they were in complete shadows:

53.jpg


Now there is a calculated shadow 'approximation' that will help.

55.jpg


It seems I have messed up the sun and ambient lights colors, and also the blending between sky and track objects when I fixed my normals smoothing, so there is a lot to do.

54.jpg
 
The lensflare effect didn't work as it should in the new rendering environment, so I remade it using the game textures (needs a little bit more tweaking still).
Also a little bit better shadows with smoother edges, but not perfect.

I think the most difficult problem for the moment is to figure out why the track groove flicker in car interior view when rear view mirrors are activated...

58.jpg
 
Multi transparency is added back (there is also motion blur visible here, and it is most noticeable from track side, very little from interior view).
I tried to avoid semi transparency as much as possible before because it led to sorting order errors, but now the opaque pixels in those materials are drawn separately with z-buffer write activated, resulting in much less errors.

59.jpg
60.jpg
 
Back
Top