AnKor's Shaders

I did have a functional way of making "LODs" for clouds where a less detailed version of the cloud was rendered at all distances, and at closer distances "the rest of the cloud" was rendered as a separate cloud at the same positions. Unfortunately, performance was even worse. It seems that the number of clouds has as much or even more impact than the quality of the clouds.

If you bring the horizon distance in with the cloud distance, it isn't quite as jarring. However, having that far horizon it turns out was worth sacrificing a lot of FPS for me. Going from 150km to 125km helps a little because an awful lot of terrain doesn't get rendered, but it doesn't do much for the clouds, since most are limited to less than 125km. You should notice a decent difference going from 125km to 100km, but you also really notice the closer horizon too.
 
It's tied to the CPU having to keep track of each cloud element's location and orientation as an object and then sends that to the GPU for rendering. It's a similar problem to displaying trees with uniform density out to great distances so you don't see them suddenly appear as you get closer. It's all about the item count going up as the square of the distance. The item you need to reduce to improve performance is the density (not visibility, but frequency). Think clouds per cubic kilometer, or trees per square kilometer.

At 1 cloud texture per cubic kilometer the object count is:
Render Distance
150km = 423,900
120km = 271,296
60 km = 67,824

At 100 cloud textures per cubic kilometer:
Render Distance
150km = 42,390,000
120km = 27,129,600
60 km = 6,782,400

The new weather Mod looks gorgeous, but some of its weather conditions add a lot of texture sprites.
 
The item you need to reduce to improve performance is the density (not visibility, but frequency).

That's it about as simply as it can be put. Having spent the best part of today's free time studying the files and checking framerates, there's indeed a direct correlation between the amount of clouds and the fps hit, the actual mass of cloud on the screen doesn't play a large part. However if it's compiled of a hundred small clouds or ten huge ones absolutely does. The next step: figure out how to make a similar enough looking cloud coverage with fewer sprites.
 
Reducing the sprite count while maintaining density sounds like the perfect challenge for optimizing the mod. Maybe merging smaller textures into single cloud clusters could work without triggering the performance hit. Great insights by both of you!
 
I'll try another thing, the clouds are still on the back burner, but now I'd like more contrast to the shadows. Or actually, more brightness to the entire lighting system as the shadows look darker if the light increases. Since it's all done dynamically now I'm sure it's possible, I'll just have to find out how.

Simply increasing the "SunStrength" value doesn't work - already tried that, and it just applies to the aircraft making it too shiny. My aim is to make the entire world light up brighter with perhaps more saturation under direct sunlight, CFS3 looks slightly dull by design but it may be possible to change that. I don't want cartoon colours, just more "pop" to where the sun shines.
 
SunStrength modifies the specular intensity, but not overall brightness. There might be a setting somewhere that does it globally, but I'm not sure.

The Suneffect.xml sets the baseline for it, with the dirRed, dirBlue, dirGreen values. At midday, the greyscale equivalent of the values there now is 245, 245, 245. So it could be made slightly brighter, but you will lose the tint of the light. Perhaps that's even desirable, the effect is subtle, but makes a difference. But, being so subtle, it is hard to pin down; I have gone back on forth on different shades.

The ambRed, ambBlue, and ambGreen values set the ambient light, which is what sets how dark the shadows are. You you could get more pop by darkening the ambient light. Again, I messed around with this to no end as I was tuning the shaders for release. Because of limitations of DX9, it is pretty much impossible to get it right for all lighting conditions, so I went for the best compromise I could find. But it is very much in the eye of the beholder. I decided that since I spend a similar amount of time wishing the shadows were lighter as I do wishing they were darker, that I'm probably in the right ballpark.

I tried to keep the shadows at about the same percentage relative to the greyscale value of the direct light as the sun went down, and then reduced the ratio mathematically to reach the night-time values. This seemed to keep the transition from day to night as natural as possible, but I'm still not 100% satisfied with it. I don't remember exactly how I calculated it. But be careful here, the tuning of low light values is quite sensitive.
 
But it is very much in the eye of the beholder.

Not to mention the display being used, or even its calibration. Mine was way too blue out of the box, the normal Windows calibration got the colours right but crushed both extremes, and now I have the manufacturer's colour profile which opened the extremes up so everything reasonably bright isn't white and reasonably dark isn't black anymore. As a side effect it also made things look washed out in a way as many previously black parts became dark grey and black is now reserved for actual black.

From a quick test the ambient light is a step to the right direction. More experimenting is needed, and losing the tint may indeed be good as actual sunlight is basically bright white.
 
Back
Top