Sign in to follow this  
Guest cbuchner1

DX10 Rain Void ?

Recommended Posts

Hello allIm having a slight problem with my DX10 rain effects & just wanted to check to see if this is a local or widespread issue ?The problem is that i seem to have a void around my view point/cam under DX10 while its raining(this expands in size based upon zoom settings)As a picture is worth a 1000 words heres a few shots of the problem comparing DX10 to DX9(resized from 1680x1050)DX10 Void problemhttp://forums.avsim.net/user_files/182530.jpghttp://forums.avsim.net/user_files/182531.jpgDx9 no problemhttp://forums.avsim.net/user_files/182533.jpghttp://forums.avsim.net/user_files/182532.jpgThe DX10 version also looks a lot worse in motion as the rain texture streaks are far thicker and a lot less transparent than under DX9Can any other DX10 users confirm this as(yet one more)DX10 issue?if not i'll do a total reinstall minus addonsbtw Im running a 640mb 8800gts on driver set 169.25 under vista x64 While i wait to see if this is local or widespread im going to have a play with swapping out the DX9 rain shader with the DX10 one to see if i can be fix it that way i'll let you know how i get on CheersGizmo

Share this post


Link to post
Help AVSIM continue to serve you!
Please donate today!

I'm running the same card and drivers, and have the same problem. It's pretty annoying.Until it's fixed, I'm not flying in rain or snow.

Share this post


Link to post

Looks like the rain polygons are being occluded by the ground plane where no occlusion should occur, really.

Share this post


Link to post

Thanks for the replies :)Atleast i now know i wont have to rip FSX out to find the problem still existsSo next question is are any ATI DX10 users suffering this rain void problem or can this be added to the NV DX10 Driver bug listOr if anyone from Aces is reading this could you let us know if this is the way Dx10 rain is(if so why?)or if it can somehow be fixed to be like better looking Dx9 rain shader?CheersGizmo

Share this post


Link to post

Update:Ive had some feedback from an ATI DX10 user in another forum & unless ATI's drivers are also rendering these rain/snow shaders incorrectly it seem that these much inferior effects are infact a feature of DX10!Some more shots showing the problem but this time under snowy conditionsDX10http://forums.avsim.net/user_files/182608.jpghttp://forums.avsim.net/user_files/182609.jpgDX9http://forums.avsim.net/user_files/182610.jpghttp://forums.avsim.net/user_files/182611.jpgIm not sure why these effects have taken a step backwards under dx10 when the others have been a step forward but the way they are at the moment pretty much cripples any kind of flight during bad weather under Dx10,infact the falling snow effect is that bad in flight that reminds me of some kind of warp tunnel from a space sim.....So as we've now been Abandoned patch/features/support wise i can only hope that some talented community member or a 3rd party environment addon will address these problemsCheersGizmo

Share this post


Link to post

I am by no means an expert in shader programming, but it should be possible to modify the file ShadersHLSLmiscRain40.fx and Rain40.fxh to not perform any occlusion checking with the z buffer.Just thinking loud... it should be fixable by third parties.UPDATE: Let the third party be meKeep a backup of your original Rain40.fx file please. This is a long shot and hasn't been tested by me.In Rain40.fx modify the technique block to include a ZEnable = falsestatement like this:technique10 T0{ pass P0 { ZEnable = False; SetVertexShader(CompileShader(vs_4_0, VS())); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_4_0, PS())); }}Then erase the already compiled Rain40 shader file from this folder(it might be similar, I don't have Vista handy):C:UsersLocal SettingsApplication DataMicrosoftFSXShadersmiscand report back if it worked...Christian

Share this post


Link to post

Hi Christian Thanks for your reply & input on trying to fix this issue it is greatly appreciatedId added the ZEnable = False; comment as you suggested and cleared my shader cache but im sad to it just causes the failure of the shader to compile :( CheersGizmoSeems i inadvertainly removed the snow shots from my above post while editing it so here they are again :)DX10 http://forums.avsim.net/user_files/182618.jpghttp://forums.avsim.net/user_files/182619.jpgDX9 http://forums.avsim.net/user_files/182620.jpghttp://forums.avsim.net/user_files/182621.jpg

Share this post


Link to post

I am sorry to hear this did not work.I'll study more documentation before making another attempt ;)

Share this post


Link to post

I did my homework. Here is the new code.technique10 T0{ pass P0 { SetVertexShader(CompileShader(vs_4_0, VS())); SetGeometryShader(NULL); SetPixelShader(CompileShader(ps_4_0, PS())); SetDepthStencilState( DisableDepth, 0 ); }}The new command is SetDepthStencilState(...) - forget about the ZEnable I posted earlier. That one only works in "technique" blocks, but not "technique10" blocks for DirectX10.Christian

Share this post


Link to post

Hi Again ChristianThanks for checking back but im sorry to say still no joy once i add the SetDepthStencilState( DisableDepth, 0 );the Shader again refuses to compile :(btw Great work on TileProxy its a real shame Aces pretty much broke the texture render for 256x256 textures from sp1 onwards it also pretty much ruined all my france VFR addons,anyhows i look forward to seeing your work on flightgear in the near future :)CheersGizmo

Share this post


Link to post

Well it certainly is a valid command, as you can see in this nVidia presentation - coincidentially about rain shaders ;)The command is used in the same way, at the same position inside the technique10 block. *sigh*http://developer.download.nvidia.com/white...KWhitePaper.pdfUPDATE: A-ha! These two state definitions will have to go before the technique10 block. Otherwise DisableDepth will not be known and compilation must fail.DepthStencilState EnableDepth{ DepthEnable = TRUE; DepthWriteMask = ALL; DepthFunc = LESS_EQUAL;};DepthStencilState DisableDepth{ DepthEnable = FALSE; DepthWriteMask = ZERO;};Christian.

Share this post


Link to post

No more updates to the rain shader thread from my side anytime soon! My PC just gave way with a flash and accompanying bang. I guess the 450 Watts power supply did not endure me playing Crysis with a Quad CPU and a 8800GT graphics card. It sparked, the circuit breaker blew and now the PC seems dead.That's the definitive proof: Crysis is heavier on the machine than FSX!I have other PCs, but the SP2/Acceleration with the DX10 shader code was only on this box. If anyone could report if my latest "fix" to the shader worked, that would be great. If it didn't... sorry PC's dead ;)

Share this post


Link to post

HelloThats just it, everyone else can see that the FSX rain / snow effects are Soooo much improved over FS9, its just us two who cant see the VAST improvement.How are you seeing the Airport Polys, Big improvement ?http://www.freewebs.com/reading1871/30.jpg

Share this post


Link to post

Hi Christian,Sorry to hear about your machine. Hopefully, it's repairable and you haven't lost anything but the power supply.Your latest fix worked for me in very limited testing. It's a big improvement, for sure. Thanks.Regards,Jim Karn

Share this post


Link to post

You my friend are a *STAR* /bowDX10 FIXED http://forums.avsim.net/user_files/182641.jpghttp://forums.avsim.net/user_files/182643.jpgIf you've UK based let me know as i have a spare jeantech 450watt PSU id gift to you for your hard work on this if you are and you'ed find it useful plz fire me a PM and i'll get it packaged up for you :)So now for anyone else wanting to use this fix ive attached the fixed rain40.fx file to this post as a txt file(182644.txt)download/save it then rename it to Rain40.fx goto your Microsoft Flight Simulator XShadersHLSLmiscand make a copy/backup of Rain40.fx then replace the original file with the modded onenow goto your X:UsersAppDataLocalMicrosoftFSXShaders10ShadersHLSLmiscfolder and remove/delete the Rain40.fx_0x4700000000000000_0x0ffile Once you rerun FSX in dx10 mode it will recompile and replace the shader code with the new fixed code Again many many thanks for your hard work on this problem Christian you are an asset to the FS community and now this is fixed i can get along with my overhaul of the FSX lightening effect look for more info in a few days time :)And a quick message to Aces you need to BETA TEST MORE next time you release something!!CheersGizmo

Share this post


Link to post

Agreed I think FSX has the worst rain/weather effects ive seen in a game/sim since DX8 was relased but atleast now the DX10 rain is now rendering onpar with DX9 thanks to Christianim pretty sure a 3rd party (FEX I hope)will get to replacing the whole rain/snow effects in the not to distant future & i myself am about to start work on a project(should be freeware depends on just how bad the FSX effects SDK is to work with)replacing the weak/tacky lightening effects CheersGizmo

Share this post


Link to post

It's a step forward from the OP's original post and what I was seeing as well. This little tweak stops the rain from creating a circular void around the aircraft. For this, I'm appreciative of Christian's work and find the results extremely satisfying.It wasn't a texture change nor was it advertised as such.Again, thanks Christian.Regards,Jim Karn

Share this post


Link to post

I think we need a dedicated "Shader Mod" forum for FSX. I have some more ideas what could be done. This forum would be fora) *collecting all shader patches* at a central place:( discussing and developing modifications (such as this)c) providing a meeting place for the technically inclined persons, without cluttering the FSX main forum.So what about:Adding athmospheric effects (light scattering) similar to the WindLight engine.Optimizing existing effects (can we make the DX9 light bloom faster?)Improve existing effects and textures (water reflections etc) and alter their appearanceWhat cannot currently be done easily isa) adding new textures or rendering passes. :( modifying or adding input arguments to the shaders that are currently provided by the FSX binary program (fsx.exe).To accomplish a) and :( we would have to hook into the DX9 API. *this is difficult, but possible!*Christian

Share this post


Link to post

Great work Christian !While I'm not running DX10 or Vista, it's great to see when people such as yourself with the knowledge jump in and "fix" stuff like this.I read your post some time back about editing light ray passes and increasing the constrasts etc, and I for one would look forward to seeing ideas and tweaks like this evolve.Regards'GarettPS: I have a new ANTEC SP-500 (modular cables) PS is you want it. Only used it for 2 months then updated to my 750. Have about 5 PS's laying around, but that one is the best of them.

Share this post


Link to post

Nice work Christian! You make it seem effortless.I'd do backflips if you discover a fix for the flashing dx10 taxiway textures.Happy New Year.

Share this post


Link to post

Good idea there Christianwe've seen a few shader hacks and mods poping up around here and at various other forums so to have them pooled into one place would be very handy Ive Been playing with the rain40.fx a little bit and found if you alter the(rgb?)values in the linereturn float4(1,1,1,In.cDiffuse.w) * (cColor0 + cColor1);toreturn float4(0,0,0,In.cDiffuse.w) * (cColor0 + cColor1);it will give you much darker rain which does'nt obscure your view as much in flight the only downside to this is it also alters the colour of the snow effect as the 2 seem to be interlinked at a shader levelCheersGizmo

Share this post


Link to post

Excellent work gentlemen, these shader hacks are doing some great things for the Flight Sim. I'll try out these new RGB values.

Share this post


Link to post

I think the 4 values are R, G, B and alpha.By reducing the alpha you will get more transparency.how about 0.5 times the original value? I am not sureif this is permitted syntax in the shader language, however.return float4(1,1,1, 0.5 * In.cDiffuse.w) * (cColor0 + cColor1);

Share this post


Link to post

The flashing runways *might* be so called Z fighting. That occurs when the depth buffer has not enough precision to provide a consistent result. Then small variations in the values lead to popping up of polygons (or parts thereof).For example in DX9 mode, 16 bits per pixel with scenery object ground shadows enabled I get BAD Z fighting - for example on the cruise ships docked near Key West Airport.Christian

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this