• Guest Please check out the Help Wanted thread in Ickie's NewsHawks.
    The future of the Outhouse depends on you!
    Help Wanted

This Could Be Very Interesting - AnKor's Shaders

After looking into a lot of different possible sources, I have not been able to replicate the black terrain textures that others are experiencing. The fact that the terrain renders properly out to a particular distance tells me that they can be rendered, just not when seen from a distance. That would hint at something like compositetexturebudgets.xml, or cfs3config terrain detail setting differences.
 
I dug in to the d3d8.ini a bit deeper and after a few fruitless tests found out that disabling terrain bump mapping removed the problem once and for all. On the other hand it caused new issues such as my airfield playing hide and seek when trying to land but that's another story, I fully intend to keep the bump mapping on.

It seems to be caused more by viewing angle than distance, the black areas only exist at low altitudes where the angle from the viewing point to the terrain is relatively low. Above 5000 feet they're pretty much gone.

EDIT - getting more and more weird. I messed with the shaders30 folder stuff, managed to crash the entire thing, got it back up and running, and everything was fine. Closed CFS3, fired it up again, and the black areas were back. I'm beginning to think that everything isn't loading properly.
 
Last edited:
Here are my d3d8.ini settings and I can fly right down to the treetops without seeing a rendering problem.

Code:
[D3D8]
; Change to NoMultisampling=1 for SweetFX compatibility, but it will disable ingame antialiasing.
NoMultisampling=1


; Aircraft shadows. 0 - No Shadows; 1 - Low; 2 - Medium; 3 - Good; 4 - High; 5 - Best
ShadowQuality=5


; Terrain shadows. 0 - Disabled; 1 - Low Quality; 2 - Medium; 3 - High
TerrainShadows=3


; 0 - Disabled; 1 - Enabled
TerrainBumpMapping=1


; 0 - No shadows; 1 - 10%; 2 - 20%; ...; 10 - 100%. Doesn't make much sense to go below 50%.
CloudShadowScale=10


; 0 - No shadows; 1 - 10%; 2 - 20%; ...; 10 - 100%. Smaller values cause brighter shadows.
CloudShadowDensity=5


; -1 - Off; 0 - Default; 1 - VSync On
VSyncMode=0


; 0 - Use default (which is 60 degrees); 1...180 - override FOV for external views.
ExternalFOV=30


; Sun glare and lens flares. 0 - Off. 1 - On.
SunGlare=1


; Weather tuning (might be overwritten by WOFF)
; Range 0...100 as percentage of sunlight reduction.
CloudShadowOvercast=10
CloudShadowHeavy=90


; Tweaks strength of environment reflection. 0 - off. 1 minimum, 9 maximum.
EnvReflection=5


; Tweak sharpness of sun and environment reflections. 1 dullest, 9 sharpest.
Glossiness=1


; Enable dynamic lights (gun flashes, etc) for scenery objects. 0 - Off. 1 - On.
SceneryDynamicLighting=1


; Adjust sprite (smoke, dust, etc) brightness according to time of day. 0 - Off (always bright). 1 - On.
SpriteLighting=1


; Ambient+sun light amount when night sprites are enabled
NightLightThreshold=0.35


; Troubleshooting options
Enabled=1
ForceHardwareVertexProcessing=1
ForceRenderTargetTextures=1
EnumAllDisplayModes=1
AutoGenMipMaps=1
WriteLog=0
Numpad0Switch=1
 
Last edited by a moderator:
and my ConfigOverrides values

Code:
<Config>
    <FileVersion val="60"/>
    <Adapter val="0"/>
    <Device val="0"/>
    <Mode val="37"/>
    <MultisampleType val="D3DMULTISAMPLE_NONE"/>
    <VendorId val="4318"/>
    <DeviceId val="5056"/>
    <VersionNumberLowPart val="858168"/>
    <VersionNumberHighPart val="655378"/>
    <TextureLimits>
        <aircraftmodels Scale="0" MaxDim="0"/>
        <compositeterrain Scale="0" MaxDim="0"/>
        <compositeterrainsource Scale="0" MaxDim="0"/>
        <effects Scale="0" MaxDim="0"/>
        <hud Scale="0" MaxDim="0"/>
        <nonaircraftmodels Scale="0" MaxDim="0"/>
        <precompiledterrain Scale="0" MaxDim="0"/>
        <shadows Scale="0" MaxDim="0"/>
        <ui Scale="0" MaxDim="0"/>
        <uncategorized Scale="0" MaxDim="0"/>
    </TextureLimits>
    <ConfigOverrides>
        <DisableWarningBoxes val="n"/>
        <DisableSound val="n"/>
        <DisableIntroMovie val="y"/>
        <DisableMovieUI val="n"/>
        <DisableUIAnimations val="n"/>
        <SafeMode val="n"/>
        <NoDXT1 val="n"/>
        <NoDXT3 val="n"/>
        <NoDXT5 val="n"/>
        <DisableIndexBuffers val="n"/>
        <DisableVertexBuffers val="n"/>
        <Disable1600x1200 val="n"/>
        <Disable1280x1024 val="n"/>
        <Disable1024x768 val="n"/>
        <DualPassRender val="n"/>
        <HighResolutionZBuffer val="y"/>
        <TerrainDetailTexture val="y"/>
        <DisableWindowed val="n"/>
        <DisableValidateDevice val="y"/>
        <DisableWriteOnlyVB val="n"/>
        <DisableWriteOnlyIB val="n"/>
        <DisableTriangleStrips val="n"/>
        <UnsupportedHardware val="n"/>
        <UnsupportedDriver val="n"/>
        <DisableCompositeTerrainTextureMips val="n"/>
        <DisableCompositeTerrainTextures val="n"/>
        <DisableCompositeGroundPlaneTextures val="n"/>
        <DisableCompositeAircraftTextures val="n"/>
        <DisableScenery val="n"/>
        <DisableEnvironmentMapping val="n"/>
        <DisableShadows val="n"/>
        <DisableWhiteOut val="n"/>
        <DisableTerrainLighting val="n"/>
        <DisableSceneryLighting val="n"/>
        <DisableSun val="n"/>
        <DisableStars val="n"/>
        <DisableRenderText val="n"/>
        <DisableLabels val="n"/>
        <DisableTacticalDisplay val="n"/>
        <DisableTargetCone val="n"/>
        <DisableHUD val="n"/>
        <DisableChat val="n"/>
        <DisableAdvisor val="n"/>
        <DisableSimWarnings val="n"/>
        <DisableTimeCompress val="n"/>
        <DisableWeather val="n"/>
        <DisableClouds val="n"/>
        <DisableBlendToOffscreen val="n"/>
        <DisableClear val="n"/>
        <DisableTerrainRender val="n"/>
        <DisableTerrainUpdate val="n"/>
        <DisableSceneDBRender val="n"/>
        <DisableWaterRender val="n"/>
        <DisableWaterShorelineRender val="n"/>
        <DisableWaterReflectionRender val="n"/>
        <DisableWaterAnimationRender val="n"/>
        <DisableTerrainTextureRingBlend val="n"/>
        <DisableFog val="n"/>
        <DisableRain val="n"/>
        <DisableTexturedAlphaMaterial val="n"/>
        <DisableShellCasings val="n"/>
        <DisableTerrainDiffuseLighting val="n"/>
        <DisableTerrainDecalRender val="n"/>
        <DisableVCFog val="n"/>
        <DisableInCloudEffect val="n"/>
        <DisablePropDiscs val="n"/>
        <CompositeAircraftTextureBudget val="10240"/>
        <CompositeAircraftTextureMaxDim val="4096"/>
        <CompositeAircraftTexturePool val="D3DPOOL_DEFAULT"/>
        <CompositeAircraftTextureUsage val="D3DUSAGE_RENDERTARGET"/>
        <CompositeTerrainTextureBudget val="five"/>
        <VertexBufferPool val="D3DPOOL_DEFAULT"/>
        <IndexBufferPool val="D3DPOOL_DEFAULT"/>
        <PreCompiledTerrainTextureBudget val="five"/>
        <UserShadowTextureBudget val="1"/>
        <AIShadowTextureBudget val="30"/>
        <ObjectShadowTextureBudget val="500"/>
        <UserShadowSize val="512"/>
        <AIShadowSize val="512"/>
        <ObjectShadowSize val="512"/>
        <MaxParticles val="2000000"/>
        <ZBiasBitsResolution val="15"/>
        <ZBiasTerrainDecal val="0"/>
        <ZBiasWaterPolyNear val="1"/>
        <ZBiasWaterPolyFar val="0"/>
        <ZBiasWaterLineNear val="1"/>
        <ZBiasWaterLineFar val="0"/>
        <ZBiasFlatEffects val="25"/>
        <ZBiasShadow val="0"/>
        <ZBiasTerrainAlphaNear val="0"/>
        <ZBiasTerrainAlphaFar val="0"/>
        <ZBiasObject val="0"/>
        <ZBiasObjectFar val="0"/>
        <ZBiasEffects val="1"/>
        <ZBiasClouds val="1"/>
        <TerrainVertexBufferCapacity val="65536"/>
        <TerrainIndexBufferCapacity val="65536"/>
        <VertexCacheSize val="64"/>
        <BackClipDist val="128748"/>
        <InteriorWaterLoadingFactor val="1"/>
        <WaterDetailTextureSize val="5"/>
        <WaterElevationBias val="4"/>
        <WaterElevationBiasFactor val="0.5"/>
        <NearPassBackClipDist val="1000"/>
        <FarPassNearClipDist val="10000"/>
        <FogStartDist val="10000"/>
        <CloudScale val="10"/>
        <TerrainBestImageQuality val="0"/>
        <MaxLandClassVariations val="0"/>
        <TerrainMaxBlenderInstPerFrameNear val="8192"/>
        <TerrainMaxBlenderInstPerFrameFar val="8192"/>
        <SceneryTriangleBudget val="five"/>
        <TerrainTriangleBudget val="five"/>
        <MaxModelLOD val="100"/>
        <FullscreenSwapEffect val="D3DSWAPEFFECT_DISCARD"/>
        <CompositeTerrainTexturePool val="D3DPOOL_DEFAULT"/>
        <CompositeTerrainTextureUsage val="D3DUSAGE_RENDERTARGET"/>
        <TextMaxTextures val="0"/>
        <OverallGraphicDetail val="5"/>
        <AircraftDetail val="5"/>
        <SceneryDetail val="5"/>
        <TerrainDetail val="5"/>
        <EffectsQuality val="5"/>
        <CloudsQuality val="5"/>
    </ConfigOverrides>
</Config>
 
Last edited by a moderator:
View attachment 40646

Nothing obviously visible in my config settings when compared.

Another thing that I may have missed in the past, is it normal that trees seem to lose their mipmaps when the shaders are enabled? It's been like that for the entire time I've used them.
 
I tried your configoverrides file, but could still not create the same effect.

I also tried making changes in the d3d8.ini file, again without being able to cause anything to happen.
The only thing I did discover was that cfs3.exe would not run if I disabled the terrain shadow rendering (0). The Low, Medium or High settings were fine (again, with no black texture problems).

Since it only occurs at low viewing angles, perhaps it has something to do with calculating the trig angles in the shader where the systems that have this problem are rounding small numbers to 0.

Andrey, is this calculation done by the CPU or the GPU?
 
Major,
I used your config and I still get the dark scenery in the back ground.
Afther some research the d3d8.dll dated 2016-07-13 seem to be the culprit.
When I use the one before dated 2016-04-04 everything is fine.
Hope this helps
attachment.php
 

Attachments

  • Shot07-21-16-13-10-04.jpg
    Shot07-21-16-13-10-04.jpg
    48.6 KB · Views: 3
Since it only occurs at low viewing angles, perhaps it has something to do with calculating the trig angles in the shader where the systems that have this problem are rounding small numbers to 0.

Andrey, is this calculation done by the CPU or the GPU?
Lower angle causes GPU to choose smaller mipmap as if the texture was further away (and thus blurrier). This is why anisotropic filtering was invented.
As I said I've seen the issue some time before, but I'm not sure about the cause.

I browsed through the code and found several suspicious leftovers which I removed.
Can anyone having the issue try this version (only d3d8.dll is included, just install the 0713 version and then overwrite it with this one) and tell me if it helps:
https://dl.dropboxusercontent.com/u/2918136/cfs/d3d8.20160722.update.zip

Andrey.
 
Andrey,
I am happy to report that your last mod of the d3d8.dll file is a success :encouragement:.
However the details of the aircraft insigna and nose-art are blurry.
 
I've run the 22 July d3d8.dll through testing with 8 different installs, and they all work fine. The FPS increase versus the one from back in March is still intact, so these should be good to go for everyone until someone finds something else that needs to be resolved.

When things settle down with the SOH server I'll see about uploading this fix to the Library.
 
i've an issue with the new Ankor shader which i think it's make AntiAliasing unstable, everytime i try to change value in my configoverride the result makes my AA unstable which become jaggies, at first it works fine but when about 5 seconds flying when i choose to view outside cockpit those AA looks didn't function properly it start to dissapeared and back like there's no AntiAliasing active
i don't know if this had relation with new shader but i try 2 Nvidia different driver the result always the same

If i didn't change the value in my configoverride then it's all normal, so for now i've left the original texture only to 1024 and the rest sets to 5
does anyone had the same issue like me?
 
Andrey,
I am happy to report that your last mod of the d3d8.dll file is a success :encouragement:

I can confirm this, no more black scenery and the FPS increase indeed has been retained. :encouragement:

Repeating a previous question though, is it normal that when I enable the shaders the trees lose their normal alpha channeling as specified in the scenerysheet01.dds and go for an "everything or nothing" transparency? I guess it is as it's been like that ever since I first tried the shaders.
 
Ok, good to know that the fix worked.

33
wiekniera, yes, I've noticed that AA settings are often reset for some reason. Never really investigated it because WOFF doesn't use cfs3config. Maybe I'll look into it.

greycap.raf,
yes, it is normal. This approach works good for WOFF and solves some rendering issues cause by semi-transparency.
However I can probably add an option to restore the original alpha blending for trees for those who prefer it.

 
33
wiekniera, yes, I've noticed that AA settings are often reset for some reason. Never really investigated it because WOFF doesn't use cfs3config. Maybe I'll look into it.

I've found that it might be happen on my XP win install or it's XP driver problem, i've tested with 8.1 it works fine Ankor ! And Big thanks for this new beautiful shader ! :encouragement:
 
I just noticed an issue which might be effecting some of you. The environment reflections require a certain type of environment map in order to show up in some situations, even though the environment map texture itself is not displayed. Here is one that I have tested and know it works - at least for me. Maybe it will help some of you as well.

It goes in your effects/skybox folder.
 

Attachments

  • panoramic_cubic_test.zip
    426.5 KB · Views: 0
Back
Top