Jump to content


- - - - -

FSX DX10 - Self Shadowing VCs


  • Please log in to reply
127 replies to this topic

#41 Capt_Gabe

Capt_Gabe

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,537 posts
  • Location:Ireland

Posted 17 October 2007 - 03:19 PM

Thanks for engaging Phil, looking forward to DX10.

#42 scotchegg

scotchegg

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,370 posts
  • Location:Tokyo

Posted 17 October 2007 - 04:22 PM

View PostIngvarr, on Oct 17 2007, 02:09 PM, said:

I wish the forum allowed additions to the posts without time limit ;(
Well, I figured out issue with fresnel - apparenty you did it vertex-based. So when camera is close to water plane (when your amphibian is floating on the water) the separation between water polygon vertices near camera becomes too big, and fresnel essentially is eliminated. Its basically same as if you did vertex-based specular. Hovewer specular highlights on waves were done in pixel shader, so its not affected - only fresnel disappear so when it needed most (near the water surface). And when you orbit your floating plane, water looks like liquid mercury - almost perfectly reflective regardless of the eye-water angle of incidence.

I've twiddled with fx a little and put a pixel-based fresnel inside. Hovewer I hit another obstruction - apparently your water shader already on the verge of the limit of 128 instructions for PS 2.0, and my meager 5-instruction addition pushed it overboard :lol: Apparently you use PS 3.0 in some places, hovewer I didn't figure out how to properly control it (out of editing every water fx), so I've just left it as a proof of concept, with specular disabled to keep under ps20 limit. Just a proof of concept that *there are* possible additions that improve visual quality and do not require mostrous additions like separate DX10 pipeline. All you need is true desire to do it.
And no, no performance hit. As I said, your water shader was already almost 128 instruction long, so about 5 i've added - well, negligible.

Here is the (crudely) hacked water.fxh - http://rapidshare.co...ater20.fxh.html
If you want to try it, don't forget to clear compiled shaders cache in AppData\Local

Heh, I don't know why I bothered with this. I guess desire to prove something became irresistible (but I suspect I never will prove anything :censored: ). So I think it will be my last such post. At least until I'll write a book or two on the subject to give my words some weight :lol:

All Greek to me but if it makes the water reflectivity more realistic I'd certainly be interested to see its effects.

#43 Ashton Lawson

Ashton Lawson

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,839 posts
  • Location:Phuket, Thailand

Posted 17 October 2007 - 09:26 PM

this'd be interesting.  Phil versus another dude who has no idea how the FS engine is structured, but may know a lot about graphics cards.  I believe that you can't really make definate statements unless you actually know what kind of thing you're dealing with.

However, this edited shader file seems quite interesting.  If my computer's motherboard didn't decide to give out (one month after warranty expires, omg), I'd be testing this file right now.  If someone does test it, post a screenie.  I'm quite interested.  Plus, this feud, is becoming quite interesting, and also quite informative.  Whatever helps me with graphics programming :lol:.

#44 Ingvarr

Ingvarr

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 326 posts

Posted 18 October 2007 - 02:14 AM

View PostStr!ker, on Oct 18 2007, 05:26 AM, said:

this'd be interesting.  Phil versus another dude who has no idea how the FS engine is structured, but may know a lot about graphics cards.  I believe that you can't really make definate statements unless you actually know what kind of thing you're dealing with.
Actually I am a graphics programmer myself. And I beleive I know what kind of thing I am dealing with. Actually, the thing that stirred me from passive observation was the solid statement "we can not do good/fast shadowmapping without DX10". Maybe I am wrong here, but I still do not see why is it so, regardless of the engine architecture. It sounded more like "we don't want to do it, because in DX9 doing it optimized is complex/hassle". In terms of technique plain directional shadowmapping is not very different between DX10 and DX9, at least to my knowing. I don't claim absolute knowledge but vague statements about "better resolution" and "better performance" just sound like deux ex machina explanation - because to my knowing, there is no "free shadowmap for everyone" in DX10 cards, it still almost the same performance hit, maybe a somewhat better, but its defenitely not free :lol:
And "you must see our codebase to understand, but you'll obviously never will see our codebase so you will never understand, but we are right here" is just another universal explanation. Every kind of statement may be backed by saying so, and they talk about "conspiracy theories"? :lol:

About water - just back up your original ShadersHLSL\Terrain\Water.fxh, replace it with a hacked one.
Then go to Documents and Settings\<your user>\AppData\Local\Microsoft\FSX\Shaders\Terrain - delete everythiing there (so shaders will be recompiled on next run).
Then put your Beaver on the water somewhere and pan camera around, and observe how stuff reflects. I've hacked a water color to more greeneer, because actual mostly blue color of the water happens majorly in tropical seas - in temperate waters algae that gives it color is never blue, its dark grayish-yellowish-greenish, blueness comes from the sky reflected.
As I said, pity that I had to disable water sun reflection, if Phil will kindly point to how easely to enable shaders 3.0 support, it can be reenabled.

Edited by Ingvarr, 18 October 2007 - 02:23 AM.


#45 Jetset

Jetset

    Contributor

  • Moderator
  • PipPipPipPipPipPip
  • 3,462 posts
  • Location:London UK

Posted 18 October 2007 - 01:01 PM

I took the liberty of trying this file, and I'm very impressed..
Here's some comparison shots.

Original
Posted Image

Modified
Posted Image

Original
Posted Image

Modified
Posted Image

Not quite sure what Ingvarr's point is (As someone else said, 'it's all Greek' to me) but the light on the water looks more natural.

#46 Ingvarr

Ingvarr

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 326 posts

Posted 18 October 2007 - 02:55 PM

My point is that there is always room for improvement in MSFS, and without noticeable performance penalties, and without oh-so-big-need for DX10

Btw, another possible improvement that would(should!) not require a DX10, is runway/taxi lights.
Allow me demonstrate with these screenshots from X-Plane, several months old:
Posted Image

Posted Image

As I see it, it's being done even without use of pixel shaders. Only with mini-models and clever billboarding. But does it looks good?
Not a rocket science, not requiring a DX10 card, not a peformance hog, but cleverly done and for good visual impression.

Pity though that in all the other areas of graphics X-Plane is a lot worse :lol:

#47 Fonzyslo

Fonzyslo

    Student Pilot

  • Members
  • PipPip
  • 16 posts

Posted 18 October 2007 - 06:36 PM

Ingvarr  Excellently showed! I beg for litle more blue colour !

Water.fxh

10+

:lol:

Edited by Fonzyslo, 18 October 2007 - 06:38 PM.


#48 Ingvarr

Ingvarr

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 326 posts

Posted 19 October 2007 - 04:29 AM

View PostFonzyslo, on Oct 19 2007, 02:36 AM, said:

Ingvarr  Excellently showed! I beg for litle more blue colour !

Done. Now the water color again changes with that is set in the scenery (ie dark blue in Seattle area, cerulean in the Carribean islands, murky green in the Thames river).
Unfortunately MSFS lits water surface like all other terrain (like solid material), and this is pre-baked in the textures, so I was unable to make water color change more properly with day-night transitions, hovewer it still looks good enough.

Also, the sun reflection highlights are back.

Enjoy - http://rapidshare.co...ater20.fxh.html

I wish ACES wouldnt give up on DX9 too easely and don't put all the cool new eyecandy features in the DX10 pipeline only. At least until MSFS will truly exhaust all potential of DX9.

Edited by Ingvarr, 19 October 2007 - 04:36 AM.


#49 scotchegg

scotchegg

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,370 posts
  • Location:Tokyo

Posted 19 October 2007 - 04:41 AM

Nice one, that water looks great. Is water sun reflection easily re-enabled or is that something only Phil can tell us how to do?

#50 Ingvarr

Ingvarr

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 326 posts

Posted 19 October 2007 - 04:43 AM

Its already re-enabled. I've managed to optimize original shader a little and squeeze it back in.

Edited by Ingvarr, 19 October 2007 - 04:51 AM.


#51 Costa

Costa

    Student Pilot

  • Members
  • PipPip
  • 91 posts
  • Location:Estonia

Posted 19 October 2007 - 05:33 AM

View PostIngvarr, on Oct 19 2007, 12:29 PM, said:

View PostFonzyslo, on Oct 19 2007, 02:36 AM, said:

Ingvarr  Excellently showed! I beg for litle more blue colour !

Done. Now the water color again changes with that is set in the scenery (ie dark blue in Seattle area, cerulean in the Carribean islands, murky green in the Thames river).
Unfortunately MSFS lits water surface like all other terrain (like solid material), and this is pre-baked in the textures, so I was unable to make water color change more properly with day-night transitions, hovewer it still looks good enough.

Also, the sun reflection highlights are back.

Enjoy - http://rapidshare.co...ater20.fxh.html

I wish ACES wouldnt give up on DX9 too easely and don't put all the cool new eyecandy features in the DX10 pipeline only. At least until MSFS will truly exhaust all potential of DX9.
Oh my god :lol: ,this watter looks awesome,can you please give me instructions,how can i install this watter??Thanks a lot.

#52 Ingvarr

Ingvarr

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 326 posts

Posted 19 October 2007 - 05:38 AM

back up your original ShadersHLSL\Terrain\Water.fxh, replace it with a hacked one

Then go to Documents and Settings\<your user name>\AppData\Local\Microsoft\FSX\Shaders\Terrain - delete everythiing there

and launch fsx

#53 JetBlast

JetBlast

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,743 posts
  • Location:Kuwait

Posted 19 October 2007 - 05:55 AM

thanks ingvarr, I also enjoyed your conversation with mr.phil :lol:
just don't blame ACES for the lack of features, they putted out a wonderful SDK, where you can make wonders of it it :lol:

edit: for vista users, heres a revised version on how to install the hacked water.

Quote

back up your original ShadersHLSL\Terrain\Water.fxh, replace it with a hacked one

Then go to {you windows partition}\Users\{user name}\AppData\Local\Microsoft\FSX- delete everythiing there

Edited by Ali., 19 October 2007 - 05:58 AM.


#54 Ingvarr

Ingvarr

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 326 posts

Posted 19 October 2007 - 06:10 AM

View PostAli., on Oct 19 2007, 01:55 PM, said:

thanks ingvarr, I also enjoyed your conversation with mr.phil :lol:
just don't blame ACES for the lack of features, they putted out a wonderful SDK, where you can make wonders of it it :lol:
Excuse me, but my major complaint that they make new features requiring DX10 and Vista, while a lot of DX9 potential remains untapped.
Also this deal with water was after I tried to point Phil into example direction of possible and easy improvement and was replied approximately as "who you to teach us, our programmer wrote a book on HLSL".

Also "user can make it yourself, so we don't need to do it" is a fringe excuse too. Especially when it concerns features non-documented in SDK, like shader hacking, and requires a graphics programming expert to do it. Also most of the rendering stuff still can not be modified by user. It was luck that at least shaders code were left exposed and possible to modify. Imagine any other game developer making a game with average graphics code and saying - "well, you can re-program it yourself if you don't like it" :censored:

Edited by Ingvarr, 19 October 2007 - 06:18 AM.


#55 Costa

Costa

    Student Pilot

  • Members
  • PipPip
  • 91 posts
  • Location:Estonia

Posted 19 October 2007 - 06:18 AM

View PostIngvarr, on Oct 19 2007, 01:38 PM, said:

back up your original ShadersHLSL\Terrain\Water.fxh, replace it with a hacked one

Then go to Documents and Settings\<your user name>\AppData\Local\Microsoft\FSX\Shaders\Terrain - delete everythiing there

and launch fsx
Thank you very much :lol:

#56 StavosWS6

StavosWS6

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 471 posts
  • Location:DTW

Posted 19 October 2007 - 06:20 AM

IMHO the water hack makes the water look like ice, and the lack of blue makes it look washed out. I reverted back to my orginal Water.fxh file.

However nice tweak regardless.

#57 Ingvarr

Ingvarr

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 326 posts

Posted 19 October 2007 - 06:26 AM

View PostStavosWS6, on Oct 19 2007, 02:20 PM, said:

IMHO the water hack makes the water look like ice, and the lack of blue makes it look washed out. I reverted back to my orginal Water.fxh file.
You can tweak amount of reflectivity yourself - in the hacked water.fxh
#define fresnMax 0.8

Ie if you set it to, say, 0.5 it will make water less reflective on the horizon

I am aware its still not completely physically accurate, but making it so will require much more time and some tweaks in the parts of MSFS we cant tweak :lol:

The main point of the hack was to make reflections almost disappear if you look directly down into water, and also make it amount depend on waves. Before it didn't, now it does. That is so called Fresnel reflection - instead of say, quicksilver, water reflects stuff depending on the angle you look at it.

Edited by Ingvarr, 19 October 2007 - 06:35 AM.


#58 Fonzyslo

Fonzyslo

    Student Pilot

  • Members
  • PipPip
  • 16 posts

Posted 19 October 2007 - 09:27 AM

View PostIngvarr, on Oct 19 2007, 04:29 AM, said:

View PostFonzyslo, on Oct 19 2007, 02:36 AM, said:

Ingvarr  Excellently showed! I beg for litle more blue colour !

Done. Now the water color again changes with that is set in the scenery (ie dark blue in Seattle area, cerulean in the Carribean islands, murky green in the Thames river).
Unfortunately MSFS lits water surface like all other terrain (like solid material), and this is pre-baked in the textures, so I was unable to make water color change more properly with day-night transitions, hovewer it still looks good enough.

Also, the sun reflection highlights are back.

Enjoy - http://rapidshare.co...ater20.fxh.html

I wish ACES wouldnt give up on DX9 too easely and don't put all the cool new eyecandy features in the DX10 pipeline only. At least until MSFS will truly exhaust all potential of DX9.

Tnx Ingvarr   :lol:

#59 Ashton Lawson

Ashton Lawson

    Commercial Pilot

  • Members
  • PipPipPipPipPip
  • 1,839 posts
  • Location:Phuket, Thailand

Posted 19 October 2007 - 12:27 PM

BTW, Ingvarr, I wasn't saying that your not a programmer, I was just saying that Phil knows the FSX engine, so he would know more about performance issues, and problems you might encounter when adding certain features...

However, your editing of the water effects file is quite interesting.  If many things in FSX can be changed this way, I may look into other fxh files to see if there are any other areas.  Perhaps, you, or I, or you and I, could release a freeware update to the fxh files making effects better.

That would be awesome.  For now though, great work.  I've got to look deeper into this.  BTW, it should be possible to force FS to use Shadow Volume for the aircraft shadow, right?  Or is that in FS's code, and not an FSH file?  Because I noticed it seems shadowing is done by shadow plane, which doesn't work well, or at all, on curved surfaces, and it keeps showing on a certain level and causes 'artifacts' when on helipads and stuff.  I'd much prefer the Shadow volume, so that the shadows don't do that annoying thing.

I looked at the fxh files a while ago and noticed shadowvolume in there, and realised that it was for scenery only, but I want to make it work with the aircraft.  Think we can do it?

Edited by Str!ker, 19 October 2007 - 12:27 PM.


#60 PhilTaylor

PhilTaylor

    Private Pilot - VFR

  • Members
  • PipPipPip
  • 203 posts

Posted 19 October 2007 - 12:31 PM

View PostIngvarr, on Oct 19 2007, 07:10 AM, said:

View PostAli., on Oct 19 2007, 01:55 PM, said:

thanks ingvarr, I also enjoyed your conversation with mr.phil :lol:
just don't blame ACES for the lack of features, they putted out a wonderful SDK, where you can make wonders of it it :lol:

Also this deal with water was after I tried to point Phil into example direction of possible and easy improvement and was replied approximately as "who you to teach us, our programmer wrote a book on HLSL".


thats not exactly a fair rendition of the conversation.

first you told us to go figure out what Fresnel was, as if we didn't know. then when I point out Sebby has written a book on HLSL, you then take it in the worst possible light.

how about we talk with little more even tone, ok? that makes it much easier to want to interact.

nice tweaks to the water shader, btw.